sprockets-rails 3.4.2 → 3.5.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 73feab57944f69ac95583179fd64af5d7e927b6e352260ce8d061e95b2dbdfd8
4
- data.tar.gz: 4cec001efd7cd64ee755114ccdaa80dac093abf39efd0e982223329508e3ddb1
3
+ metadata.gz: a51f06b8c5ad01f10611895d361f493f20793676b3a04182f5bea67b2f5a3109
4
+ data.tar.gz: 0ad6746d0b030fb467c6f24c343d2b6eb2b372a89f0cf232b3b97825ab103a2d
5
5
  SHA512:
6
- metadata.gz: 551eeb4f6d09b58157c6fbe2797f4e7ec69dde50cb9a160862e75cd2fe73063e1935582e3bf69533a835d3045d8562ce73de636caa89320e0d1a8b19cb875326
7
- data.tar.gz: 2ea2f80c41a29207772023a344a5404d0aeae3c32987c5dae511f7941637a3ac744e02d66681d667e1b583fe91b2b606c43ab708436766cf708a76408628cb42
6
+ metadata.gz: 534796ce9f7e854c034119104a45c2112f3a72f606c6af5eb73b7d3bcdf76c00c91e65f632775b22320ac39c218a369c950da583269ec7023012b8a2f89e3181
7
+ data.tar.gz: bb0a83b01f58aa870429fa8be470343ee13e8c18aeb50312202724cc773eb52531ec74baa7b4a023a4a73c62897fbdc2de448db3aaf39fc58f65ffc5771d4a2a
data/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # Sprockets Rails
2
2
 
