aboutsummaryrefslogtreecommitdiffstats
path: root/Library
diff options
context:
space:
mode:
authorMike McQuaid2016-09-17 17:01:04 +0100
committerMike McQuaid2016-09-17 17:01:04 +0100
commit1bdbb0f462e4c3557bbcba0b203696bdcf025bb4 (patch)
tree6eda39a3418c064d708f0995fb6c0e8ca60563b9 /Library
parent69e4ad9809a91e5dd6d8805905ba9ed6d7b8f4a5 (diff)
downloadbrew-1bdbb0f462e4c3557bbcba0b203696bdcf025bb4.tar.bz2
Improve rescue nesting.
Diffstat (limited to 'Library')
-rw-r--r--Library/Homebrew/diagnostic.rb16
-rw-r--r--Library/Homebrew/download_strategy.rb8
-rw-r--r--Library/Homebrew/global.rb8
-rw-r--r--Library/Homebrew/software_spec.rb8
4 files changed, 20 insertions, 20 deletions
diff --git a/Library/Homebrew/diagnostic.rb b/Library/Homebrew/diagnostic.rb
index 457b23630..bcdde6656 100644
--- a/Library/Homebrew/diagnostic.rb
+++ b/Library/Homebrew/diagnostic.rb
@@ -516,10 +516,10 @@ module Homebrew
# Our gettext formula will be caught by check_linked_keg_only_brews
gettext = begin
- Formulary.factory("gettext")
- rescue
- nil
- end
+ Formulary.factory("gettext")
+ rescue
+ nil
+ end
homebrew_owned = @found.all? do |path|
Pathname.new(path).realpath.to_s.start_with? "#{HOMEBREW_CELLAR}/gettext"
end
@@ -537,10 +537,10 @@ module Homebrew
return if @found.empty?
libiconv = begin
- Formulary.factory("libiconv")
- rescue
- nil
- end
+ Formulary.factory("libiconv")
+ rescue
+ nil
+ end
if libiconv && libiconv.linked_keg.directory?
unless libiconv.keg_only?
<<-EOS.undent
diff --git a/Library/Homebrew/download_strategy.rb b/Library/Homebrew/download_strategy.rb
index d9c3e30b7..cabb22c22 100644
--- a/Library/Homebrew/download_strategy.rb
+++ b/Library/Homebrew/download_strategy.rb
@@ -269,10 +269,10 @@ class AbstractFileDownloadStrategy < AbstractDownloadStrategy
case entries.length
when 0 then raise "Empty archive"
when 1 then begin
- Dir.chdir entries.first
- rescue
- nil
- end
+ Dir.chdir entries.first
+ rescue
+ nil
+ end
end
end
diff --git a/Library/Homebrew/global.rb b/Library/Homebrew/global.rb
index adb4ebc32..91692c146 100644
--- a/Library/Homebrew/global.rb
+++ b/Library/Homebrew/global.rb
@@ -56,10 +56,10 @@ require "compat" unless ARGV.include?("--no-compat") || ENV["HOMEBREW_NO_COMPAT"
ORIGINAL_PATHS = ENV["PATH"].split(File::PATH_SEPARATOR).map do |p|
begin
- Pathname.new(p).expand_path
- rescue
- nil
- end
+ Pathname.new(p).expand_path
+ rescue
+ nil
+ end
end.compact.freeze
# TODO: remove this as soon as it's removed from commands.rb.
diff --git a/Library/Homebrew/software_spec.rb b/Library/Homebrew/software_spec.rb
index 11a19b4c3..f935d9a13 100644
--- a/Library/Homebrew/software_spec.rb
+++ b/Library/Homebrew/software_spec.rb
@@ -339,10 +339,10 @@ class BottleSpecification
os_versions = collector.keys
os_versions.map! do |osx|
begin
- MacOS::Version.from_symbol osx
- rescue
- nil
- end
+ MacOS::Version.from_symbol osx
+ rescue
+ nil
+ end
end.compact!
os_versions.sort.reverse_each do |os_version|
osx = os_version.to_sym