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:
110 111 112 113 114 |
# File 'lib/buildr/shell.rb', line 110 def initialize(*args) # :nodoc: super @options = {} @classpath = [] end |
Instance Attribute Details
#classpath ⇒ Object
Classpath dependencies.
102 103 104 |
# File 'lib/buildr/shell.rb', line 102 def classpath @classpath end |
#options ⇒ Object (readonly)
Returns the run options.
105 106 107 |
# File 'lib/buildr/shell.rb', line 105 def @options end |
#project ⇒ Object (readonly)
:nodoc:
99 100 101 |
# File 'lib/buildr/shell.rb', line 99 def project @project end |
#provider ⇒ Object (readonly)
Underlying shell provider
108 109 110 |
# File 'lib/buildr/shell.rb', line 108 def provider @provider end |
Instance Method Details
#java_args ⇒ Object
155 156 157 |
# File 'lib/buildr/shell.rb', line 155 def java_args @options[:java_args] || (ENV['JAVA_OPTS'] || ENV['JAVA_OPTIONS']).to_s.split end |
#prerequisites ⇒ Object
:nodoc:
151 152 153 |
# File 'lib/buildr/shell.rb', line 151 def prerequisites #:nodoc: super + classpath end |
#properties ⇒ Object
159 160 161 |
# File 'lib/buildr/shell.rb', line 159 def properties @options[:properties] || {} end |
#run ⇒ Object
146 147 148 149 |
# File 'lib/buildr/shell.rb', line 146 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
133 134 135 136 137 138 139 140 141 142 143 144 |
# File 'lib/buildr/shell.rb', line 133 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 |