Class: Catfish::Dsl
- Inherits:
-
Object
- Object
- Catfish::Dsl
- Defined in:
- lib/catfish/dsl.rb
Instance Attribute Summary collapse
-
#plugins ⇒ Object
Returns the value of attribute plugins.
-
#servers ⇒ Object
Returns the value of attribute servers.
Class Method Summary collapse
Instance Method Summary collapse
- #eval_catfishfile ⇒ Object
-
#initialize ⇒ Dsl
constructor
A new instance of Dsl.
- #plugin(name, *_args) ⇒ Object
- #server(name, *_args) ⇒ Object
Constructor Details
#initialize ⇒ Dsl
Returns a new instance of Dsl.
10 11 12 13 |
# File 'lib/catfish/dsl.rb', line 10 def initialize @servers = [] @plugins = ['vagrant-managed-servers'] end |
Instance Attribute Details
#plugins ⇒ Object
Returns the value of attribute plugins.
8 9 10 |
# File 'lib/catfish/dsl.rb', line 8 def plugins @plugins end |
#servers ⇒ Object
Returns the value of attribute servers.
8 9 10 |
# File 'lib/catfish/dsl.rb', line 8 def servers @servers end |
Class Method Details
.evaluate ⇒ Object
3 4 5 6 |
# File 'lib/catfish/dsl.rb', line 3 def self.evaluate builder = new builder.eval_catfishfile end |
Instance Method Details
#eval_catfishfile ⇒ Object
15 16 17 18 19 |
# File 'lib/catfish/dsl.rb', line 15 def eval_catfishfile catfishfile = 'Catfishfile' contents = File.read(catfishfile).strip instance_eval(contents, catfishfile.to_s, 1) end |
#plugin(name, *_args) ⇒ Object
25 26 27 |
# File 'lib/catfish/dsl.rb', line 25 def plugin(name, *_args) plugins << name end |
#server(name, *_args) ⇒ Object
21 22 23 |
# File 'lib/catfish/dsl.rb', line 21 def server(name, *_args) servers << name end |