<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -7,58 +7,54 @@ module Waves
       # Takes an array of pattern elements ... coming soon, support for formatted strings!
       def initialize( pattern ) ; @pattern = pattern  ; end
       
+      # returns a hash of captured values
       def call( request )
-        return {} if @pattern == true or @pattern == false or @pattern.nil?
-        path = extract_path( request ).reverse
-        return {} if ( path.empty? and @pattern.empty? )
-        capture = {}
-        match =  @pattern.all? do | want |
-          case want
-          when true # means 1..-1
-            path = [] unless path.empty?
-          when Range 
-            if want.end == -1
-              path = [] if path.length &gt;= want.begin
-            else
-              path = [] if want.include? path.length
-            end
-          when String then want == path.pop
-          when Symbol then capture[ want ] = path.pop
-          when Regexp then want === path.pop
-          when Hash
-            key, value = want.to_a.first
-            case value
-            when true
-              ( capture[ key ], path = path.reverse, [] ) unless path.empty?
-            when Range
-              if value.end == -1
-                ( capture[ key ], path = path.reverse, [] ) if path.length &gt;= value.begin
+        if @pattern.is_a? Array
+          path = extract_path( request ).reverse
+          return {} if @pattern.empty? &amp;&amp; path.empty?
+          capture = {}
+          match = @pattern.all? do | want |
+            case want
+            when true # same as a Range of 1..-1
+              path = [] unless path.empty?
+            when Range 
+              if want.end == -1
+                path = [] if path.length &gt;= want.begin
               else
-                ( capture[ key ], path = path.reverse, [] ) if value.include? path.length
+                path = [] if want.include? path.length
+              end
+            when String then want == path.pop
+            when Symbol then capture[ want ] = path.pop
+            when Regexp then want === path.pop
+            when Hash
+              key, value = want.to_a.first
+              case value
+              when true
+                ( capture[ key ], path = path.reverse, [] ) unless path.empty?
+              when Range
+                if value.end == -1
+                  ( capture[ key ], path = path.reverse, [] ) if path.length &gt;= value.begin
+                else
+                  ( capture[ key ], path = path.reverse, [] ) if value.include? path.length
+                end
+              when String, Symbol
+                got = path.pop
+                capture[ key ] = got ? got : value.to_s
+              when Regexp then
+                got = path.pop
+                capture[ key ] = got if value === got
               end
-            when String, Symbol
-              got = path.pop
-              capture[ key ] = got ? got : value.to_s
-            when Regexp then
-              got = path.pop
-              capture[ key ] = got if value === got
             end
           end
+          capture if match &amp;&amp; path.empty?
+        elsif @pattern == true or @pattern == false or @pattern == nil
+          {}
         end
-        capture if match &amp;&amp; path.empty?
       end
 
       # private 
 
       # just a little helper method
-      def original_extract_path( request )
-        path = request.traits.waves.path
-        return path if path
-        path = request.path.split('/').map { |e| Rack::Utils.unescape(e) }
-        path.shift unless path.empty?
-        request.traits.waves.path = path
-      end
-      
       def extract_path( request )
         request.traits.waves.path ||= request.path.scan(/[^\/]+/).map { |e| Rack::Utils.unescape(e) }
       end</diff>
      <filename>lib/matchers/path.rb</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>9c919a42c870bfc03f6c6810383f6e03bf83ae8f</id>
    </parent>
  </parents>
  <author>
    <name>Matthew King</name>
    <email>automatthew@gmail.com</email>
  </author>
  <url>http://github.com/dyoder/waves/commit/cc1b31125a369cc1e2a037e5014aa63ea5e620f0</url>
  <id>cc1b31125a369cc1e2a037e5014aa63ea5e620f0</id>
  <committed-date>2009-01-06T13:21:11-08:00</committed-date>
  <authored-date>2009-01-05T15:11:54-08:00</authored-date>
  <message>refactoring Path matcher for potential speed and clarity increases</message>
  <tree>f761fc7dc70b95f016049da9ac3f8c8d448059c1</tree>
  <committer>
    <name>Matthew King</name>
    <email>automatthew@gmail.com</email>
  </committer>
</commit>
