Class: Sprockets::Helpers::Settings
- Inherits:
-
Object
- Object
- Sprockets::Helpers::Settings
- Defined in:
- lib/sprockets/helpers/settings.rb
Instance Attribute Summary collapse
-
#asset_host ⇒ Object
Link to assets from a dedicated server.
-
#debug ⇒ Object
When true, force debug mode :debug => true equals :expand => true (unless using >= Sprockets 4.0) :digest => false :manifest => false.
-
#default_path_options ⇒ Object
The default options for each asset path method.
-
#digest ⇒ Object
When true, the asset paths will return digest paths.
-
#environment ⇒ Object
Set the Sprockets environment to search for assets.
-
#expand ⇒ Object
When true, expand assets.
-
#manifest ⇒ Object
The manifest file used for lookup.
-
#prefix ⇒ Object
The base URL the Sprocket environment is mapped to.
-
#protocol ⇒ Object
Customize the protocol when using asset hosts.
-
#public_path ⇒ Object
The path to the public directory, where the assets not managed by Sprockets will be located.
Instance Attribute Details
#asset_host ⇒ Object
Link to assets from a dedicated server.
5 6 7 |
# File 'lib/sprockets/helpers/settings.rb', line 5 def asset_host @asset_host end |
#debug ⇒ Object
When true, force debug mode :debug => true equals
:expand => true (unless using >= Sprockets 4.0)
:digest => false
:manifest => false
18 19 20 |
# File 'lib/sprockets/helpers/settings.rb', line 18 def debug @debug end |
#default_path_options ⇒ Object
The default options for each asset path method. This is where you can change your default directories for the fallback directory.
53 54 55 56 57 58 59 60 61 62 |
# File 'lib/sprockets/helpers/settings.rb', line 53 def @default_path_options ||= { :audio_path => { :dir => 'audios' }, :font_path => { :dir => 'fonts' }, :image_path => { :dir => 'images' }, :javascript_path => { :dir => 'javascripts', :ext => 'js' }, :stylesheet_path => { :dir => 'stylesheets', :ext => 'css' }, :video_path => { :dir => 'videos' } } end |
#digest ⇒ Object
When true, the asset paths will return digest paths.
8 9 10 |
# File 'lib/sprockets/helpers/settings.rb', line 8 def digest @digest end |
#environment ⇒ Object
Set the Sprockets environment to search for assets. This defaults to the context’s #environment method.
22 23 24 |
# File 'lib/sprockets/helpers/settings.rb', line 22 def environment @environment end |
#expand ⇒ Object
When true, expand assets.
11 12 13 |
# File 'lib/sprockets/helpers/settings.rb', line 11 def @expand end |
#manifest ⇒ Object
The manifest file used for lookup
25 26 27 |
# File 'lib/sprockets/helpers/settings.rb', line 25 def manifest @manifest end |
#prefix ⇒ Object
The base URL the Sprocket environment is mapped to. This defaults to ‘/assets’.
29 30 31 32 |
# File 'lib/sprockets/helpers/settings.rb', line 29 def prefix @prefix ||= '/assets' @prefix.is_a?(Array) ? "/#{@prefix.first}" : @prefix end |
#protocol ⇒ Object
Customize the protocol when using asset hosts. If the value is :relative, A relative protocol (‘//’) will be used.
38 39 40 |
# File 'lib/sprockets/helpers/settings.rb', line 38 def protocol @protocol ||= 'http://' end |
#public_path ⇒ Object
The path to the public directory, where the assets not managed by Sprockets will be located. Defaults to ‘./public’
46 47 48 |
# File 'lib/sprockets/helpers/settings.rb', line 46 def public_path @public_path ||= './public' end |