Class: Caterpillar::Task
- Inherits:
-
Rake::TaskLib
- Object
- Rake::TaskLib
- Caterpillar::Task
- Defined in:
- lib/caterpillar/task.rb
Instance Attribute Summary collapse
-
#config ⇒ Object
Config.
-
#name ⇒ Object
Task name.
-
#portlets ⇒ Object
readonly
Portlets.
Instance Method Summary collapse
-
#initialize(name = :usage, config = nil, tasks = :define_tasks) {|_self| ... } ⇒ Task
constructor
The main task.
Constructor Details
#initialize(name = :usage, config = nil, tasks = :define_tasks) {|_self| ... } ⇒ Task
The main task. Reads the configuration file and launches appropriate tasks.
36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 |
# File 'lib/caterpillar/task.rb', line 36 def initialize(name = :usage, config = nil, tasks = :define_tasks) @name = name @config = (name == 'rails' or name == 'version' ) ? Config.new(false) : Util.eval_configuration(config) @logger = @config.logger @xml_files = [] if name == 'rails' @required_gems = %w(rails caterpillar jruby-jars warbler) else if not @config and not %w{generate version}.include?(name) Usage.show() exit 1 end end yield self if block_given? send tasks end |
Instance Attribute Details
#config ⇒ Object
Config
29 30 31 |
# File 'lib/caterpillar/task.rb', line 29 def config @config end |
#name ⇒ Object
Task name
26 27 28 |
# File 'lib/caterpillar/task.rb', line 26 def name @name end |
#portlets ⇒ Object (readonly)
Portlets
32 33 34 |
# File 'lib/caterpillar/task.rb', line 32 def portlets @portlets end |