Class: YMDP::Compiler::Template::JavaScript

Inherits:
View
  • Object
show all
Defined in:
lib/ymdp/compiler/template.rb

Overview

Process templates for JavaScript files.

JavaScript files support ERB tags.

Constant Summary

Constants included from ActionView::Helpers::TagHelper

ActionView::Helpers::TagHelper::BOOLEAN_ATTRIBUTES

Instance Attribute Summary

Attributes inherited from View

#output_buffer

Attributes inherited from Base

#assets_directory, #domain, #file, #hash, #host, #message, #server

Instance Method Summary collapse

Methods inherited from View

#base_filename, #convert_filename, #process_coffee, #process_erb, #process_haml, #process_scss, #validator

Methods included from LinkTagHelper

#link_to, #link_to_function, #link_to_unless_current

Methods included from FormTagHelper

#label, #password_field, #text_field

Methods included from AssetTagHelper

#image_tag

Methods included from ApplicationView

#combo, #english_languages, #include_firebug_lite, #javascript_include, #render, #supported_languages, #translations

Methods included from ActionView::Helpers::TagHelper

#cdata_section, #content_tag, #escape_once, #tag

Methods inherited from Base

#base_filename, #build, #destination_path, #initialize, #partial?, #process_erb, #processed_template, #server_path, #servers_path, #set_content_variables, #verbose, #verbose?, #write_template_with_layout, #write_template_without_layout

Methods inherited from Base

#base_path, base_path, #configuration, configuration, configure, #content_variables, display_path, #display_path, #paths, #servers

Constructor Details

This class inherits a constructor from YMDP::Compiler::Template::Base

Instance Method Details

#write_template(result) ⇒ Object

Write the processed template without any layout.

Run the JavaScript compressor on the file if that option is turned on.



326
327
328
329
330
331
# File 'lib/ymdp/compiler/template.rb', line 326

def write_template(result)
  filename = @file.split("/").last
  tmp_filename = "#{TMP_PATH}/#{filename}"
  F.save_to_file(result, tmp_filename)
  write_template_without_layout(result)
end