dm-core 0.9.2 → 0.9.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/.autotest +26 -0
 - data/{CHANGELOG → History.txt} +78 -77
 - data/Manifest.txt +123 -0
 - data/{README → README.txt} +0 -0
 - data/Rakefile +29 -0
 - data/SPECS +63 -0
 - data/TODO +1 -0
 - data/lib/dm-core.rb +6 -1
 - data/lib/dm-core/adapters/data_objects_adapter.rb +29 -32
 - data/lib/dm-core/adapters/mysql_adapter.rb +1 -1
 - data/lib/dm-core/adapters/postgres_adapter.rb +1 -1
 - data/lib/dm-core/adapters/sqlite3_adapter.rb +2 -2
 - data/lib/dm-core/associations.rb +26 -0
 - data/lib/dm-core/associations/many_to_many.rb +34 -25
 - data/lib/dm-core/associations/many_to_one.rb +4 -4
 - data/lib/dm-core/associations/one_to_many.rb +48 -13
 - data/lib/dm-core/associations/one_to_one.rb +4 -4
 - data/lib/dm-core/associations/relationship.rb +144 -42
 - data/lib/dm-core/associations/relationship_chain.rb +31 -24
 - data/lib/dm-core/auto_migrations.rb +0 -4
 - data/lib/dm-core/collection.rb +40 -7
 - data/lib/dm-core/dependency_queue.rb +31 -0
 - data/lib/dm-core/hook.rb +2 -2
 - data/lib/dm-core/is.rb +2 -2
 - data/lib/dm-core/logger.rb +10 -10
 - data/lib/dm-core/model.rb +94 -41
 - data/lib/dm-core/property.rb +72 -41
 - data/lib/dm-core/property_set.rb +8 -14
 - data/lib/dm-core/query.rb +34 -9
 - data/lib/dm-core/repository.rb +0 -0
 - data/lib/dm-core/resource.rb +13 -13
 - data/lib/dm-core/scope.rb +25 -2
 - data/lib/dm-core/type.rb +3 -3
 - data/lib/dm-core/types/discriminator.rb +10 -8
 - data/lib/dm-core/types/object.rb +4 -0
 - data/lib/dm-core/types/paranoid_boolean.rb +15 -4
 - data/lib/dm-core/types/paranoid_datetime.rb +15 -4
 - data/lib/dm-core/version.rb +3 -0
 - data/script/all +5 -0
 - data/script/performance.rb +191 -0
 - data/script/profile.rb +86 -0
 - data/spec/integration/association_spec.rb +288 -204
 - data/spec/integration/association_through_spec.rb +9 -3
 - data/spec/integration/associations/many_to_many_spec.rb +97 -31
 - data/spec/integration/associations/many_to_one_spec.rb +41 -6
 - data/spec/integration/associations/one_to_many_spec.rb +18 -2
 - data/spec/integration/auto_migrations_spec.rb +0 -0
 - data/spec/integration/collection_spec.rb +89 -42
 - data/spec/integration/dependency_queue_spec.rb +58 -0
 - data/spec/integration/model_spec.rb +67 -8
 - data/spec/integration/postgres_adapter_spec.rb +19 -20
 - data/spec/integration/property_spec.rb +17 -8
 - data/spec/integration/query_spec.rb +273 -191
 - data/spec/integration/resource_spec.rb +108 -10
 - data/spec/integration/strategic_eager_loading_spec.rb +138 -0
 - data/spec/integration/transaction_spec.rb +3 -3
 - data/spec/integration/type_spec.rb +121 -0
 - data/spec/lib/logging_helper.rb +18 -0
 - data/spec/lib/model_loader.rb +91 -0
 - data/spec/lib/publicize_methods.rb +28 -0
 - data/spec/models/vehicles.rb +34 -0
 - data/spec/models/zoo.rb +48 -0
 - data/spec/spec.opts +3 -0
 - data/spec/spec_helper.rb +25 -62
 - data/spec/unit/adapters/data_objects_adapter_spec.rb +1 -0
 - data/spec/unit/associations/many_to_many_spec.rb +3 -0
 - data/spec/unit/associations/many_to_one_spec.rb +9 -1
 - data/spec/unit/associations/one_to_many_spec.rb +12 -4
 - data/spec/unit/associations/relationship_spec.rb +19 -15
 - data/spec/unit/associations_spec.rb +37 -0
 - data/spec/unit/collection_spec.rb +8 -0
 - data/spec/unit/data_mapper_spec.rb +14 -0
 - data/spec/unit/model_spec.rb +2 -2
 - data/spec/unit/property_set_spec.rb +0 -13
 - data/spec/unit/property_spec.rb +92 -21
 - data/spec/unit/query_spec.rb +49 -4
 - data/spec/unit/resource_spec.rb +122 -60
 - data/spec/unit/scope_spec.rb +11 -0
 - data/tasks/ci.rb +68 -0
 - data/tasks/dm.rb +63 -0
 - data/tasks/doc.rb +20 -0
 - data/tasks/hoe.rb +38 -0
 - data/tasks/install.rb +20 -0
 - metadata +63 -22
 
    
        data/spec/unit/scope_spec.rb
    CHANGED
    
    | 
         @@ -75,6 +75,17 @@ describe DataMapper::Scope do 
     | 
|
| 
       75 
75 
     | 
    
         
             
                    Article.query.should be_nil
         
     | 
| 
       76 
76 
     | 
    
         
             
                  end
         
     | 
| 
       77 
77 
     | 
    
         
             
                end
         
     | 
| 
      
 78 
     | 
    
         
            +
             
     | 
| 
      
 79 
     | 
    
         
            +
                it "should ignore the default_scope when using an exclusive scope" do
         
     | 
| 
      
 80 
     | 
    
         
            +
                  Article.default_scope.update(:blog_id => 1)
         
     | 
| 
      
 81 
     | 
    
         
            +
                  Article.publicize_methods do
         
     | 
| 
      
 82 
     | 
    
         
            +
                    Article.with_exclusive_scope(:author => 'dkubb') do
         
     | 
| 
      
 83 
     | 
    
         
            +
                      Article.query.should == DataMapper::Query.new(repository(:mock), Article, :author => 'dkubb')
         
     | 
