Skip to content

Commit

Permalink
Move to ruby 2.5 as the earliest supported version.
Browse files Browse the repository at this point in the history
2.4 is nearly two years beyond EOL now.
  • Loading branch information
hainesr committed Jan 11, 2022
1 parent 90728d7 commit ce0f47b
Show file tree
Hide file tree
Showing 7 changed files with 13 additions and 15 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
- name: Install and set up ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: 2.4
ruby-version: '2.5'
bundler-cache: true

- name: Rubocop
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@ jobs:
fail-fast: false
matrix:
os: [ubuntu]
ruby: ['2.4', '2.5', '2.6', '2.7', '3.0', '3.1', head, jruby, jruby-head, truffleruby, truffleruby-head]
ruby: ['2.5', '2.6', '2.7', '3.0', '3.1', head, jruby, jruby-head, truffleruby, truffleruby-head]
include:
- os: macos
ruby: 2.4
ruby: '2.5'
- os: windows
ruby: 2.4
ruby: '2.5'
runs-on: ${{ matrix.os }}-latest
continue-on-error: ${{ endsWith(matrix.ruby, 'head') || matrix.os == 'windows' }}
steps:
Expand Down
2 changes: 1 addition & 1 deletion .rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ inherit_from: .rubocop_todo.yml
# Set this to the minimum supported ruby in the gemspec. Otherwise
# we get errors if our ruby version doesn't match.
AllCops:
TargetRubyVersion: 2.4
TargetRubyVersion: 2.5
NewCops: enable

# Allow this in this file because adding the extra lines is pointless.
Expand Down
2 changes: 1 addition & 1 deletion .simplecov
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,6 @@ SimpleCov.formatter = SimpleCov::Formatter::MultiFormatter.new(
)

SimpleCov.start do
# enable_coverage :branch <-- Re-enable this when we move to ruby ~> 2.5.
enable_coverage :branch
add_filter ['/test/', '/samples/']
end
12 changes: 5 additions & 7 deletions lib/zip/file.rb
Original file line number Diff line number Diff line change
Expand Up @@ -406,14 +406,12 @@ def check_file(path)
def on_success_replace
dirname, basename = ::File.split(name)
::Dir::Tmpname.create(basename, dirname) do |tmp_filename|
begin
if yield tmp_filename
::File.rename(tmp_filename, name)
::File.chmod(@file_permissions, name) unless @create
end
ensure
::File.unlink(tmp_filename) if ::File.exist?(tmp_filename)
if yield tmp_filename
::File.rename(tmp_filename, name)
::File.chmod(@file_permissions, name) unless @create
end
ensure
::File.unlink(tmp_filename) if ::File.exist?(tmp_filename)
end
end
end
Expand Down
2 changes: 1 addition & 1 deletion rubyzip.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ Gem::Specification.new do |s|
'wiki_uri' => 'https://github.com/rubyzip/rubyzip/wiki'
}

s.required_ruby_version = '>= 2.4'
s.required_ruby_version = '>= 2.5'

s.add_development_dependency 'minitest', '~> 5.4'
s.add_development_dependency 'rake', '~> 12.3.3'
Expand Down
2 changes: 1 addition & 1 deletion test/filesystem/file_nonmutating_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -445,7 +445,7 @@ def test_glob
'*/foo/**/*.txt' => ['globTest/foo/bar/baz/foo.txt']
}.each do |spec, expected_results|
results = zf.glob(spec)
assert(results.all? { |entry| entry.kind_of? ::Zip::Entry })
assert(results.all?(::Zip::Entry))

result_strings = results.map(&:to_s)
missing_matches = expected_results - result_strings
Expand Down

0 comments on commit ce0f47b

Please sign in to comment.