Class: Octopress::Ink::Assets::Javascript

Inherits:
Asset
  • Object
show all
Defined in:
lib/octopress-ink/assets/javascript.rb

Direct Known Subclasses

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 Asset

#asset_info, #content, #copy, #data, #disable, #disabled?, #ext, #filename, #info, #initialize, #is_disabled, #path, #payload, #read, #remove_jekyll_asset, #replaced?

Constructor Details

This class inherits a constructor from Octopress::Ink::Assets::Asset

Instance Method Details

#addObject



13
14
15
16
# File 'lib/octopress-ink/assets/javascript.rb', line 13

def add
  Plugins.add_js_tag tag
  super
end

#destinationObject



18
19
20
# File 'lib/octopress-ink/assets/javascript.rb', line 18

def destination
  File.join(base, plugin.slug, file)
end

#tagObject



5
6
7
# File 'lib/octopress-ink/assets/javascript.rb', line 5

def tag
  %Q{<script src="#{tag_path}"></script>}
end

#tag_pathObject



9
10
11
# File 'lib/octopress-ink/assets/javascript.rb', line 9

def tag_path
  Filters.expand_url(File.join(dir, file))
end