Skip to content

Commit

Permalink
Merge pull request #604 from rails/schneems/raise-required-version
Browse files Browse the repository at this point in the history
Minimum Ruby version is 2.5
  • Loading branch information
schneems authored May 20, 2019
2 parents d327cde + 8872cc3 commit 179bed1
Show file tree
Hide file tree
Showing 8 changed files with 11 additions and 16 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
8 changes: 1 addition & 7 deletions appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,8 @@ before_test:
test_script:
- bundle exec rake

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 179bed1

Please sign in to comment.