<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array">
    <added>
      <filename>mack-distributed/lib/mack-distributed/distributed.rb</filename>
    </added>
    <added>
      <filename>mack-distributed/spec/lib/distributed/distributed_spec.rb</filename>
    </added>
  </added>
  <modified type="array">
    <modified>
      <diff>@@ -3,19 +3,29 @@ module Mack
     module Object
       
       def self.included(base)
-        base.class_eval do
-          include ::DRbUndumped
-        end
-        eval %{
-          class ::Mack::Distributed::#{base}Proxy &lt; Mack::Utils::BlankSlate
-            include Singleton
-            include DRbUndumped
+        if app_config.mack.share_objects
+          base.class_eval do
+            include ::DRbUndumped
+          end
+          eval %{
+            class ::Mack::Distributed::#{base}Proxy
+              include Singleton
+              include DRbUndumped
 
-            def method_missing(sym, *args)
-              #{base}.send(sym, *args)
+              def method_missing(sym, *args)
+                #{base}.send(sym, *args)
+              end
+            
+              # def respond_to?(sym)
+              #   #{base}.respond_to?(sym)
+              # end
             end
-          end
-        }
+          }
+          raise Mack::Distributed::Errors::ApplicationNameUndefined.new if app_config.mack.distributed_app_name.nil?
+          Mack::Distributed::Utils::Rinda.register_or_renew(:space =&gt; app_config.mack.distributed_app_name.to_sym, 
+                                                            :klass_def =&gt; &quot;#{base}&quot;.to_sym, 
+                                                            :object =&gt; &quot;Mack::Distributed::#{base}Proxy&quot;.constantize.instance)
+        end
       end
       
     end # Object</diff>
      <filename>mack-distributed/lib/mack-distributed/object.rb</filename>
    </modified>
    <modified>
      <diff>@@ -36,7 +36,7 @@ module Mack
         
         private
         def self.handle_options(options = {})
-          {:space =&gt; :name, :klass_def =&gt; nil, :object =&gt; nil, :description =&gt; nil, :timeout =&gt; app_config.mack.drb_timeout}.merge(options)
+          {:space =&gt; nil, :klass_def =&gt; nil, :object =&gt; nil, :description =&gt; nil, :timeout =&gt; app_config.mack.drb_timeout}.merge(options)
         end
         
       end</diff>
      <filename>mack-distributed/lib/mack-distributed/utils/rinda.rb</filename>
    </modified>
    <modified>
      <diff>@@ -8,5 +8,7 @@ mack::page_cache: true
 
 mack::use_distributed_routes: false
 mack::distributed_app_name: fake_app
+mack::share_objects: true
+mack::drb_timeout: 0
 
 mack::testing_framework: rspec
\ No newline at end of file</diff>
      <filename>mack-distributed/spec/fake_application/config/app_config/default.yml</filename>
    </modified>
    <modified>
      <diff>@@ -4,24 +4,25 @@ require 'rinda/tuplespace'
 
 describe Mack::Distributed::Object do
 
-  class Car
-    include Mack::Distributed::Object
-    
-    def make
-      &quot;Toyota&quot;
+  before(:each) do
+    begin
+      DRb.start_service
+      Rinda::RingServer.new(Rinda::TupleSpace.new)
+    rescue Errno::EADDRINUSE =&gt; e
+      # it's fine to ignore this, it's expected that it's already running.
+      # all other exceptions should be thrown
     end
-    
-    def self.buy
-    end
-    
   end
 
   it &quot;should include DRbUndumped&quot; do
-    Car.new.should be_is_a(DRbUndumped)
+    class Pool
+      include Mack::Distributed::Object
+    end
+    Pool.new.should be_is_a(DRbUndumped)
   end
   
   it &quot;should defined a proxy singleton&quot; do
-    lambda{Mack::Distributed::BoatProxy}.should raise_error(NameError)
+    lambda{Mack::Distributed::BoatProxy}.should raise_error(Rinda::RequestExpiredError)
     class Boat
       include Mack::Distributed::Object
     end
@@ -32,11 +33,20 @@ describe Mack::Distributed::Object do
   end
   
   it &quot;should respond with the methods of the underlying class&quot; do
+    class Car
+      include Mack::Distributed::Object
+      def make
+        &quot;Toyota&quot;
+      end
+      def self.buy
+        true
+      end
+    end
     car = Mack::Distributed::CarProxy.instance.new
     car.should be_is_a(Car)
     car.make.should == &quot;Toyota&quot;
     car.respond_to?(:make).should == true
-    Mack::Distributed::CarProxy.instance.respond_to?(:buy).should == true
+    Mack::Distributed::CarProxy.instance.buy.should == true
   end
   
 </diff>
      <filename>mack-distributed/spec/lib/distributed/object_spec.rb</filename>
    </modified>
    <modified>
      <diff>@@ -2,19 +2,14 @@ require File.join(File.dirname(__FILE__), &quot;..&quot;, &quot;..&quot;, &quot;..&quot;, &quot;spec_helper&quot;)
 
 describe &quot;droute_url&quot; do
   
-  before(:all) do
+  before(:each) do
     begin
       DRb.start_service
       Rinda::RingServer.new(Rinda::TupleSpace.new)
-      # DRb.thread.join
     rescue Errno::EADDRINUSE =&gt; e
       # it's fine to ignore this, it's expected that it's already running.
       # all other exceptions should be thrown
     end
-    begin
-      rs.take([:testing, :String, nil, nil], 0)
-    rescue Exception =&gt; e
-    end
     app_config.load_hash({&quot;mack::use_distributed_routes&quot; =&gt; true, &quot;mack::distributed_app_name&quot; =&gt; :known_app}, :distributed_route_test)
     Mack::Routes.build do |r| # force the routes to go the DRb server
       r.known &quot;/my_known_app/my_known_url&quot;, :controller =&gt; :foo, :action =&gt; :bar
@@ -22,7 +17,7 @@ describe &quot;droute_url&quot; do
     end
   end
   
-  after(:all) do
+  after(:each) do
     app_config.revert
   end
   </diff>
      <filename>mack-distributed/spec/lib/distributed/routing/distributed_route_spec.rb</filename>
    </modified>
    <modified>
      <diff>@@ -4,11 +4,10 @@ require 'rinda/tuplespace'
 
 describe Mack::Distributed::Utils::Rinda do
   
-  before(:all) do 
+  before(:each) do 
     begin
       DRb.start_service
       Rinda::RingServer.new(Rinda::TupleSpace.new)
-      # DRb.thread.join
     rescue Errno::EADDRINUSE =&gt; e
       # it's fine to ignore this, it's expected that it's already running.
       # all other exceptions should be thrown</diff>
      <filename>mack-distributed/spec/lib/distributed/utils/rinda_spec.rb</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>05bfe9ca17d7bb89e1a5445d6fcb963b38e1f572</id>
    </parent>
  </parents>
  <author>
    <name>Mark Bates</name>
    <email>mark@markbates.com</email>
  </author>
  <url>http://github.com/markbates/mack-more/commit/59fece7a6a3511724a08edbab4d8e4267b462468</url>
  <id>59fece7a6a3511724a08edbab4d8e4267b462468</id>
  <committed-date>2008-08-05T14:15:53-07:00</committed-date>
  <authored-date>2008-08-05T14:15:53-07:00</authored-date>
  <message>More work on distributed objects [#10]</message>
  <tree>3a4fb3a672aba1fd3e43097819f3dea6f6b845ba</tree>
  <committer>
    <name>Mark Bates</name>
    <email>mark@markbates.com</email>
  </committer>
</commit>
