Class: Protobuf::CLI

Inherits:
Thor
  • Object
show all
Includes:
Logging, Thor::Actions
Defined in:
lib/protobuf/cli.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Logging

initialize_logger, #log_exception, #log_signature, #logger, #sign_message

Instance Attribute Details

#exit_requestedObject

Returns the value of attribute exit_requested.



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

def exit_requested
  @exit_requested
end

#modeObject

Returns the value of attribute mode.



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

def mode
  @mode
end

#runnerObject

Returns the value of attribute runner.



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

def runner
  @runner
end

Instance Method Details

#start(app_file) ⇒ Object



48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
# File 'lib/protobuf/cli.rb', line 48

def start(app_file)
  debug_say('Configuring the rpc_server process')

  configure_logger
  configure_traps
  configure_runner_mode
  create_runner
  configure_process_name(app_file)
  configure_gc
  configure_deprecation_warnings

  require_application(app_file) unless exit_requested?
  start_server unless exit_requested?
rescue => e
  say_and_exit('ERROR: RPC Server failed to start.', e)
end

#versionObject



66
67
68
# File 'lib/protobuf/cli.rb', line 66

def version
  say("Ruby Protobuf v#{::Protobuf::VERSION}")
end