<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array">
    <added>
      <filename>config/workling.yml</filename>
    </added>
    <added>
      <filename>lib/workling/clients/starling.rb</filename>
    </added>
    <added>
      <filename>lib/workling/remote/invokers/poller.rb</filename>
    </added>
    <added>
      <filename>lib/workling/routing/base.rb</filename>
    </added>
    <added>
      <filename>lib/workling/routing/class_and_method_routing.rb</filename>
    </added>
    <added>
      <filename>test/dispacher_poller_test.rb</filename>
    </added>
  </added>
  <modified type="array">
    <modified>
      <diff>@@ -38,7 +38,7 @@ Version 0.2, 13.02.08 rev. 21
 - progress bars or returning results now possible with return stores. use these to communicate back from your workling.
 - memory store for testing and starling store added. 
 - now generates uids for workling jobs. these are returned by the runner.
-- extracted Workling::Starling::Client
+- extracted Workling::Clients::Starling
 - clearer file structure for workling
 
 Version 0.1, 06.02.08</diff>
      <filename>CHANGES.markdown</filename>
    </modified>
    <modified>
      <diff>@@ -3,7 +3,7 @@ require 'fileutils'
 plugin_root = File.dirname(__FILE__)
 
 # config files
-for file in config = %w{ starling.yml } do
+for file in config = %w{ workling.yml } do
   FileUtils.cp(File.join(plugin_root, 'config', file), File.join(RAILS_ROOT, 'config'))
 end
 </diff>
      <filename>install.rb</filename>
    </modified>
    <modified>
      <diff>@@ -6,7 +6,7 @@ module Workling
   class WorklingNotFoundError &lt; WorklingError; end
   class StarlingNotFoundError &lt; WorklingError
     def initialize
-      super &quot;config/starling.yml configured to connect to starling on #{ Workling::Starling.config[:listens_on] } for this environment. could not connect to starling on this host:port. pass starling the port with -p flag when starting it. If you don't want to use Starling at all, then explicitly set Workling::Remote.dispatcher (see README for an example)&quot;
+      super &quot;config/starling.yml configured to connect to starling on #{ Workling.config[:listens_on] } for this environment. could not connect to starling on this host:port. pass starling the port with -p flag when starting it. If you don't want to use Starling at all, then explicitly set Workling::Remote.dispatcher (see README for an example)&quot;
     end
   end
   
@@ -96,6 +96,17 @@ module Workling
     end
   end
   
