Class: JsAssets::List
- Inherits:
-
Object
- Object
- JsAssets::List
- Defined in:
- lib/js_assets/list.rb
Class Attribute Summary collapse
-
.allow ⇒ Object
Returns the value of attribute allow.
-
.exclude ⇒ Object
Returns the value of attribute exclude.
Class Method Summary collapse
Class Attribute Details
.allow ⇒ Object
Returns the value of attribute allow.
4 5 6 |
# File 'lib/js_assets/list.rb', line 4 def allow @allow end |
.exclude ⇒ Object
Returns the value of attribute exclude.
4 5 6 |
# File 'lib/js_assets/list.rb', line 4 def exclude @exclude end |
Class Method Details
.fetch ⇒ Object
8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 |
# File 'lib/js_assets/list.rb', line 8 def self.fetch project_assets = {} env = Sprockets::Railtie.build_environment(::Rails.application) env.logical_paths do |logical_path, filename| next if matches_filter(@exclude, logical_path, filename) next unless matches_filter(@allow, logical_path, filename) assets_root = ::Rails.application.config.action_controller.asset_host.present? ? ::Rails.application.config.action_controller.asset_host : '/' if env.file_digest(filename) project_assets[logical_path] = File.join(assets_root, ::Rails.application.config.assets.prefix, env[logical_path].digest_path) else project_assets[logical_path] = File.join(assets_root, ::Rails.application.config.assets.prefix, logical_path) end end return project_assets end |