| 
      
 84 
     | 
    
         
            +
                    end
         
     | 
| 
      
 85 
     | 
    
         
            +
                  end
         
     | 
| 
      
 86 
     | 
    
         
            +
                  Article.default_scope.delete(:blog_id)
         
     | 
| 
      
 87 
     | 
    
         
            +
                end
         
     | 
| 
      
 88 
     | 
    
         
            +
             
     | 
| 
       78 
89 
     | 
    
         
             
              end
         
     | 
| 
       79 
90 
     | 
    
         | 
| 
       80 
91 
     | 
    
         
             
              describe '.scope_stack' do
         
     | 
    
        data/tasks/ci.rb
    ADDED
    
    | 
         @@ -0,0 +1,68 @@ 
     | 
|
| 
      
 1 
     | 
    
         
            +
            task 'ci:doc' => :doc
         
     | 
| 
      
 2 
     | 
    
         
            +
             
     | 
| 
      
 3 
     | 
    
         
            +
            namespace :ci do
         
     | 
| 
      
 4 
     | 
    
         
            +
             
     | 
| 
      
 5 
     | 
    
         
            +
              task :prepare do
         
     | 
| 
      
 6 
     | 
    
         
            +
                rm_rf ROOT + "ci"
         
     | 
| 
      
 7 
     | 
    
         
            +
                mkdir_p ROOT + "ci"
         
     | 
| 
      
 8 
     | 
    
         
            +
                mkdir_p ROOT + "ci/doc"
         
     | 
| 
      
 9 
     | 
    
         
            +
                mkdir_p ROOT + "ci/cyclomatic"
         
     | 
| 
      
 10 
     | 
    
         
            +
                mkdir_p ROOT + "ci/token"
         
     | 
| 
      
 11 
     | 
    
         
            +
              end
         
     | 
| 
      
 12 
     | 
    
         
            +
             
     | 
| 
      
 13 
     | 
    
         
            +
              Spec::Rake::SpecTask.new("spec:unit" => :prepare) do |t|
         
     | 
| 
      
 14 
     | 
    
         
            +
                t.spec_opts = ["--format", "specdoc", "--format", "html:#{ROOT}/ci/unit_rspec_report.html", "--diff"]
         
     | 
| 
      
 15 
     | 
    
         
            +
                t.spec_files = Pathname.glob(ROOT + "spec/unit/**/*_spec.rb")
         
     | 
| 
      
 16 
     | 
    
         
            +
                unless ENV['NO_RCOV']
         
     | 
| 
      
 17 
     | 
    
         
            +
                  t.rcov = true
         
     | 
| 
      
 18 
     | 
    
         
            +
                  t.rcov_opts << '--exclude' << "spec,gems"
         
     | 
| 
      
 19 
     | 
    
         
            +
                  t.rcov_opts << '--text-summary'
         
     | 
| 
      
 20 
     | 
    
         
            +
                  t.rcov_opts << '--sort' << 'coverage' << '--sort-reverse'
         
     | 
| 
      
 21 
     | 
    
         
            +
                  t.rcov_opts << '--only-uncovered'
         
     | 
| 
      
 22 
     | 
    
         
            +
                end
         
     | 
| 
      
 23 
     | 
    
         
            +
              end
         
     | 
| 
      
 24 
     | 
    
         
            +
             
     | 
| 
      
 25 
     | 
    
         
            +
              Spec::Rake::SpecTask.new("spec:integration" => :prepare) do |t|
         
     | 
| 
      
 26 
     | 
    
         
            +
                t.spec_opts = ["--format", "specdoc", "--format", "html:#{ROOT}/ci/integration_rspec_report.html", "--diff"]
         
     | 
| 
      
 27 
     | 
    
         
            +
                t.spec_files = Pathname.glob(ROOT + "spec/integration/**/*_spec.rb")
         
     | 
| 
      
 28 
     | 
    
         
            +
                unless ENV['NO_RCOV']
         
     | 
| 
      
 29 
     | 
    
         
            +
                  t.rcov = true
         
     | 
| 
      
 30 
     | 
    
         
            +
                  t.rcov_opts << '--exclude' << "spec,gems"
         
     | 
| 
      
 31 
     | 
    
         
            +
                  t.rcov_opts << '--text-summary'
         
     | 
| 
      
 32 
     | 
    
         
            +
                  t.rcov_opts << '--sort' << 'coverage' << '--sort-reverse'
         
     | 
| 
      
 33 
     | 
    
         
            +
                  t.rcov_opts << '--only-uncovered'
         
     | 
| 
      
 34 
     | 
    
         
            +
                end
         
     | 
| 
      
 35 
     | 
    
         
            +
              end
         
     | 
| 
      
 36 
     | 
    
         
            +
             
     | 
| 
      
 37 
     | 
    
         
            +
              task :spec do
         
     | 
| 
      
 38 
     | 
    
         
            +
                Rake::Task["ci:spec:unit"].invoke
         
     | 
| 
      
 39 
     | 
    
         
            +
                mv ROOT + "coverage", ROOT + "ci/unit_coverage"
         
     | 
| 
      
 40 
     | 
    
         
            +
             
     | 
| 
      
 41 
     | 
    
         
            +
                Rake::Task["ci:spec:integration"].invoke
         
     | 
| 
      
 42 
     | 
    
         
            +
                mv ROOT + "coverage", ROOT + "ci/integration_coverage"
         
     | 
| 
      
 43 
     | 
    
         
            +
              end
         
     | 
| 
      
 44 
     | 
    
         
            +
             
     | 
| 
      
 45 
     | 
    
         
            +
              task :saikuro => :prepare do
         
     | 
| 
      
 46 
     | 
    
         
            +
                system "saikuro -c -i lib -y 0 -w 10 -e 15 -o ci/cyclomatic"
         
     | 
| 
      
 47 
     | 
    
         
            +
                mv 'ci/cyclomatic/index_cyclo.html', 'ci/cyclomatic/index.html'
         
     | 
| 
      
 48 
     | 
    
         
            +
             
     | 
