File tree Expand file tree Collapse file tree 1 file changed +11
-7
lines changed Expand file tree Collapse file tree 1 file changed +11
-7
lines changed Original file line number Diff line number Diff line change @@ -44,14 +44,10 @@ def self.extended(obj)
44
44
end
45
45
end
46
46
47
- def check_dependencies! ( dep )
48
- return unless @_dependency_assets
49
- return if @_dependency_assets . detect { |asset | asset . include? ( dep ) }
50
- raise DependencyError . new ( self . pathname , dep )
51
- end
52
-
53
47
def compute_asset_path ( path , options = { } )
54
- check_dependencies! ( path )
48
+ # Check if we are inside Sprockets context before calling check_dependencies!.
49
+ check_dependencies! ( path ) if defined? ( _dependency_assets )
50
+
55
51
if digest_path = asset_digest_path ( path )
56
52
path = digest_path if digest_assets
57
53
path += "?body=1" if options [ :debug ]
@@ -140,6 +136,14 @@ def stylesheet_link_tag(*sources)
140
136
end
141
137
142
138
protected
139
+
140
+ # Checks if the asset is included in the dependencies list.
141
+ def check_dependencies! ( dep )
142
+ if !_dependency_assets . detect { |asset | asset . include? ( dep ) }
143
+ raise DependencyError . new ( self . pathname , dep )
144
+ end
145
+ end
146
+
143
147
# Enable split asset debugging. Eventually will be deprecated
144
148
# and replaced by source maps in Sprockets 3.x.
145
149
def request_debug_assets?
You can’t perform that action at this time.
0 commit comments