Class: DeRjs::Runner
- Inherits:
-
Object
- Object
- DeRjs::Runner
- Defined in:
- lib/de_rjs/runner.rb
Instance Attribute Summary collapse
-
#filenames ⇒ Object
readonly
Returns the value of attribute filenames.
Instance Method Summary collapse
- #execute ⇒ Object
-
#initialize(filenames) ⇒ Runner
constructor
A new instance of Runner.
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
#filenames ⇒ Object (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
#execute ⇒ Object
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 |