diff --git a/.rubocop.yml b/.rubocop.yml index ee22ae7f5..572a4d0cd 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -1,4 +1,5 @@ AllCops: + TargetRubyVersion: 2.5 NewCops: enable Style/StringLiterals: diff --git a/lib/macho.rb b/lib/macho.rb index e8ab0dd19..20f413fca 100644 --- a/lib/macho.rb +++ b/lib/macho.rb @@ -16,7 +16,7 @@ # The primary namespace for ruby-macho. module MachO # release version - VERSION = "2.3.0" + VERSION = "2.4.0" # Opens the given filename as a MachOFile or FatFile, depending on its magic. # @param filename [String] the file being opened diff --git a/lib/macho/fat_file.rb b/lib/macho/fat_file.rb index f389159af..0eecdcf32 100644 --- a/lib/macho/fat_file.rb +++ b/lib/macho/fat_file.rb @@ -398,16 +398,14 @@ def each_macho(options = {}) errors = [] machos.each_with_index do |macho, index| - begin - yield macho - rescue RecoverableModificationError => e - e.macho_slice = index + yield macho + rescue RecoverableModificationError => e + e.macho_slice = index - # Strict mode: Immediately re-raise. Otherwise: Retain, check later. - raise e if strict + # Strict mode: Immediately re-raise. Otherwise: Retain, check later. + raise e if strict - errors << e - end + errors << e end # Non-strict mode: Raise first error if *all* Mach-O slices failed. diff --git a/ruby-macho.gemspec b/ruby-macho.gemspec index 2c0ade9b2..31c1f2879 100644 --- a/ruby-macho.gemspec +++ b/ruby-macho.gemspec @@ -10,7 +10,7 @@ Gem::Specification.new do |s| s.authors = ["William Woodruff"] s.email = "william@yossarian.net" s.files = Dir["LICENSE", "README.md", ".yardopts", "lib/**/*"] - s.required_ruby_version = ">= 2.3" + s.required_ruby_version = ">= 2.5" s.homepage = "https://github.com/Homebrew/ruby-macho" s.license = "MIT" end