Class: DeRjs::Runner

Inherits:
Object
  • Object
show all
Defined in:
lib/de_rjs/runner.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(filenames) ⇒ Runner

Returns a new instance of Runner.



7
8
9
# File 'lib/de_rjs/runner.rb', line 7

def initialize(filenames)
  @filenames = filenames
end

Instance Attribute Details

#filenamesObject (readonly)

Returns the value of attribute filenames.



5
6
7
# File 'lib/de_rjs/runner.rb', line 5

def filenames
  @filenames
end

Instance Method Details

#executeObject



11
12
13
14
15
16
17
# File 'lib/de_rjs/runner.rb', line 11

def execute
  filenames.each do |filename|
    source = File.read filename
    js_erb = rewrite_to_js_erb(source)
    File.open(filename, "w") {|f| f << js_erb}
  end
end