Skip to content
This repository
Browse code

These are a pain to set up

  • Loading branch information...
commit b4c0e7041776c69d21065555531b77d053cc82f3 1 parent d9bad40
Darrick Wiebe authored

Showing 1 changed file with 15 additions and 3 deletions. Show diff stats Hide diff stats

  1. +15 3 lib/pacer/transform/branch.rb
18 lib/pacer/transform/branch.rb
@@ -88,6 +88,7 @@ def after_initialize
88 88
89 89 def attach_pipe(source_pipe)
90 90 first_branch_pipe = nil
  91 + need_pipeline = false
91 92 branch_pipes = []
92 93 all_branch_pipes = []
93 94 branches.map do |route, use_split|
@@ -104,12 +105,23 @@ def attach_pipe(source_pipe)
104 105 if branch_pipes.any?
105 106 split = split_pipe.new branch_pipes
106 107 first_branch_pipe.setStarts split
107   - split.set_starts source_pipe if source_pipe
  108 + if source_pipe
  109 + split.setStarts source_pipe
  110 + else
  111 + need_pipeline = true
  112 + end
108 113 elsif first_branch_pipe
109 114 first_branch_pipe.setStarts source_pipe if source_pipe
110 115 end
111   - if all_branch_pipes.any?
112   - merge_pipe.new all_branch_pipes
  116 + if all_branch_pipes.count > 1
  117 + merged = merge_pipe.new all_branch_pipes
  118 + if need_pipeline
  119 + Pacer::Pipes::BlackboxPipeline.new split, merged
  120 + else
  121 + merged
  122 + end
  123 + elsif all_branch_pipes.any?
  124 + all_branch_pipes.first
113 125 else
114 126 source_pipe
115 127 end

0 comments on commit b4c0e70

Please sign in to comment.
Something went wrong with that request. Please try again.