Skip to content

Commit

Permalink
Minimum Ruby version is 2.5
Browse files Browse the repository at this point in the history
Ruby 2.3 is EOL and is no longer supported by Ruby Core. 2.4 will be EOL in 6 months when 2.7 comes out. This also allows us to match Ruby versions with Rails 6.
  • Loading branch information
schneems committed May 20, 2019
1 parent d327cde commit 1741272
Show file tree
Hide file tree
Showing 8 changed files with 11 additions and 13 deletions.
3 changes: 2 additions & 1 deletion .rubocop.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
require: rubocop-performance
AllCops:
DisabledByDefault: true
DisplayCopNames: true
TargetRubyVersion: 2.3
TargetRubyVersion: 2.5

Performance:
Enabled: true
2 changes: 0 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@ before_script: "unset _JAVA_OPTIONS"
before_install: gem install bundler -v '<2'

rvm:
- 2.3.8
- 2.4.5
- 2.5.3
- 2.6.0
- jruby-9.2.5.0
Expand Down
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ Get upgrade notes from Sprockets 3.x to 4.x at https://github.com/rails/sprocket

## Master

- Minimum Ruby version for Sprockets 4 is now 2.5+ which matches minimum ruby verision of Rails [#604]

## 4.0.0.beta8

- Security release for [CVE-2018-3760](https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2018-3760)
Expand Down
5 changes: 1 addition & 4 deletions appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,9 @@ test_script:

matrix:
allow_failures:
- RUBY_VERSION: 25-x64
- RUBY_VERSION: 24-x64

environment:
matrix:
- RUBY_VERSION: 26-x64
- RUBY_VERSION: 25-x64
- RUBY_VERSION: 24-x64
- RUBY_VERSION: 23-x64

4 changes: 2 additions & 2 deletions lib/sprockets/loader.rb
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ def asset_from_cache(key)
asset[:metadata][:dependencies].map! { |uri| uri.start_with?("file-digest://") ? expand_from_root(uri) : uri } if asset[:metadata][:dependencies]

asset[:metadata].each_key do |k|
next unless k.to_s.end_with?('_dependencies')
next unless k.match?(/_dependencies\z/) # rubocop:disable Performance/EndWith
asset[:metadata][k].map! { |uri| expand_from_root(uri) }
end
end
Expand Down Expand Up @@ -244,7 +244,7 @@ def store_asset(asset, unloaded)

# compress all _dependencies in metadata like `sass_dependencies`
cached_asset[:metadata].each do |key, value|
next unless key.to_s.end_with?('_dependencies')
next unless key.match?(/_dependencies\z/) # rubocop:disable Performance/EndWith
cached_asset[:metadata][key] = value.dup
cached_asset[:metadata][key].map! {|uri| compress_from_root(uri) }
end
Expand Down
2 changes: 1 addition & 1 deletion lib/sprockets/path_utils.rb
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ def absolute_path?(path)
#
# Returns true if path is relative, otherwise false.
def relative_path?(path)
path =~ /^\.\.?($|#{SEPARATOR_PATTERN})/ ? true : false
path.match?(/^\.\.?($|#{SEPARATOR_PATTERN})/) ? true : false
end

# Public: Get relative path from `start` to `dest`.
Expand Down
4 changes: 2 additions & 2 deletions sprockets.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,9 @@ Gem::Specification.new do |s|
unless RUBY_PLATFORM.include?('java')
s.add_development_dependency "zopfli", "~> 0.0.4"
end
s.add_development_dependency "rubocop", "~> 0.63"
s.add_development_dependency "rubocop-performance", "~> 1.3"

s.required_ruby_version = '>= 2.3.0'
s.required_ruby_version = '>= 2.5.0'

s.authors = ["Sam Stephenson", "Joshua Peek"]
s.email = ["[email protected]", "[email protected]"]
Expand Down
2 changes: 1 addition & 1 deletion test/test_caching.rb
Original file line number Diff line number Diff line change
Expand Up @@ -436,7 +436,7 @@ def teardown
end
cache = environment.cache
def cache.set(key, value, local = false)
if value.to_s =~ /#{Dir.pwd}/
if value.to_s.match?(/#{Dir.pwd}/)
raise "Expected '#{value}' to not contain absolute path '#{Dir.pwd}' but did"
end
end
Expand Down

0 comments on commit 1741272

Please sign in to comment.