| 
      
 49 
     | 
    
         
            +
                system "saikuro -t -i lib -y 0 -w 20 -e 30 -o ci/token"
         
     | 
| 
      
 50 
     | 
    
         
            +
                mv 'ci/token/index_token.html', 'ci/token/index.html'
         
     | 
| 
      
 51 
     | 
    
         
            +
              end
         
     | 
| 
      
 52 
     | 
    
         
            +
             
     | 
| 
      
 53 
     | 
    
         
            +
              task :publish do
         
     | 
| 
      
 54 
     | 
    
         
            +
                out = ENV['CC_BUILD_ARTIFACTS'] || "out"
         
     | 
| 
      
 55 
     | 
    
         
            +
                mkdir_p out unless File.directory? out
         
     | 
| 
      
 56 
     | 
    
         
            +
             
     | 
| 
      
 57 
     | 
    
         
            +
                mv "ci/unit_rspec_report.html", "#{out}/unit_rspec_report.html"
         
     | 
| 
      
 58 
     | 
    
         
            +
                mv "ci/unit_coverage", "#{out}/unit_coverage"
         
     | 
| 
      
 59 
     | 
    
         
            +
                mv "ci/integration_rspec_report.html", "#{out}/integration_rspec_report.html"
         
     | 
| 
      
 60 
     | 
    
         
            +
                mv "ci/integration_coverage", "#{out}/integration_coverage"
         
     | 
| 
      
 61 
     | 
    
         
            +
                mv "ci/doc", "#{out}/doc"
         
     | 
| 
      
 62 
     | 
    
         
            +
                mv "ci/cyclomatic", "#{out}/cyclomatic_complexity"
         
     | 
| 
      
 63 
     | 
    
         
            +
                mv "ci/token", "#{out}/token_complexity"
         
     | 
| 
      
 64 
     | 
    
         
            +
              end
         
     | 
| 
      
 65 
     | 
    
         
            +
            end
         
     | 
| 
      
 66 
     | 
    
         
            +
             
     | 
| 
      
 67 
     | 
    
         
            +
            #task :ci => %w[ ci:spec ci:doc ci:saikuro install ci:publish ]  # yard-related tasks do not work yet
         
     | 
| 
      
 68 
     | 
    
         
            +
            task :ci => %w[ ci:spec ci:saikuro install ]
         
     | 
    
        data/tasks/dm.rb
    ADDED
    
    | 
         @@ -0,0 +1,63 @@ 
     | 
|
| 
      
 1 
     | 
    
         
            +
            task :default => 'dm:spec'
         
     | 
| 
      
 2 
     | 
    
         
            +
            task :spec    => 'dm:spec'
         
     | 
| 
      
 3 
     | 
    
         
            +
            task :rcov    => 'dm:rcov'
         
     | 
| 
      
 4 
     | 
    
         
            +
             
     | 
| 
      
 5 
     | 
    
         
            +
            namespace :spec do
         
     | 
| 
      
 6 
     | 
    
         
            +
              task :unit        => 'dm:spec:unit'
         
     | 
| 
      
 7 
     | 
    
         
            +
              task :integration => 'dm:spec:integration'
         
     | 
| 
      
 8 
     | 
    
         
            +
            end
         
     | 
| 
      
 9 
     | 
    
         
            +
             
     | 
| 
      
 10 
     | 
    
         
            +
            namespace :rcov do
         
     | 
| 
      
 11 
     | 
    
         
            +
              task :unit        => 'dm:rcov:unit'
         
     | 
| 
      
 12 
     | 
    
         
            +
              task :integration => 'dm:rcov:integration'
         
     | 
| 
      
 13 
     | 
    
         
            +
            end
         
     | 
| 
      
 14 
     | 
    
         
            +
             
     | 
| 
      
 15 
     | 
    
         
            +
            namespace :dm do
         
     | 
| 
      
 16 
     | 
    
         
            +
              def run_spec(name, files, rcov)
         
     | 
| 
      
 17 
     | 
    
         
            +
                Spec::Rake::SpecTask.new(name) do |t|
         
     | 
| 
      
 18 
     | 
    
         
            +
                  t.spec_opts << '--colour' << '--loadby' << 'random'
         
     | 
| 
      
 19 
     | 
    
         
            +
                  t.spec_files = Pathname.glob(ENV['FILES'] || files)
         
     | 
| 
      
 20 
     | 
    
         
            +
                  t.rcov = rcov
         
     | 
| 
      
 21 
     | 
    
         
            +
                  t.rcov_opts << '--exclude' << 'spec,environment.rb'
         
     | 
| 
      
 22 
     | 
    
         
            +
                  t.rcov_opts << '--text-summary'
         
     | 
| 
      
 23 
     | 
    
         
            +
                  t.rcov_opts << '--sort' << 'coverage' << '--sort-reverse'
         
     | 
| 
      
 24 
     | 
    
         
            +
                  t.rcov_opts << '--only-uncovered'
         
     | 
| 
      
 25 
     | 
    
         
            +
                end
         
     | 
| 
      
 26 
     | 
    
         
            +
              end
         
     | 
| 
      
 27 
     | 
    
         
            +
             
     | 
| 
      
 28 
     | 
    
         
            +
              unit_specs = ROOT + 'spec/unit/**/*_spec.rb'
         
     | 
| 
      
 29 
     | 
    
         
            +
              integration_specs = ROOT + 'spec/integration/**/*_spec.rb'
         
     | 
| 
      
 30 
     | 
    
         
            +
              all_specs = ROOT + 'spec/**/*_spec.rb'
         
     | 
| 
      
 31 
     | 
    
         
            +
             
     | 
| 
      
 32 
     | 
    
         
            +
              desc "Run all specifications"
         
     | 
| 
      
 33 
     | 
    
         
            +
              run_spec('spec', all_specs, false)
         
     | 
| 
      
 34 
     | 
    
         
            +
             
     | 
| 
      
 35 
     | 
    
         
            +
              desc "Run all specifications with rcov"
         
     | 
| 
      
 36 
     | 
    
         
            +
              run_spec('rcov', all_specs, true)
         
     | 
| 
      
 37 
     | 
    
         
            +
             
     | 
