Class: Roadie::Rails::AssetPipelineProvider

Inherits:
Object
  • Object
show all
Includes:
AssetProvider
Defined in:
lib/roadie/rails/asset_pipeline_provider.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(pipeline) ⇒ AssetPipelineProvider

Returns a new instance of AssetPipelineProvider.



9
10
11
12
13
14
15
16
17
18
19
# File 'lib/roadie/rails/asset_pipeline_provider.rb', line 9

def initialize(pipeline)
  unless pipeline
    raise(
      ArgumentError,
      "You need to pass a pipeline to initialize AssetPipelineProvider"
    )
  end

  super()
  @pipeline = pipeline
end

Instance Attribute Details

#pipelineObject (readonly)

Returns the value of attribute pipeline.



7
8
9
# File 'lib/roadie/rails/asset_pipeline_provider.rb', line 7

def pipeline
  @pipeline
end

Instance Method Details

#find_stylesheet(name) ⇒ Object



21
22
23
24
25
# File 'lib/roadie/rails/asset_pipeline_provider.rb', line 21

def find_stylesheet(name)
  if (asset = find_asset_in_pipeline(name))
    Stylesheet.new("#{filename(asset)} (live compiled)", asset.to_s)
  end
end