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.
31 32 33 34 35 36 37 38 39 40 |
# File 'lib/watchmonkey_cli/application/configuration.rb', line 31 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
46 47 48 49 50 51 52 |
# File 'lib/watchmonkey_cli/application/configuration.rb', line 46 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
42 43 44 |
# File 'lib/watchmonkey_cli/application/configuration.rb', line 42 def ssh_connection name, opts = {}, &b @app.fetch_connection(:ssh, name, opts, &b) end |