Class: Sprockets::Railtie
Defined Under Namespace
Classes: ManifestNeededError, OrderedOptions
Constant Summary
collapse
- LOOSE_APP_ASSETS =
lambda do |logical_path, filename|
filename.start_with?(::Rails.root.join("app/assets").to_s) &&
!['.js', '.css', ''].include?(File.extname(logical_path))
end
Class Method Summary
collapse
Instance Method Summary
collapse
#using_sprockets4?
Class Method Details
.build_manifest(app) ⇒ Object
213
214
215
216
217
|
# File 'lib/sprockets/railtie.rb', line 213
def self.build_manifest(app)
config = app.config
path = File.join(config.paths['public'].first, config.assets.prefix)
Sprockets::Manifest.new(app.assets, path, config.assets.manifest)
end
|
Instance Method Details
#build_environment(app, initialized = nil) ⇒ Object
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
|
# File 'lib/sprockets/railtie.rb', line 182
def build_environment(app, initialized = nil)
initialized = app.initialized? if initialized.nil?
unless initialized
::Rails.logger.warn "Application uninitialized: Try calling YourApp::Application.initialize!"
end
env = Sprockets::Environment.new(app.root.to_s)
config = app.config
config.assets._blocks.each do |block|
block.call(env)
end
env.js_compressor = config.assets.js_compressor
env.css_compressor = config.assets.css_compressor
if config.cache_classes
env = env.cached
end
env
end
|