Class: Bender::CLI
- Inherits:
-
Thor
- Object
- Thor
- Bender::CLI
- Defined in:
- lib/bender/cli.rb
Instance Method Summary collapse
-
#initialize(args = [], opts = {}, config = {}) ⇒ CLI
constructor
A new instance of CLI.
- #publish ⇒ Object
- #start ⇒ Object
Constructor Details
#initialize(args = [], opts = {}, config = {}) ⇒ CLI
Returns a new instance of CLI.
10 11 12 13 14 15 16 17 18 19 20 |
# File 'lib/bender/cli.rb', line 10 def initialize(args = [], opts = {}, config = {}) super(args, opts, config) if !File.exists?([:config]) puts "Cannot find #{options[:config]}." exit end = YAML.load_file([:config]).deep_symbolize_keys = .symbolize_keys.merge() end |
Instance Method Details
#publish ⇒ Object
43 44 45 46 47 48 49 50 51 |
# File 'lib/bender/cli.rb', line 43 def publish load_enviroment([:require]) opts = .symbolize_keys.slice(:timeout, :interval, :daemon, :pid_file) Bender::Client.new([:hostname] || Socket.gethostname, ).publish( [:watcher], [:message], [:ack] ) end |
#start ⇒ Object
31 32 33 34 35 |
# File 'lib/bender/cli.rb', line 31 def start load_enviroment([:require]) opts = .symbolize_keys.slice(:timeout, :interval, :daemon, :pid_file) Bender::Client.new([:hostname] || Socket.gethostname, ).start_watchers end |