<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -1,11 +1,16 @@
 HyperactiveResource
 ===================
 
-Many have said that ActiveResource is not really &quot;complete&quot;. On the surface, this means that some features that are documented aren't implemented. Digging a little deeper, we find that some features that should exist don't.
+Many have said that ActiveResource is not really &quot;complete&quot;. On the surface,
+this means that some features that are documented aren't implemented. Digging a
+little deeper, we find that some features that should exist don't.
 
-Arguably, a &quot;complete&quot; ActiveResource would behave like ActiveRecord or, as the rdoc for ActiveResource states &quot;very similarly to Active Record&quot;.
+Arguably, a &quot;complete&quot; ActiveResource would behave like ActiveRecord or, as the
+rdoc for ActiveResource states &quot;very similarly to Active Record&quot;.
 
-Hyperactive Resource is MDL's extension to ActiveResource::Base written to support our Patient Registry and goes a long way towards the goal of an ActiveResource that behaves like ActiveRecord.
+Hyperactive Resource is MDL's extension to ActiveResource::Base written to
+support our Patient Registry and goes a long way towards the goal of an
+ActiveResource that behaves like ActiveRecord.
 
 Features
  * Client side validations
@@ -29,7 +34,8 @@ Example
 
  1. Install the plugin via: (insert svn commands here)
 
- 2. Create a HyperactiveResource where you would normally use ActiveResource and define the meta-data/associations that drive the dynamic magic:
+ 2. Create a HyperactiveResource where you would normally use ActiveResource
+    and define the meta-data/associations that drive the dynamic magic:
 
     class Address &lt; HyperactiveResource      
       self.columns = [ :street_address, :city, :zipcode, :home_phone_number ]</diff>
      <filename>README</filename>
    </modified>
    <modified>
      <diff>@@ -1,6 +1,6 @@
 require File.dirname(__FILE__) + '/spec_helper'
 require RAILS_ROOT + '/vendor/rails/activeresource/lib/active_resource/http_mock'
-require &quot;http_mock_mod&quot; 
+require &quot;http_mock_mod&quot;
 
 class TestResource &lt; HyperactiveResource
   self.site = 'http://localhost:3000' #This should never get called
@@ -14,191 +14,191 @@ class Race &lt; HyperactiveResource
   self.site = 'http://localhost:3000' #This should never get called
 end
 
-describe &quot;An active resource that extends abstract resource&quot; do  
+describe &quot;An active resource that extends abstract resource&quot; do
   before(:each) do
-    @it = TestResource.new    
+    @it = TestResource.new
   end
-  
+
   def reset_class_vars
-    @it.instance_eval do 
+    @it.instance_eval do
       self.skip_to_xml_for = []
-      self.has_manys = [] 
+      self.has_manys = []
       self.columns = []
       self.belong_tos = []
       self.nested_resources = []
     end
   end
-  
+
   def mock_xml(type = 'blah')
     {:id =&gt; 1, :name =&gt; type.to_s}.to_xml(:root =&gt; type.to_s)
   end
-  
+
   def mock_post(url = '/test_resources.xml')
     ActiveResource::HttpMock.respond_to do |mock|
       mock.post url, {}, mock_xml, 200
     end
   end
-  
+
   def mock_put(url = '/test_resources/1.xml')
     ActiveResource::HttpMock.respond_to do |mock|
       mock.put url, {}, mock_xml, 200
     end
   end
 
-  it &quot;should be able to find_by_something&quot; do    
+  it &quot;should be able to find_by_something&quot; do
     TestResource.should_receive(:find).with(:first, :params =&gt; { 'something' =&gt; 'SOMETHING' }).and_return(&quot;SOMETHING&quot;)
     TestResource.find_by_something('SOMETHING').should == &quot;SOMETHING&quot;
