Class: Steamd::CodeGenerator
- Inherits:
-
Object
- Object
- Steamd::CodeGenerator
- Defined in:
- lib/steamd/code_generator.rb
Overview
Generates the steam language into specified code
Instance Method Summary collapse
-
#generate ⇒ Object
Generates ruby code from the input, places the Ruby files in the output.
-
#initialize(input, output) ⇒ CodeGenerator
constructor
A new instance of CodeGenerator.
Constructor Details
#initialize(input, output) ⇒ CodeGenerator
Returns a new instance of CodeGenerator.
11 12 13 14 |
# File 'lib/steamd/code_generator.rb', line 11 def initialize(input, output) @input = input @output = output end |
Instance Method Details
#generate ⇒ Object
Generates ruby code from the input, places the Ruby files in the output
18 19 20 21 22 23 24 25 |
# File 'lib/steamd/code_generator.rb', line 18 def generate make_output_directory files.each do |file| File.write("#{@output}/#{File.basename(file, '.*')}.rb", Steamd::Generator::Ruby.new(file).run) end end |