Class: Gruf::Cli::Executor
- Inherits:
-
Object
- Object
- Gruf::Cli::Executor
- Defined in:
- lib/gruf/cli/executor.rb
Overview
Handles execution of the gruf binstub, along with command-line arguments
Instance Method Summary collapse
-
#initialize(args = ARGV) ⇒ Executor
constructor
A new instance of Executor.
-
#run ⇒ Object
Run the server.
Constructor Details
#initialize(args = ARGV) ⇒ Executor
Returns a new instance of Executor.
27 28 29 30 |
# File 'lib/gruf/cli/executor.rb', line 27 def initialize(args = ARGV) @args = args setup! end |
Instance Method Details
#run ⇒ Object
Run the server
35 36 37 38 39 40 41 42 43 |
# File 'lib/gruf/cli/executor.rb', line 35 def run server = Gruf::Server.new(Gruf.) Gruf.services.each { |s| server.add_service(s) } server.start! rescue StandardError => e msg = "FATAL ERROR: #{e.} #{e.backtrace.join("\n")}" logger = Gruf.logger ? Gruf.logger : Logger.new(STDERR) logger.fatal msg end |