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 7, 2024
1 parent 5f6d88d commit d34e89c
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 9 deletions.
10 changes: 1 addition & 9 deletions lib/sprockets/rails.rb
Original file line number Diff line number Diff line change
@@ -1,13 +1,5 @@
require 'sprockets/rails/version'
require 'active_support'
if defined? Rails::Railtie
require 'sprockets/railtie'
end

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

require "active_support"

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 d34e89c

Please sign in to comment.