Class: Octopress::Ink::Assets::Stylesheet
- Inherits:
-
Asset
- Object
- Asset
- Octopress::Ink::Assets::Stylesheet
show all
- Defined in:
- lib/octopress-ink/assets/stylesheet.rb
Direct Known Subclasses
Sass
Constant Summary
Constants inherited
from Asset
Asset::FRONT_MATTER
Instance Attribute Summary
Attributes inherited from Asset
#base, #dir, #exists, #file, #plugin, #replacement, #root
Instance Method Summary
collapse
Methods inherited from Asset
#asset_info, #content, #copy, #data, #disable, #ext, #filename, #info, #is_disabled, #path, #payload, #read, #remove_jekyll_asset, #replaced?
Constructor Details
#initialize(plugin, base, file) ⇒ Stylesheet
Returns a new instance of Stylesheet.
6
7
8
9
10
11
12
13
14
15
|
# 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
|
Instance Method Details
#add ⇒ Object
37
38
39
40
|
# File 'lib/octopress-ink/assets/stylesheet.rb', line 37
def add
Plugins.add_css_tag tag
super
end
|
#disabled? ⇒ Boolean
25
26
27
|
# File 'lib/octopress-ink/assets/stylesheet.rb', line 25
def disabled?
is_disabled('css', filename) || is_disabled('stylesheets', filename)
end
|
17
18
19
20
21
22
23
|
# File 'lib/octopress-ink/assets/stylesheet.rb', line 17
def media
m = @media
if file =~ /@(.+?)\./
m = $1
end
m
end
|
#tag ⇒ Object
29
30
31
|
# 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 ⇒ Object
33
34
35
|
# File 'lib/octopress-ink/assets/stylesheet.rb', line 33
def tag_path
Filters.expand_url(File.join(dir, output_file_name))
end
|