Module: Bobkit::CoffeeBridge

Includes:
FileHelpers
Included in:
Tasks
Defined in:
lib/bobkit/coffee_bridge.rb

Instance Method Summary collapse

Methods included from FileHelpers

#copy_file, #create_file, #create_folder, #create_folder_for

Instance Method Details

#compile_js(file, options = {}) ⇒ Object



5
6
7
8
9
10
11
# File 'lib/bobkit/coffee_bridge.rb', line 5

def compile_js(file, options = {})
  @file = "#{coffee_folder}/#{file}.coffee"
  content = CoffeeScript.compile File.read @file
  output = options[:output]
  create_file "#{js_output_folder}/#{output}.js", content if output
  content
end