Class: Carson::Delivery
- Inherits:
-
Object
- Object
- Carson::Delivery
- Defined in:
- lib/carson/delivery.rb
Constant Summary collapse
- ACTIVE_STATES =
%w[preparing gated queued integrating escalated].freeze
- BLOCKED_STATES =
%w[gated escalated].freeze
- READY_STATES =
%w[queued].freeze
- TERMINAL_STATES =
%w[integrated failed superseded].freeze
Instance Attribute Summary collapse
-
#branch ⇒ Object
readonly
Returns the value of attribute branch.
-
#cause ⇒ Object
readonly
Returns the value of attribute cause.
-
#created_at ⇒ Object
readonly
Returns the value of attribute created_at.
-
#head ⇒ Object
readonly
Returns the value of attribute head.
-
#integrated_at ⇒ Object
readonly
Returns the value of attribute integrated_at.
-
#merge_proof ⇒ Object
readonly
Returns the value of attribute merge_proof.
-
#pull_request_draft ⇒ Object
readonly
Returns the value of attribute pull_request_draft.
-
#pull_request_merged_at ⇒ Object
readonly
Returns the value of attribute pull_request_merged_at.
-
#pull_request_number ⇒ Object
readonly
Returns the value of attribute pull_request_number.
-
#pull_request_state ⇒ Object
readonly
Returns the value of attribute pull_request_state.
-
#pull_request_url ⇒ Object
readonly
Returns the value of attribute pull_request_url.
-
#repo_path ⇒ Object
readonly
Returns the value of attribute repo_path.
-
#repository ⇒ Object
readonly
Returns the value of attribute repository.
-
#revisions ⇒ Object
readonly
Returns the value of attribute revisions.
-
#status ⇒ Object
readonly
Returns the value of attribute status.
-
#summary ⇒ Object
readonly
Returns the value of attribute summary.
-
#superseded_at ⇒ Object
readonly
Returns the value of attribute superseded_at.
-
#updated_at ⇒ Object
readonly
Returns the value of attribute updated_at.
-
#worktree_path ⇒ Object
readonly
Returns the value of attribute worktree_path.
Instance Method Summary collapse
- #active? ⇒ Boolean
- #blocked? ⇒ Boolean
- #failed? ⇒ Boolean
-
#initialize(repo_path:, branch:, head:, worktree_path:, status:, pull_request_number:, pull_request_url:, cause:, summary:, created_at:, updated_at:, integrated_at:, superseded_at:, revisions: [], repository: nil, pull_request_state: nil, pull_request_draft: nil, pull_request_merged_at: nil, merge_proof: nil) ⇒ Delivery
constructor
A new instance of Delivery.
- #integrated? ⇒ Boolean
- #key ⇒ Object
- #ready? ⇒ Boolean
- #revision_count ⇒ Object
- #superseded? ⇒ Boolean
- #terminal? ⇒ Boolean
Constructor Details
#initialize(repo_path:, branch:, head:, worktree_path:, status:, pull_request_number:, pull_request_url:, cause:, summary:, created_at:, updated_at:, integrated_at:, superseded_at:, revisions: [], repository: nil, pull_request_state: nil, pull_request_draft: nil, pull_request_merged_at: nil, merge_proof: nil) ⇒ Delivery
Returns a new instance of Delivery.
14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 |
# File 'lib/carson/delivery.rb', line 14 def initialize( repo_path:, branch:, head:, worktree_path:, status:, pull_request_number:, pull_request_url:, cause:, summary:, created_at:, updated_at:, integrated_at:, superseded_at:, revisions: [], repository: nil, pull_request_state: nil, pull_request_draft: nil, pull_request_merged_at: nil, merge_proof: nil ) @repo_path = repo_path @repository = repository @branch = branch @head = head @worktree_path = worktree_path @status = status @pull_request_number = pull_request_number @pull_request_url = pull_request_url @revisions = revisions @cause = cause @summary = summary @created_at = created_at @updated_at = updated_at @integrated_at = integrated_at @superseded_at = superseded_at @pull_request_state = pull_request_state @pull_request_draft = pull_request_draft @pull_request_merged_at = pull_request_merged_at @merge_proof = merge_proof end |
Instance Attribute Details
#branch ⇒ Object (readonly)
Returns the value of attribute branch.
9 10 11 |
# File 'lib/carson/delivery.rb', line 9 def branch @branch end |
#cause ⇒ Object (readonly)
Returns the value of attribute cause.
9 10 11 |
# File 'lib/carson/delivery.rb', line 9 def cause @cause end |
#created_at ⇒ Object (readonly)
Returns the value of attribute created_at.
9 10 11 |
# File 'lib/carson/delivery.rb', line 9 def created_at @created_at end |
#head ⇒ Object (readonly)
Returns the value of attribute head.
9 10 11 |
# File 'lib/carson/delivery.rb', line 9 def head @head end |
#integrated_at ⇒ Object (readonly)
Returns the value of attribute integrated_at.
9 10 11 |
# File 'lib/carson/delivery.rb', line 9 def integrated_at @integrated_at end |
#merge_proof ⇒ Object (readonly)
Returns the value of attribute merge_proof.
9 10 11 |
# File 'lib/carson/delivery.rb', line 9 def merge_proof @merge_proof end |
#pull_request_draft ⇒ Object (readonly)
Returns the value of attribute pull_request_draft.
9 10 11 |
# File 'lib/carson/delivery.rb', line 9 def pull_request_draft @pull_request_draft end |
#pull_request_merged_at ⇒ Object (readonly)
Returns the value of attribute pull_request_merged_at.
9 10 11 |
# File 'lib/carson/delivery.rb', line 9 def pull_request_merged_at @pull_request_merged_at end |
#pull_request_number ⇒ Object (readonly)
Returns the value of attribute pull_request_number.
9 10 11 |
# File 'lib/carson/delivery.rb', line 9 def pull_request_number @pull_request_number end |
#pull_request_state ⇒ Object (readonly)
Returns the value of attribute pull_request_state.
9 10 11 |
# File 'lib/carson/delivery.rb', line 9 def pull_request_state @pull_request_state end |
#pull_request_url ⇒ Object (readonly)
Returns the value of attribute pull_request_url.
9 10 11 |
# File 'lib/carson/delivery.rb', line 9 def pull_request_url @pull_request_url end |
#repo_path ⇒ Object (readonly)
Returns the value of attribute repo_path.
9 10 11 |
# File 'lib/carson/delivery.rb', line 9 def repo_path @repo_path end |
#repository ⇒ Object (readonly)
Returns the value of attribute repository.
9 10 11 |
# File 'lib/carson/delivery.rb', line 9 def repository @repository end |
#revisions ⇒ Object (readonly)
Returns the value of attribute revisions.
9 10 11 |
# File 'lib/carson/delivery.rb', line 9 def revisions @revisions end |
#status ⇒ Object (readonly)
Returns the value of attribute status.
9 10 11 |
# File 'lib/carson/delivery.rb', line 9 def status @status end |
#summary ⇒ Object (readonly)
Returns the value of attribute summary.
9 10 11 |
# File 'lib/carson/delivery.rb', line 9 def summary @summary end |
#superseded_at ⇒ Object (readonly)
Returns the value of attribute superseded_at.
9 10 11 |
# File 'lib/carson/delivery.rb', line 9 def superseded_at @superseded_at end |
#updated_at ⇒ Object (readonly)
Returns the value of attribute updated_at.
9 10 11 |
# File 'lib/carson/delivery.rb', line 9 def updated_at @updated_at end |
#worktree_path ⇒ Object (readonly)
Returns the value of attribute worktree_path.
9 10 11 |
# File 'lib/carson/delivery.rb', line 9 def worktree_path @worktree_path end |
Instance Method Details
#active? ⇒ Boolean
51 52 53 |
# File 'lib/carson/delivery.rb', line 51 def active? ACTIVE_STATES.include?( status ) end |
#blocked? ⇒ Boolean
55 56 57 |
# File 'lib/carson/delivery.rb', line 55 def blocked? BLOCKED_STATES.include?( status ) end |
#failed? ⇒ Boolean
67 68 69 |
# File 'lib/carson/delivery.rb', line 67 def failed? status == "failed" end |
#integrated? ⇒ Boolean
63 64 65 |
# File 'lib/carson/delivery.rb', line 63 def integrated? status == "integrated" end |
#key ⇒ Object
43 44 45 |
# File 'lib/carson/delivery.rb', line 43 def key "#{repo_path}:#{branch}:#{head}" end |
#ready? ⇒ Boolean
59 60 61 |
# File 'lib/carson/delivery.rb', line 59 def ready? READY_STATES.include?( status ) end |
#revision_count ⇒ Object
47 48 49 |
# File 'lib/carson/delivery.rb', line 47 def revision_count revisions.length end |
#superseded? ⇒ Boolean
71 72 73 |
# File 'lib/carson/delivery.rb', line 71 def superseded? status == "superseded" end |
#terminal? ⇒ Boolean
75 76 77 |
# File 'lib/carson/delivery.rb', line 75 def terminal? TERMINAL_STATES.include?( status ) end |