| 
      
 38 
     | 
    
         
            +
              namespace :spec do
         
     | 
| 
      
 39 
     | 
    
         
            +
                desc "Run unit specifications"
         
     | 
| 
      
 40 
     | 
    
         
            +
                run_spec('unit', unit_specs, false)
         
     | 
| 
      
 41 
     | 
    
         
            +
             
     | 
| 
      
 42 
     | 
    
         
            +
                desc "Run integration specifications"
         
     | 
| 
      
 43 
     | 
    
         
            +
                run_spec('integration', integration_specs, false)
         
     | 
| 
      
 44 
     | 
    
         
            +
              end
         
     | 
| 
      
 45 
     | 
    
         
            +
             
     | 
| 
      
 46 
     | 
    
         
            +
              namespace :rcov do
         
     | 
| 
      
 47 
     | 
    
         
            +
                desc "Run unit specifications with rcov"
         
     | 
| 
      
 48 
     | 
    
         
            +
                run_spec('unit', unit_specs, true)
         
     | 
| 
      
 49 
     | 
    
         
            +
             
     | 
| 
      
 50 
     | 
    
         
            +
                desc "Run integration specifications with rcov"
         
     | 
| 
      
 51 
     | 
    
         
            +
                run_spec('integration', integration_specs, true)
         
     | 
| 
      
 52 
     | 
    
         
            +
              end
         
     | 
| 
      
 53 
     | 
    
         
            +
             
     | 
| 
      
 54 
     | 
    
         
            +
              desc "Run all comparisons with ActiveRecord"
         
     | 
| 
      
 55 
     | 
    
         
            +
              task :perf do
         
     | 
| 
      
 56 
     | 
    
         
            +
                sh ROOT + 'script/performance.rb'
         
     | 
| 
      
 57 
     | 
    
         
            +
              end
         
     | 
| 
      
 58 
     | 
    
         
            +
             
     | 
| 
      
 59 
     | 
    
         
            +
              desc "Profile DataMapper"
         
     | 
| 
      
 60 
     | 
    
         
            +
              task :profile do
         
     | 
| 
      
 61 
     | 
    
         
            +
                sh ROOT + 'script/profile.rb'
         
     | 
| 
      
 62 
     | 
    
         
            +
              end
         
     | 
| 
      
 63 
     | 
    
         
            +
            end
         
     | 
    
        data/tasks/doc.rb
    ADDED
    
    | 
         @@ -0,0 +1,20 @@ 
     | 
|
| 
      
 1 
     | 
    
         
            +
            # when yard's ready, it'll have to come back, but for now...
         
     | 
| 
      
 2 
     | 
    
         
            +
            Rake::RDocTask.new("doc") do |t|
         
     | 
| 
      
 3 
     | 
    
         
            +
              t.rdoc_dir = 'doc'
         
     | 
| 
      
 4 
     | 
    
         
            +
              t.title    = "DataMapper - Ruby Object Relational Mapper"
         
     | 
| 
      
 5 
     | 
    
         
            +
              t.options  = ['--line-numbers', '--inline-source', '--all']
         
     | 
| 
      
 6 
     | 
    
         
            +
              t.rdoc_files.include("README.txt", "QUICKLINKS", "FAQ", "lib/**/**/*.rb")
         
     | 
| 
      
 7 
     | 
    
         
            +
            end
         
     | 
| 
      
 8 
     | 
    
         
            +
             
     | 
| 
      
 9 
     | 
    
         
            +
            begin
         
     | 
| 
      
 10 
     | 
    
         
            +
              gem 'yard', '>=0.2.1'
         
     | 
| 
      
 11 
     | 
    
         
            +
              require 'yard'
         
     | 
| 
      
 12 
     | 
    
         
            +
             
     | 
| 
      
 13 
     | 
    
         
            +
              YARD::Rake::YardocTask.new("yardoc") do |t|
         
     | 
| 
      
 14 
     | 
    
         
            +
                t.options << '--protected'
         
     | 
| 
      
 15 
     | 
    
         
            +
                # t.options << '-q'
         
     | 
| 
      
 16 
     | 
    
         
            +
                # t.files << '...anyglobshere...'
         
     | 
| 
      
 17 
     | 
    
         
            +
              end
         
     | 
| 
      
 18 
     | 
    
         
            +
            rescue Exception
         
     | 
| 
      
 19 
     | 
    
         
            +
              # yard not installed
         
     | 
| 
      
 20 
     | 
    
         
            +
            end
         
     | 
    
        data/tasks/hoe.rb
    ADDED
    
    | 
         @@ -0,0 +1,38 @@ 
     | 
|
| 
      
 1 
     | 
    
         
            +
            require 'hoe'
         
     | 
| 
      
 2 
     | 
    
         
            +
             
     | 
| 
      
 3 
     | 
    
         
            +
            @config_file = "~/.rubyforge/user-config.yml"
         
     | 
| 
      
 4 
     | 
    
         
            +
            @config = nil
         
     | 
| 
      
 5 
     | 
    
         
            +
            RUBYFORGE_USERNAME = "unknown"
         
     | 
| 
      
 6 
     | 
    
         
            +
            def rubyforge_username
         
     | 
| 
      
 7 
     | 
    
         
            +
              unless @config
         
     | 
| 
      
 8 
     | 
    
         
            +
                begin
         
     | 
| 
      
 9 
     | 
    
         
            +
                  @config = YAML.load(File.read(File.expand_path(@config_file)))
         
     | 
| 
      
 10 
     | 
    
         
            +
                rescue
         
     | 
| 
      
 11 
     | 
    
         
            +
                  puts <<-EOS
         
     | 
| 
      
 12 
     | 
    
         
            +
            ERROR: No rubyforge config file found: #{@config_file}
         
     | 
| 
      
 13 
     | 
    
         
            +
            Run 'rubyforge setup' to prepare your env for access to Rubyforge
         
     | 
| 
      
 14 
     | 
    
         
            +
             - See http://newgem.rubyforge.org/rubyforge.html for more details
         
     | 
| 
      
 15 
     | 
    
         
            +
                  EOS
         
     | 
| 
      
 16 
     | 
    
         
            +
                  exit
         
     | 
