<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -413,11 +413,10 @@ end
 
 helper :distance_of_time do |from_time, to_time|
   # this is a dumbed-down version of actionpack's helper.
-  from_time = from_time.to_time if from_time.respond_to?(:to_time)
-  to_time = to_time.to_time if to_time.respond_to?(:to_time)
+  from_time = Time.parse(from_time) if from_time.is_a?(String)
+  to_time   = Time.parse(to_time) if to_time.is_a?(String)
 
   distance_in_minutes = (((to_time - from_time).abs)/60).round
-
   words = case distance_in_minutes
           when 0               then &quot;less than 1 minute&quot;
           when 2..44           then &quot;%d minutes&quot; % distance_in_minutes</diff>
      <filename>lib/commands/helpers.rb</filename>
    </modified>
    <modified>
      <diff>@@ -27,8 +27,8 @@ describe &quot;github issues&quot; do
       stdout.should == &lt;&lt;-EOS.gsub(/^      /, '')
       -----
       Issue #1 (0 votes): members.json 500 error
-      *  Opened about 19 hours ago by kdmny
-      *  Last updated about 18 hours ago
+      *  Opened about 10 hours ago by bug_finder
+      *  Last updated 5 minutes ago
       
       I have a nasty bug.
       -----
@@ -43,9 +43,9 @@ describe &quot;github issues&quot; do
       stdout.should == &lt;&lt;-EOS.gsub(/^      /, '')
       -----
       Issue #1 (0 votes): members.json 500 error
-      *  Opened about 19 hours ago by kdmny
-      *  Closed about 18 hours ago
-      *  Last updated about 18 hours ago
+      *  Opened about 10 hours ago by bug_finder
+      *  Closed 5 minutes ago
+      *  Last updated 5 minutes ago
       
       I have a nasty bug.
       -----
@@ -68,24 +68,29 @@ describe &quot;github issues&quot; do
   end
   
   class CommandHelper::Runner
-    def mock_issues_for(state = &quot;open&quot;, user = &quot;user&quot;, project = &quot;project&quot;)
+    def mock_issues_for(state = &quot;open&quot;, options = {})
+      options[:updated_at] = 5.minutes.ago
+      options[:closed_at]  = 5.minutes.ago
+      options[:created_at] = 10.hours.ago
+      options[:user]       = &quot;user&quot;
+      options[:project]    = &quot;project&quot;
       yaml = &lt;&lt;-YAML.gsub(/^    /, '')
       --- 
       issues: 
       - number: 1
         votes: 0
-        created_at: 2009-11-04 20:25:02 -08:00
+        created_at: #{options[:created_at].strftime(&quot;%Y-%m-%d %H:%M:%S %z&quot;)}
         body: |-
           I have a nasty bug.
         title: members.json 500 error
-        updated_at: 2009-11-04 21:26:39 -08:00
-        #{&quot;closed_at: 2009-11-04 21:25:17 -08:00&quot; if state == &quot;closed&quot;}
-        user: kdmny
+        updated_at: #{options[:updated_at].strftime(&quot;%Y-%m-%d %H:%M:%S %z&quot;)}
+        #{&quot;closed_at: #{options[:closed_at].strftime(&quot;%Y-%m-%d %H:%M:%S %z&quot;)}&quot; if state == &quot;closed&quot;}
+        user: bug_finder
         labels: []
 
         state: #{state}
       YAML
-      api_url = &quot;http://github.com/api/v2/yaml/issues/list/#{user}/#{project}/#{state}&quot;
+      api_url = &quot;http://github.com/api/v2/yaml/issues/list/#{options[:user]}/#{options[:project]}/#{state}&quot;
       @command.should_receive(:open).with(api_url).and_return(yaml)
     end
   end</diff>
      <filename>spec/commands/command_issues_spec.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,5 +1,6 @@
 require 'rubygems'
 require 'spec'
+require 'activerecord'
 
 require File.dirname(__FILE__) + '/../lib/github'
 </diff>
      <filename>spec/spec_helper.rb</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>b5166fce5364265db530aec40e3268762674c537</id>
    </parent>
  </parents>
  <author>
    <name>Dr Nic Williams</name>
    <email>drnicwilliams@gmail.com</email>
  </author>
  <url>http://github.com/defunkt/github-gem/commit/ad96bb21aea6c17aa6572a3aaaf0efeeef8532bb</url>
  <id>ad96bb21aea6c17aa6572a3aaaf0efeeef8532bb</id>
  <committed-date>2009-11-05T16:57:57-08:00</committed-date>
  <authored-date>2009-11-05T16:57:57-08:00</authored-date>
  <message>Using Time.parse on the yaml timestamps from issues to ensure correct parsing against time zones</message>
  <tree>c651cfdee065d4ba50169f3b941421daea1b3b62</tree>
  <committer>
    <name>Dr Nic Williams</name>
    <email>drnicwilliams@gmail.com</email>
  </committer>
</commit>
