<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -39,7 +39,7 @@ end
 
 spec = Gem::Specification.new do |s|
   s.name        = %q{factory_girl}
-  s.version     = &quot;1.1.4&quot;
+  s.version     = &quot;1.1.5&quot;
   s.summary     = %q{factory_girl provides a framework and DSL for defining and
                      using model instance factories.}
   s.description = %q{factory_girl provides a framework and DSL for defining and
@@ -58,7 +58,6 @@ spec = Gem::Specification.new do |s|
   s.email   = %q{jferris@thoughtbot.com}
 
   s.platform = Gem::Platform::RUBY
-  s.add_dependency(%q&lt;activesupport&gt;, [&quot;&gt;= 1.0&quot;])
 end
 
 Rake::GemPackageTask.new spec do |pkg|</diff>
      <filename>Rakefile</filename>
    </modified>
    <modified>
      <diff>@@ -2,15 +2,15 @@
 
 Gem::Specification.new do |s|
   s.name = %q{factory_girl}
-  s.version = &quot;1.1.4&quot;
+  s.version = &quot;1.1.5&quot;
 
   s.required_rubygems_version = Gem::Requirement.new(&quot;&gt;= 0&quot;) if s.respond_to? :required_rubygems_version=
   s.authors = [&quot;Joe Ferris&quot;]
-  s.date = %q{2008-11-28}
+  s.date = %q{2008-12-11}
   s.description = %q{factory_girl provides a framework and DSL for defining and using factories - less error-prone, more explicit, and  all-around easier to work with than fixtures.}
   s.email = %q{jferris@thoughtbot.com}
   s.extra_rdoc_files = [&quot;README.textile&quot;]
-  s.files = [&quot;Changelog&quot;, &quot;LICENSE&quot;, &quot;Rakefile&quot;, &quot;README.textile&quot;, &quot;lib/factory_girl/aliases.rb&quot;, &quot;lib/factory_girl/attribute.rb&quot;, &quot;lib/factory_girl/attribute_proxy.rb&quot;, &quot;lib/factory_girl/factory.rb&quot;, &quot;lib/factory_girl/sequence.rb&quot;, &quot;lib/factory_girl.rb&quot;, &quot;test/aliases_test.rb&quot;, &quot;test/attribute_proxy_test.rb&quot;, &quot;test/attribute_test.rb&quot;, &quot;test/factory_test.rb&quot;, &quot;test/integration_test.rb&quot;, &quot;test/models.rb&quot;, &quot;test/sequence_test.rb&quot;, &quot;test/test_helper.rb&quot;]
+  s.files = [&quot;Changelog&quot;, &quot;CONTRIBUTION_GUIDELINES.rdoc&quot;, &quot;LICENSE&quot;, &quot;Rakefile&quot;, &quot;README.textile&quot;, &quot;lib/factory_girl/aliases.rb&quot;, &quot;lib/factory_girl/attribute.rb&quot;, &quot;lib/factory_girl/attribute_proxy.rb&quot;, &quot;lib/factory_girl/factory.rb&quot;, &quot;lib/factory_girl/sequence.rb&quot;, &quot;lib/factory_girl.rb&quot;, &quot;test/aliases_test.rb&quot;, &quot;test/attribute_proxy_test.rb&quot;, &quot;test/attribute_test.rb&quot;, &quot;test/factory_test.rb&quot;, &quot;test/integration_test.rb&quot;, &quot;test/models.rb&quot;, &quot;test/sequence_test.rb&quot;, &quot;test/test_helper.rb&quot;]
   s.has_rdoc = true
   s.rdoc_options = [&quot;--line-numbers&quot;, &quot;--inline-source&quot;, &quot;--main&quot;, &quot;README.textile&quot;]
   s.require_paths = [&quot;lib&quot;]
@@ -23,11 +23,8 @@ Gem::Specification.new do |s|
     s.specification_version = 2
 
     if Gem::Version.new(Gem::RubyGemsVersion) &gt;= Gem::Version.new('1.2.0') then
-      s.add_runtime_dependency(%q&lt;activesupport&gt;, [&quot;&gt;= 1.0&quot;])
     else
-      s.add_dependency(%q&lt;activesupport&gt;, [&quot;&gt;= 1.0&quot;])
     end
   else
-    s.add_dependency(%q&lt;activesupport&gt;, [&quot;&gt;= 1.0&quot;])
   end
 end</diff>
      <filename>factory_girl.gemspec</filename>
    </modified>
    <modified>
      <diff>@@ -1,6 +1,8 @@
 class Factory
 
-  cattr_accessor :aliases #:nodoc:
+  class &lt;&lt; self
+    attr_accessor :aliases #:nodoc:
+  end
   self.aliases = [
     [/(.*)_id/, '\1'],
     [/(.*)/, '\1_id']</diff>
      <filename>lib/factory_girl/aliases.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,13 +1,16 @@
 class Factory
   
-  cattr_accessor :factories #:nodoc:
-  self.factories = {}
+  class &lt;&lt; self
+    attr_accessor :factories #:nodoc:
+
+    # An Array of strings specifying locations that should be searched for
+    # factory definitions. By default, factory_girl will attempt to require
+    # &quot;factories,&quot; &quot;test/factories,&quot; and &quot;spec/factories.&quot; Only the first
+    # existing file will be loaded.
+    attr_accessor :definition_file_paths
+  end
 
-  # An Array of strings specifying locations that should be searched for
-  # factory definitions. By default, factory_girl will attempt to require
-  # &quot;factories,&quot; &quot;test/factories,&quot; and &quot;spec/factories.&quot; Only the first
-  # existing file will be loaded.
-  cattr_accessor :definition_file_paths
+  self.factories = {}
   self.definition_file_paths = %w(factories test/factories spec/factories)
 
   attr_reader :factory_name
@@ -36,7 +39,7 @@ class Factory
   end
 
   def initialize (name, options = {}) #:nodoc:
-    options.assert_valid_keys(:class)
+    assert_valid_options(options)
     @factory_name = factory_name_for(name)
     @options      = options
     @attributes   = []
@@ -111,7 +114,7 @@ class Factory
   #       default use the &quot;user&quot; factory.
   def association (name, options = {})
     name    = name.to_sym
-    options = options.symbolize_keys
+    options = symbolize_keys(options)
     association_factory = options[:factory] || name
 
     add_attribute(name) {|a| a.association(association_factory) }
@@ -203,7 +206,7 @@ class Factory
   private
 
   def build_attributes_hash (values, strategy)
-    values = values.symbolize_keys
+    values = symbolize_keys(values)
     passed_keys = values.keys.collect {|key| Factory.aliases_for(key) }.flatten
     @attributes.each do |attribute|
       unless passed_keys.include?(attribute.name)
@@ -225,7 +228,7 @@ class Factory
 
   def class_for (class_or_to_s)
     if class_or_to_s.respond_to?(:to_sym)
-      class_or_to_s.to_s.pluralize.classify.constantize
+      Object.const_get(variable_name_to_class_name(class_or_to_s))
     else
       class_or_to_s
     end
@@ -235,7 +238,7 @@ class Factory
     if class_or_to_s.respond_to?(:to_sym)
       class_or_to_s.to_sym
     else
-      class_or_to_s.to_s.underscore.to_sym
+      class_name_to_variable_name(class_or_to_s).to_sym
     end
   end
 
@@ -243,4 +246,35 @@ class Factory
     !@attributes.detect {|attr| attr.name == name }.nil?
   end
 
+  def assert_valid_options(options)
+    invalid_keys = options.keys - [:class] 
+    unless invalid_keys == []
+      raise ArgumentError, &quot;Unknown arguments: #{invalid_keys.inspect}&quot;
+    end
+  end
+
+  # Based on ActiveSupport's underscore inflector
+  def class_name_to_variable_name(name)
+    name.to_s.gsub(/::/, '/').
+      gsub(/([A-Z]+)([A-Z][a-z])/,'\1_\2').
+      gsub(/([a-z\d])([A-Z])/,'\1_\2').
+      tr(&quot;-&quot;, &quot;_&quot;).
+      downcase
+  end
+
+  # Based on ActiveSupport's camelize inflector
+  def variable_name_to_class_name(name)
+    name.to_s.
+      gsub(/\/(.?)/) { &quot;::#{$1.upcase}&quot; }.
+      gsub(/(?:^|_)(.)/) { $1.upcase }
+  end
+
+  # From ActiveSupport
+  def symbolize_keys(hash)
+    hash.inject({}) do |options, (key, value)|
+      options[(key.to_sym rescue key) || key] = value
+      options
+    end
+  end
+
 end</diff>
      <filename>lib/factory_girl/factory.rb</filename>
    </modified>
    <modified>
      <diff>@@ -15,7 +15,9 @@ class Factory
 
   end
 
-  cattr_accessor :sequences #:nodoc:
+  class &lt;&lt; self
+    attr_accessor :sequences #:nodoc:
+  end
   self.sequences = {}
 
   # Defines a new sequence that can be used to generate unique values in a specific format.</diff>
      <filename>lib/factory_girl/sequence.rb</filename>
    </modified>
    <modified>
      <diff>@@ -337,7 +337,7 @@ class FactoryTest &lt; Test::Unit::TestCase
 
       end
 
-      should &quot;raise an ActiveRecord::RecordInvalid error for invalid instances&quot; do
+      should &quot;raise an error for invalid instances&quot; do
         assert_raise(ActiveRecord::RecordInvalid) do
           @factory.create(:first_name =&gt; nil)
         end</diff>
      <filename>test/factory_test.rb</filename>
    </modified>
    <modified>
      <diff>@@ -28,7 +28,7 @@ class IntegrationTest &lt; Test::Unit::TestCase
   end
 
   def teardown
-    Factory.send(:class_variable_get, &quot;@@factories&quot;).clear
+    Factory.factories.clear
   end
 
   context &quot;a generated attributes hash&quot; do</diff>
      <filename>test/integration_test.rb</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>3eafc97fc05e8e22383a7f92d9dc7eb22c004178</id>
    </parent>
  </parents>
  <author>
    <name>Joe Ferris</name>
    <email>joe.r.ferris@gmail.com</email>
  </author>
  <url>http://github.com/thoughtbot/factory_girl/commit/d550e709e448e3b43314f5e9ecc7f2cca09e8dca</url>
  <id>d550e709e448e3b43314f5e9ecc7f2cca09e8dca</id>
  <committed-date>2008-12-11T12:54:33-08:00</committed-date>
  <authored-date>2008-12-11T12:54:33-08:00</authored-date>
  <message>#19: removed ActiveSupport as a dependency</message>
  <tree>ebaa8f1004309cdcdeb1e472a29e1c9cfe8eb9bd</tree>
  <committer>
    <name>Joe Ferris</name>
    <email>joe.r.ferris@gmail.com</email>
  </committer>
</commit>