-  end  
-  
-  it &quot;should be able to find_all_by_something&quot; do    
+  end
+
+  it &quot;should be able to find_all_by_something&quot; do
     TestResource.should_receive(:find).with(:all, :params =&gt; { 'something' =&gt; 'SOMETHING' }).and_return([&quot;SOMETHING&quot;,&quot;ELSE&quot;])
     TestResource.find_all_by_something('SOMETHING').should == [&quot;SOMETHING&quot;,&quot;ELSE&quot;]
   end
-  
+
   it &quot;should not have a nil site variable&quot; do
     TestResource.site.should_not be_nil
   end
-  
+
   it &quot;should behave like active_record and have attributes= do an update rather than a replacement&quot; do
     @it = TestResource.new( :a =&gt; 1 )
     @it.attributes = { 'b' =&gt; 2 } #Aah. it seems that you can't use a symbol when you do this
     @it.a.should == 1
     @it.b.should == 2
   end
-  
-  it &quot;should have a save! method that behaves like active_record and raises as exception if validation fails remotely&quot; do        
+
+  it &quot;should have a save! method that behaves like active_record and raises as exception if validation fails remotely&quot; do
     ActiveResource::HttpMock.respond_to do |mock|
       mock.post '/test_resources.xml', {}, &quot;&lt;errors&gt;&lt;error&gt;Field has invalid characters&lt;/error&gt;&lt;/errors&gt;&quot;, 422
     end
 
     lambda { @it.save! }.should raise_error( RecordNotSaved )
   end
-  
+
   it &quot;should have a save! method that behaves like active_record and raises as exception if validation fails locally&quot; do
-    @it.instance_eval do 
+    @it.instance_eval do
       def validate
         errors.add(&quot;field&quot;, &quot;has invalid characters&quot;)
       end
     end
-    
+
     lambda { @it.save! }.should raise_error( RecordNotSaved )
   end
-  
+
   it &quot;should do local validation before doing an http request&quot; do
-    reset_class_vars    
+    reset_class_vars
     mock_post
-      
+
     @it.should_receive(:validate).and_return(true)
     @it.save
   end
-  
+
   it &quot;'s to_xml should skip attributes that are in the skip list&quot; do
-    @it.instance_eval do 
+    @it.instance_eval do
       self.skip_to_xml_for = [ :enrollments ]
       self.belong_tos = [] #Make sure gender isn't treated as a belong_tos for this spec
     end
     enrollment = mock(:enrollment)
     @it.enrollments = [ enrollment ]
     @it.gender = mock(:gender)
-    
+
     enrollment.should_not_receive(:to_xml)
     @it.gender.should_receive(:to_xml).and_return( mock_xml(:gender) )
-    
+
     @it.to_xml
   end
-  
+
   it &quot;'s to_xml should move id's from associated belong_to objects into blah_id&quot; do
-    @it.instance_eval do 
+    @it.instance_eval do
       self.belong_tos = [ :gender ]
-    end    
-    
+    end
+
     gender_id = '25'
-    @it.gender = mock(:gender, :id =&gt; gender_id)        
-    
+    @it.gender = mock(:gender, :id =&gt; gender_id)
+
     @it.gender.should_not_receive(:to_xml)
