Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

These are a pain to set up

  • Loading branch information...
commit b4c0e7041776c69d21065555531b77d053cc82f3 1 parent d9bad40
Darrick Wiebe authored
Showing with 15 additions and 3 deletions.
  1. +15 −3 lib/pacer/transform/branch.rb
18 lib/pacer/transform/branch.rb
View
@@ -88,6 +88,7 @@ def after_initialize
def attach_pipe(source_pipe)
first_branch_pipe = nil
+ need_pipeline = false
branch_pipes = []
all_branch_pipes = []
branches.map do |route, use_split|
@@ -104,12 +105,23 @@ def attach_pipe(source_pipe)
if branch_pipes.any?
split = split_pipe.new branch_pipes
first_branch_pipe.setStarts split
- split.set_starts source_pipe if source_pipe
+ if source_pipe
+ split.setStarts source_pipe
+ else
+ need_pipeline = true
+ end
elsif first_branch_pipe
first_branch_pipe.setStarts source_pipe if source_pipe
end
- if all_branch_pipes.any?
- merge_pipe.new all_branch_pipes
+ if all_branch_pipes.count > 1
+ merged = merge_pipe.new all_branch_pipes
+ if need_pipeline
+ Pacer::Pipes::BlackboxPipeline.new split, merged
+ else
+ merged
+ end
+ elsif all_branch_pipes.any?
+ all_branch_pipes.first
else
source_pipe
end
Please sign in to comment.
Something went wrong with that request. Please try again.