From d62095710fef350551c415af3854926e66a40c71 Mon Sep 17 00:00:00 2001 From: Xu Cheng Date: Mon, 3 Aug 2015 20:38:20 +0800 Subject: [PATCH] More core files style updates --- Library/Homebrew/cleaner.rb | 2 +- Library/Homebrew/cmd/doctor.rb | 2 +- Library/Homebrew/cmd/search.rb | 2 +- Library/Homebrew/keg_relocate.rb | 2 +- Library/brew.rb | 8 +++++--- 5 files changed, 9 insertions(+), 7 deletions(-) diff --git a/Library/Homebrew/cleaner.rb b/Library/Homebrew/cleaner.rb index dae9dbc6cb..bafbb34e08 100644 --- a/Library/Homebrew/cleaner.rb +++ b/Library/Homebrew/cleaner.rb @@ -22,7 +22,7 @@ class Cleaner # Get rid of any info 'dir' files, so they don't conflict at the link stage info_dir_file = @f.info + "dir" - if info_dir_file.file? and !@f.skip_clean? info_dir_file + if info_dir_file.file? && !@f.skip_clean?(info_dir_file) observe_file_removal info_dir_file end diff --git a/Library/Homebrew/cmd/doctor.rb b/Library/Homebrew/cmd/doctor.rb index 7c184587f1..2a7c7abb1c 100644 --- a/Library/Homebrew/cmd/doctor.rb +++ b/Library/Homebrew/cmd/doctor.rb @@ -576,7 +576,7 @@ class Checks end def check_xcode_select_path - if !MacOS::CLT.installed? and !File.file? "#{MacOS.active_developer_dir}/usr/bin/xcodebuild" + if !MacOS::CLT.installed? && !File.file?("#{MacOS.active_developer_dir}/usr/bin/xcodebuild") path = MacOS::Xcode.bundle_path path = "/Developer" if path.nil? || !path.directory? <<-EOS.undent diff --git a/Library/Homebrew/cmd/search.rb b/Library/Homebrew/cmd/search.rb index c3d1597c3f..ba2932450c 100644 --- a/Library/Homebrew/cmd/search.rb +++ b/Library/Homebrew/cmd/search.rb @@ -60,7 +60,7 @@ module Homebrew puts_columns(tap_results) count = local_results.length + tap_results.length - if count == 0 and !blacklisted? query + if count == 0 && !blacklisted?(query) puts "No formula found for #{query.inspect}." begin GitHub.print_pull_requests_matching(query) diff --git a/Library/Homebrew/keg_relocate.rb b/Library/Homebrew/keg_relocate.rb index 723b5f7aae..97e0bee311 100644 --- a/Library/Homebrew/keg_relocate.rb +++ b/Library/Homebrew/keg_relocate.rb @@ -9,7 +9,7 @@ class Keg each_install_name_for(file) do |bad_name| # Don't fix absolute paths unless they are rooted in the build directory - next if bad_name.start_with? "/" and !bad_name.start_with? HOMEBREW_TEMP.to_s + next if bad_name.start_with? "/" && !bad_name.start_with?(HOMEBREW_TEMP.to_s) new_name = fixed_name(file, bad_name) change_install_name(bad_name, new_name, file) unless new_name == bad_name diff --git a/Library/brew.rb b/Library/brew.rb index f2ea301100..916e2705c4 100755 --- a/Library/brew.rb +++ b/Library/brew.rb @@ -39,10 +39,12 @@ if OS.mac? && MacOS.version < :mavericks && MacOS.active_developer_dir == "/" EOS end -case HOMEBREW_PREFIX.to_s when "/", "/usr" - # it may work, but I only see pain this route and don't want to support it - abort "Cowardly refusing to continue at this prefix: #{HOMEBREW_PREFIX}" +case HOMEBREW_PREFIX.to_s +when "/", "/usr" + # it may work, but I only see pain this route and don't want to support it + abort "Cowardly refusing to continue at this prefix: #{HOMEBREW_PREFIX}" end + if OS.mac? and MacOS.version < "10.6" abort <<-EOABORT.undent Homebrew requires Snow Leopard or higher. For Tiger and Leopard support, see: