<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array">
    <added>
      <filename>bin/ginger</filename>
    </added>
    <added>
      <filename>ginger_scenarios.rb</filename>
    </added>
  </added>
  <modified type="array">
    <modified>
      <diff>@@ -1,4 +1,5 @@
+.ginger
 .DS_Store
 coverage
 doc
-pkg/*
\ No newline at end of file
+pkg/*</diff>
      <filename>.gitignore</filename>
    </modified>
    <modified>
      <diff>@@ -1,39 +1,42 @@
 begin
   require 'echoe'
- 
+
   Echoe.new('exceptional', '0.0.6') do |p|
     p.rubyforge_name = 'exceptional'
-    p.summary      = &quot;Exceptional is the core Ruby library for communicating with http://getexceptional.com (hosted error tracking service)&quot;
-    p.description  = &quot;Exceptional is the core Ruby library for communicating with http://getexceptional.com (hosted error tracking service)&quot;
-    p.url          = &quot;http://getexceptional.com/&quot;
-    p.author       = [&quot;Contrast&quot;]
-    p.email        = &quot;hello@contrast.ie&quot;
+    p.summary = &quot;Exceptional is the core Ruby library for communicating with http://getexceptional.com (hosted error tracking service)&quot;
+    p.description = &quot;Exceptional is the core Ruby library for communicating with http://getexceptional.com (hosted error tracking service)&quot;
+    p.url = &quot;http://getexceptional.com/&quot;
+    p.author = [&quot;Contrast&quot;]
+    p.email = &quot;hello@contrast.ie&quot;
     p.dependencies = [&quot;json&quot;]
   end
- 
 rescue LoadError =&gt; e
   puts &quot;You are missing a dependency required for meta-operations on this gem.&quot;
   puts &quot;#{e.to_s.capitalize}.&quot;
 end
- 
 # add spec tasks, if you have rspec installed
 begin
   require 'spec/rake/spectask'
- 
   Spec::Rake::SpecTask.new(&quot;spec&quot;) do |t|
     t.spec_files = FileList['spec/**/*_spec.rb']
     t.spec_opts = ['--color']
   end
-  
+
   task :test do
     Rake::Task['spec'].invoke
   end
-  
+
   Spec::Rake::SpecTask.new(&quot;coverage&quot;) do |t|
     t.spec_files = FileList['spec/**/*_spec.rb']
     t.spec_opts = ['--color']
     t.rcov = true
     t.rcov_opts = ['--exclude', '^spec,/gems/']
   end
-  
+end
+
+desc 'Run specs using ginger'
+task :ginger do
+  ARGV.clear
+  ARGV &lt;&lt; 'spec'
+  load File.join(*%w[bin ginger])
 end
\ No newline at end of file</diff>
      <filename>Rakefile</filename>
    </modified>
    <modified>
      <diff>@@ -31,4 +31,4 @@ Gem::Specification.new do |s|
   else
     s.add_dependency(%q&lt;json&gt;, [&quot;&gt;= 0&quot;])
   end
-end
+end
\ No newline at end of file</diff>
      <filename>exceptional.gemspec</filename>
    </modified>
    <modified>
      <diff>@@ -9,7 +9,6 @@ require 'exceptional/api'
 require 'exceptional/bootstrap'
 
 module Exceptional
-
   class &lt;&lt; self
     include Exceptional::Config
     include Exceptional::Api</diff>
      <filename>lib/exceptional.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,8 +1,6 @@
 require 'json' unless defined? Rails
 
-
 module Exceptional
-
   module Api
     # parse an exception into an ExceptionData object
     def parse(exception)</diff>
      <filename>lib/exceptional/api.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,14 +1,11 @@
 if defined? ActiveSupport
-  
-  # Hack to force Rails version prior to 2.0 to use quoted JSON as per the JSON standard... (TODO: could be cleaner!)
+  # Hack to force Rails version prior to 2.0 to use quoted JSON as per the JSON standard...
   if (defined?(ActiveSupport::JSON) &amp;&amp; ActiveSupport::JSON.respond_to?(:unquote_hash_key_identifiers))
     ActiveSupport::JSON.unquote_hash_key_identifiers = false 
   end
