Class: TapRep::Runner

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

Overview

Kicks off tap-rep process

Instance Attribute Summary collapse

Instance Method Summary collapse

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_filenameObject (readonly)

Returns the value of attribute config_filename.



14
15
16
# File 'lib/runner.rb', line 14

def config_filename
  @config_filename
end

#state_filenameObject (readonly)

Returns the value of attribute state_filename.



15
16
17
# File 'lib/runner.rb', line 15

def state_filename
  @state_filename
end

#streamObject (readonly)

Returns the value of attribute stream.



16
17
18
# File 'lib/runner.rb', line 16

def stream
  @stream
end

#verboseObject (readonly)

Returns the value of attribute verbose.



17
18
19
# File 'lib/runner.rb', line 17

def verbose
  @verbose
end

Instance Method Details

#configObject



32
33
34
# File 'lib/runner.rb', line 32

def config
  @config ||= read_json(config_filename)
end

#performObject



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

#stateObject



36
37
38
# File 'lib/runner.rb', line 36

def state
  @state ||= read_json(state_filename)
end