Class: Awestruct::Handlers::JavascriptHandler

Inherits:
BaseHandler
  • Object
show all
Defined in:
lib/awestruct/handlers/javascript_handler.rb

Constant Summary collapse

CHAIN =
Awestruct::HandlerChain.new( /\.js$/,
  Awestruct::Handlers::FileHandler,
  Awestruct::Handlers::FrontMatterHandler,
  Awestruct::Handlers::InterpolationHandler,
  Awestruct::Handlers::JavascriptHandler
)

Instance Attribute Summary

Attributes inherited from BaseHandler

#delegate, #site

Instance Method Summary collapse

Methods inherited from BaseHandler

#content_line_offset, #dependencies, #execute_shell, #front_matter, #inherit_front_matter, #input_mtime, #output_path, #path, #raw_content, #relative_source_path, #stale?, #to_chain

Constructor Details

#initialize(site, delegate) ⇒ JavascriptHandler

Returns a new instance of JavascriptHandler.



20
21
22
# File 'lib/awestruct/handlers/javascript_handler.rb', line 20

def initialize(site, delegate)
  super( site, delegate )
end

Instance Method Details

#content_syntaxObject



36
37
38
# File 'lib/awestruct/handlers/javascript_handler.rb', line 36

def content_syntax
  :javascript
end

#output_extensionObject



32
33
34
# File 'lib/awestruct/handlers/javascript_handler.rb', line 32

def output_extension
  '.js'
end

#output_filenameObject



28
29
30
# File 'lib/awestruct/handlers/javascript_handler.rb', line 28

def output_filename
  File.basename( relative_source_path )
end

#rendered_content(context, with_layouts = false) ⇒ Object



40
41
42
# File 'lib/awestruct/handlers/javascript_handler.rb', line 40

def rendered_content(context, with_layouts=false)
  delegate.rendered_content( context, with_layouts )
end

#simple_nameObject



24
25
26
# File 'lib/awestruct/handlers/javascript_handler.rb', line 24

def simple_name
  File.basename( relative_source_path, '.js' ) 
end