Class: Fudge::Build
- Inherits:
-
Tasks::CompositeTask
- Object
- Tasks::Task
- Tasks::CompositeTask
- Fudge::Build
- Defined in:
- lib/fudge/build.rb
Overview
Represents a build defined in the FudgeFile
Instance Attribute Summary collapse
-
#about ⇒ String
A brief description of the build; this is output by the ‘list’ command.
-
#callbacks ⇒ Object
Returns the value of attribute callbacks.
-
#description ⇒ Object
readonly
Returns the value of attribute description.
-
#failure_hooks ⇒ Object
readonly
Returns the value of attribute failure_hooks.
-
#formatter ⇒ Object
readonly
Returns the value of attribute formatter.
-
#success_hooks ⇒ Object
readonly
Returns the value of attribute success_hooks.
-
#time ⇒ Object
Returns the value of attribute time.
Attributes inherited from Tasks::Task
Instance Method Summary collapse
-
#initialize(*args) ⇒ Build
constructor
A new instance of Build.
-
#run(options = {}) ⇒ Object
Run task.
Methods inherited from Tasks::CompositeTask
Methods inherited from Tasks::Task
Constructor Details
#initialize(*args) ⇒ Build
Returns a new instance of Build.
14 15 16 17 18 19 |
# File 'lib/fudge/build.rb', line 14 def initialize(*args) @success_hooks = [] @failure_hooks = [] super end |
Instance Attribute Details
#about ⇒ String
Returns a brief description of the build; this is output by the ‘list’ command.
8 9 10 |
# File 'lib/fudge/build.rb', line 8 def about @about end |
#callbacks ⇒ Object
Returns the value of attribute callbacks.
9 10 11 |
# File 'lib/fudge/build.rb', line 9 def callbacks @callbacks end |
#description ⇒ Object (readonly)
Returns the value of attribute description.
11 12 13 |
# File 'lib/fudge/build.rb', line 11 def description @description end |
#failure_hooks ⇒ Object (readonly)
Returns the value of attribute failure_hooks.
10 11 12 |
# File 'lib/fudge/build.rb', line 10 def failure_hooks @failure_hooks end |
#formatter ⇒ Object (readonly)
Returns the value of attribute formatter.
12 13 14 |
# File 'lib/fudge/build.rb', line 12 def formatter @formatter end |
#success_hooks ⇒ Object (readonly)
Returns the value of attribute success_hooks.
10 11 12 |
# File 'lib/fudge/build.rb', line 10 def success_hooks @success_hooks end |
#time ⇒ Object
Returns the value of attribute time.
9 10 11 |
# File 'lib/fudge/build.rb', line 9 def time @time end |
Instance Method Details
#run(options = {}) ⇒ Object
Run task
22 23 24 25 26 27 28 29 30 31 32 |
# File 'lib/fudge/build.rb', line 22 def run(={}) start_time = Time.new init_formatter() success = super if callbacks return false unless run_callbacks(success) end report_time(start_time, time) success end |