-
 end
 
 if defined? ActionController
-
   module ActionController
     class Base
     
@@ -28,5 +25,4 @@ if defined? ActionController
       protected :rescue_action
     end
   end
-
 end
\ No newline at end of file</diff>
      <filename>lib/exceptional/integration/rails.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,12 +1,9 @@
 require File.dirname(__FILE__) + '/spec_helper'
 
-
 describe Exceptional::Api do
-
-
   describe &quot;with no configuration&quot; do
     before(:each) do
-    Exceptional.stub!(:to_stderr) # Don't print error when testing
+      Exceptional.stub!(:to_stderr) # Don't print error when testing
     end
 
     after(:each) do
@@ -23,37 +20,33 @@ describe Exceptional::Api do
 
     it &quot;should parse exception into exception data object&quot; do
       exception = mock(Exception, :message =&gt; &quot;Something bad has happened&quot;,
-      :backtrace =&gt; [&quot;/app/controllers/buggy_controller.rb:29:in `index'&quot;])
+                       :backtrace =&gt; [&quot;/app/controllers/buggy_controller.rb:29:in `index'&quot;])
       exception_data = Exceptional.parse(exception)
       exception_data.kind_of?(Exceptional::ExceptionData).should be_true
       exception_data.exception_message.should == exception.message
       exception_data.exception_backtrace.should == exception.backtrace
       exception_data.exception_class.should == exception.class.to_s
-
-
     end
 
     it &quot;should post exception&quot; do
-
       exception_data = mock(Exceptional::ExceptionData,
-      :message =&gt; &quot;Something bad has happened&quot;,
-      :backtrace =&gt; [&quot;/app/controllers/buggy_controller.rb:29:in `index'&quot;],
-      :class =&gt; Exception, :to_hash =&gt; { :message =&gt; &quot;Something bad has happened&quot; })
+                            :message =&gt; &quot;Something bad has happened&quot;,
+                            :backtrace =&gt; [&quot;/app/controllers/buggy_controller.rb:29:in `index'&quot;],
+                            :class =&gt; Exception, :to_hash =&gt; { :message =&gt; &quot;Something bad has happened&quot; })
       Exceptional.api_key = &quot;TEST_API_KEY&quot;
       Exceptional.should_receive(:authenticate).once.and_return(true)
       Exceptional.should_receive(:call_remote, :with =&gt; [:errors, exception_data]).once
       Exceptional.post(exception_data)
-
     end
 
     it &quot;should catch exception&quot; do
       exception = mock(Exception, :message =&gt; &quot;Something bad has happened&quot;,
-      :backtrace =&gt; [&quot;/app/controllers/buggy_controller.rb:29:in `index'&quot;])
+                       :backtrace =&gt; [&quot;/app/controllers/buggy_controller.rb:29:in `index'&quot;])
 
       exception_data = mock(Exceptional::ExceptionData,
-      :message =&gt; &quot;Something bad has happened&quot;,
-      :backtrace =&gt; [&quot;/app/controllers/buggy_controller.rb:29:in `index'&quot;],
-      :class =&gt; Exception, :to_hash =&gt; { :message =&gt; &quot;Something bad has happened&quot; })
+                            :message =&gt; &quot;Something bad has happened&quot;,
+                            :backtrace =&gt; [&quot;/app/controllers/buggy_controller.rb:29:in `index'&quot;],
+                            :class =&gt; Exception, :to_hash =&gt; { :message =&gt; &quot;Something bad has happened&quot; })
       exception_data.should_receive(:controller_name=).with(File.basename($0))
 
       Exceptional.should_receive(:parse, :with =&gt; [exception]).and_return(exception_data)
@@ -64,35 +57,33 @@ describe Exceptional::Api do
 
     it &quot;should raise a license exception if api key is not set&quot; do
       exception_data = mock(Exceptional::ExceptionData,
-      :message =&gt; &quot;Something bad has happened&quot;,
-      :backtrace =&gt; [&quot;/app/controllers/buggy_controller.rb:29:in `index'&quot;],
-      :class =&gt; Exception,
-      :to_hash =&gt; { :message =&gt; &quot;Something bad has happened&quot; })
+                            :message =&gt; &quot;Something bad has happened&quot;,
+                            :backtrace =&gt; [&quot;/app/controllers/buggy_controller.rb:29:in `index'&quot;],
+                            :class =&gt; Exception,
+                            :to_hash =&gt; { :message =&gt; &quot;Something bad has happened&quot; })
       Exceptional.api_key.should == nil
       lambda { Exceptional.post(exception_data) }.should raise_error(Exceptional::Config::ConfigurationException)
     end
   end
 
   describe &quot;rescue&quot; do
-
     it &quot;should send exception data onto catch&quot; do
       Exceptional.should_receive(:catch)
       lambda{ Exceptional.rescue do
         raise IOError
       end}.should raise_error(IOError)
-
     end
   end
 
   describe &quot;handle&quot; do
     before(:each) do
-    Exceptional.stub!(:to_stderr) # Don't print error when testing
-    Exceptional.stub!(:log!) # Don't even attempt to log
+      Exceptional.stub!(:to_stderr) # Don't print error when testing
+      Exceptional.stub!(:log!) # Don't even attempt to log
     end
 
     it &quot;should send exception data onto post&quot; do
       exception = mock(Exception, :message =&gt; &quot;Something bad has happened&quot;,
-      :backtrace =&gt; &quot;/app/controllers/buggy_controller.rb:29:in `index'&quot;)
+                       :backtrace =&gt; &quot;/app/controllers/buggy_controller.rb:29:in `index'&quot;)
 
       controller = mock(&quot;controller&quot;, :controller_name =&gt; &quot;Test Controller Name&quot;, :action_name =&gt; &quot;Test Action Name&quot;)
 
@@ -119,20 +110,20 @@ describe Exceptional::Api do
     end
 
     it &quot;safe_environment() should handle array type parameters&quot; do
-      
-      request = mock(request, :env =&gt; { 
-          'string_array_var' =&gt; ['value', 'another value'], 
-          'bool_array_var' =&gt; [false, false, true],
-          'numb_array_var' =&gt; [3,2,1],
-          'nil_array_var' =&gt; [nil, nil],
-          'non_ack' =&gt; 'value2' }
-          )
-      Exceptional.send(:safe_environment, request).should == { 
-        'string_array_var' =&gt; ['value', 'another value'], 
-        'bool_array_var' =&gt; [false, false, true],
-        'numb_array_var' =&gt; [3,2,1],
-        'nil_array_var' =&gt; [nil, nil],
-        'non_ack' =&gt; 'value2' }
+
+      request = mock(request, :env =&gt; {
+              'string_array_var' =&gt; ['value', 'another value'],
+              'bool_array_var' =&gt; [false, false, true],
+              'numb_array_var' =&gt; [3, 2, 1],
+              'nil_array_var' =&gt; [nil, nil],
+              'non_ack' =&gt; 'value2' }
+      )
+      Exceptional.send(:safe_environment, request).should == {
+              'string_array_var' =&gt; ['value', 'another value'],
+              'bool_array_var' =&gt; [false, false, true],
+              'numb_array_var' =&gt; [3, 2, 1],
+              'nil_array_var' =&gt; [nil, nil],
+              'non_ack' =&gt; 'value2' }
 
     end
 
@@ -144,7 +135,6 @@ describe Exceptional::Api do
       Exceptional.send(:safe_session, mock_session).should == { 'var1' =&gt; ['value', 'another value'], 'var2' =&gt; 'value2' }
     end
 
-
     it &quot;safe_session() should filter all /db/, /cgi/ variables and sub @ for blank&quot; do
       class SessionHelper
         def initialize
@@ -158,54 +148,35 @@ describe Exceptional::Api do
       Exceptional.send(:safe_session, session).should == { 'some_var' =&gt; 1 }
     end
 
-    it &quot;sanitize_hash() should sanitize cyclic problem for to_json&quot; do
-      class MyClass
-        def initialize
-          @test = self
-        end
+    class ClassWithCircularReferenceToHash
+      def initialize
+        @test = self
+      end
 
-        def to_hash
-          { :test =&gt; self }
-        end
+      def to_hash
+        { :test =&gt; self }
       end
-      my_class = MyClass.new
-      
-      lambda { my_class.to_json }.should raise_error(ActiveSupport::JSON::CircularReferenceError)
-      Exceptional.send(:sanitize_hash, my_class.to_hash).to_json.should == &quot;{}&quot;
     end
-    
+
+    it &quot;sanitize_hash() should sanitize cyclic problem for to_json&quot; do
+      circular = ClassWithCircularReferenceToHash.new
+
+      lambda { circular.to_json }.should raise_error
+      Exceptional.send(:sanitize_hash, circular.to_hash).to_json.should == &quot;{}&quot;
+    end
+
     it &quot;sanitize_hash() should sanitize cyclic problem for to_json passing hash&quot; do
-      class MyClass
-        def initialize
-          @test = self
-        end
+      circular = ClassWithCircularReferenceToHash.new
 
-        def to_hash
-          { :test =&gt; self }
-        end
-      end
-      my_class = MyClass.new
-      
-      
-      lambda { my_class.to_json }.should raise_error(ActiveSupport::JSON::CircularReferenceError)
-      Exceptional.send(:sanitize_hash, {'hkey' =&gt; my_class}).to_json.should == &quot;{}&quot;
+      lambda { circular.to_json }.should raise_error
+      Exceptional.send(:sanitize_hash, {'hkey' =&gt; circular}).to_json.should == &quot;{}&quot;
     end
-    
+
     it &quot;sanitize_hash() should sanitize cyclic problem for to_json passing hash mult params&quot; do
-      class MyClass
-        def initialize
-          @test = self
-        end
+      circular = ClassWithCircularReferenceToHash.new
 
-        def to_hash
-          { :test =&gt; self }
-        end
-      end
-      my_class = MyClass.new
-      
-      
-      lambda { my_class.to_json }.should raise_error(ActiveSupport::JSON::CircularReferenceError)
-      Exceptional.send(:sanitize_hash, {'hkey' =&gt; my_class, 'ruby' =&gt; 'tuesday'}).to_json.should == &quot;{\&quot;ruby\&quot;: \&quot;tuesday\&quot;}&quot;
+      lambda { circular.to_json }.should raise_error
+      Exceptional.send(:sanitize_hash, {'hkey' =&gt; circular, 'ruby' =&gt; 'tuesday'}).should == {'ruby' =&gt; 'tuesday'}
     end
   end
 end</diff>
      <filename>spec/api_spec.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,11 +1,7 @@
 require File.dirname(__FILE__) + '/spec_helper'
 
-
 describe Exceptional::Bootstrap do
-
-
   describe &quot;setup&quot; do
-
     TEST_ENVIRONMENT= &quot;development&quot;
 
     it &quot;should initialize the config and log&quot; do
@@ -32,7 +28,6 @@ describe Exceptional::Bootstrap do
       Exceptional.should_not_receive(:authenticate)
       STDERR.should_not_receive(:puts) # Will silently not enable itself
 
-
       Exceptional.bootstrap(TEST_ENVIRONMENT, File.dirname(__FILE__))
     end
 
@@ -55,4 +50,4 @@ describe Exceptional::Bootstrap do
       Exceptional.bootstrap(TEST_ENVIRONMENT, File.dirname(__FILE__))
     end
   end
-end
+end
\ No newline at end of file</diff>
      <filename>spec/bootstrap_spec.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,10 +1,7 @@
 require File.dirname(__FILE__) + '/spec_helper'
 
-
 describe Exceptional::Config do
-  
   before(:all) do
-
     def Exceptional.reset_state
       @api_key = nil
       @ssl_enabled = nil
@@ -14,7 +11,6 @@ describe Exceptional::Config do
       @remote_host = nil
       @applicaton_root = nil
     end
-    
   end
 
   after(:each) do
@@ -27,7 +23,6 @@ describe Exceptional::Config do
   end
   
   describe &quot;default configuration&quot; do
-    
     it &quot;should use port 80 by default if ssl not enabled&quot; do
       Exceptional.ssl_enabled?.should be_false
       Exceptional.remote_port.should == 80
@@ -67,7 +62,6 @@ describe Exceptional::Config do
   end
 
   describe &quot;load config&quot; do
-
     it &quot;error during config file loading raises configuration exception&quot; do
       File.should_receive(:open).once.and_raise(IOError)
       </diff>
      <filename>spec/config_spec.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,9 +1,7 @@
 require File.dirname(__FILE__) + '/spec_helper'
 
 describe Exceptional::ExceptionData do
-  
   describe &quot;with valid base data&quot; do
-    
     before(:each) do
       @exception_data = Exceptional::ExceptionData.new
       @exception_data.exception_class = &quot;Error&quot;
@@ -28,7 +26,5 @@ describe Exceptional::ExceptionData do
     it &quot;should convert to json&quot; do
       @exception_data.to_json.class.should == String
     end
-    
   end
-  
 end
\ No newline at end of file</diff>
      <filename>spec/exception_data_spec.rb</filename>
    </modified>
    <modified>
      <diff>@@ -2,40 +2,38 @@ require File.dirname(__FILE__) + '/spec_helper'
 require 'action_controller'
 require File.join(File.dirname(__FILE__), '..', 'lib', 'exceptional', 'integration', 'rails')
 
-class MyException &lt; Exception; end
-class SpecialException &lt; Exception; end
-class RescueFromController &lt; ActionController::Base
-  rescue_from MyException, :with =&gt; :my_handler 
-  
-  def my_handler
-    return 'test'
-  end
-  
-  def my_action
-    raise MyException
-  end
-  
-end
+if ActionController::Base.respond_to?(:rescue_from)
+  # pre 2.0 versions of rails don't have rescue_from so there's no contention
+  class MyException &lt; Exception;end
+  class SpecialException &lt; Exception;end
+
+  class RescueFromController &lt; ActionController::Base
+    rescue_from MyException, :with =&gt; :my_handler
 
-describe &quot;Exceptional with rescue_from() support&quot; do
-  before(:each) do
-    @controller = RescueFromController.new
+    def my_handler
+      true
+    end
   end
 
-  it &quot;should not call Exceptional&quot; do
-    @controller.should_receive(:rescue_action_without_exceptional).and_return(true)
-    if Gem::Requirement.create(&quot;&gt;=2.2.0&quot;).satisfied_by?(Gem.loaded_specs['rails'].version)
-      Exceptional.should_not_receive(:handle)
-    else
+  describe &quot;Exceptional with rescue_from() support&quot; do
+    before(:each) do
+      @controller = RescueFromController.new
+    end
+
+    it &quot;should not call Exceptional&quot; do
+      @controller.should_receive(:rescue_action_without_exceptional).and_return(true)
+      if Gem::Requirement.create(&quot;&gt;=2.2.0&quot;).satisfied_by?(Gem.loaded_specs['rails'].version)
+        Exceptional.should_not_receive(:handle)
+      else
+        Exceptional.should_receive(:handle)
+      end
+      @controller.send(:rescue_action, MyException.new(&quot;test&quot;)).should == true
+    end
+
+    it &quot;should call Exceptional&quot; do
       Exceptional.should_receive(:handle)
+      @controller.should_receive(:rescue_action_without_exceptional).and_return(true)
+      @controller.send(:rescue_action, SpecialException.new(&quot;test&quot;)).should == true
     end
-    @controller.send(:rescue_action, MyException.new(&quot;test&quot;)).should == true
-  end
-  
-  it &quot;should call Exceptional&quot; do
-    Exceptional.should_receive(:handle)
-    @controller.should_receive(:rescue_action_without_exceptional).and_return(true)
-    @controller.send(:rescue_action, SpecialException.new(&quot;test&quot;)).should == true
   end
-  
 end
\ No newline at end of file</diff>
      <filename>spec/exceptional_rescue_from_spec.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,8 +1,6 @@
 require File.dirname(__FILE__) + '/spec_helper'
 
-
 describe Exceptional do
-
   describe &quot;with no configuration&quot; do
     before(:each) do
       Exceptional.stub!(:to_stderr) # Don't print error when testing
@@ -21,5 +19,4 @@ describe Exceptional do
       lambda { Exceptional.post_exception(exception_data) }.should raise_error(Exceptional::Config::ConfigurationException)
     end
   end
-  
 end
\ No newline at end of file</diff>
      <filename>spec/exceptional_spec.rb</filename>
    </modified>
    <modified>
      <diff>@@ -5,14 +5,12 @@ describe Exceptional::Log do
   TEST_LOG_MESSAGE = &quot;Test-log-message&quot;
 
   it &quot;uninitialized should only log to STDERR&quot; do
-    
     STDERR.should_receive(:puts)
     Logger.should_not_receive(:send)
     Exceptional.log! TEST_LOG_MESSAGE
   end
 
   it &quot;initialized should log to both STDERR and log file&quot; do
-    
     mock_log = mock(&quot;log&quot;)
     mock_log.should_receive(:level=)
     </diff>
      <filename>spec/log_spec.rb</filename>
    </modified>
    <modified>
      <diff>@@ -27,7 +27,6 @@ describe Exceptional::Remote do
   end
 
   describe &quot;authentication&quot; do
-
     it &quot;should not be authenticated if API authentication unsuccessful&quot; do
       Exceptional.api_key = TEST_API_KEY
 
@@ -69,9 +68,7 @@ describe Exceptional::Remote do
   end
 
   describe &quot;sending data &quot; do
-
     it &quot;should return response body if successful&quot; do
-
       OK_RESPONSE_BODY = &quot;OK-RESP-BODY&quot;
       
       Exceptional.api_key = TEST_API_KEY
@@ -92,7 +89,6 @@ describe Exceptional::Remote do
     end
     
     it &quot;should raise error if network problem during sending exception&quot; do
-
       Exceptional.api_key = TEST_API_KEY
       Exceptional.authenticated?.should be_false
 
@@ -112,7 +108,6 @@ describe Exceptional::Remote do
     end
 
     it &quot;should raise Exception if sending exception unsuccessful&quot; do
-
       Exceptional.api_key = TEST_API_KEY
       Exceptional.authenticated?.should be_false
 </diff>
      <filename>spec/remote_spec.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,13 +1,7 @@
-require 'rubygems'
-
-if ENV['RAILS_VER']
-  gem 'rails', &quot;=#{ENV['RAILS_VER']}&quot;
-else
-  gem 'rails'
+begin
+  require 'ginger'
+rescue LoadError
 end
-
-# TODO couple of different ways to test parts of exceptional with Rails (or a mock), reconcile them.
-#require 'active_support'
-# module Rails; end # Rails faker
-
+require 'rubygems'
+gem 'rails'
 require File.dirname(__FILE__) + '/../lib/exceptional'</diff>
      <filename>spec/spec_helper.rb</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>fc75a8b99a5dce282f67905d7d2e2f18a21fec8a</id>
    </parent>
  </parents>
  <author>
    <name>Darragh Curran</name>
    <email>darragh@peelmeagrape.net</email>
  </author>
  <url>http://github.com/contrast/exceptional/commit/ef18104da63d174505208d94964ea0581fcb6b3d</url>
  <id>ef18104da63d174505208d94964ea0581fcb6b3d</id>
  <committed-date>2009-09-23T07:52:50-07:00</committed-date>
  <authored-date>2009-09-23T07:52:50-07:00</authored-date>
  <message>Run specs against different versions of rails using ginger (http://github.com/freelancing-god/ginger)</message>
  <tree>0f45eab2c75e6754c0dd2f93e8b110ec91c54aca</tree>
  <committer>
    <name>Darragh Curran</name>
    <email>darragh@peelmeagrape.net</email>
  </committer>
</commit>
