Class: Garlic::Target::Runner
- Inherits:
-
Object
- Object
- Garlic::Target::Runner
show all
- Defined in:
- lib/garlic/target.rb
Instance Attribute Summary collapse
Instance Method Summary
collapse
Constructor Details
#initialize(target) ⇒ Runner
Returns a new instance of Runner.
113
114
115
|
# File 'lib/garlic/target.rb', line 113
def initialize(target)
@target = target
end
|
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(method, *args, &block) ⇒ Object
123
124
125
|
# File 'lib/garlic/target.rb', line 123
def method_missing(method, *args, &block)
target.garlic.send(method, *args, &block)
end
|
Instance Attribute Details
#target ⇒ Object
Returns the value of attribute target.
111
112
113
|
# File 'lib/garlic/target.rb', line 111
def target
@target
end
|
Instance Method Details
#dependency(repo, dest, options = {}, &block) ⇒ Object
135
136
137
|
# File 'lib/garlic/target.rb', line 135
def dependency(repo, dest, options = {}, &block)
target.send(:install_dependency, repo, dest, options, &block)
end
|
#plugin(plugin, options = {}, &block) ⇒ Object
131
132
133
|
# File 'lib/garlic/target.rb', line 131
def plugin(plugin, options = {}, &block)
target.send(:install_dependency, plugin, "vendor/plugins/#{options[:as] || plugin}", options, &block)
end
|
#respond_to?(method) ⇒ Boolean
127
128
129
|
# File 'lib/garlic/target.rb', line 127
def respond_to?(method)
super(method) || target.garlic.respond_to?(method)
end
|
#run(&block) ⇒ Object
117
118
119
120
121
|
# File 'lib/garlic/target.rb', line 117
def run(&block)
cd target.path do
instance_eval(&block)
end
end
|