lib/octopress-ink/assets/stylesheet.rb in octopress-ink-1.0.0.alpha.33 vs lib/octopress-ink/assets/stylesheet.rb in octopress-ink-1.0.0.alpha.34
- old
+ new
@@ -1,33 +1,39 @@
module Octopress
module Ink
module Assets
class Stylesheet < Asset
- def initialize(plugin, type, file, media)
+
+ def initialize(plugin, base, file, media)
@plugin = plugin
@file = file
- @type = type
+ @base = base
@media = media || 'all'
@root = plugin.assets_path
- @dir = File.join(plugin.slug, type)
+ @dir = File.join(plugin.slug, 'stylesheets')
@exists = {}
file_check
end
def media
m = @media
- if @file =~ /@(.+?)\./
+ if file =~ /@(.+?)\./
m = $1
end
m
end
+ def disabled?
+ plugin.disabled?('css', filename) ||
+ plugin.disabled?('stylesheets', filename)
+ end
+
def destination
- File.join(@dir, @file.sub(/@(.+?)\./,'.'))
+ File.join(base, plugin.slug, file.sub(/@(.+?)\./,'.'))
end
def tag
- "<link href='#{Filters.expand_url(File.join(@dir, @file))}' media='#{media}' rel='stylesheet' type='text/css'>"
+ "<link href='#{Filters.expand_url(File.join(dir, file))}' media='#{media}' rel='stylesheet' type='text/css'>"
end
end
end
end
end