Class: Buildr::Shell::ShellTask
- Inherits:
-
Rake::Task
- Object
- Rake::Task
- Buildr::Shell::ShellTask
- Defined in:
- lib/buildr/shell.rb
Instance Attribute Summary collapse
-
#classpath ⇒ Object
Classpath dependencies.
-
#options ⇒ Object
readonly
Returns the run options.
-
#project ⇒ Object
readonly
:nodoc:.
-
#provider ⇒ Object
readonly
Underlying shell provider.
Instance Method Summary collapse
-
#initialize(*args) ⇒ ShellTask
constructor
:nodoc:.
- #java_args ⇒ Object
-
#prerequisites ⇒ Object
:nodoc:.
- #properties ⇒ Object
- #run ⇒ Object
-
#using(*args) ⇒ Object
:call-seq: using(options) => self.
-
#with(*specs) ⇒ Object
:call-seq: with(*artifacts) => self.
Methods inherited from Rake::Task
#invoke, #invoke_with_call_chain
Constructor Details
#initialize(*args) ⇒ ShellTask
:nodoc:
109 110 111 112 113 |
# File 'lib/buildr/shell.rb', line 109 def initialize(*args) # :nodoc: super @options = {} @classpath = [] end |
Instance Attribute Details
#classpath ⇒ Object
Classpath dependencies.
101 102 103 |
# File 'lib/buildr/shell.rb', line 101 def classpath @classpath end |
#options ⇒ Object (readonly)
Returns the run options.
104 105 106 |
# File 'lib/buildr/shell.rb', line 104 def @options end |
#project ⇒ Object (readonly)
:nodoc:
98 99 100 |
# File 'lib/buildr/shell.rb', line 98 def project @project end |
#provider ⇒ Object (readonly)
Underlying shell provider
107 108 109 |
# File 'lib/buildr/shell.rb', line 107 def provider @provider end |
Instance Method Details
#java_args ⇒ Object
154 155 156 |
# File 'lib/buildr/shell.rb', line 154 def java_args @options[:java_args] || (ENV['JAVA_OPTS'] || ENV['JAVA_OPTIONS']).to_s.split end |
#prerequisites ⇒ Object
:nodoc:
150 151 152 |
# File 'lib/buildr/shell.rb', line 150 def prerequisites #:nodoc: super + classpath end |
#properties ⇒ Object
158 159 160 |
# File 'lib/buildr/shell.rb', line 158 def properties @options[:properties] || {} end |
#run ⇒ Object
145 146 147 148 |
# File 'lib/buildr/shell.rb', line 145 def run fail "No shell provider defined in project '#{project.name}' for language '#{project.compile.language.inspect}'" unless provider provider.launch(self) end |
#using(*args) ⇒ Object
:call-seq:
using() => self
Sets the run options from a hash and returns self.
For example:
shell.using :properties => {'foo' => 'bar'}
shell.using :bsh
132 133 134 135 136 137 138 139 140 141 142 143 |
# File 'lib/buildr/shell.rb', line 132 def using(*args) if Hash === args.last args.pop.each { |key, value| @options[key.to_sym] = value } end until args.empty? new_shell = Shell.select_by_name(args.pop) @provider = new_shell.new(project) unless new_shell.nil? end self end |