-    
+
     REXML::Document.new( @it.to_xml ).elements[&quot;//test-resource/gender-id&quot;].text.should eql( gender_id )
   end
-  
+
   #This is not ideal.. but that's the current spec due to errors serializing arrays of integers
   it &quot;'s to_xml should ignore plural id fields (blah_ids) and assume that :blahs =&gt; [ :blah =&gt; { :id =&gt; will be populated&quot; do
-    @it.instance_eval do 
+    @it.instance_eval do
       self.has_manys = [ :races ]
     end
-        
-    #race_1 = mock(:race, :id =&gt; 1)        
-    #race_2 = mock(:race, :id =&gt; 2)        
-    
+
+    #race_1 = mock(:race, :id =&gt; 1)
+    #race_2 = mock(:race, :id =&gt; 2)
+
     #@it.races = [race_1, race_2]
     #@it.race_ids = [race_1.id, race_2.id]
     @it.race_ids = [1, 2]
-    
+
     @it.race_ids.should_not_receive(:to_xml)
-    
+
     @it.to_xml
   end
-  
-  it &quot;'s save should call before_save and after_save when save is called&quot; do   
+
+  it &quot;'s save should call before_save and after_save when save is called&quot; do
     mock_post
     @it.should_receive(:before_save)
     @it.should_receive(:after_save)
     @it.save
   end
-  
-  it &quot;'s save should call before_validate when validate is called&quot; do   
+
+  it &quot;'s save should call before_validate when validate is called&quot; do
     mock_post
     @it.should_receive(:before_validate)
     @it.send(:validate)
   end
-  
+
   it &quot;'s valid? should clear errors and call validate&quot; do
     @it.errors.should_receive(:clear)
     @it.should_receive(:validate)
-    #@it.parent.should_receive(:valid?).and_return(:true) #It should call super       
+    #@it.parent.should_receive(:valid?).and_return(:true) #It should call super
     @it.valid?.should be_true
-  end  
-  
+  end
+
   it &quot;'s save should save nested resources&quot; do
     mock_post
-    
-    @it.instance_eval do 
+
+    @it.instance_eval do
       self.skip_to_xml_for = [] #Make sure enrollments isn't skipped
       self.has_manys = [ :enrollments ]
       self.nested_resources = [ :enrollment ]
     end
-        
-    @it.enrollments = [ mock(:enrollment), mock(:enrollment) ]    
-    
+
+    @it.enrollments = [ mock(:enrollment), mock(:enrollment) ]
+
     @it.enrollments.each do |enrollment|
       enrollment.should_receive(:to_xml).and_return( mock_xml(:enrollment) )
       enrollment.should_receive(:test_resource_id=).with(1) #An id of 1 will be assigned by the mock_post
       enrollment.should_receive(:save).and_return( true )
     end
-    
+
     @it.save
   end
-  
+
   it &quot;'s update should update/save nested resources&quot; do
     mock_put
-    
-    @it.instance_eval do 
+
+    @it.instance_eval do
       self.skip_to_xml_for = [] #Make sure enrollments isn't skipped
       self.has_manys = [ :enrollments ]
       self.nested_resources = [ :enrollment ]
     end
-        
+
     @it.id = 1
     @it.enrollments = [ mock(:enrollment, :id =&gt; 1), mock(:enrollment, :id =&gt; 2) ]
-    
+
     @it.enrollments.each do |enrollment|
       enrollment.should_receive(:to_xml).and_return( mock_xml(:enrollment) )
       enrollment.should_receive(:test_resource_id=).with(1) #An id of 1 will be assigned by the mock_post
       enrollment.should_receive(:save).and_return( true )
     end
-    
+
     @it.save
   end
-  
+
   #TODO this doesn't work. It's not used either so it's commented out in both abstract_resource and it's spec
 #  it &quot;should let you define associations via belong_to :blah instead of belong_tos = [:blah]&quot; do
 #    @it.instance_eval do
@@ -209,12 +209,12 @@ describe &quot;An active resource that extends abstract resource&quot; do
 #      self.has_one :ho1
 #      self.has_one :ho2
 #    end
-#    
+#
 #    @it.belong_tos.should eql([:bt1, :bt2])
 #    @it.has_manys.should eql([:hm1, :hm2])
-#    @it.has_ones.should eql([:ho1, :ho2])    
+#    @it.has_ones.should eql([:ho1, :ho2])
 #  end
-  
+
   it &quot;should store unique class inherited variables for nested_resource, belong_tos, etc for each class&quot; do
     class_attributes = [:skip_to_xml_for, :has_manys, :belong_tos, :has_ones, :columns]
     test_values = [:something, :something_else]
@@ -223,172 +223,172 @@ describe &quot;An active resource that extends abstract resource&quot; do
         self.send(&quot;#{attribute}=&quot;, test_values)
       end
     end
-    
+
     class_attributes.each do |attribute|
       @it.send(attribute).should eql( test_values )
-    end    
-    
+    end
+
     @another = AnotherResource.new
-    
+
     class_attributes.each do |attribute|
       @another.send(attribute).should be_empty
     end
   end
-  
+
   it &quot;should load an array of id values into a single comma delimeted string&quot; do
-    @it.instance_eval do 
+    @it.instance_eval do
       self.has_manys = [ :races ]
     end
-    
+
     @it = TestResource.new(:race_ids =&gt; [1,2,3,4])
     @it.race_ids.should eql(&quot;1,2,3,4&quot;)
   end
-  
+
   it &quot;should convert ids in a belongs_to into integers&quot; do
-    @it.instance_eval do 
+    @it.instance_eval do
       self.belong_tos = [ :gender ]
     end
-    
+
     @it = TestResource.new(:gender_id =&gt; &quot;1&quot;)
-    
-    #TODO Should this work? It doesn't currently.. 
-    #@it.gender_id = &quot;1&quot;         
+
+    #TODO Should this work? It doesn't currently..
+    #@it.gender_id = &quot;1&quot;
     @it.gender_id.should == 1
   end
-  
+
   it &quot;should not dup loaded attributes&quot; do
     gender = mock(:gender)
     @it = TestResource.new(:gender =&gt; gender)
     @it.gender.should === gender
   end
-  
+
   it &quot;should let you set an attribute using a setter method if defined as a column&quot; do
-    @it.instance_eval do 
+    @it.instance_eval do
       self.columns = [ :something ]
     end
-    
+
     test_value = 'blah'
     @it.something = test_value
     @it.attributes['something'].should === test_value #It's not an indifferent hash so only strings work!! Stupid active_resource.
   end
-  
+
   it &quot;should return nil if a column getter is called rather than method_missing as in ActiveResource&quot; do
-    @it.instance_eval do 
+    @it.instance_eval do
       self.columns = [ :something ]
     end
-        
+
     @it.something.should be_nil
   end
-  
+
   it &quot;should return nil if a belong_to column's id getter is called rather than method_missing as in ActiveResource&quot; do
-    @it.instance_eval do 
+    @it.instance_eval do
       self.columns = [] #You shouldn't need the column specified, it should infer from the belong_tos
       self.belong_tos = [ :something ]
     end
-        
+
     @it.something_id.should be_nil
   end
-  
+
   it &quot;should return [] if a has_many's ids getter is called rather than method_missing as in ActiveResource&quot; do
-    @it.instance_eval do 
+    @it.instance_eval do
       self.columns = [] #You shouldn't need the column specified, it should infer from the belong_tos
       self.has_manys = [ :somethings ]
     end
-        
+
     @it.something_ids.should == []
   end
-  
+
   it &quot;'s has_many accessors should return [] when ids is set to an empty string or nil&quot; do
-    @it.instance_eval do 
+    @it.instance_eval do
       self.columns = []
       self.has_manys = [ :somethings ]
     end
-        
+
     @it.something_ids = ''
     @it.somethings.should == []
-    
+
     @it.something_ids = nil
     @it.somethings.should == []
   end
-  
+
   it &quot;should find a belongs_to if given only an id&quot; do
-    @it.instance_eval do 
+    @it.instance_eval do
       self.belong_tos = [ :gender ]
-    end        
-    
+    end
+
     @it.gender_id = 1
-    
+
     Object.const_set('Gender', Class.new)
     gender = mock(:gender)
     Gender.should_receive(:find).with(@it.gender_id).and_return(gender)
-    
+
     @it.gender.should === gender
-  end    
-  
+  end
+
   it &quot;should not find a belongs_to if the id is empty&quot; do
-    @it.instance_eval do 
+    @it.instance_eval do
       self.belong_tos = [ :gender ]
-    end                
-    
+    end
+
     @it.gender_id = nil
-    @it.gender.should be_nil         
-    
+    @it.gender.should be_nil
+
     @it.gender_id = &quot;&quot;
-    @it.gender.should be_nil     
+    @it.gender.should be_nil
   end
-  
+
   it &quot;should return the id for belongs_to if given only the object&quot; do
-    @it.instance_eval do 
+    @it.instance_eval do
       self.belong_tos = [ :gender ]
     end
-        
+
     gender = mock(:gender, :id =&gt; 3)
-    
+
     @it.gender = gender
     @it.gender_id.should eql( gender.id )
   end
-  
+
   it &quot;should return ids for a has_many if given only the objects&quot; do
-    @it.instance_eval do 
+    @it.instance_eval do
       self.has_manys = [ :races ]
     end
-    
+
     race = mock(:race, :id =&gt; 1)
-    
+
     @it.races = [race,race,race]
     @it.race_ids.should eql([race.id,race.id,race.id])
   end
-  
+
   it &quot;should return the objects for a has_many if given only the ids&quot; do
-    @it.instance_eval do 
+    @it.instance_eval do
       self.has_manys = [ :races ]
     end
-    
+
     race_ids = [1,2,3]
     @it.race_ids = race_ids
-    
+
     race = mock(:race)
-    
+
     race_ids.each { |race_id| Race.should_receive(:find).with(race_id).and_return(race) }
-    
+
     @it.races.should eql([race,race,race])
   end
-  
+
   it &quot;should find the object for a has_one given only the id&quot; do
-    @it.instance_eval do 
+    @it.instance_eval do
       self.has_ones = [ :dog ]
     end
-    
+
     @it.id = 1
-    
+
     Object.const_set('Dog', Class.new)
     dog = mock(:dog)
     Dog.should_receive(:find_by_test_resource_id).with(@it.id).and_return(dog)
     @it.dog.should === dog
-  end      
-  
+  end
+
   it &quot;should raise an exception if a bad class method is called&quot; do
     #This is testing that our dynamic find_by_blah isn't wrecking anything
     lambda { TestResource.something_that_does_not_exist }.should raise_error
   end
-end
\ No newline at end of file
+end</diff>
      <filename>spec/hyperactive_resource_spec.rb</filename>
    </modified>
    <modified>
      <diff>@@ -9,7 +9,8 @@ require 'spec/translator'
 namespace :hyperactive_resource do
   desc &quot;Run all specs for hyperactive resource&quot;
   Spec::Rake::SpecTask.new(:spec) do |t|    
-    t.spec_opts = ['--options', &quot;\&quot;#{RAILS_ROOT}/spec/spec.opts\&quot;&quot;]
-    t.spec_files = FileList['vendor/plugins/hyperactive_resource/spec/*_spec.rb']    
+    spec_opts_file = &quot;\&quot;#{RAILS_ROOT}/spec/spec.opts\&quot;&quot;
+    t.spec_opts = ['--options', spec_opts_file] if File.exist? spec_opts_file
+    t.spec_files = FileList['vendor/plugins/hyperactive_resource/spec/*_spec.rb']
   end
-end
\ No newline at end of file
+end</diff>
      <filename>tasks/rspec.rake</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>7310672bcab616c667624f21e623a453a3ab9743</id>
    </parent>
  </parents>
  <author>
    <name>nicholas a. evans</name>
    <email>nevans@nevans-laptop.(none)</email>
  </author>
  <url>http://github.com/lukegalea/hyperactiveresource/commit/3a3f9da518e9b0a6ca2232623692e0a14470959e</url>
  <id>3a3f9da518e9b0a6ca2232623692e0a14470959e</id>
  <committed-date>2008-07-22T10:31:04-07:00</committed-date>
  <authored-date>2008-07-22T10:31:04-07:00</authored-date>
  <message>Minor formatting changes.  Small change to `rake spec`.

 * removed the spaces from the end of lines
 * wrapped lines in README
 * `rake spec` checks for the existance of spec.opts</message>
  <tree>83f013bc408f013ba11c5bc6d52fcc93500c43c2</tree>
  <committer>
    <name>nicholas a. evans</name>
    <email>nevans@nevans-laptop.(none)</email>
  </committer>
</commit>
