<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -49,7 +49,8 @@ module Limelight
       end
 
       def process
-        Limelight::Producer.open(@production_path, :drb_port =&gt; @drb_port )
+        Studio.publish_on_drb(@drb_port.to_i) if @drb_port
+        Studio.open(@production_path)
       end
 
     end</diff>
      <filename>lib/limelight/commands/open_command.rb</filename>
    </modified>
    <modified>
      <diff>@@ -77,7 +77,6 @@ module Limelight
       end
       @casting_director = nil
 
-      @production.publish_on_drb(options[:drb_port]) if options[:drb_port]
       @production.production_opened
     end
 </diff>
      <filename>lib/limelight/producer.rb</filename>
    </modified>
    <modified>
      <diff>@@ -128,12 +128,6 @@ module Limelight
       self.production_closed
     end
 
-    # Publish the production, using DRb, on the specified port.
-    #
-    def publish_on_drb(port)
-      @drb_server = DRb.start_service(&quot;druby://0.0.0.0:#{port}&quot;, self)      
-    end
-
   end
 
 end
\ No newline at end of file</diff>
      <filename>lib/limelight/production.rb</filename>
    </modified>
    <modified>
      <diff>@@ -95,6 +95,12 @@ module Limelight
         return @index.nil? ? [] : @index.dup
       end
 
+      # Publish the Studio, using DRb, on the specified port.
+      #
+      def publish_on_drb(port)
+        @drb_server = DRb.start_service(&quot;druby://0.0.0.0:#{port}&quot;, self)
+      end
+
       private #############################################
 
       def assign_unique_name(production) #:nodoc:
@@ -103,7 +109,7 @@ module Limelight
         while name_taken?(name)
           name = &quot;#{production.name}_#{count}&quot;
           count += 1
-        end  
+        end
         production.name = name
       end
 </diff>
      <filename>lib/limelight/studio.rb</filename>
    </modified>
    <modified>
      <diff>@@ -18,14 +18,14 @@ describe Limelight::Commands::OpenCommand do
 
   it &quot;should open a production&quot; do
     Limelight::Main.should_receive(:initialize_context)
-    Limelight::Producer.should_receive(:open).with(&quot;production_name&quot;, :drb_port =&gt; nil )
+    Limelight::Studio.should_receive(:open).with(&quot;production_name&quot;)
 
     @command.run([&quot;production_name&quot;])
   end
 
   it &quot;should open the default production&quot; do
     Limelight::Main.should_receive(:initialize_context)
-    Limelight::Producer.should_receive(:open).with(@command_class::DEFAULT_PRODUCTION, :drb_port =&gt; nil )
+    Limelight::Studio.should_receive(:open).with(@command_class::DEFAULT_PRODUCTION)
 
     @command.run([])
   end
@@ -41,4 +41,12 @@ describe Limelight::Commands::OpenCommand do
     @command.drb_port.should == &quot;4321&quot;
   end
 
+  it &quot;should start the studio on drb&quot; do
+    Limelight::Main.should_receive(:initialize_context)
+    Limelight::Studio.should_receive(:publish_on_drb).with(1234)
+    Limelight::Studio.should_receive(:open).with(&quot;some_prod&quot;)
+
+    @command.run [&quot;-d&quot;, &quot;1234&quot;, &quot;some_prod&quot;]
+  end
+
 end
\ No newline at end of file</diff>
      <filename>spec/commands/open_command_spec.rb</filename>
    </modified>
    <modified>
      <diff>@@ -184,11 +184,4 @@ describe Limelight::Producer do
     @producer.builtin_styles.should_not be(@producer.builtin_styles)
   end
 
-  it &quot;should publish a production&quot; do
-    @producer.stub!(:open_scene)
-    @producer.production.should_receive(:publish_on_drb).with(&quot;1234&quot;)
-
-    @producer.open(:drb_port =&gt; &quot;1234&quot;)
-  end
-
 end</diff>
      <filename>spec/producer_spec.rb</filename>
    </modified>
    <modified>
      <diff>@@ -56,14 +56,6 @@ describe Limelight::Production, &quot;Instance methods&quot; do
     @production.scene_directory(:root).should == &quot;/tmp&quot;
   end
 
-  it &quot;should publish on drb&quot; do
-    @production.publish_on_drb(&quot;9876&quot;)
-
-    DRb.start_service
-    proxy = DRbObject.new(nil, &quot;druby://127.0.0.1:9876&quot;)
-    proxy.path.should == &quot;/tmp&quot;
-  end
-
   it &quot;should allow close by default&quot; do
     @production.allow_close?.should == true
   end</diff>
      <filename>spec/production_spec.rb</filename>
    </modified>
    <modified>
      <diff>@@ -14,7 +14,7 @@ describe Limelight::Studio do
 
   before do
     Studio.reset
-    @production = TestProduction.new 
+    @production = TestProduction.new
   end
 
   it &quot;should install itsself&quot; do
@@ -72,7 +72,7 @@ describe Limelight::Studio do
 
     Studio.production_closed(@production)
 
-    Thread.pass
+    sleep(0.1)
   end
 
   it &quot;should add productions to the index&quot; do
@@ -121,7 +121,15 @@ describe Limelight::Studio do
     Limelight::Context.instance().should_receive(:shutdown)
 
     Studio.shutdown
-    Thread.sleep(0.1)
+    sleep(0.1)
+  end
+
+  it &quot;should publish on drb&quot; do
+    Studio.publish_on_drb(&quot;9876&quot;)
+
+    DRb.start_service
+    proxy = DRbObject.new(nil, &quot;druby://127.0.0.1:9876&quot;)
+    proxy.instance.should_not == nil
   end
 
 end
\ No newline at end of file</diff>
      <filename>spec/studio_spec.rb</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>199fcd6e4ec9934459181cf3b7bd6b77a05e6cad</id>
    </parent>
  </parents>
  <author>
    <name>Micah Martin</name>
    <email>micah@8thlight.com</email>
  </author>
  <url>http://github.com/slagyr/limelight/commit/acaa22adce39057f848fb052047f58d48cb727f2</url>
  <id>acaa22adce39057f848fb052047f58d48cb727f2</id>
  <committed-date>2009-05-30T00:04:56-07:00</committed-date>
  <authored-date>2009-05-30T00:04:56-07:00</authored-date>
  <message>using the studio to publish on drb</message>
  <tree>d19a1eabb0fd6816f34e1773febfbb8f1a04ef71</tree>
  <committer>
    <name>Micah Martin</name>
    <email>micah@8thlight.com</email>
  </committer>
</commit>
