Permalink
Browse files

Rename CombinedPath to PathTree (2/2)

  • Loading branch information...
1 parent ccae8f3 commit 49112be6e29e1b800dea0badcaa7ef3597fdb08b @pangloss committed Sep 28, 2012
Showing with 16 additions and 14 deletions.
  1. +1 −1 lib/pacer/loader.rb
  2. +15 −13 lib/pacer/transform/path_tree.rb
View
2 lib/pacer/loader.rb
@@ -81,7 +81,7 @@ module SideEffect end
require 'pacer/transform/process'
require 'pacer/transform/join'
require 'pacer/transform/path'
-require 'pacer/transform/combined_path'
+require 'pacer/transform/path_tree'
require 'pacer/transform/wrapped_path'
require 'pacer/transform/scatter'
require 'pacer/transform/has_count_cap'
View
28 lib/pacer/transform/path_tree.rb
@@ -2,25 +2,35 @@ module Pacer
module Core
module Graph
module PathRoute
- def combine(*exts)
- wrapped.chain_route transform: :combine_path, element_type: :object
+ # Transform raw paths to a tree:
+ # [a b c]
+ # [a b d]
+ # [a e f]
+ # [a e g]
+ # -- becomes --
+ # [a [b [c]
+ # [d]]
+ # [e [f
+ # g]]]
+ def tree
+ wrapped.chain_route transform: :path_tree, element_type: :object
end
end
end
end
module Transform
- module CombinePath
+ module PathTree
protected
def attach_pipe(end_pipe)
- pipe = CombinePathPipe.new
+ pipe = PathTreePipe.new
pipe.setStarts end_pipe
pipe
end
- class CombinePathPipe < Pacer::Pipes::RubyPipe
+ class PathTreePipe < Pacer::Pipes::RubyPipe
def initialize
super
self.building_path = nil
@@ -89,11 +99,3 @@ def next_path(path)
end
end
-
-# [a [b [c]
-# [d]]
-# [e [f
-# g]]]
-
-
-

0 comments on commit 49112be

Please sign in to comment.