Class: Oryx::Runner

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(argv) ⇒ Runner

Returns a new instance of Runner.



8
9
10
11
12
# File 'lib/oryx/runner.rb', line 8

def initialize argv
  @options = Options.new argv
  @input_filename  = @options.input
  @output_filename = @options.output
end

Instance Attribute Details

#input_filenameObject (readonly)

Returns the value of attribute input_filename.



6
7
8
# File 'lib/oryx/runner.rb', line 6

def input_filename
  @input_filename
end

#output_filenameObject (readonly)

Returns the value of attribute output_filename.



6
7
8
# File 'lib/oryx/runner.rb', line 6

def output_filename
  @output_filename
end

Instance Method Details

#runObject



14
15
16
17
18
19
20
21
# File 'lib/oryx/runner.rb', line 14

def run
  puts "input:  #{input_filename}"
  puts "output: #{output_filename}"
  print "lexing".blue+"."*17
  l = Lexer.new
  output_filename.open('w:UTF-8') { |f| f.write(tabularize_output l.lex_file(input_filename.to_s)) }
  puts "complete".green
end