Class: Middleman::Extensions::AssetHost
- Inherits:
-
Middleman::Extension
- Object
- Middleman::Extension
- Middleman::Extensions::AssetHost
- Defined in:
- lib/middleman-more/extensions/asset_host.rb
Overview
Asset Host module
Instance Attribute Summary
Attributes inherited from Middleman::Extension
Instance Method Summary collapse
- #host ⇒ Object
-
#initialize(app, options_hash = {}, &block) ⇒ AssetHost
constructor
A new instance of AssetHost.
Methods inherited from Middleman::Extension
activate, activated_extension, after_extension_activated, clear_after_extension_callbacks, config, extension_name, helpers, option, register
Constructor Details
#initialize(app, options_hash = {}, &block) ⇒ AssetHost
Returns a new instance of AssetHost.
6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 |
# File 'lib/middleman-more/extensions/asset_host.rb', line 6 def initialize(app, ={}, &block) super # Backwards compatible API app.config.define_setting :asset_host, nil, 'The asset host to use, or false for no asset host, or a Proc to determine asset host' app.compass_config do |config| if asset_host = extensions[:asset_host].host if asset_host.is_a?(Proc) config.asset_host(&asset_host) else config.asset_host do |asset| asset_host end end end end if app.respond_to?(:compass_config) end |
Instance Method Details
#host ⇒ Object
25 26 27 |
# File 'lib/middleman-more/extensions/asset_host.rb', line 25 def host app.config[:asset_host] || [:host] end |