Class: Octopress::AssetPipeline::Sass

Inherits:
Css
  • Object
show all
Defined in:
lib/octopress-asset-pipeline/assets/sass.rb

Instance Attribute Summary collapse

Attributes inherited from Asset

#file_object

Instance Method Summary collapse

Methods inherited from Css

#media, #output_file_name, #tag

Methods inherited from Asset

#base, #copy, #filename, #info, #initialize

Constructor Details

This class inherits a constructor from Octopress::AssetPipeline::Asset

Instance Attribute Details

#renderObject (readonly)

Returns the value of attribute render.



4
5
6
# File 'lib/octopress-asset-pipeline/assets/sass.rb', line 4

def render
  @render
end

Instance Method Details

#addObject



18
19
20
# File 'lib/octopress-asset-pipeline/assets/sass.rb', line 18

def add
  Ink::Plugins.static_files << Ink::StaticFileContent.new(content, destination)
end

#contentObject



26
27
28
29
30
31
32
33
34
35
36
37
# File 'lib/octopress-asset-pipeline/assets/sass.rb', line 26

def content
  @render ||= begin
    contents = super
    if asset_payload = payload
      Liquid::Template.parse(contents).render!(payload)
    else
      contents
    end
  end

  Ink::PluginAssetPipeline.compile_sass(self)
end

#dataObject



22
23
24
# File 'lib/octopress-asset-pipeline/assets/sass.rb', line 22

def data
  file_object.data
end

#destinationObject



14
15
16
# File 'lib/octopress-asset-pipeline/assets/sass.rb', line 14

def destination
  super.sub(/\.s[ca]ss$/, '.css')
end

#extObject



6
7
8
# File 'lib/octopress-asset-pipeline/assets/sass.rb', line 6

def ext
  file_object.ext
end

#pathObject



10
11
12
# File 'lib/octopress-asset-pipeline/assets/sass.rb', line 10

def path
  File.join(Octopress.site.source, file)
end