Class: Tomo::Configuration::DSL::ConfigFile
- Inherits:
-
Object
- Object
- Tomo::Configuration::DSL::ConfigFile
- Includes:
- HostsAndSettings
- Defined in:
- lib/tomo/configuration/dsl/config_file.rb
Instance Method Summary collapse
- #deploy ⇒ Object
- #environment(name) ⇒ Object
-
#initialize(config) ⇒ ConfigFile
constructor
A new instance of ConfigFile.
- #plugin(name) ⇒ Object
- #role(name, runs:) ⇒ Object
- #setup ⇒ Object
Methods included from HostsAndSettings
Constructor Details
#initialize(config) ⇒ ConfigFile
Returns a new instance of ConfigFile.
9 10 11 |
# File 'lib/tomo/configuration/dsl/config_file.rb', line 9 def initialize(config) @config = config end |
Instance Method Details
#deploy ⇒ Object
29 30 31 32 |
# File 'lib/tomo/configuration/dsl/config_file.rb', line 29 def deploy(&) TasksBlock.new(@config.deploy_tasks).instance_eval(&) self end |
#environment(name) ⇒ Object
23 24 25 26 27 |
# File 'lib/tomo/configuration/dsl/config_file.rb', line 23 def environment(name, &) environment = @config.environments[name.to_s] ||= Environment.new EnvironmentBlock.new(environment).instance_eval(&) self end |
#plugin(name) ⇒ Object
13 14 15 16 |
# File 'lib/tomo/configuration/dsl/config_file.rb', line 13 def plugin(name) @config.plugins << name.to_s self end |
#role(name, runs:) ⇒ Object
18 19 20 21 |
# File 'lib/tomo/configuration/dsl/config_file.rb', line 18 def role(name, runs:) @config.task_filter.add_role(name, runs) self end |
#setup ⇒ Object
34 35 36 37 |
# File 'lib/tomo/configuration/dsl/config_file.rb', line 34 def setup(&) TasksBlock.new(@config.setup_tasks).instance_eval(&) self end |