Class: Travis::Client::Build
- Includes:
- Restartable, States
- Defined in:
- lib/travis/client/build.rb
Constant Summary
Constants included from States
Constants inherited from Entity
Instance Attribute Summary collapse
-
#commit ⇒ Object
readonly
Returns the value of attribute commit.
-
#commit_id ⇒ Object
readonly
Returns the value of attribute commit_id.
-
#config ⇒ Object
readonly
Returns the value of attribute config.
-
#duration ⇒ Object
readonly
Returns the value of attribute duration.
-
#finished_at ⇒ Object
readonly
Returns the value of attribute finished_at.
-
#job_ids ⇒ Object
readonly
Returns the value of attribute job_ids.
-
#jobs ⇒ Object
readonly
Returns the value of attribute jobs.
-
#number ⇒ Object
readonly
Returns the value of attribute number.
-
#pull_request ⇒ Object
(also: #pull_request?)
readonly
Returns the value of attribute pull_request.
-
#pull_request_number ⇒ Object
(also: #pr_number)
readonly
Returns the value of attribute pull_request_number.
-
#pull_request_title ⇒ Object
readonly
Returns the value of attribute pull_request_title.
-
#repository ⇒ Object
readonly
Returns the value of attribute repository.
-
#repository_id ⇒ Object
readonly
Returns the value of attribute repository_id.
-
#started_at ⇒ Object
readonly
Returns the value of attribute started_at.
-
#state ⇒ Object
readonly
Returns the value of attribute state.
Attributes inherited from Entity
#attributes, #curry, #id, #session
Instance Method Summary collapse
- #branch_info ⇒ Object
- #delete_logs(reason = {}) ⇒ Object
- #inspect_info ⇒ Object
- #push? ⇒ Boolean
- #pusher_channels ⇒ Object
Methods included from States
#canceled?, #color, #created?, #errored?, #failed?, #finished?, #green?, #passed?, #pending?, #queued?, #ready?, #received?, #red?, #running?, #started?, #unsuccessful?, #yellow?
Methods included from Restartable
#cancel, #cancelable?, #restart, #restartable?
Methods inherited from Entity
#[], #[]=, aka, #attribute_names, attributes, base_path, #cancelable?, cast_id, #complete?, has, has_singleton, id?, id_field, #include?, #initialize, #inspect, inspect_info, #load, many, #missing?, one, preloadable, preloadable?, relations, #relations, #reload, #restartable?, subclass_for, subclasses, time, #to_h, #update_attributes, weak?
Constructor Details
This class inherits a constructor from Travis::Client::Entity
Instance Attribute Details
#commit ⇒ Object (readonly)
Returns the value of attribute commit.
1 2 3 |
# File 'lib/travis/client/build.rb', line 1 def commit @commit end |
#commit_id ⇒ Object (readonly)
Returns the value of attribute commit_id.
1 2 3 |
# File 'lib/travis/client/build.rb', line 1 def commit_id @commit_id end |
#config ⇒ Object (readonly)
Returns the value of attribute config.
1 2 3 |
# File 'lib/travis/client/build.rb', line 1 def config @config end |
#duration ⇒ Object (readonly)
Returns the value of attribute duration.
1 2 3 |
# File 'lib/travis/client/build.rb', line 1 def duration @duration end |
#finished_at ⇒ Object (readonly)
Returns the value of attribute finished_at.
1 2 3 |
# File 'lib/travis/client/build.rb', line 1 def finished_at @finished_at end |
#job_ids ⇒ Object (readonly)
Returns the value of attribute job_ids.
1 2 3 |
# File 'lib/travis/client/build.rb', line 1 def job_ids @job_ids end |
#jobs ⇒ Object (readonly)
Returns the value of attribute jobs.
1 2 3 |
# File 'lib/travis/client/build.rb', line 1 def jobs @jobs end |
#number ⇒ Object (readonly)
Returns the value of attribute number.
1 2 3 |
# File 'lib/travis/client/build.rb', line 1 def number @number end |
#pull_request ⇒ Object (readonly) Also known as: pull_request?
Returns the value of attribute pull_request.
1 2 3 |
# File 'lib/travis/client/build.rb', line 1 def pull_request @pull_request end |
#pull_request_number ⇒ Object (readonly) Also known as: pr_number
Returns the value of attribute pull_request_number.
1 2 3 |
# File 'lib/travis/client/build.rb', line 1 def pull_request_number @pull_request_number end |
#pull_request_title ⇒ Object (readonly)
Returns the value of attribute pull_request_title.
1 2 3 |
# File 'lib/travis/client/build.rb', line 1 def pull_request_title @pull_request_title end |
#repository ⇒ Object (readonly)
Returns the value of attribute repository.
1 2 3 |
# File 'lib/travis/client/build.rb', line 1 def repository @repository end |
#repository_id ⇒ Object (readonly)
Returns the value of attribute repository_id.
1 2 3 |
# File 'lib/travis/client/build.rb', line 1 def repository_id @repository_id end |
#started_at ⇒ Object (readonly)
Returns the value of attribute started_at.
1 2 3 |
# File 'lib/travis/client/build.rb', line 1 def started_at @started_at end |
#state ⇒ Object (readonly)
Returns the value of attribute state.
1 2 3 |
# File 'lib/travis/client/build.rb', line 1 def state @state end |
Instance Method Details
#branch_info ⇒ Object
33 34 35 36 |
# File 'lib/travis/client/build.rb', line 33 def branch_info info = commit.branch pull_request? ? info + " (PR ##{pr_number})" : info end |
#delete_logs(reason = {}) ⇒ Object
23 24 25 26 27 |
# File 'lib/travis/client/build.rb', line 23 def delete_logs(reason = {}) jobs.each do |job| job.delete_log(reason) end end |
#inspect_info ⇒ Object
42 43 44 |
# File 'lib/travis/client/build.rb', line 42 def inspect_info "#{repository.slug}##{number}" end |
#push? ⇒ Boolean
29 30 31 |
# File 'lib/travis/client/build.rb', line 29 def push? not pull_request? end |
#pusher_channels ⇒ Object
38 39 40 |
# File 'lib/travis/client/build.rb', line 38 def pusher_channels repository.pusher_channels end |