Class: NatsWorker::CLI
- Inherits:
-
Object
- Object
- NatsWorker::CLI
- Defined in:
- lib/nats_worker/cli.rb
Overview
Parses ARGV for ‘bin/nats_worker` and the rake task, loads the Rails environment when present, resolves which worker classes to run and hands them off to NatsWorker::Runner.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(argv) ⇒ CLI
constructor
A new instance of CLI.
- #run ⇒ Object
Constructor Details
#initialize(argv) ⇒ CLI
Returns a new instance of CLI.
12 13 14 15 |
# File 'lib/nats_worker/cli.rb', line 12 def initialize(argv) @argv = argv.dup @options = { workers: nil, require: nil } end |
Class Method Details
.start(argv = ARGV) ⇒ Object
8 9 10 |
# File 'lib/nats_worker/cli.rb', line 8 def self.start(argv = ARGV) new(argv).run end |