Class: Octopress::AssetPipeline::Javascript

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

Direct Known Subclasses

Coffeescript

Instance Attribute Summary

Attributes inherited from Asset

#file_object

Instance Method Summary collapse

Methods inherited from Asset

#base, #copy, #destination, #filename, #info, #initialize, #path

Constructor Details

This class inherits a constructor from Octopress::AssetPipeline::Asset

Instance Method Details

#contentObject



8
9
10
11
12
13
14
15
16
17
# File 'lib/octopress-asset-pipeline/assets/javascript.rb', line 8

def content
  @render ||= begin
    contents = super
    if asset_payload = payload
      Liquid::Template.parse(contents).render!(payload)
    else
      contents
    end
  end
end

#tagObject



4
5
6
# File 'lib/octopress-asset-pipeline/assets/javascript.rb', line 4

def tag
  "<script src='#{Filters.expand_url(destination)}'></script>"
end