Class: ClassyAssets::Configuration
- Inherits:
-
Object
- Object
- ClassyAssets::Configuration
- Defined in:
- lib/classy_assets.rb
Class Method Summary collapse
- .asset_digest ⇒ Object
- .asset_digest=(digest) ⇒ Object
- .asset_host ⇒ Object
- .asset_host=(host) ⇒ Object
- .asset_host_protocol ⇒ Object
- .asset_host_protocol=(protocol) ⇒ Object
- .asset_paths ⇒ Object
- .asset_paths=(paths) ⇒ Object
- .asset_prefix ⇒ Object
- .asset_prefix=(prefix) ⇒ Object
- .build_asset_path(dir_names) ⇒ Object
- .configure {|_self| ... } ⇒ Object
- .css_compressor ⇒ Object
- .css_compressor=(compressor) ⇒ Object
- .debug_mode ⇒ Object
- .debug_mode=(debug) ⇒ Object
- .js_compressor ⇒ Object
- .js_compressor=(compressor) ⇒ Object
- .public_path ⇒ Object
- .public_path=(path) ⇒ Object
- .root_path ⇒ Object
- .root_path=(path) ⇒ Object
- .sprockets ⇒ Object
Class Method Details
.asset_digest ⇒ Object
17 18 19 |
# File 'lib/classy_assets.rb', line 17 def self.asset_digest @asset_digest.nil? ? false : @asset_digest end |
.asset_digest=(digest) ⇒ Object
21 22 23 |
# File 'lib/classy_assets.rb', line 21 def self.asset_digest=(digest) @asset_digest = digest end |
.asset_host ⇒ Object
33 34 35 |
# File 'lib/classy_assets.rb', line 33 def self.asset_host @asset_host end |
.asset_host=(host) ⇒ Object
37 38 39 |
# File 'lib/classy_assets.rb', line 37 def self.asset_host=(host) @asset_host = host end |
.asset_host_protocol ⇒ Object
41 42 43 |
# File 'lib/classy_assets.rb', line 41 def self.asset_host_protocol @asset_host_protocol || :relative end |
.asset_host_protocol=(protocol) ⇒ Object
45 46 47 |
# File 'lib/classy_assets.rb', line 45 def self.asset_host_protocol=(protocol) @asset_host_protocol = protocol end |
.asset_paths ⇒ Object
25 26 27 |
# File 'lib/classy_assets.rb', line 25 def self.asset_paths @asset_paths || build_asset_path(%w(fonts images javascripts stylesheets)) end |
.asset_paths=(paths) ⇒ Object
29 30 31 |
# File 'lib/classy_assets.rb', line 29 def self.asset_paths=(paths) @asset_paths = paths.to_a end |
.asset_prefix ⇒ Object
49 50 51 |
# File 'lib/classy_assets.rb', line 49 def self.asset_prefix @asset_prefix || 'assets' end |
.asset_prefix=(prefix) ⇒ Object
53 54 55 |
# File 'lib/classy_assets.rb', line 53 def self.asset_prefix=(prefix) @asset_prefix = prefix end |
.build_asset_path(dir_names) ⇒ Object
97 98 99 100 101 102 |
# File 'lib/classy_assets.rb', line 97 def self.build_asset_path(dir_names) dir_names.map! do |dir_name| File.join(root_path, asset_prefix, dir_name) end dir_names end |
.configure {|_self| ... } ⇒ Object
13 14 15 |
# File 'lib/classy_assets.rb', line 13 def self.configure yield self end |
.css_compressor ⇒ Object
57 58 59 |
# File 'lib/classy_assets.rb', line 57 def self.css_compressor @css_compressor || :yui end |
.css_compressor=(compressor) ⇒ Object
61 62 63 |
# File 'lib/classy_assets.rb', line 61 def self.css_compressor=(compressor) @css_compressor = compressor end |
.debug_mode ⇒ Object
65 66 67 |
# File 'lib/classy_assets.rb', line 65 def self.debug_mode @debug_mode.nil? ? (ENV['RACK_ENV'] == 'development') : @debug_mode end |
.debug_mode=(debug) ⇒ Object
69 70 71 |
# File 'lib/classy_assets.rb', line 69 def self.debug_mode=(debug) @debug_mode = debug end |
.js_compressor ⇒ Object
73 74 75 |
# File 'lib/classy_assets.rb', line 73 def self.js_compressor @js_compressor || :uglifier end |
.js_compressor=(compressor) ⇒ Object
77 78 79 |
# File 'lib/classy_assets.rb', line 77 def self.js_compressor=(compressor) @js_compressor = compressor end |
.public_path ⇒ Object
81 82 83 |
# File 'lib/classy_assets.rb', line 81 def self.public_path @public_path || File.join(root_path, 'public') end |
.public_path=(path) ⇒ Object
85 86 87 |
# File 'lib/classy_assets.rb', line 85 def self.public_path=(path) @public_path = path end |
.root_path ⇒ Object
89 90 91 |
# File 'lib/classy_assets.rb', line 89 def self.root_path @root_path || '.' end |
.root_path=(path) ⇒ Object
93 94 95 |
# File 'lib/classy_assets.rb', line 93 def self.root_path=(path) @root_path = path end |
.sprockets ⇒ Object
104 105 106 107 108 109 110 |
# File 'lib/classy_assets.rb', line 104 def self.sprockets @sprockets ||= ::Sprockets::Environment.new(root_path) asset_paths.each do |asset_path| @sprockets.append_path asset_path unless @sprockets.paths.include?(asset_path) end @sprockets end |