<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -1,8 +1,8 @@
 class AssetHostingWithMinimumSsl
-  attr_accessor :asset_host, :ssl_asset_host
+  attr_accessor :asset_host, :ssl_asset_host, :server_pool_size
   
-  def initialize(asset_host, ssl_asset_host)
-    self.asset_host, self.ssl_asset_host = asset_host, ssl_asset_host
+  def initialize(asset_host, ssl_asset_host, server_pool_size = 4)
+    self.asset_host, self.ssl_asset_host, self.server_pool_size = asset_host, ssl_asset_host, server_pool_size
   end
   
   def call(source, request)
@@ -21,18 +21,16 @@ class AssetHostingWithMinimumSsl
       asset_host(source)
     end
   end
-  
-  
+    
   private
     def asset_host(source)
-      @asset_host % (source.hash % 4)
+      @asset_host % (source.hash % self.server_pool_size)
     end
 
     def ssl_asset_host(source)
-      @ssl_asset_host % (source.hash % 4)
+      @ssl_asset_host % (source.hash % self.server_pool_size)
     end
 
-
     def javascript_file?(source)
       source =~ /\.js(\?.*)?$/ 
     end
@@ -41,7 +39,6 @@ class AssetHostingWithMinimumSsl
       source =~ /^\/images/
     end
 
-
     def safari?(request)
       request.headers[&quot;USER_AGENT&quot;] =~ /Safari/
     end</diff>
      <filename>lib/asset_hosting_with_minimum_ssl.rb</filename>
    </modified>
    <modified>
      <diff>@@ -53,6 +53,16 @@ class AssetHostingWithMinimumSslTest &lt; Test::Unit::TestCase
       @asset_host.call(&quot;/stylesheets/application.css&quot;, ssl_request_from(&quot;IE&quot;))
   end
   
+  def test_should_default_the_number_of_asset_hosts
+    assert_equal 4, @asset_host.server_pool_size
+  end
+  
+  def test_allow_the_number_of_asset_hosts_to_be_configurable
+    @asset_host.server_pool_size = 7
+     assert_match \
+        non_ssl_host, 
+        @asset_host.call(&quot;/images/test.png&quot;, ssl_request_from(&quot;Firefox&quot;))
+  end
 
   private
     def non_ssl_host</diff>
      <filename>test/asset_hosting_with_minimum_ssl_test.rb</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>03940de2fa55940ef6c8567200e91a3fdadac39d</id>
    </parent>
  </parents>
  <author>
    <name>Rob Ares</name>
    <email>rob.ares@gmail.com</email>
  </author>
  <url>http://github.com/rares/asset-hosting-with-minimum-ssl/commit/0559218672638195543c460ed6c751e1b081d3ec</url>
  <id>0559218672638195543c460ed6c751e1b081d3ec</id>
  <committed-date>2009-11-04T12:54:02-08:00</committed-date>
  <authored-date>2009-11-04T12:54:02-08:00</authored-date>
  <message>adding a configurable number of hosts, defaulting to 4 for backwards compatability</message>
  <tree>41e64d7f1bc499166424f503453156286e099d73</tree>
  <committer>
    <name>Rob Ares</name>
    <email>rob.ares@gmail.com</email>
  </committer>
</commit>
