Module: Coffeefile

Defined in:
lib/coffeefile.rb

Defined Under Namespace

Modules: Source

Constant Summary collapse

VERSION =
'0.0.1'

Class Method Summary collapse

Class Method Details

.compile_to(output, options = {}) ⇒ Object



24
25
26
27
28
29
30
# File 'lib/coffeefile.rb', line 24

def compile_to(output, options={})
  contents  = Source.contents.collect { |source| File.read(source) }.join("\n")
  data      = CoffeeScript.compile(contents, options)
  fileout   = File.basename(output) =~ /(\.js)$/ ? output : "#{output}.js"

  File.open(File.join(Dir.pwd, fileout), 'w+') { |f| f.puts data }
end

.files_to_compileObject



32
33
34
# File 'lib/coffeefile.rb', line 32

def files_to_compile
  Source.contents
end

.versionObject



20
21
22
# File 'lib/coffeefile.rb', line 20

def version
  VERSION
end