Class: EasyHtmlGenerator::Generator::Compile::Coffee

Inherits:
Base
  • Object
show all
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

#config

Instance Method Summary collapse

Methods inherited from Base

#do_file, #generate!, #walk_files, #watch_files

Methods inherited from Base

#enabled?, #file_changed?, #generate, #generate!, #initialize, #log, #log_running, #repetitive?, #store_file_hash, #tasks

Constructor Details

This class inherits a constructor from EasyHtmlGenerator::Generator::Base

Instance Method Details

#do_input!(input, input_file = 'inline', *_args) ⇒ Object



10
11
12
13
14
15
16
17
18
# File 'lib/easy_html_generator/generator/compile/coffee.rb', line 10

def do_input!(input, input_file = 'inline', *_args)
  result = CoffeeScript.compile input

  return result unless @config.minimize

  EasyHtmlGenerator::Generator::Minimize::Js.compress result
rescue StandardError => e
  raise e, "#{e.message} in #{input_file} ", e.backtrace
end

#input_to_output_file(input_file, config) ⇒ Object



20
21
22
# File 'lib/easy_html_generator/generator/compile/coffee.rb', line 20

def input_to_output_file(input_file, config)
  super(input_file, config).gsub('.js.coffee', '.js')
end