<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -310,7 +310,11 @@ module Merb
           end
         end
         
-        @variables = @segments.flatten.select { |s| s.is_a?(Symbol)  }
+        unless regexp?
+          @variables = @segments.flatten.select { |s| s.is_a?(Symbol)  }
+          compiled.gsub!(%r[/+], '/')
+          compiled.gsub!(%r[(.+)/$], '\1')
+        end
 
         compiled
       end</diff>
      <filename>lib/merb-core/dispatch/router/route.rb</filename>
    </modified>
    <modified>
      <diff>@@ -12,7 +12,7 @@ module Merb
       # ==== Returns
       # String:: The generated URL.
       def url(*args)
-        args &lt;&lt; @request_params || {}
+        args &lt;&lt; (@request_params || {})
         Merb::Router.url(*args)
       end
       </diff>
      <filename>lib/merb-core/test/helpers/route_helper.rb</filename>
    </modified>
    <modified>
      <diff>@@ -17,6 +17,24 @@ describe &quot;When recognizing requests,&quot; do
     it &quot;should not match a different path&quot; do
       lambda { route_to(&quot;/notinfo&quot;) }.should raise_not_found
     end
+    
+    it &quot;should ignore trailing slashes&quot; do
+      Merb::Router.prepare do
+        match(&quot;/hello/&quot;).to(:controller =&gt; &quot;world&quot;)
+      end
+      
+      route_to(&quot;/hello&quot;).should have_route(:controller =&gt; &quot;world&quot;)
+    end
+    
+    it &quot;should ignore repeated slashes&quot; do
+      Merb::Router.prepare do
+        match(&quot;/foo///bar&quot;).to(:controller =&gt; &quot;fubar&quot;)
+        match(&quot;/hello//world&quot;).to(:controller =&gt; &quot;greetings&quot;)
+      end
+      
+      route_to(&quot;/foo/bar&quot;).should have_route(:controller =&gt; &quot;fubar&quot;)
+      route_to(&quot;/hello/world&quot;).should have_route(:controller =&gt; &quot;greetings&quot;)
+    end
   end
   
   describe &quot;a route with a Request method condition&quot; do
@@ -232,6 +250,26 @@ describe &quot;When recognizing requests,&quot; do
       lambda { route_to(&quot;/one&quot;) }.should raise_not_found
     end
     
+    it &quot;should ignore trailing slashes&quot; do
+      Merb::Router.prepare do
+        match(&quot;/hello&quot;) do
+          match(&quot;/&quot;).to(:controller =&gt; &quot;greetings&quot;)
+        end
+      end
+      
+      route_to(&quot;/hello&quot;).should have_route(:controller =&gt; &quot;greetings&quot;)
+    end
+    
+    it &quot;should ignore double slashes&quot; do
+      Merb::Router.prepare do
+        match(&quot;/hello/&quot;) do
+          match(&quot;/world&quot;).to(:controller =&gt; &quot;greetings&quot;)
+        end
+      end
+      
+      route_to(&quot;/hello/world&quot;).should have_route(:controller =&gt; &quot;greetings&quot;)
+    end
+    
     it &quot;should be able to define a route and still use the context for more route definition&quot; do
       Merb::Router.prepare do
         match(&quot;/hello&quot;) do</diff>
      <filename>spec/public/router/recognition/conditions_spec.rb</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>36e76f35b62860bec3f63c30177115778586b618</id>
    </parent>
  </parents>
  <author>
    <name>Carl Lerche</name>
    <email>carllerche@mac.com</email>
  </author>
  <url>http://github.com/wycats/merb-core/commit/32ee4fa37b534c5b046b1bb65d425947841d8e04</url>
  <id>32ee4fa37b534c5b046b1bb65d425947841d8e04</id>
  <committed-date>2008-09-29T16:41:04-07:00</committed-date>
  <authored-date>2008-09-29T16:41:04-07:00</authored-date>
  <message>Route matching handles slashes according to the RFC

Trailing slashes in route matching are dropped and repeated
slashes are converted to a single slash.</message>
  <tree>e6dfc67c507bc1ee4bc2941c8c1b2b27f3f32b05</tree>
  <committer>
    <name>Carl Lerche</name>
    <email>carllerche@mac.com</email>
  </committer>
</commit>
