Class: Sprockets::Helpers::Settings

Inherits:
Object
  • Object
show all
Defined in:
lib/sprockets/helpers/settings.rb

Instance Attribute Summary collapse

Instance Attribute Details

#asset_hostObject

Link to assets from a dedicated server.



5
6
7
# File 'lib/sprockets/helpers/settings.rb', line 5

def asset_host
  @asset_host
end

#debugObject

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_optionsObject

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
  @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

#digestObject

When true, the asset paths will return digest paths.



8
9
10
# File 'lib/sprockets/helpers/settings.rb', line 8

def digest
  @digest
end

#environmentObject

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

#expandObject

When true, expand assets.



11
12
13
# File 'lib/sprockets/helpers/settings.rb', line 11

def expand
  @expand
end

#manifestObject

The manifest file used for lookup



25
26
27
# File 'lib/sprockets/helpers/settings.rb', line 25

def manifest
  @manifest
end

#prefixObject

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

#protocolObject

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_pathObject

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