Class: Fudge::Build

Inherits:
Tasks::CompositeTask show all
Defined in:
lib/fudge/build.rb

Overview

Represents a build defined in the FudgeFile

Instance Attribute Summary collapse

Attributes inherited from Tasks::Task

#args, #options

Instance Method Summary collapse

Methods inherited from Tasks::CompositeTask

#tasks

Methods inherited from Tasks::Task

name

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

#aboutString

Returns a brief description of the build; this is output by the ‘list’ command.

Returns:

  • (String)

    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

#callbacksObject

Returns the value of attribute callbacks.



9
10
11
# File 'lib/fudge/build.rb', line 9

def callbacks
  @callbacks
end

#descriptionObject (readonly)

Returns the value of attribute description.



11
12
13
# File 'lib/fudge/build.rb', line 11

def description
  @description
end

#failure_hooksObject (readonly)

Returns the value of attribute failure_hooks.



10
11
12
# File 'lib/fudge/build.rb', line 10

def failure_hooks
  @failure_hooks
end

#formatterObject (readonly)

Returns the value of attribute formatter.



12
13
14
# File 'lib/fudge/build.rb', line 12

def formatter
  @formatter
end

#success_hooksObject (readonly)

Returns the value of attribute success_hooks.



10
11
12
# File 'lib/fudge/build.rb', line 10

def success_hooks
  @success_hooks
end

#timeObject

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(options={})
  start_time = Time.new
  init_formatter(options)
  success = super
  if callbacks
    return false unless run_callbacks(success)
  end
  report_time(start_time, time)

  success
end