aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorXu Cheng2015-08-03 20:38:20 +0800
committerXu Cheng2015-08-03 20:38:20 +0800
commitd62095710fef350551c415af3854926e66a40c71 (patch)
tree156342fd269c7a9dcdb1eb9ae79e6c82b5ecc4ad
parent13d544e11e92ba8ea3788723432046f8dfe4adf9 (diff)
downloadbrew-d62095710fef350551c415af3854926e66a40c71.tar.bz2
More core files style updates
-rw-r--r--Library/Homebrew/cleaner.rb2
-rw-r--r--Library/Homebrew/cmd/doctor.rb2
-rw-r--r--Library/Homebrew/cmd/search.rb2
-rw-r--r--Library/Homebrew/keg_relocate.rb2
-rwxr-xr-xLibrary/brew.rb8
5 files changed, 9 insertions, 7 deletions
diff --git a/Library/Homebrew/cleaner.rb b/Library/Homebrew/cleaner.rb
index dae9dbc6c..bafbb34e0 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 7c184587f..2a7c7abb1 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 c3d1597c3..ba2932450 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 723b5f7aa..97e0bee31 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 f2ea30110..916e2705c 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: