Skip to content

Commit

Permalink
Only use kwargs splat operator on Ruby 2.7+
Browse files Browse the repository at this point in the history
This gem supports a lot of Ruby/Rails versions so we'd need to bump
the major version if we wanted to break backwards compatibility.
  • Loading branch information
pixeltrix committed Sep 11, 2020
1 parent b7e27b3 commit 94f4260
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions lib/sprockets/rails/helper.rb
Expand Up @@ -352,8 +352,14 @@ def find_debug_asset(path)
end

private
def find_asset(path, options = {})
@env[path, **options]
if RUBY_VERSION >= "2.7"
def find_asset(path, options = {})
@env[path, **options]
end
else
def find_asset(path, options = {})
@env[path, options]
end
end

def precompiled?(path)
Expand Down

0 comments on commit 94f4260

Please sign in to comment.