Module: Buildr::Run
- Includes:
- Extension
- Included in:
- Project
- Defined in:
- lib/buildr/run.rb,
lib/buildr/core/run.rb
Defined Under Namespace
Classes: Base, JavaRunner, RunTask
Class Method Summary
collapse
Instance Method Summary
collapse
Methods included from Extension
included
Class Method Details
22
23
24
|
# File 'lib/buildr/run.rb', line 22
def runners
@runners ||= []
end
|
.select_by_lang(lang) ⇒ Object
Also known as:
select
26
27
28
29
|
# File 'lib/buildr/run.rb', line 26
def select_by_lang(lang)
fail 'Unable to define run task for nil language' if lang.nil?
runners.detect { |e| e.languages.nil? ? false : e.languages.include?(lang.to_sym) }
end
|
.select_by_name(name) ⇒ Object
33
34
35
36
|
# File 'lib/buildr/run.rb', line 33
def select_by_name(name)
fail 'Unable to define run task for nil' if name.nil?
runners.detect { |e| e.to_sym == name.to_sym }
end
|
Instance Method Details
#run(&block) ⇒ Object
:call-seq:
run(&block) => RunTask
This method returns the project’s run task. It also accepts a block to be executed when the run task is invoked.
184
185
186
187
188
|
# File 'lib/buildr/run.rb', line 184
def run(&block)
task('run').tap do |t|
t.enhance &block if block
end
end
|