Class: Octopress::AssetPipeline::Css

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

Direct Known Subclasses

Sass

Instance Attribute Summary

Attributes inherited from Asset

#file_object

Instance Method Summary collapse

Methods inherited from Asset

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

Constructor Details

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

Instance Method Details

#destinationObject



8
9
10
# File 'lib/octopress-asset-pipeline/assets/css.rb', line 8

def destination
  File.join(base, output_file_name)
end

#mediaObject



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

def media
  path.to_s.scan(/@(.+?)\./).flatten[0] || 'all'
end

#output_file_nameObject



16
17
18
# File 'lib/octopress-asset-pipeline/assets/css.rb', line 16

def output_file_name
  filename.sub(/@/,'-')
end

#tagObject



12
13
14
# File 'lib/octopress-asset-pipeline/assets/css.rb', line 12

def tag
  "<link href='#{Filters.expand_url(destination)}' media='#{media}' rel='stylesheet' type='text/css'>"
end