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, logger, logger=, #sign_message

Instance Attribute Details

#modeObject

Returns the value of attribute mode.



12
13
14
# File 'lib/protobuf/cli.rb', line 12

def mode
  @mode
end

#runnerObject

Returns the value of attribute runner.



12
13
14
# File 'lib/protobuf/cli.rb', line 12

def runner
  @runner
end

Instance Method Details

#start(app_file) ⇒ Object



42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
# File 'lib/protobuf/cli.rb', line 42

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



60
61
62
# File 'lib/protobuf/cli.rb', line 60

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