<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array">
    <added>
      <filename>lib/timecop/time_stack_item.rb</filename>
    </added>
    <added>
      <filename>test/test_time_stack_item.rb</filename>
    </added>
  </added>
  <modified type="array">
    <modified>
      <diff>@@ -7,12 +7,11 @@
 
 class Time #:nodoc:
   class &lt;&lt; self
-    # Time we might be behaving as
-    #attr_reader :mock_time
     
     @@mock_offset = nil
     @@mock_time = nil
     
+    # Time we are behaving as
     def mock_time
       if !@@mock_offset.nil?
         now_without_mock_time - @@mock_offset
@@ -53,18 +52,12 @@ end
 if Object.const_defined?(:Date) &amp;&amp; Date.respond_to?(:today)
   class Date #:nodoc:
     class &lt;&lt; self
-      def mock_date
-        now = Time.mock_time
-        return nil if now.nil?
-        Date.new(now.year, now.month, now.day)
-      end
-        
       # Alias the original today
       alias_method :today_without_mock_date, :today
     
       # Define today_with_mock_date
       def today_with_mock_date
-        mock_date || today_without_mock_date
+        Time.now.send(:to_date)
       end
     
       # Alias today to today_with_mock_date
@@ -76,19 +69,12 @@ end
 if Object.const_defined?(:DateTime) &amp;&amp; DateTime.respond_to?(:now)
   class DateTime #:nodoc:
     class &lt;&lt; self
-      def mock_time
-        t_now = Time.mock_time
-        return nil if t_now.nil?
-        offset = Rational(t_now.utc_offset, 60 * 60 * 24)
-        DateTime.new(t_now.year, t_now.month, t_now.day, t_now.hour, t_now.min, t_now.sec, offset)
-      end
-
       # Alias the original now
       alias_method :now_without_mock_time, :now
 
       # Define now_with_mock_time
       def now_with_mock_time
-        mock_time || now_without_mock_time
+        Time.now.send(:to_datetime)
       end
 
       # Alias now to now_with_mock_time</diff>
      <filename>lib/timecop/time_extensions.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,6 +1,6 @@
 require 'singleton'
 require File.join(File.dirname(__FILE__), 'time_extensions')
-require File.join(File.dirname(__FILE__), 'stack_item')
+require File.join(File.dirname(__FILE__), 'time_stack_item')
 
 # Timecop
 # * Wrapper class for manipulating the extensions to the Time, Date, and DateTime objects
@@ -77,10 +77,7 @@ class Timecop
     end
     
     def travel(mock_type, *args, &amp;block) #:nodoc:
-      # parse the arguments, build our base time units
-      year, month, day, hour, minute, second = parse_travel_args(*args)
-
-      stack_item = StackItem.new(mock_type, year, month, day, hour, minute, second)
+      stack_item = TimeStackItem.new(mock_type, *args)
       # perform our action
       freeze_or_move(stack_item)
       
@@ -114,43 +111,9 @@ class Timecop
   
     def freeze_or_move(stack_item) #:nodoc:
       if stack_item.mock_type == :freeze
-        Time.freeze_time(time_for_stack_item(stack_item))
+        Time.freeze_time(stack_item.time)
       else
-        Time.move_time(time_for_stack_item(stack_item))
-      end
-    end
-    
-    def time_for_stack_item(stack_item) #:nodoc:
-      if Time.respond_to?(:zone) &amp;&amp; !Time.zone.nil?
-        # ActiveSupport loaded
-        time = Time.zone.local(stack_item.year, stack_item.month, stack_item.day, stack_item.hour, stack_item.minute, stack_item.second)
-      else 
-        # ActiveSupport not loaded
-        time = Time.local(stack_item.year, stack_item.month, stack_item.day, stack_item.hour, stack_item.minute, stack_item.second)
-      end      
-    end
-        
-    def parse_travel_args(*args) #:nodoc:
-      arg = args.shift
-      if arg.is_a?(Time)
-        arg = arg.getlocal
-        year, month, day, hour, minute, second = arg.year, arg.month, arg.day, arg.hour, arg.min, arg.sec
-      elsif Object.const_defined?(:DateTime) &amp;&amp; arg.is_a?(DateTime)
-        arg = arg.new_offset(DateTime.now_without_mock_time.offset)
-        year, month, day, hour, minute, second = arg.year, arg.month, arg.day, arg.hour, arg.min, arg.sec
-      elsif Object.const_defined?(:Date) &amp;&amp; arg.is_a?(Date)
-        year, month, day, hour, minute, second = arg.year, arg.month, arg.day, 0, 0, 0
-      elsif args.empty? &amp;&amp; arg.kind_of?(Integer)
-        t = Time.now + arg
-        year, month, day, hour, minute, second = t.year, t.month, t.day, t.hour, t.min, t.sec
-      else # we'll just assume it's a list of y/m/h/d/m/s
-        year   = arg        || 0
-        month  = args.shift || 1
-        day    = args.shift || 1
-        hour   = args.shift || 0
-        minute = args.shift || 0
-        second = args.shift || 0
+        Time.move_time(stack_item.time)
       end