+  #
+  #  returns a config hash. reads RAILS_ROOT/config/workling.yml
+  #  NOTE: this used to be starling.yml. simply rename to upgrade.
+  #
+  def self.config
+    config_path = File.join(RAILS_ROOT, 'config', 'workling.yml')
+    @@config ||=  YAML.load_file(config_path)[RAILS_ENV || 'development'].symbolize_keys
+    @@config[:memcache_options].symbolize_keys! if @@config[:memcache_options]
+    @@config 
+  end
+  
   private
     def self.raise_not_found(clazz, method)
       raise Workling::WorklingNotFoundError.new(&quot;could not find #{ clazz }:#{ method } workling. &quot;) </diff>
      <filename>lib/workling.rb</filename>
    </modified>
    <modified>
      <diff>@@ -13,7 +13,7 @@ module Workling
         
         def initialize
           BackgroundjobRunner.routing = 
-            Workling::Starling::Routing::ClassAndMethodRouting.new
+            Workling::Routing::ClassAndMethodRouting.new
         end
         
         #  passes the job to bj by serializing the options to xml and passing them to</diff>
      <filename>lib/workling/remote/runners/backgroundjob_runner.rb</filename>
    </modified>
    <modified>
      <diff>@@ -20,8 +20,8 @@ module Workling
         cattr_accessor :client
         
         def initialize
-          StarlingRunner.client = Workling::Starling::Client.new
-          StarlingRunner.routing = Workling::Starling::Routing::ClassAndMethodRouting.new
+          StarlingRunner.client = Workling::Clients::Starling.new
+          StarlingRunner.routing = Workling::Routing::ClassAndMethodRouting.new
         end
         
         # enqueues the job onto Starling. </diff>
      <filename>lib/workling/remote/runners/starling_runner.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,5 +1,5 @@
 require 'workling/return/store/base'
-require 'workling/starling/client'
+require 'workling/clients/starling'
 
 #
 #  Recommended Return Store if you are using the Starling Runner. This
@@ -12,7 +12,7 @@ module Workling
         cattr_accessor :client
         
         def initialize
-          self.client = Workling::Starling::Client.new
+          self.client = Workling::Clients::Starling.new
         end
         
         # set a value in the queue 'key'. </diff>
      <filename>lib/workling/return/store/starling_return_store.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,4 +1,4 @@
-@routing = Workling::Starling::Routing::ClassAndMethodRouting.new
+@routing = Workling::Routing::ClassAndMethodRouting.new
 unnormalized = REXML::Text::unnormalize(STDIN.read)
 message, command, args = *unnormalized.match(/(^[^ ]*) (.*)/)
 options = Hash.from_xml(args)[&quot;hash&quot;]</diff>
      <filename>script/bj_invoker.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,8 +1,8 @@
 puts '=&gt; Loading Rails...'
 
 require File.dirname(__FILE__) + '/../../../../config/environment'
-require File.dirname(__FILE__) + '/../lib/workling/starling/poller'
-require File.dirname(__FILE__) + '/../lib/workling/starling/routing/class_and_method_routing'
+require File.dirname(__FILE__) + '/../lib/workling/remote/invokers/poller'
+require File.dirname(__FILE__) + '/../lib/workling/routing/class_and_method_routing'
 
 puts '** Rails loaded.'
 puts '** Starting Workling::Starling::Poller...'
@@ -11,7 +11,7 @@ puts '** Use CTRL-C to stop.'
 ActiveRecord::Base.logger = Workling::Base.logger
 ActionController::Base.logger = Workling::Base.logger
 
-poller = Workling::Starling::Poller.new(Workling::Starling::Routing::ClassAndMethodRouting.new)
+poller = Workling::Starling::Poller.new(Workling::Routing::ClassAndMethodRouting.new)
 
 trap(:INT) { poller.stop; exit }
 </diff>
      <filename>script/listen.rb</filename>
    </modified>
    <modified>
      <diff>@@ -3,15 +3,15 @@ require 'pp'
 puts '=&gt; Loading Rails...'
 
 require File.dirname(__FILE__) + '/../config/environment'
-require File.dirname(__FILE__) + '/../vendor/plugins/workling/lib/workling/starling/poller'
-require File.dirname(__FILE__) + '/../vendor/plugins/workling/lib/workling/starling/routing/class_and_method_routing'
+require File.dirname(__FILE__) + '/../vendor/plugins/workling/lib/workling/remote/invokers/poller'
+require File.dirname(__FILE__) + '/../vendor/plugins/workling/lib/workling/routing/class_and_method_routing'
 
 puts '** Rails loaded.'
 
 trap(:INT) { exit }
 
 begin
-  client = Workling::Starling::Client.new
+  client = Workling::Clients::Starling.new
   client.reset
   
   client.stats # do this so that connection is shown as established below. </diff>
      <filename>script/starling_status.rb</filename>
    </modified>
    <modified>
      <diff>@@ -2,17 +2,17 @@ require File.dirname(__FILE__) + '/test_helper.rb'
 
 context &quot;class and method routing&quot; do
   specify &quot;should create a queue called utils:echo for a Util class that subclasses worker and has the method echo&quot; do
-    routing = Workling::Starling::Routing::ClassAndMethodRouting.new  
+    routing = Workling::Routing::ClassAndMethodRouting.new  
     routing['utils__echo'].class.to_s.should.equal &quot;Util&quot;
   end
   
   specify &quot;should create a queue called analytics:invites:sent for an Analytics::Invites class that subclasses worker and has the method sent&quot; do
-    routing = Workling::Starling::Routing::ClassAndMethodRouting.new
+    routing = Workling::Routing::ClassAndMethodRouting.new
     routing['analytics__invites__sent'].class.to_s.should.equal &quot;Analytics::Invites&quot;
   end
   
   specify &quot;queue_names_routing_class should return all queue names associated with a class&quot; do
-    routing = Workling::Starling::Routing::ClassAndMethodRouting.new
+    routing = Workling::Routing::ClassAndMethodRouting.new
     routing.queue_names_routing_class(Util).should.include 'utils__echo'
   end
 end
\ No newline at end of file</diff>
      <filename>test/class_and_method_routing_test.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,6 +1,6 @@
 module Workling
-  module Starling
-    class Client
+  module Clients
+    class Starling
       def raise_unless_connected!; end
     end
   end</diff>
      <filename>test/mocks/client.rb</filename>
    </modified>
    <modified>
      <diff>@@ -2,8 +2,8 @@ require File.dirname(__FILE__) + '/test_helper'
 
 context &quot;The starling client&quot; do
   specify &quot;should be able to connect to multiple Starling instances&quot; do
-    Workling::Starling.send :class_variable_set, &quot;@@config&quot;, { :listens_on =&gt; &quot;localhost:12345, 127.0.0.1:12346&quot;, :memcache_options =&gt; { :namespace =&gt; &quot;myapp_development&quot; } }
-    client = Workling::Starling::Client.new
+    Workling.send :class_variable_set, &quot;@@config&quot;, { :listens_on =&gt; &quot;localhost:12345, 127.0.0.1:12346&quot;, :memcache_options =&gt; { :namespace =&gt; &quot;myapp_development&quot; } }
+    client = Workling::Clients::Starling.new
     
     client.starling_urls.should.equal [&quot;localhost:12345&quot;, &quot;127.0.0.1:12346&quot;]
     client.connection.servers.first.host.should == &quot;localhost&quot;
@@ -14,8 +14,8 @@ context &quot;The starling client&quot; do
   end
   
   specify &quot;should load it's config as well as any given MemCache options from RAILS_ENV/config/starling.yml&quot; do
-    Workling::Starling.send :class_variable_set, &quot;@@config&quot;, { :listens_on =&gt; &quot;localhost:12345&quot;, :memcache_options =&gt; { :namespace =&gt; &quot;myapp_development&quot; } }
-    client = Workling::Starling::Client.new
+    Workling.send :class_variable_set, &quot;@@config&quot;, { :listens_on =&gt; &quot;localhost:12345&quot;, :memcache_options =&gt; { :namespace =&gt; &quot;myapp_development&quot; } }
+    client = Workling::Clients::Starling.new
     
     client.starling_urls.should.equal [&quot;localhost:12345&quot;]
     client.connection.servers.first.host.should == &quot;localhost&quot;
@@ -25,8 +25,8 @@ context &quot;The starling client&quot; do
   
   
   specify &quot;should load it's config correctly if no memcache options are given&quot; do
-    Workling::Starling.send :class_variable_set, &quot;@@config&quot;, { :listens_on =&gt; &quot;localhost:12345&quot; }
-    client = Workling::Starling::Client.new
+    Workling.send :class_variable_set, &quot;@@config&quot;, { :listens_on =&gt; &quot;localhost:12345&quot; }
+    client = Workling::Clients::Starling.new
 
     client.starling_urls.should.equal [&quot;localhost:12345&quot;]
   end  </diff>
      <filename>test/starling_client_test.rb</filename>
    </modified>
    <modified>
      <diff>@@ -4,7 +4,7 @@ context &quot;the starling return store&quot; do
   setup do
     # the memoryreturnstore behaves exactly like memcache. 
     MemCache.expects(:new).at_least(0).returns Workling::Return::Store::MemoryReturnStore.new
-    Workling::Starling::Client.expects(:connection).at_least(0).returns Workling::Return::Store::MemoryReturnStore.new
+    Workling::Clients::Starling.expects(:connection).at_least(0).returns Workling::Return::Store::MemoryReturnStore.new
   end
   
   specify &quot;should be able to store a value with a key, and then retrieve that same value with the same key.&quot; do</diff>
      <filename>test/starling_return_store_test.rb</filename>
    </modified>
    <modified>
      <diff>@@ -23,8 +23,8 @@ require &quot;workling/base&quot;
 Workling.try_load_a_memcache_client
 
 require &quot;workling/discovery&quot;
-require &quot;workling/starling/routing/class_and_method_routing&quot;
-require &quot;workling/starling/poller&quot;
+require &quot;workling/routing/class_and_method_routing&quot;
+require &quot;workling/remote/invokers/poller&quot;
 require &quot;workling/remote&quot;
 require &quot;workling/remote/runners/not_remote_runner&quot;
 require &quot;workling/remote/runners/spawn_runner&quot;</diff>
      <filename>test/test_helper.rb</filename>
    </modified>
  </modified>
  <removed type="array">
    <removed>
      <filename>config/starling.yml</filename>
    </removed>
    <removed>
      <filename>lib/workling/starling.rb</filename>
    </removed>
    <removed>
      <filename>lib/workling/starling/client.rb</filename>
    </removed>
    <removed>
      <filename>lib/workling/starling/poller.rb</filename>
    </removed>
    <removed>
      <filename>lib/workling/starling/routing/base.rb</filename>
    </removed>
    <removed>
      <filename>lib/workling/starling/routing/class_and_method_routing.rb</filename>
    </removed>
    <removed>
      <filename>test/starling_poller_test.rb</filename>
    </removed>
  </removed>
  <parents type="array">
    <parent>
      <id>0ebe031e79cbcd7a0f24dcebff9075d4e66a2f69</id>
    </parent>
  </parents>
  <author>
    <name>Rany Keddo</name>
    <email>rany@playtype.net</email>
  </author>
  <url>http://github.com/digitalhobbit/workling/commit/cce378692563d94688733554dc0f9a0364eb13db</url>
  <id>cce378692563d94688733554dc0f9a0364eb13db</id>
  <committed-date>2008-11-02T10:03:53-08:00</committed-date>
  <authored-date>2008-11-02T10:03:53-08:00</authored-date>
  <message>refactored pollers, initial work</message>
  <tree>470baaf155daa6e0b4f3f4b0f94d13b0fd1d08ea</tree>
  <committer>
    <name>Rany Keddo</name>
    <email>rany@playtype.net</email>
  </committer>
</commit>