| 
      
 17 
     | 
    
         
            +
                end
         
     | 
| 
      
 18 
     | 
    
         
            +
              end
         
     | 
| 
      
 19 
     | 
    
         
            +
              RUBYFORGE_USERNAME.replace @config["username"]
         
     | 
| 
      
 20 
     | 
    
         
            +
            end
         
     | 
| 
      
 21 
     | 
    
         
            +
             
     | 
| 
      
 22 
     | 
    
         
            +
            hoe = Hoe.new(GEM_NAME, GEM_VERSION) do |p|
         
     | 
| 
      
 23 
     | 
    
         
            +
             
     | 
| 
      
 24 
     | 
    
         
            +
              p.developer(AUTHOR, EMAIL)
         
     | 
| 
      
 25 
     | 
    
         
            +
             
     | 
| 
      
 26 
     | 
    
         
            +
              p.description = PROJECT_DESCRIPTION
         
     | 
| 
      
 27 
     | 
    
         
            +
              p.summary = PROJECT_SUMMARY
         
     | 
| 
      
 28 
     | 
    
         
            +
              p.url = PROJECT_URL
         
     | 
| 
      
 29 
     | 
    
         
            +
             
     | 
| 
      
 30 
     | 
    
         
            +
              p.rubyforge_name = PROJECT_NAME if PROJECT_NAME
         
     | 
| 
      
 31 
     | 
    
         
            +
             
     | 
| 
      
 32 
     | 
    
         
            +
              p.clean_globs |= ["{coverage,doc,log}/", "**/*.db", "profile_results.*", "**/.*.sw?", "*.gem", ".config", "**/.DS_Store"]
         
     | 
| 
      
 33 
     | 
    
         
            +
             
     | 
| 
      
 34 
     | 
    
         
            +
              GEM_DEPENDENCIES.each do |dep|
         
     | 
| 
      
 35 
     | 
    
         
            +
                p.extra_deps << dep
         
     | 
| 
      
 36 
     | 
    
         
            +
              end
         
     | 
| 
      
 37 
     | 
    
         
            +
             
     | 
| 
      
 38 
     | 
    
         
            +
            end
         
     | 
    
        data/tasks/install.rb
    ADDED
    
    | 
         @@ -0,0 +1,20 @@ 
     | 
|
| 
      
 1 
     | 
    
         
            +
            WIN32 = (RUBY_PLATFORM =~ /win32|mingw|bccwin|cygwin/) rescue nil
         
     | 
| 
      
 2 
     | 
    
         
            +
            SUDO = WIN32 ? '' : ('sudo' unless ENV['SUDOLESS'])
         
     | 
| 
      
 3 
     | 
    
         
            +
             
     | 
| 
      
 4 
     | 
    
         
            +
            desc "Install #{GEM_NAME}"
         
     | 
| 
      
 5 
     | 
    
         
            +
            if WIN32
         
     | 
| 
      
 6 
     | 
    
         
            +
              task :install => :gem do
         
     | 
