class Octopress::Ink::Assets::Stylesheet
Public Class Methods
new(plugin, base, file)
click to toggle source
# File lib/octopress-ink/assets/stylesheet.rb, line 6 def initialize(plugin, base, file) @plugin = plugin @file = file @base = base @media = media || 'all' @root = plugin.assets_path @dir = File.join(plugin.slug, 'stylesheets') @exists = {} file_check end
Public Instance Methods
add()
click to toggle source
Calls superclass method
Octopress::Ink::Assets::Asset#add
# File lib/octopress-ink/assets/stylesheet.rb, line 37 def add Plugins.add_css_tag tag super end
disabled?()
click to toggle source
# File lib/octopress-ink/assets/stylesheet.rb, line 25 def disabled? is_disabled('css', filename) || is_disabled('stylesheets', filename) end
media()
click to toggle source
# File lib/octopress-ink/assets/stylesheet.rb, line 17 def media m = @media if file =~ /@(.+?)\./ m = $1 end m end
tag()
click to toggle source
# File lib/octopress-ink/assets/stylesheet.rb, line 29 def tag %Q{<link href="#{tag_path}" media="#{media}" rel="stylesheet" type="text/css">} end
tag_path()
click to toggle source
# File lib/octopress-ink/assets/stylesheet.rb, line 33 def tag_path Filters.expand_url(File.join(dir, output_file_name)) end
Private Instance Methods
destination()
click to toggle source
# File lib/octopress-ink/assets/stylesheet.rb, line 44 def destination File.join(base, plugin.slug, output_file_name) end
output_file_name()
click to toggle source
# File lib/octopress-ink/assets/stylesheet.rb, line 48 def output_file_name file.sub('@','-') end