Module: Travis::Builder::Base
- Included in:
- Travis::Builder
- Defined in:
- lib/travis/builder/base.rb
Instance Attribute Summary collapse
-
#build ⇒ Object
readonly
Returns the value of attribute build.
-
#meta_id ⇒ Object
readonly
Returns the value of attribute meta_id.
Instance Method Summary collapse
- #buildable ⇒ Object
- #initialize(meta_id, build) ⇒ Object
- #on_finish ⇒ Object
- #on_log(chars) ⇒ Object
- #on_start ⇒ Object
- #repository_id ⇒ Object
- #work! ⇒ Object
Instance Attribute Details
#build ⇒ Object (readonly)
Returns the value of attribute build.
4 5 6 |
# File 'lib/travis/builder/base.rb', line 4 def build @build end |
#meta_id ⇒ Object (readonly)
Returns the value of attribute meta_id.
4 5 6 |
# File 'lib/travis/builder/base.rb', line 4 def @meta_id end |
Instance Method Details
#buildable ⇒ Object
18 19 20 21 22 23 24 |
# File 'lib/travis/builder/base.rb', line 18 def buildable @buildable ||= Travis::Buildable.new( :script => 'rake', :commit => build['commit'], :url => build['repository']['url'] ) end |
#initialize(meta_id, build) ⇒ Object
6 7 8 9 |
# File 'lib/travis/builder/base.rb', line 6 def initialize(, build) @meta_id = @build = build.dup end |
#on_finish ⇒ Object
38 39 40 |
# File 'lib/travis/builder/base.rb', line 38 def on_finish build.merge!('finished_at' => Time.now) end |
#on_log(chars) ⇒ Object
34 35 36 |
# File 'lib/travis/builder/base.rb', line 34 def on_log(chars) build['log'] << chars end |
#on_start ⇒ Object
30 31 32 |
# File 'lib/travis/builder/base.rb', line 30 def on_start build.merge!('log' => '', 'started_at' => Time.now) end |
#repository_id ⇒ Object
26 27 28 |
# File 'lib/travis/builder/base.rb', line 26 def repository_id build['repository']['id'] end |
#work! ⇒ Object
11 12 13 14 15 16 |
# File 'lib/travis/builder/base.rb', line 11 def work! on_start build['status'] = buildable.build! # sleep(1) on_finish end |