Class: Octopress::Ink::Assets::Coffeescript
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 Javascript
#tag
Methods inherited from Asset
#asset_info, #copy, #data, #disable, #disabled?, #ext, #filename, #info, #initialize, #is_disabled, #path, #payload, #read, #remove_jekyll_asset, #replaced?
Instance Method Details
#content ⇒ Object
15
16
17
18
19
20
21
22
|
# File 'lib/octopress-ink/assets/coffeescript.rb', line 15
def content
begin
require 'jekyll-coffeescript'
rescue LoadError
raise "Add gem jekyll-coffeescript to Gemfile (or gemspec)."
end
::CoffeeScript.compile(super)
end
|
#destination ⇒ Object
24
25
26
|
# File 'lib/octopress-ink/assets/coffeescript.rb', line 24
def destination
File.join(base, plugin.slug, File.basename(file, '.*') << '.js')
end
|
#tag_path ⇒ Object
6
7
8
|
# File 'lib/octopress-ink/assets/coffeescript.rb', line 6
def tag_path
Filters.expand_url(File.join(dir, File.basename(file, '.*') << '.js'))
end
|