-      return year, month, day, hour, minute, second
     end
 end</diff>
      <filename>lib/timecop/timecop.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,7 +1,7 @@
 #!/bin/sh
 
-echo &quot;\033[1;81m Running test_timecop_internals...\033[0m&quot;
-ruby test_timecop_internals.rb || (echo &quot;FAILED!!!!!!!!!!!!&quot;)
+echo &quot;\033[1;81m Running test_time_stack_item...\033[0m&quot;
+ruby test_time_stack_item.rb || (echo &quot;FAILED!!!!!!!!!!!!&quot;)
 
 echo &quot;\033[1;81m Running test_timecop_without_date...\033[0m&quot;
 ruby test_timecop_without_date.rb || (echo &quot;FAILED!!!!!!!!!!!!&quot;)</diff>
      <filename>test/run_tests.sh</filename>
    </modified>
    <modified>
      <diff>@@ -160,26 +160,26 @@ class TestTimecop &lt; Test::Unit::TestCase
       t = DateTime.parse(&quot;2009-10-11 00:38:00 +0200&quot;)
       assert_equal &quot;+02:00&quot;, t.zone
       Timecop.freeze(t) do
-        assert_equal t, DateTime.now
+        assert_equal t, DateTime.now.new_offset(t.offset), &quot;Failed for timezone: #{ENV['TZ']}: #{t.to_s} not equal to #{DateTime.now.new_offset(t.offset).to_s}&quot;
       end
     end
   end
   
   def test_freeze_with_datetime_on_specific_timezone_not_during_dst
     each_timezone do
-      t = DateTime.parse(&quot;2009-11-11 00:38:00 +0200&quot;)
+      t = DateTime.parse(&quot;2009-12-11 00:38:00 +0200&quot;)
       assert_equal &quot;+02:00&quot;, t.zone
       Timecop.freeze(t) do
-        assert_equal t, DateTime.now
+        assert_equal t, DateTime.now.new_offset(t.offset), &quot;Failed for timezone: #{ENV['TZ']}&quot;
       end
-    end    
+    end
   end
 
   def test_mocked_date_time_now_is_local
     each_timezone do
       t = DateTime.parse(&quot;2009-10-11 00:38:00 +0200&quot;)
       Timecop.freeze(t) do
-        assert_equal local_offset, DateTime.now.offset
+        assert_equal local_offset, DateTime.now.offset, &quot;Failed for timezone: #{ENV['TZ']}&quot;
       end
     end
   end
@@ -189,7 +189,7 @@ class TestTimecop &lt; Test::Unit::TestCase
       t = Time.utc(2008, 10, 10, 10, 10, 10)
       local = t.getlocal
       Timecop.freeze(t) do
-        assert_equal local, Time.now
+        assert_equal local, Time.now, &quot;Failed for timezone: #{ENV['TZ']}&quot;
       end
     end
   end</diff>
      <filename>test/test_timecop.rb</filename>
    </modified>
  </modified>
  <removed type="array">
    <removed>
      <filename>lib/timecop/stack_item.rb</filename>
    </removed>
    <removed>
      <filename>test/test_timecop_internals.rb</filename>
    </removed>
  </removed>
  <parents type="array">
    <parent>
      <id>fbc0edc31b6eb04311ff717cafe5797de54d3c4d</id>
    </parent>
  </parents>
  <author>
    <name>John Trupiano</name>
    <email>jtrupiano@gmail.com</email>
  </author>
  <url>http://github.com/jtrupiano/timecop/commit/db8829ba0ccd41178b3d2b5d75dd4da2b96e5a15</url>
  <id>db8829ba0ccd41178b3d2b5d75dd4da2b96e5a15</id>
  <committed-date>2009-11-03T13:39:43-08:00</committed-date>
  <authored-date>2009-11-03T13:38:36-08:00</authored-date>
  <message>Simplify time_extensions, refactor StackItem to TimeStackItem
and push responsibility for parsing #travel calls into
TimeStackItem.</message>
  <tree>a887eb7e03bd20e5c8b3c4be14740ed24114bcf1</tree>
  <committer>
    <name>John Trupiano</name>
    <email>jtrupiano@gmail.com</email>
  </committer>
</commit>
