Module: Rails

Defined in:
lib/sprockets/rails2/asset_pipeline.rb

Class Method Summary collapse

Class Method Details

.asset_pipelineObject



5
6
7
# File 'lib/sprockets/rails2/asset_pipeline.rb', line 5

def asset_pipeline
  @asset_pipeline ||= initialize_pipeline
end

.initialize_pipelineObject



9
10
11
12
13
14
15
16
17
18
# File 'lib/sprockets/rails2/asset_pipeline.rb', line 9

def initialize_pipeline
  sprockets = Sprockets::Environment.new
  sprockets.cache = ActiveSupport::Cache::FileStore.new(File.join(Rails.root, "tmp", "cache", "assets"))
  sprockets.append_path(File.join(Rails.root, "assets"))

  sprockets.context_class.instance_eval do
    include ActionView::Helpers
  end
  sprockets
end