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.



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

def exit_requested
  @exit_requested
end

#modeObject

Returns the value of attribute mode.



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

def mode
  @mode
end

#runnerObject

Returns the value of attribute runner.



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

def runner
  @runner
end

Instance Method Details

#start(app_file) ⇒ Object



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

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



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

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