Class: Coffee

Inherits:
Swig::Worker show all
Defined in:
lib/swig/workers/coffee.rb

Instance Method Summary collapse

Methods inherited from Swig::Worker

#initialize

Constructor Details

This class inherits a constructor from Swig::Worker

Instance Method Details

#eval(files) ⇒ Object



6
7
8
9
10
11
12
13
# File 'lib/swig/workers/coffee.rb', line 6

def eval(files)
  files.inject([]) do |acc, file|
    basename = file.basename.gsub(".js", ".coffee")
    content = CoffeeScript.compile(file.read, @options)

    acc << Swig::FileInStream.new(basename, content)
  end
end