Class: TapRep::Runner
- Inherits:
-
Object
- Object
- TapRep::Runner
- Defined in:
- lib/runner.rb
Overview
Kicks off tap-rep process
Instance Attribute Summary collapse
-
#config_filename ⇒ Object
readonly
Returns the value of attribute config_filename.
-
#state_filename ⇒ Object
readonly
Returns the value of attribute state_filename.
-
#stream ⇒ Object
readonly
Returns the value of attribute stream.
-
#verbose ⇒ Object
readonly
Returns the value of attribute verbose.
Instance Method Summary collapse
- #config ⇒ Object
-
#initialize(argv, stream: $stderr, config: nil, state: nil) ⇒ Runner
constructor
A new instance of Runner.
- #perform ⇒ Object
- #state ⇒ Object
Constructor Details
#initialize(argv, stream: $stderr, config: nil, state: nil) ⇒ Runner
19 20 21 22 23 24 |
# File 'lib/runner.rb', line 19 def initialize(argv, stream: $stderr, config: nil, state: nil) @stream = stream @config = config @state = state parser.parse! argv end |
Instance Attribute Details
#config_filename ⇒ Object (readonly)
Returns the value of attribute config_filename.
14 15 16 |
# File 'lib/runner.rb', line 14 def config_filename @config_filename end |
#state_filename ⇒ Object (readonly)
Returns the value of attribute state_filename.
15 16 17 |
# File 'lib/runner.rb', line 15 def state_filename @state_filename end |
#stream ⇒ Object (readonly)
Returns the value of attribute stream.
16 17 18 |
# File 'lib/runner.rb', line 16 def stream @stream end |
#verbose ⇒ Object (readonly)
Returns the value of attribute verbose.
17 18 19 |
# File 'lib/runner.rb', line 17 def verbose @verbose end |
Instance Method Details
#config ⇒ Object
32 33 34 |
# File 'lib/runner.rb', line 32 def config @config ||= read_json(config_filename) end |
#perform ⇒ Object
26 27 28 29 30 |
# File 'lib/runner.rb', line 26 def perform return stream.puts(parser) if config.keys.empty? output_schemata process_models end |
#state ⇒ Object
36 37 38 |
# File 'lib/runner.rb', line 36 def state @state ||= read_json(state_filename) end |