Class: Catfish::Dsl

Inherits:
Object
  • Object
show all
Defined in:
lib/catfish/dsl.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeDsl

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

#pluginsObject

Returns the value of attribute plugins.



8
9
10
# File 'lib/catfish/dsl.rb', line 8

def plugins
  @plugins
end

#serversObject

Returns the value of attribute servers.



8
9
10
# File 'lib/catfish/dsl.rb', line 8

def servers
  @servers
end

Class Method Details

.evaluateObject



3
4
5
6
# File 'lib/catfish/dsl.rb', line 3

def self.evaluate
  builder = new
  builder.eval_catfishfile
end

Instance Method Details

#eval_catfishfileObject



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