Skip to content

Commit d34e89c

Browse files
committed
Require sprockets deprecator in Railtie
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
1 parent 5f6d88d commit d34e89c

File tree

3 files changed

+13
-9
lines changed

3 files changed

+13
-9
lines changed

lib/sprockets/rails.rb

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,5 @@
11
require 'sprockets/rails/version'
2-
require 'active_support'
32
if defined? Rails::Railtie
43
require 'sprockets/railtie'
54
end
6-
7-
module Sprockets
8-
module Rails
9-
def self.deprecator
10-
@deprecator ||= ActiveSupport::Deprecation.new("4.0", "Sprockets::Rails")
11-
end
12-
end
13-
end
5+
require 'sprockets/rails/deprecator'

lib/sprockets/rails/deprecator.rb

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# frozen_string_literal: true
2+
3+
require "active_support"
4+
5+
module Sprockets
6+
module Rails
7+
def self.deprecator
8+
@deprecator ||= ActiveSupport::Deprecation.new("4.0", "Sprockets::Rails")
9+
end
10+
end
11+
end

lib/sprockets/railtie.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
require 'sprockets'
77

88
require 'sprockets/rails/asset_url_processor'
9+
require 'sprockets/rails/deprecator'
910
require 'sprockets/rails/sourcemapping_url_processor'
1011
require 'sprockets/rails/context'
1112
require 'sprockets/rails/helper'

0 commit comments

Comments
 (0)