Class: Rails::Application::Configuration

Inherits:
Engine::Configuration show all
Defined in:
lib/extensions/application_ext.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Engine::Configuration

#paths_with_assets

Instance Attribute Details

#assetsObject

Returns the value of attribute assets.



41
42
43
# File 'lib/extensions/application_ext.rb', line 41

def assets
  @assets
end

Instance Method Details

#initialize_with_assets(*args) ⇒ Object



20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
# File 'lib/extensions/application_ext.rb', line 20

def initialize_with_assets(*args)
  initialize_without_assets(*args)
  @assets = ActiveSupport::OrderedOptions.new
  # @assets.enabled                  = false
  @assets.paths                    = []
  @assets.precompile               = [ Proc.new{ |path| !['.js', '.css'].include?(File.extname(path)) },
                                       /(?:\/|\\|\A)application\.(css|js)$/ ]
  @assets.prefix                   = "/assets"
  @assets.version                  = ''
  @assets.debug                    = false
  @assets.compile                  = true
  @assets.digest                   = false
  @assets.manifest                 = nil
  @assets.cache_store              = [ :file_store, "#{root}/tmp/cache/assets/" ]
  @assets.js_compressor            = nil
  @assets.css_compressor           = nil
  @assets.initialize_on_precompile = true
end

#paths_with_vendor_assetsObject

we need to do this over again for Rails::Application::Configuration because the Rails 3.0 implementation squashes the paths.vendor that we made in application_ext.rb.



8
9
10
11
12
13
14
15
16
# File 'lib/extensions/application_ext.rb', line 8

def paths_with_vendor_assets
  @paths ||= begin
    paths = paths_without_vendor_assets
    paths.vendor              "vendor",              :load_path => true
    paths.vendor.assets       "vendor/assets",       :glob => "*"
    paths.vendor.plugins      "vendor/plugins"
    paths
  end
end