<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -8,7 +8,7 @@ Feature: Alternate preparations for recipes
 
     Given a &quot;pancake&quot; recipe with &quot;buttermilk&quot;
     And no other recipes
-    When I view the recipe
+    When I visit the recipe with &quot;buttermilk&quot; in it
     Then I should see no alternate preparations
 
   Scenario: Alternate preparation</diff>
      <filename>features/recipe_alternate_preparations.feature</filename>
    </modified>
    <modified>
      <diff>@@ -7,7 +7,7 @@ Feature: Updating recipes in our cookbook
   Scenario: No previous or next version of a recipe
 
     Given a &quot;Buttermilk Pancake&quot; recipe with &quot;buttermilk&quot;
-    When I view the recipe
+    When I visit the recipe with &quot;buttermilk&quot; in it
     Then I should not see previous versions of the recipe
     And I should not see updated versions of the recipe
 </diff>
      <filename>features/recipe_replacement.feature</filename>
    </modified>
    <modified>
      <diff>@@ -3,7 +3,7 @@ Given /^&quot;([^\&quot;]*)&quot;, (\w+) on ([-\d]+)$/ do |title, status, date_str|
 
   type = title.split.first
   permalink = date.to_s
-  permalink += &quot;-&quot; + title.downcase.gsub(/[#\W]+/, '-') if type == 'Recipe'
+  permalink += &quot;-&quot; + title.downcase.gsub(/[#\W]+/, '_') if type == 'Recipe'
 
   var_name = '@' + title.downcase.gsub(/[#\W]+/, '_') + '_permalink'
   instance_variable_set(var_name.to_sym, permalink)
@@ -23,7 +23,7 @@ Given /^&quot;([^\&quot;]*)&quot;, (\w+) on ([-\d]+)$/ do |title, status, date_str|
 end
 
 When /^I show &quot;Recipe #1&quot;$/ do
-  visit(&quot;/recipes/#{@recipe_1_permalink}&quot;)
+  visit(&quot;/recipes/#{@recipe_1_permalink.gsub('-', '/')}&quot;)
 end
 
 When /^I show &quot;Meal #1&quot;$/ do</diff>
      <filename>features/step_definitions/draft.rb</filename>
    </modified>
    <modified>
      <diff>@@ -19,7 +19,7 @@ Given /^the three pancake recipes are alternate preparations of each other$/ do
 end
 
 When /^I visit the &quot;Hearty Pancake&quot; recipe$/ do
-  visit &quot;/recipes/#{@permalink_identified_by['wheat germ']}&quot;
+  visit &quot;/recipes/#{@permalink_identified_by['wheat germ'].gsub(/-/, '/')}&quot;
 end
 
 Then /^I should see no alternate preparations$/ do</diff>
      <filename>features/step_definitions/recipe_alternates.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,7 +1,7 @@
 Given /^a recipe for Buttermilk Chocolate Chip Pancakes$/ do
   @date = Date.new(2009, 3, 24)
   @title = &quot;Buttermilk Chocolate Chip Pancakes&quot;
-  @permalink = @date.to_s + &quot;-&quot; + @title.downcase.gsub(/\W/, '-')
+  @permalink = @date.to_s + &quot;-&quot; + @title.downcase.gsub(/\W/, '_')
 
   recipe = {
     :title =&gt; @title,
@@ -38,7 +38,7 @@ end
 Given /^a recipe for Crockpot Lentil Andouille Soup$/ do
   @date = Date.new(2009, 3, 24)
   @title = &quot;Crockpot Lentil Andouille Soup&quot;
-  @permalink = @date.to_s + &quot;-&quot; + @title.downcase.gsub(/\W/, '-')
+  @permalink = @date.to_s + &quot;-&quot; + @title.downcase.gsub(/\W/, '_')
 
   recipe = {
     :title         =&gt; @title,
@@ -55,7 +55,7 @@ end
 Given /^a recipe for Chicken Noodle Soup$/ do
   @date = Date.new(2009, 4, 1)
   @title = &quot;Chicken Noodle Soup&quot;
-  @permalink = @date.to_s + &quot;-&quot; + @title.downcase.gsub(/\W/, '-')
+  @permalink = @date.to_s + &quot;-&quot; + @title.downcase.gsub(/\W/, '_')
 
   recipe = {
     :title =&gt; @title,
@@ -97,7 +97,7 @@ end
 Given /^a recipe for Mango and Tomato Salad$/ do
   @date = Date.new(2009, 4, 2)
   @title = &quot;Mango and Tomato Salad&quot;
-  @permalink = @date.to_s + &quot;-&quot; + @title.downcase.gsub(/\W/, '-')
+  @permalink = @date.to_s + &quot;-&quot; + @title.downcase.gsub(/\W/, '_')
 
   recipe = {
     :title =&gt; @title,
@@ -113,7 +113,7 @@ end
 Given /^a recipe for Curried Shrimp$/ do
   @date = Date.new(2009, 4, 2)
   @title = &quot;Curried Shrimp&quot;
-  @permalink = @date.to_s + &quot;-&quot; + @title.downcase.gsub(/\W/, '-')
+  @permalink = @date.to_s + &quot;-&quot; + @title.downcase.gsub(/\W/, '_')
 
   @summary = &quot;This dish is *yummy*.&quot;
   @instructions = &lt;&lt;_EOM
@@ -136,7 +136,7 @@ end
 
 Given /^a &quot;([^\&quot;]*)&quot; recipe from (.+)$/ do |title, date_str|
   date = Date.parse(date_str)
-  @recipe_permalink = date.to_s + &quot;-&quot; + title.downcase.gsub(/\W/, '-')
+  @recipe_permalink = date.to_s + &quot;-&quot; + title.downcase.gsub(/\W/, '_')
 
   recipe = {
     :title        =&gt; title,
@@ -153,11 +153,11 @@ Given /^a &quot;([^\&quot;]*)&quot; recipe from (.+)$/ do |title, date_str|
 end
 
 When /^I view the recipe$/ do
-  visit(&quot;/recipes/#{@permalink}&quot;)
+  visit(&quot;/recipes/#{@permalink.gsub(/-/, '/')}&quot;)
 end
 
 When /^I view the &quot;([^\&quot;]*)&quot; recipe$/ do |title|
-  visit(&quot;/recipes/#{@recipe_permalink}&quot;)
+  visit(&quot;/recipes/#{@recipe_permalink.gsub(/-/, '/')}&quot;)
 end
 
 </diff>
      <filename>features/step_definitions/recipe_details.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,6 +1,6 @@
 Given /^a &quot;([^\&quot;]*)&quot; recipe (.*)with &quot;([^\&quot;]*)&quot;$/ do |title, on, ingredient|
   date = (on == &quot;&quot;) ? Date.new(2009, 9, 5) : Date.new(2000, 9, 5)
-  permalink = date.to_s + &quot;-&quot; + title.downcase.gsub(/\W/, '-')
+  permalink = date.to_s + &quot;-&quot; + title.downcase.gsub(/\W/, '_')
 
   @permalink_identified_by ||= { }
   @permalink_identified_by[ingredient] = permalink
@@ -34,7 +34,7 @@ When /^the &quot;([^\&quot;]*)&quot; recipe is marked as update of the &quot;([^\&quot;]*)&quot; recipe$/ do |
 end
 
 When /^I visit the recipe with &quot;([^\&quot;]*)&quot; in it$/ do |ingredient|
-  visit &quot;/recipes/#{@permalink_identified_by[ingredient]}&quot;
+  visit &quot;/recipes/#{@permalink_identified_by[ingredient].gsub(/-/, '/')}&quot;
 end
 
 Then /^I should not see previous versions of the recipe$/ do
@@ -47,7 +47,7 @@ end
 
 Then /^I should see that the recipe is an update to the recipe with &quot;([^\&quot;]*)&quot; in it$/ do |ingredient|
   response.should have_selector(&quot;.update-of a&quot;,
-                                :href =&gt; &quot;/recipes/#{@permalink_identified_by[ingredient]}&quot;)
+                                :href =&gt; &quot;/recipes/#{@permalink_identified_by[ingredient].gsub(/-/, '/')}&quot;)
 end
 
 Then /^I should see that the recipe was updated by the recipe with &quot;([^\&quot;]*)&quot; in it$/ do |ingredient|</diff>
      <filename>features/step_definitions/recipe_replacement.rb</filename>
    </modified>
    <modified>
      <diff>@@ -69,10 +69,15 @@ module Eee
       end
     end
 
+    def url_from_permalink(permalink)
+      permalink.split(/-/, 4).join('/')
+    end
+
     def recipe_link(link, title=nil)
       permalink = link.gsub(/\//, '-')
       recipe = JSON.parse(RestClient.get(&quot;#{_db}/#{permalink}&quot;))
-      %Q|&lt;a href=&quot;/recipes/#{recipe['_id'].gsub(/-/, '/')}&quot;&gt;#{title || recipe['title']}&lt;/a&gt;|
+      url = &quot;/recipes/&quot; + url_from_permalink(recipe['_id'])
+      %Q|&lt;a href=&quot;#{url}&quot;&gt;#{title || recipe['title']}&lt;/a&gt;|
     end
 
     def meal_link(link, title=nil)
@@ -282,7 +287,8 @@ _EOM
       if previous
         links = previous.map do |update_permalink|
           date_str = Date.parse(update_permalink).strftime(&quot;%B %e, %Y&quot;)
-          %Q|&lt;a href=&quot;/recipes/#{update_permalink}&quot;&gt;#{date_str}&lt;/a&gt;|
+          url = &quot;/recipes/&quot; + url_from_permalink(update_permalink)
+          %Q|&lt;a href=&quot;#{url}&quot;&gt;#{date_str}&lt;/a&gt;|
         end
 
         %Q|&lt;span class=&quot;update-of&quot;&gt;| +
@@ -324,7 +330,7 @@ _EOM
       if ids &amp;&amp; ids.size &gt; 0
         %Q|&lt;span class=&quot;label&quot;&gt;Alternate Preparations:&lt;/span&gt; | +
         couch_recipe_titles(ids).
-          map{ |recipe| %Q|&lt;a href=&quot;/recipes/#{recipe[:id]}&quot;&gt;#{recipe[:title]}&lt;/a&gt;|}.
+          map{ |recipe| %Q|&lt;a href=&quot;/recipes/#{url_from_permalink(recipe[:id])}&quot;&gt;#{recipe[:title]}&lt;/a&gt;|}.
           join(&quot;, &quot;)
       end
     end</diff>
      <filename>helpers.rb</filename>
    </modified>
    <modified>
      <diff>@@ -520,7 +520,7 @@ describe &quot;recipe_update_of&quot; do
     stub!(:couch_recipe_update_of).and_return(['2000-09-07-recipe'])
     recipe_update_of('2009-09-07-recipe').
       should have_selector('span.update-of a',
-                           :href =&gt; &quot;/recipes/2000-09-07-recipe&quot;)
+                           :href =&gt; &quot;/recipes/2000/09/07/recipe&quot;)
   end
   it &quot;should link to a pretty formatted date&quot; do
     stub!(:couch_recipe_update_of).and_return(['2000-09-07-recipe'])</diff>
      <filename>spec/eee_helpers_spec.rb</filename>
    </modified>
    <modified>
      <diff>@@ -50,14 +50,14 @@ describe &quot;recipe.haml&quot; do
   it &quot;should link to previous recipe&quot; do
     render(&quot;/views/recipe.haml&quot;)
     response.should have_selector(&quot;a&quot;,
-                                  :href =&gt; &quot;/recipes/2009-06-01-foo&quot;,
+                                  :href =&gt; &quot;/recipes/2009/06/01/foo&quot;,
                                   :content =&gt; &quot;June  1, 2009&quot;)
   end
 
   it &quot;should link to previous recipe title&quot; do
     render(&quot;/views/recipe.haml&quot;)
     response.should have_selector(&quot;a&quot;,
-                                  :href =&gt; &quot;/recipes/2009-06-01-foo&quot;,
+                                  :href =&gt; &quot;/recipes/2009/06/01/foo&quot;,
                                   :content =&gt; &quot;Foo&quot;)
   end
 </diff>
      <filename>spec/views/recipe.haml_spec.rb</filename>
    </modified>
    <modified>
      <diff>@@ -15,9 +15,9 @@
 
 %div.navigation
   &amp;lsaquo;
-  =link_to_adjacent_view_date(@recipe['date'], @recipes_by_date, :previous =&gt; true) { |k, r| Date.parse(r['date']).strftime(%Q|&lt;a id=&quot;previous-recipe&quot; href=&quot;/recipes/#{r['id']}&quot;&gt;#{r['title']} (%B %e, %Y)&lt;/a&gt;|) }
+  =link_to_adjacent_view_date(@recipe['date'], @recipes_by_date, :previous =&gt; true) { |k, r| Date.parse(r['date']).strftime(%Q|&lt;a id=&quot;previous-recipe&quot; href=&quot;/recipes/#{url_from_permalink(r['id'])}&quot;&gt;#{r['title']} (%B %e, %Y)&lt;/a&gt;|) }
   |
-  =link_to_adjacent_view_date(@recipe['date'], @recipes_by_date) { |k, r| Date.parse(r['date']).strftime(%Q|&lt;a id=&quot;next-recipe&quot; href=&quot;/recipes/#{r['id']}&quot;&gt;#{r['title']} (%B %e, %Y)&lt;/a&gt;|) }
+  =link_to_adjacent_view_date(@recipe['date'], @recipes_by_date) { |k, r| Date.parse(r['date']).strftime(%Q|&lt;a id=&quot;next-recipe&quot; href=&quot;/recipes/#{url_from_permalink(r['id'])}&quot;&gt;#{r['title']} (%B %e, %Y)&lt;/a&gt;|) }
   &amp;rsaquo;
 
 #recipe-meta</diff>
      <filename>views/recipe.haml</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>d4cec1a25672d250fca8c9bb03a83c864b0135c2</id>
    </parent>
  </parents>
  <author>
    <name>eee-c</name>
    <email>eee.c@eeecooks.com</email>
  </author>
  <url>http://github.com/eee-c/eee-code/commit/8a8889f65521fd3339d2aa1a7b098bd145754c9f</url>
  <id>8a8889f65521fd3339d2aa1a7b098bd145754c9f</id>
  <committed-date>2009-10-16T01:50:37-07:00</committed-date>
  <authored-date>2009-10-16T01:50:37-07:00</authored-date>
  <message>Changes in response to converting the recipe URLs from /recipes/YYYY-MM-DD-short_name to /recipes/YYYY/MM/DD/short_name.</message>
  <tree>1b469237437052bac81132f19451b2a1fa13bc0d</tree>
  <committer>
    <name>eee-c</name>
    <email>eee.c@eeecooks.com</email>
  </committer>
</commit>
