Skip to content

Commit

Permalink
Require sprockets deprecator in Railtie
Browse files Browse the repository at this point in the history
With the release of sprockets-rails 3.5.0, our local test suite breaks
with

```
NoMethodError:
  undefined method `deprecator' for Sprockets::Rails:Module
 /home/circleci/solidus/vendor/bundle/ruby/3.2.0/gems/sprockets-rails-3.5.0/lib/sprockets/railtie.rb:129:in `block in <class:Railtie>'
```

This should fix that by explicitly requiring the
`Sprockets::Rails.deprecator` in both `lib/sprockets/rails.rb` and
`lib/sprockets/railtie.rb`.

Should fix #524
  • Loading branch information
mamhoff committed Jun 6, 2024
1 parent 5f6d88d commit fa7dc71
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 3 deletions.
4 changes: 1 addition & 3 deletions lib/sprockets/rails.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,9 @@
if defined? Rails::Railtie
require 'sprockets/railtie'
end
require 'sprockets/rails/deprecator'

module Sprockets
module Rails
def self.deprecator
@deprecator ||= ActiveSupport::Deprecation.new("4.0", "Sprockets::Rails")
end
end
end
9 changes: 9 additions & 0 deletions lib/sprockets/rails/deprecator.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# frozen_string_literal: true

module Sprockets
module Rails
def self.deprecator
@deprecator ||= ActiveSupport::Deprecation.new("4.0", "Sprockets::Rails")
end
end
end
1 change: 1 addition & 0 deletions lib/sprockets/railtie.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
require 'sprockets'

require 'sprockets/rails/asset_url_processor'
require 'sprockets/rails/deprecator'
require 'sprockets/rails/sourcemapping_url_processor'
require 'sprockets/rails/context'
require 'sprockets/rails/helper'
Expand Down

0 comments on commit fa7dc71

Please sign in to comment.