3
- Provides Sprockets implementation for Rails 4.x (and beyond) Asset Pipeline.
3
+ Provides [Sprockets](https://github.com/rails/sprockets) implementation for Rails 4.x (and beyond) Asset Pipeline.
4
4
 
5
5
 
6
6
  ## Installation
@@ -89,8 +89,7 @@ module Sprockets
89
89
  message << "To bypass the asset pipeline and preserve this behavior,\n"
90
90
  message << "use the `skip_pipeline: true` option.\n"
91
91
 
92
- call_stack = Kernel.respond_to?(:caller_locations) && ::Rails::VERSION::MAJOR >= 5 ? caller_locations : caller
93
- ActiveSupport::Deprecation.warn(message, call_stack)
92
+ Sprockets::Rails.deprecator.warn(message, caller_locations)
94
93
  end
95
94
  super
96
95
  end
@@ -1,5 +1,7 @@
1
1
  module Sprockets
2
2
  module Rails
3
+ class LoggerSilenceError < StandardError; end
4
+
3
5
  class QuietAssets
4
6
  def initialize(app)
5
7
  @app = app
@@ -8,11 +10,23 @@ module Sprockets
8
10
 
9
11
  def call(env)
10
12
  if env['PATH_INFO'] =~ @assets_regex
13
+ raise_logger_silence_error unless ::Rails.logger.respond_to?(:silence)
14
+
11
15
  ::Rails.logger.silence { @app.call(env) }
12
16
  else
13
17
  @app.call(env)
14
18
  end
15
19
  end
20
+
21
+ private
22
+ def raise_logger_silence_error
23
+ error = "You have enabled `config.assets.quiet`, but your `Rails.logger`\n"
24
+ error << "does not use the `LoggerSilence` module.\n\n"
25
+ error << "Please use a compatible logger such as `ActiveSupport::Logger`\n"
26
+ error << "to take advantage of quiet asset logging.\n\n"
27
+
28
+ raise LoggerSilenceError, error
29
+ end
16
30
  end
17
31
  end
18
32
  end
@@ -1,7 +1,6 @@
1
1
  module Sprockets
2
2
  module Rails
3
3
  module RouteWrapper
4
-
5
4
  def internal_assets_path?
6
5
  path =~ %r{\A#{self.class.assets_prefix}\z}
7
6
  end
@@ -9,15 +8,6 @@ module Sprockets
9
8
  def internal?
10
9
  super || internal_assets_path?
11
10
  end
12
-
13
- def self.included(klass)
14
- klass.class_eval do
15
- def internal_with_sprockets?
16
- internal_without_sprockets? || internal_assets_path?
17
- end
18
- alias_method_chain :internal?, :sprockets
19
- end
20
- end
21
11
  end
22
12
  end
23
13
  end
@@ -1,5 +1,5 @@
1
1
  module Sprockets
2
2
  module Rails
3
- VERSION = "3.4.2"
3
+ VERSION = "3.5.0"
4
4
  end
5
5
  end
@@ -1,4 +1,13 @@
1
1
  require 'sprockets/rails/version'
2
+ require 'active_support'
2
3
  if defined? Rails::Railtie
3
4
  require 'sprockets/railtie'
4
5
  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
@@ -53,17 +53,6 @@ module Rails
53
53
  @precompiled_assets ||= assets_manifest.find(config.assets.precompile).map(&:logical_path).to_set
54
54
  end
55
55
  end
56
-
57
- class Engine < Railtie
58
- # Skip defining append_assets_path on Rails <= 4.2
59
- unless initializers.find { |init| init.name == :append_assets_path }
60
- initializer :append_assets_path, :group => :all do |app|
61
- app.config.assets.paths.unshift(*paths["vendor/assets"].existent_directories)
62
- app.config.assets.paths.unshift(*paths["lib/assets"].existent_directories)
63
- app.config.assets.paths.unshift(*paths["app/assets"].existent_directories)
64
- end
65
- end
66
- end
67
56
  end
68
57
 
69
58
  module Sprockets
@@ -96,6 +85,12 @@ module Sprockets
96
85
  end
97
86
  end
98
87
 
88
+ ::Rails::Engine.initializer :append_assets_path, :group => :all do |app|
89
+ app.config.assets.paths.unshift(*paths["vendor/assets"].existent_directories)
90
+ app.config.assets.paths.unshift(*paths["lib/assets"].existent_directories)
91
+ app.config.assets.paths.unshift(*paths["app/assets"].existent_directories)
92
+ end
93
+
99
94
  config.assets = OrderedOptions.new
100
95
  config.assets._blocks = []
101
96
  config.assets.paths = []
@@ -130,6 +125,10 @@ module Sprockets
130
125
  Sprockets.register_postprocessor "application/javascript", ::Sprockets::Rails::SourcemappingUrlProcessor
131
126
  end
132
127
 
128
+ initializer "sprockets-rails.deprecator" do |app|
129
+ app.deprecators[:sprockets_rails] = Sprockets::Rails.deprecator if app.respond_to?(:deprecators)
130
+ end
131
+
133
132
  config.assets.version = ""
134
133
  config.assets.debug = false
135
134
  config.assets.compile = true
@@ -237,11 +236,7 @@ module Sprockets
237
236
  ActionDispatch::Routing::RouteWrapper.class_eval do
238
237
  class_attribute :assets_prefix
239
238
 
240
- if defined?(prepend) && ::Rails.version >= '4'
241
- prepend Sprockets::Rails::RouteWrapper
242
- else
243
- include Sprockets::Rails::RouteWrapper
244
- end
239
+ prepend Sprockets::Rails::RouteWrapper
245
240
 
246
241
  self.assets_prefix = config.assets.prefix
247
242
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sprockets-rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.4.2
4
+ version: 3.5.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Joshua Peek
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-12-11 00:00:00.000000000 Z
11
+ date: 2024-06-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: sprockets
@@ -30,42 +30,42 @@ dependencies:
30
30
  requirements:
31
31
  - - ">="
32
32
  - !ruby/object:Gem::Version
33
- version: '5.2'
33
+ version: '6.1'
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
38
  - - ">="
39
39
  - !ruby/object:Gem::Version
40
- version: '5.2'
40
+ version: '6.1'
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: activesupport
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
45
  - - ">="
46
46
  - !ruby/object:Gem::Version
47
- version: '5.2'
47
+ version: '6.1'
48
48
  type: :runtime
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
52
  - - ">="
53
53
  - !ruby/object:Gem::Version
54
- version: '5.2'
54
+ version: '6.1'
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: railties
57
57
  requirement: !ruby/object:Gem::Requirement
58
58
  requirements:
59
59
  - - ">="
60
60
  - !ruby/object:Gem::Version
61
- version: '5.2'
61
+ version: '6.1'
62
62
  type: :development
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
66
  - - ">="
67
67
  - !ruby/object:Gem::Version
68
- version: '5.2'
68
+ version: '6.1'
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: rake
71
71
  requirement: !ruby/object:Gem::Requirement
@@ -146,7 +146,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
146
146
  - !ruby/object:Gem::Version
147
147
  version: '0'
148
148
  requirements: []
149
- rubygems_version: 3.2.32
149
+ rubygems_version: 3.5.9
150
150
  signing_key:
151
151
  specification_version: 4
152
152
  summary: Sprockets Rails integration