| 
      
 7 
     | 
    
         
            +
                system %{gem install --no-rdoc --no-ri -l pkg/#{GEM_NAME}-#{GEM_VERSION}.gem}
         
     | 
| 
      
 8 
     | 
    
         
            +
              end
         
     | 
| 
      
 9 
     | 
    
         
            +
              namespace :dev do
         
     | 
| 
      
 10 
     | 
    
         
            +
                desc 'Install for development (for windows)'
         
     | 
| 
      
 11 
     | 
    
         
            +
                task :winstall => :gem do
         
     | 
| 
      
 12 
     | 
    
         
            +
                  warn "You can now call 'rake install' instead of 'rake dev:winstall'."
         
     | 
| 
      
 13 
     | 
    
         
            +
                  system %{gem install --no-rdoc --no-ri -l pkg/#{GEM_NAME}-#{GEM_VERSION}.gem}
         
     | 
| 
      
 14 
     | 
    
         
            +
                end
         
     | 
| 
      
 15 
     | 
    
         
            +
              end
         
     | 
| 
      
 16 
     | 
    
         
            +
            else
         
     | 
| 
      
 17 
     | 
    
         
            +
              task :install => :package do
         
     | 
| 
      
 18 
     | 
    
         
            +
                sh %{#{SUDO} gem install --local pkg/#{GEM_NAME}-#{GEM_VERSION}.gem}
         
     | 
| 
      
 19 
     | 
    
         
            +
              end
         
     | 
| 
      
 20 
     | 
    
         
            +
            end
         
     | 
    
        metadata
    CHANGED
    
    | 
         @@ -1,7 +1,7 @@ 
     | 
|
| 
       1 
1 
     | 
    
         
             
            --- !ruby/object:Gem::Specification 
         
     | 
| 
       2 
2 
     | 
    
         
             
            name: dm-core
         
     | 
| 
       3 
3 
     | 
    
         
             
            version: !ruby/object:Gem::Version 
         
     | 
| 
       4 
     | 
    
         
            -
              version: 0.9. 
     | 
| 
      
 4 
     | 
    
         
            +
              version: 0.9.3
         
     | 
| 
       5 
5 
     | 
    
         
             
            platform: ruby
         
     | 
| 
       6 
6 
     | 
    
         
             
            authors: 
         
     | 
| 
       7 
7 
     | 
    
         
             
            - Sam Smoot
         
     | 
| 
         @@ -9,29 +9,32 @@ autorequire: 
     | 
|
| 
       9 
9 
     | 
    
         
             
            bindir: bin
         
     | 
| 
       10 
10 
     | 
    
         
             
            cert_chain: []
         
     | 
| 
       11 
11 
     | 
    
         | 
| 
       12 
     | 
    
         
            -
            date: 2008- 
     | 
| 
      
 12 
     | 
    
         
            +
            date: 2008-07-24 00:00:00 -05:00
         
     | 
| 
       13 
13 
     | 
    
         
             
            default_executable: 
         
     | 
| 
       14 
14 
     | 
    
         
             
            dependencies: 
         
     | 
| 
       15 
15 
     | 
    
         
             
            - !ruby/object:Gem::Dependency 
         
     | 
| 
       16 
16 
     | 
    
         
             
              name: data_objects
         
     | 
| 
      
 17 
     | 
    
         
            +
              type: :runtime
         
     | 
| 
       17 
18 
     | 
    
         
             
              version_requirement: 
         
     | 
| 
       18 
19 
     | 
    
         
             
              version_requirements: !ruby/object:Gem::Requirement 
         
     | 
| 
       19 
20 
     | 
    
         
             
                requirements: 
         
     | 
| 
       20 
21 
     | 
    
         
             
                - - "="
         
     | 
| 
       21 
22 
     | 
    
         
             
                  - !ruby/object:Gem::Version 
         
     | 
| 
       22 
     | 
    
         
            -
                    version: 0.9. 
     | 
| 
      
 23 
     | 
    
         
            +
                    version: 0.9.3
         
     | 
| 
       23 
24 
     | 
    
         
             
                version: 
         
     | 
| 
       24 
25 
     | 
    
         
             
            - !ruby/object:Gem::Dependency 
         
     | 
| 
       25 
26 
     | 
    
         
             
              name: extlib
         
     | 
| 
      
 27 
     | 
    
         
            +
              type: :runtime
         
     | 
| 
       26 
28 
     | 
    
         
             
              version_requirement: 
         
     | 
| 
       27 
29 
     | 
    
         
             
              version_requirements: !ruby/object:Gem::Requirement 
         
     | 
| 
       28 
30 
     | 
    
         
             
                requirements: 
         
     | 
| 
       29 
31 
     | 
    
         
             
                - - "="
         
     | 
| 
       30 
32 
     | 
    
         
             
                  - !ruby/object:Gem::Version 
         
     | 
| 
       31 
     | 
    
         
            -
                    version: 0.9. 
     | 
| 
      
 33 
     | 
    
         
            +
                    version: 0.9.3
         
     | 
| 
       32 
34 
     | 
    
         
             
                version: 
         
     | 
| 
       33 
35 
     | 
    
         
             
            - !ruby/object:Gem::Dependency 
         
     | 
| 
       34 
36 
     | 
    
         
             
              name: rspec
         
     | 
| 
      
 37 
     | 
    
         
            +
              type: :runtime
         
     | 
| 
       35 
38 
     | 
    
         
             
              version_requirement: 
         
     | 
| 
       36 
39 
     | 
    
         
             
              version_requirements: !ruby/object:Gem::Requirement 
         
     | 
| 
       37 
40 
     | 
    
         
             
                requirements: 
         
     | 
| 
         @@ -41,6 +44,7 @@ dependencies: 
     | 
|
| 
       41 
44 
     | 
    
         
             
                version: 
         
     | 
| 
       42 
45 
     | 
    
         
             
            - !ruby/object:Gem::Dependency 
         
     | 
| 
       43 
46 
     | 
    
         
             
              name: addressable
         
     | 
| 
      
 47 
     | 
    
         
            +
              type: :runtime
         
     | 
| 
       44 
48 
     | 
    
         
             
              version_requirement: 
         
     | 
| 
       45 
49 
     | 
    
         
             
              version_requirements: !ruby/object:Gem::Requirement 
         
     | 
| 
       46 
50 
     | 
    
         
             
                requirements: 
         
     | 
| 
         @@ -48,35 +52,55 @@ dependencies: 
     | 
|
| 
       48 
52 
     | 
    
         
             
                  - !ruby/object:Gem::Version 
         
     | 
| 
       49 
53 
     | 
    
         
             
                    version: 1.0.4
         
     | 
| 
       50 
54 
     | 
    
         
             
                version: 
         
     | 
| 
      
 55 
     | 
    
         
            +
            - !ruby/object:Gem::Dependency 
         
     | 
| 
      
 56 
     | 
    
         
            +
              name: hoe
         
     | 
| 
      
 57 
     | 
    
         
            +
              type: :development
         
     | 
| 
      
 58 
     | 
    
         
            +
              version_requirement: 
         
     | 
| 
      
 59 
     | 
    
         
            +
              version_requirements: !ruby/object:Gem::Requirement 
         
     | 
| 
      
 60 
     | 
    
         
            +
                requirements: 
         
     | 
| 
      
 61 
     | 
    
         
            +
                - - ">="
         
     | 
| 
      
 62 
     | 
    
         
            +
                  - !ruby/object:Gem::Version 
         
     | 
| 
      
 63 
     | 
    
         
            +
                    version: 1.7.0
         
     | 
| 
      
 64 
     | 
    
         
            +
                version: 
         
     | 
| 
       51 
65 
     | 
    
         
             
            description: Faster, Better, Simpler.
         
     | 
| 
       52 
     | 
    
         
            -
            email:  
     | 
| 
      
 66 
     | 
    
         
            +
            email: 
         
     | 
| 
      
 67 
     | 
    
         
            +
            - ssmoot@gmail.com
         
     | 
| 
       53 
68 
     | 
    
         
             
            executables: []
         
     | 
| 
       54 
69 
     | 
    
         | 
| 
       55 
70 
     | 
    
         
             
            extensions: []
         
     | 
| 
       56 
71 
     | 
    
         | 
| 
       57 
     | 
    
         
            -
            extra_rdoc_files:  
     | 
| 
       58 
     | 
    
         
            -
             
     | 
| 
      
 72 
     | 
    
         
            +
            extra_rdoc_files: 
         
     | 
| 
      
 73 
     | 
    
         
            +
            - History.txt
         
     | 
| 
      
 74 
     | 
    
         
            +
            - Manifest.txt
         
     | 
| 
      
 75 
     | 
    
         
            +
            - README.txt
         
     | 
| 
       59 
76 
     | 
    
         
             
            files: 
         
     | 
| 
       60 
     | 
    
         
            -
            -  
     | 
| 
      
 77 
     | 
    
         
            +
            - .autotest
         
     | 
| 
       61 
78 
     | 
    
         
             
            - FAQ
         
     | 
| 
       62 
     | 
    
         
            -
            -  
     | 
| 
       63 
     | 
    
         
            -
            - CHANGELOG
         
     | 
| 
      
 79 
     | 
    
         
            +
            - History.txt
         
     | 
| 
       64 
80 
     | 
    
         
             
            - MIT-LICENSE
         
     | 
| 
      
 81 
     | 
    
         
            +
            - Manifest.txt
         
     | 
| 
      
 82 
     | 
    
         
            +
            - QUICKLINKS
         
     | 
| 
      
 83 
     | 
    
         
            +
            - README.txt
         
     | 
| 
      
 84 
     | 
    
         
            +
            - Rakefile
         
     | 
| 
      
 85 
     | 
    
         
            +
            - SPECS
         
     | 
| 
      
 86 
     | 
    
         
            +
            - TODO
         
     | 
| 
      
 87 
     | 
    
         
            +
            - lib/dm-core.rb
         
     | 
| 
      
 88 
     | 
    
         
            +
            - lib/dm-core/adapters.rb
         
     | 
| 
       65 
89 
     | 
    
         
             
            - lib/dm-core/adapters/abstract_adapter.rb
         
     | 
| 
       66 
90 
     | 
    
         
             
            - lib/dm-core/adapters/data_objects_adapter.rb
         
     | 
| 
       67 
91 
     | 
    
         
             
            - lib/dm-core/adapters/mysql_adapter.rb
         
     | 
| 
       68 
92 
     | 
    
         
             
            - lib/dm-core/adapters/postgres_adapter.rb
         
     | 
| 
       69 
93 
     | 
    
         
             
            - lib/dm-core/adapters/sqlite3_adapter.rb
         
     | 
| 
       70 
     | 
    
         
            -
            - lib/dm-core/ 
     | 
| 
      
 94 
     | 
    
         
            +
            - lib/dm-core/associations.rb
         
     | 
| 
       71 
95 
     | 
    
         
             
            - lib/dm-core/associations/many_to_many.rb
         
     | 
| 
       72 
96 
     | 
    
         
             
            - lib/dm-core/associations/many_to_one.rb
         
     | 
| 
       73 
97 
     | 
    
         
             
            - lib/dm-core/associations/one_to_many.rb
         
     | 
| 
       74 
98 
     | 
    
         
             
            - lib/dm-core/associations/one_to_one.rb
         
     | 
| 
       75 
99 
     | 
    
         
             
            - lib/dm-core/associations/relationship.rb
         
     | 
| 
       76 
100 
     | 
    
         
             
            - lib/dm-core/associations/relationship_chain.rb
         
     | 
| 
       77 
     | 
    
         
            -
            - lib/dm-core/associations.rb
         
     | 
| 
       78 
101 
     | 
    
         
             
            - lib/dm-core/auto_migrations.rb
         
     | 
| 
       79 
102 
     | 
    
         
             
            - lib/dm-core/collection.rb
         
     | 
| 
      
 103 
     | 
    
         
            +
            - lib/dm-core/dependency_queue.rb
         
     | 
| 
       80 
104 
     | 
    
         
             
            - lib/dm-core/hook.rb
         
     | 
| 
       81 
105 
     | 
    
         
             
            - lib/dm-core/identity_map.rb
         
     | 
| 
       82 
106 
     | 
    
         
             
            - lib/dm-core/is.rb
         
     | 
| 
         @@ -91,15 +115,16 @@ files: 
     | 
|
| 
       91 
115 
     | 
    
         
             
            - lib/dm-core/repository.rb
         
     | 
| 
       92 
116 
     | 
    
         
             
            - lib/dm-core/resource.rb
         
     | 
| 
       93 
117 
     | 
    
         
             
            - lib/dm-core/scope.rb
         
     | 
| 
      
 118 
     | 
    
         
            +
            - lib/dm-core/support.rb
         
     | 
| 
       94 
119 
     | 
    
         
             
            - lib/dm-core/support/array.rb
         
     | 
| 
       95 
120 
     | 
    
         
             
            - lib/dm-core/support/assertions.rb
         
     | 
| 
       96 
121 
     | 
    
         
             
            - lib/dm-core/support/errors.rb
         
     | 
| 
       97 
122 
     | 
    
         
             
            - lib/dm-core/support/kernel.rb
         
     | 
| 
       98 
123 
     | 
    
         
             
            - lib/dm-core/support/symbol.rb
         
     | 
| 
       99 
     | 
    
         
            -
            - lib/dm-core/support.rb
         
     | 
| 
       100 
124 
     | 
    
         
             
            - lib/dm-core/transaction.rb
         
     | 
| 
       101 
125 
     | 
    
         
             
            - lib/dm-core/type.rb
         
     | 
| 
       102 
126 
     | 
    
         
             
            - lib/dm-core/type_map.rb
         
     | 
| 
      
 127 
     | 
    
         
            +
            - lib/dm-core/types.rb
         
     | 
| 
       103 
128 
     | 
    
         
             
            - lib/dm-core/types/boolean.rb
         
     | 
| 
       104 
129 
     | 
    
         
             
            - lib/dm-core/types/discriminator.rb
         
     | 
| 
       105 
130 
     | 
    
         
             
            - lib/dm-core/types/object.rb
         
     | 
| 
         @@ -107,8 +132,10 @@ files: 
     | 
|
| 
       107 
132 
     | 
    
         
             
            - lib/dm-core/types/paranoid_datetime.rb
         
     | 
| 
       108 
133 
     | 
    
         
             
            - lib/dm-core/types/serial.rb
         
     | 
| 
       109 
134 
     | 
    
         
             
            - lib/dm-core/types/text.rb
         
     | 
| 
       110 
     | 
    
         
            -
            - lib/dm-core/ 
     | 
| 
       111 
     | 
    
         
            -
            -  
     | 
| 
      
 135 
     | 
    
         
            +
            - lib/dm-core/version.rb
         
     | 
| 
      
 136 
     | 
    
         
            +
            - script/all
         
     | 
| 
      
 137 
     | 
    
         
            +
            - script/performance.rb
         
     | 
| 
      
 138 
     | 
    
         
            +
            - script/profile.rb
         
     | 
| 
       112 
139 
     | 
    
         
             
            - spec/integration/association_spec.rb
         
     | 
| 
       113 
140 
     | 
    
         
             
            - spec/integration/association_through_spec.rb
         
     | 
| 
       114 
141 
     | 
    
         
             
            - spec/integration/associations/many_to_many_spec.rb
         
     | 
| 
         @@ -117,6 +144,7 @@ files: 
     | 
|
| 
       117 
144 
     | 
    
         
             
            - spec/integration/auto_migrations_spec.rb
         
     | 
| 
       118 
145 
     | 
    
         
             
            - spec/integration/collection_spec.rb
         
     | 
| 
       119 
146 
     | 
    
         
             
            - spec/integration/data_objects_adapter_spec.rb
         
     | 
| 
      
 147 
     | 
    
         
            +
            - spec/integration/dependency_queue_spec.rb
         
     | 
| 
       120 
148 
     | 
    
         
             
            - spec/integration/model_spec.rb
         
     | 
| 
       121 
149 
     | 
    
         
             
            - spec/integration/mysql_adapter_spec.rb
         
     | 
| 
       122 
150 
     | 
    
         
             
            - spec/integration/postgres_adapter_spec.rb
         
     | 
| 
         @@ -126,9 +154,16 @@ files: 
     | 
|
| 
       126 
154 
     | 
    
         
             
            - spec/integration/resource_spec.rb
         
     | 
| 
       127 
155 
     | 
    
         
             
            - spec/integration/sqlite3_adapter_spec.rb
         
     | 
| 
       128 
156 
     | 
    
         
             
            - spec/integration/sti_spec.rb
         
     | 
| 
      
 157 
     | 
    
         
            +
            - spec/integration/strategic_eager_loading_spec.rb
         
     | 
| 
       129 
158 
     | 
    
         
             
            - spec/integration/transaction_spec.rb
         
     | 
| 
       130 
159 
     | 
    
         
             
            - spec/integration/type_spec.rb
         
     | 
| 
      
 160 
     | 
    
         
            +
            - spec/lib/logging_helper.rb
         
     | 
| 
       131 
161 
     | 
    
         
             
            - spec/lib/mock_adapter.rb
         
     | 
| 
      
 162 
     | 
    
         
            +
            - spec/lib/model_loader.rb
         
     | 
| 
      
 163 
     | 
    
         
            +
            - spec/lib/publicize_methods.rb
         
     | 
| 
      
 164 
     | 
    
         
            +
            - spec/models/vehicles.rb
         
     | 
| 
      
 165 
     | 
    
         
            +
            - spec/models/zoo.rb
         
     | 
| 
      
 166 
     | 
    
         
            +
            - spec/spec.opts
         
     | 
| 
       132 
167 
     | 
    
         
             
            - spec/spec_helper.rb
         
     | 
| 
       133 
168 
     | 
    
         
             
            - spec/unit/adapters/abstract_adapter_spec.rb
         
     | 
| 
       134 
169 
     | 
    
         
             
            - spec/unit/adapters/adapter_shared_spec.rb
         
     | 
| 
         @@ -157,11 +192,17 @@ files: 
     | 
|
| 
       157 
192 
     | 
    
         
             
            - spec/unit/transaction_spec.rb
         
     | 
| 
       158 
193 
     | 
    
         
             
            - spec/unit/type_map_spec.rb
         
     | 
| 
       159 
194 
     | 
    
         
             
            - spec/unit/type_spec.rb
         
     | 
| 
       160 
     | 
    
         
            -
             
     | 
| 
      
 195 
     | 
    
         
            +
            - tasks/ci.rb
         
     | 
| 
      
 196 
     | 
    
         
            +
            - tasks/dm.rb
         
     | 
| 
      
 197 
     | 
    
         
            +
            - tasks/doc.rb
         
     | 
| 
      
 198 
     | 
    
         
            +
            - tasks/hoe.rb
         
     | 
| 
      
 199 
     | 
    
         
            +
            - tasks/install.rb
         
     | 
| 
      
 200 
     | 
    
         
            +
            has_rdoc: true
         
     | 
| 
       161 
201 
     | 
    
         
             
            homepage: http://datamapper.org
         
     | 
| 
       162 
202 
     | 
    
         
             
            post_install_message: 
         
     | 
| 
       163 
     | 
    
         
            -
            rdoc_options:  
     | 
| 
       164 
     | 
    
         
            -
             
     | 
| 
      
 203 
     | 
    
         
            +
            rdoc_options: 
         
     | 
| 
      
 204 
     | 
    
         
            +
            - --main
         
     | 
| 
      
 205 
     | 
    
         
            +
            - README.txt
         
     | 
| 
       165 
206 
     | 
    
         
             
            require_paths: 
         
     | 
| 
       166 
207 
     | 
    
         
             
            - lib
         
     | 
| 
       167 
208 
     | 
    
         
             
            required_ruby_version: !ruby/object:Gem::Requirement 
         
     | 
| 
         @@ -176,10 +217,10 @@ required_rubygems_version: !ruby/object:Gem::Requirement 
     | 
|
| 
       176 
217 
     | 
    
         
             
                - !ruby/object:Gem::Version 
         
     | 
| 
       177 
218 
     | 
    
         
             
                  version: "0"
         
     | 
| 
       178 
219 
     | 
    
         
             
              version: 
         
     | 
| 
       179 
     | 
    
         
            -
            requirements: 
         
     | 
| 
       180 
     | 
    
         
            -
             
     | 
| 
       181 
     | 
    
         
            -
            rubyforge_project:  
     | 
| 
       182 
     | 
    
         
            -
            rubygems_version: 1.0 
     | 
| 
      
 220 
     | 
    
         
            +
            requirements: []
         
     | 
| 
      
 221 
     | 
    
         
            +
             
     | 
| 
      
 222 
     | 
    
         
            +
            rubyforge_project: datamapper
         
     | 
| 
      
 223 
     | 
    
         
            +
            rubygems_version: 1.2.0
         
     | 
| 
       183 
224 
     | 
    
         
             
            signing_key: 
         
     | 
| 
       184 
225 
     | 
    
         
             
            specification_version: 2
         
     | 
| 
       185 
226 
     | 
    
         
             
            summary: An Object/Relational Mapper for Ruby
         
     |