Class: Sinatra::Sprockets::Configuration

Inherits:
Object
  • Object
show all
Defined in:
lib/sinatra/sprockets/configuration.rb

Constant Summary collapse

DEFAULTS =
{
  :digest => true, 
  :debug => false, 
  :compile => false, 
  :compress => true,
  :prefix => "assets", 
  :host => nil, 
  :relative_url_root => ENV['RACK_RELATIVE_URL_ROOT'],
  :precompile => [ /\w+\.(?!js|css).+/, /application.(css|js)$/ ], 
  :manifest_path => "public/assets",
  :app => nil
}
OPTIONS =
DEFAULTS.keys

Instance Method Summary collapse

Constructor Details

#initializeConfiguration

Returns a new instance of Configuration.



34
35
36
37
38
# File 'lib/sinatra/sprockets/configuration.rb', line 34

def initialize
  @_config = DEFAULTS
  @_digests = {}
  @_paths = []
end

Instance Method Details

#append_path(path) ⇒ Object



48
49
50
# File 'lib/sinatra/sprockets/configuration.rb', line 48

def append_path(path)
  @_paths << path
end

#digestsObject



40
41
42
# File 'lib/sinatra/sprockets/configuration.rb', line 40

def digests
  @_digests
end

#digests=(value) ⇒ Object



44
45
46
# File 'lib/sinatra/sprockets/configuration.rb', line 44

def digests=(value)
  @_digests = value
end

#environmentObject



64
65
66
# File 'lib/sinatra/sprockets/configuration.rb', line 64

def environment
  Sinatra::Sprockets.environment
end

#inspectObject



60
61
62
# File 'lib/sinatra/sprockets/configuration.rb', line 60

def inspect
  @_config.inspect
end

#pathsObject



56
57
58
# File 'lib/sinatra/sprockets/configuration.rb', line 56

def paths
  @_paths
end

#paths=(value) ⇒ Object



52
53
54
# File 'lib/sinatra/sprockets/configuration.rb', line 52

def paths=(value)
  @_paths = value.to_a
end