Class: EasyHtmlGenerator::Generator::Compile::Coffee
- Defined in:
- lib/easy_html_generator/generator/compile/coffee.rb
Overview
this generator coffee sass files from src folder and copies them to the dist folder
Instance Attribute Summary
Attributes inherited from Base
Instance Method Summary collapse
- #do_input(input, src = 'inline') ⇒ Object
-
#initialize(project, config) ⇒ Coffee
constructor
A new instance of Coffee.
- #input_to_output_file(i) ⇒ Object
Methods inherited from Base
#dest_path, #do_file, #generate, #log, #log_running, #resolve_path_prefix, #should_do_file?, #src_path, #walk_files
Constructor Details
#initialize(project, config) ⇒ Coffee
Returns a new instance of Coffee.
10 11 12 13 14 15 |
# File 'lib/easy_html_generator/generator/compile/coffee.rb', line 10 def initialize(project, config) super(project, config) @config.src = project.config.paths.src.scripts @config.dest = project.config.paths.dist.scripts end |
Instance Method Details
#do_input(input, src = 'inline') ⇒ Object
17 18 19 20 21 22 23 24 25 |
# File 'lib/easy_html_generator/generator/compile/coffee.rb', line 17 def do_input(input, src = 'inline') result = CoffeeScript.compile input return result unless @config.minimize EasyHtmlGenerator::Generator::Minimize::Js.compress result rescue StandardError => e raise e, "#{e.} in #{src} ", e.backtrace end |
#input_to_output_file(i) ⇒ Object
27 28 29 |
# File 'lib/easy_html_generator/generator/compile/coffee.rb', line 27 def input_to_output_file(i) super(i).gsub('.js.coffee', '.js') end |