Class: Vendorificator::Segment::Overlay
- Inherits:
-
Vendorificator::Segment
- Object
- Vendorificator::Segment
- Vendorificator::Segment::Overlay
- Defined in:
- lib/vendorificator/segment/overlay.rb
Instance Attribute Summary collapse
-
#environment ⇒ Object
readonly
Returns the value of attribute environment.
-
#overlay ⇒ Object
readonly
Returns the value of attribute overlay.
-
#segments ⇒ Object
readonly
Returns the value of attribute segments.
Instance Method Summary collapse
- #base_branch_name ⇒ Object
- #branch_name ⇒ Object
- #compute_dependencies! ⇒ Object
-
#each_segment(*segments) ⇒ Object
Public: Goes through all the Vendor instances and runs the block.
- #group ⇒ Object
-
#initialize(options) ⇒ Overlay
constructor
A new instance of Overlay.
- #merge_branch_name ⇒ Object
- #name ⇒ Object
- #path ⇒ Object
- #version ⇒ Object
Methods inherited from Vendorificator::Segment
#fast_forward, #head, #included_in_list?, #merged_notes, #merged_version, #pushable_refs, #run!, #status, #to_s, #updatable?, #work_dir
Constructor Details
#initialize(options) ⇒ Overlay
Returns a new instance of Overlay.
5 6 7 8 9 10 |
# File 'lib/vendorificator/segment/overlay.rb', line 5 def initialize() @overlay = ::Vendorificator::Overlay.new([:overlay_opts]) @environment = [:environment] @segments = [] super end |
Instance Attribute Details
#environment ⇒ Object (readonly)
Returns the value of attribute environment.
3 4 5 |
# File 'lib/vendorificator/segment/overlay.rb', line 3 def environment @environment end |
#overlay ⇒ Object (readonly)
Returns the value of attribute overlay.
3 4 5 |
# File 'lib/vendorificator/segment/overlay.rb', line 3 def @overlay end |
#segments ⇒ Object (readonly)
Returns the value of attribute segments.
3 4 5 |
# File 'lib/vendorificator/segment/overlay.rb', line 3 def segments @segments end |
Instance Method Details
#base_branch_name ⇒ Object
16 17 18 |
# File 'lib/vendorificator/segment/overlay.rb', line 16 def base_branch_name _join config[:branch_prefix], 'overlay', (.name || .path) end |
#branch_name ⇒ Object
20 21 22 |
# File 'lib/vendorificator/segment/overlay.rb', line 20 def branch_name _join base_branch_name, 'layer' end |
#compute_dependencies! ⇒ Object
28 29 30 |
# File 'lib/vendorificator/segment/overlay.rb', line 28 def compute_dependencies! each_segment { |seg| seg.compute_dependencies! } end |
#each_segment(*segments) ⇒ Object
Public: Goes through all the Vendor instances and runs the block
segments - An Array of vendor segments to yield the block for.
Returns nothing.
37 38 39 40 41 42 43 44 45 46 47 48 |
# File 'lib/vendorificator/segment/overlay.rb', line 37 def each_segment(*segments) # We don't use @segments.each here, because Vendor#run! is # explicitly allowed to append to instantiate new dependencies, and #each # fails to catch up on some Ruby implementations. i = 0 while true break if i >= @segments.length seg = @segments[i] yield seg if segments.empty? || seg.included_in_list?(segments) i += 1 end end |
#group ⇒ Object
50 51 52 |
# File 'lib/vendorificator/segment/overlay.rb', line 50 def group nil end |
#merge_branch_name ⇒ Object
24 25 26 |
# File 'lib/vendorificator/segment/overlay.rb', line 24 def merge_branch_name _join base_branch_name, 'merged' end |
#name ⇒ Object
12 13 14 |
# File 'lib/vendorificator/segment/overlay.rb', line 12 def name "Overlay \"#{.path}\"" end |
#path ⇒ Object
58 59 60 |
# File 'lib/vendorificator/segment/overlay.rb', line 58 def path _join .path end |
#version ⇒ Object
54 55 56 |
# File 'lib/vendorificator/segment/overlay.rb', line 54 def version nil end |