Class: WatchmonkeyCli::Application::Configuration
- Inherits:
-
Object
- Object
- WatchmonkeyCli::Application::Configuration
- Defined in:
- lib/watchmonkey_cli/application/configuration.rb
Defined Under Namespace
Modules: AppHelper
Instance Method Summary collapse
-
#initialize(app, file) ⇒ Configuration
constructor
A new instance of Configuration.
- #method_missing(meth, *args, &block) ⇒ Object
- #ssh_connection(name, opts = {}, &b) ⇒ Object
Constructor Details
#initialize(app, file) ⇒ Configuration
Returns a new instance of Configuration.
62 63 64 65 66 67 68 69 70 71 |
# File 'lib/watchmonkey_cli/application/configuration.rb', line 62 def initialize app, file @app = app @file = file begin eval File.read(file, encoding: "utf-8"), binding, file rescue app.error "Invalid config file #{file}" raise end end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(meth, *args, &block) ⇒ Object
77 78 79 80 81 82 83 |
# File 'lib/watchmonkey_cli/application/configuration.rb', line 77 def method_missing meth, *args, &block if c = @app.checkers[meth.to_s] c.enqueue(*args) else super end end |
Instance Method Details
#ssh_connection(name, opts = {}, &b) ⇒ Object
73 74 75 |
# File 'lib/watchmonkey_cli/application/configuration.rb', line 73 def ssh_connection name, opts = {}, &b @app.fetch_connection(:ssh, name, opts, &b) end |