Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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.
schneems committed May 20, 2019

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
1 parent d327cde commit 52ac9eb
Showing 7 changed files with 10 additions and 9 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
@@ -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
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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)
4 changes: 2 additions & 2 deletions lib/sprockets/loader.rb
Original file line number Diff line number Diff line change
@@ -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
@@ -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
2 changes: 1 addition & 1 deletion lib/sprockets/path_utils.rb
Original file line number Diff line number Diff line change
@@ -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`.
4 changes: 2 additions & 2 deletions sprockets.gemspec
Original file line number Diff line number Diff line change
@@ -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]"]
2 changes: 1 addition & 1 deletion test/test_caching.rb
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit 52ac9eb

Please sign in to comment.