dm-core 0.9.9 → 0.9.10

Sign up to get free protection for your applications and to get access to all the features.
Files changed (52) hide show
  1. data/History.txt +10 -0
  2. data/MIT-LICENSE +1 -1
  3. data/Rakefile +4 -4
  4. data/dm-core.gemspec +14 -12
  5. data/lib/dm-core.rb +1 -1
  6. data/lib/dm-core/adapters/data_objects_adapter.rb +2 -2
  7. data/lib/dm-core/adapters/mysql_adapter.rb +1 -1
  8. data/lib/dm-core/adapters/postgres_adapter.rb +1 -1
  9. data/lib/dm-core/adapters/sqlite3_adapter.rb +1 -1
  10. data/lib/dm-core/associations/many_to_one.rb +1 -1
  11. data/lib/dm-core/associations/one_to_many.rb +18 -18
  12. data/lib/dm-core/associations/relationship.rb +9 -3
  13. data/lib/dm-core/associations/relationship_chain.rb +1 -1
  14. data/lib/dm-core/collection.rb +3 -3
  15. data/lib/dm-core/model.rb +5 -4
  16. data/lib/dm-core/resource.rb +11 -5
  17. data/lib/dm-core/version.rb +1 -1
  18. data/script/all +3 -4
  19. data/spec/integration/association_spec.rb +18 -18
  20. data/spec/integration/association_through_spec.rb +4 -4
  21. data/spec/integration/associations/many_to_many_spec.rb +9 -9
  22. data/spec/integration/associations/many_to_one_spec.rb +1 -1
  23. data/spec/integration/associations/one_to_many_spec.rb +3 -3
  24. data/spec/integration/collection_spec.rb +2 -2
  25. data/spec/integration/dependency_queue_spec.rb +1 -1
  26. data/spec/integration/model_spec.rb +1 -1
  27. data/spec/integration/mysql_adapter_spec.rb +1 -1
  28. data/spec/integration/postgres_adapter_spec.rb +16 -16
  29. data/spec/integration/property_spec.rb +10 -6
  30. data/spec/integration/query_spec.rb +4 -4
  31. data/spec/integration/repository_spec.rb +1 -1
  32. data/spec/integration/sqlite3_adapter_spec.rb +7 -7
  33. data/spec/integration/sti_spec.rb +6 -6
  34. data/spec/integration/strategic_eager_loading_spec.rb +14 -11
  35. data/spec/integration/type_spec.rb +10 -6
  36. data/spec/lib/logging_helper.rb +11 -11
  37. data/spec/spec_helper.rb +8 -4
  38. data/spec/unit/adapters/data_objects_adapter_spec.rb +9 -5
  39. data/spec/unit/adapters/in_memory_adapter_spec.rb +1 -1
  40. data/spec/unit/adapters/postgres_adapter_spec.rb +5 -5
  41. data/spec/unit/associations/many_to_many_spec.rb +2 -2
  42. data/spec/unit/associations/many_to_one_spec.rb +3 -3
  43. data/spec/unit/associations/one_to_many_spec.rb +2 -2
  44. data/spec/unit/associations/relationship_spec.rb +6 -6
  45. data/spec/unit/associations_spec.rb +21 -21
  46. data/spec/unit/identity_map_spec.rb +3 -3
  47. data/spec/unit/is_spec.rb +7 -7
  48. data/spec/unit/property_spec.rb +7 -7
  49. data/spec/unit/resource_spec.rb +12 -12
  50. data/spec/unit/transaction_spec.rb +1 -1
  51. data/tasks/dm.rb +1 -1
  52. metadata +6 -6
@@ -2,18 +2,18 @@ require File.expand_path(File.join(File.dirname(__FILE__), '..', 'spec_helper'))
2
2
 
3
3
  describe "DataMapper::IdentityMap" do
4
4
  before(:all) do
5
- class Cow
5
+ class ::Cow
6
6
  include DataMapper::Resource
7
7
  property :id, Integer, :key => true
8
8
  property :name, String
9
9
  end
10
10
 
11
- class Chicken
11
+ class ::Chicken
12
12
  include DataMapper::Resource
13
13
  property :name, String
14
14
  end
15
15
 
16
- class Pig
16
+ class ::Pig
17
17
  include DataMapper::Resource
18
18
  property :id, Integer, :key => true
19
19
  property :composite, Integer, :key => true
data/spec/unit/is_spec.rb CHANGED
@@ -3,7 +3,7 @@ require File.expand_path(File.join(File.dirname(__FILE__), '..', 'spec_helper'))
3
3
  describe "DataMapper::Is" do
4
4
  describe ".is" do
5
5
 
6
- module DataMapper
6
+ module ::DataMapper
7
7
 
8
8
  module Is
9
9
  module Example
@@ -32,17 +32,17 @@ describe "DataMapper::Is" do
32
32
  end # module Model
33
33
  end # module DataMapper
34
34
 
35
- class House
35
+ class ::House
36
36
  include DataMapper::Resource
37
37
  end
38
38
 
39
- class Cabin
39
+ class ::Cabin
40
40
  include DataMapper::Resource
41
41
  end
42
42
 
43
43
  it "should raise error unless it finds the plugin" do
44
44
  lambda do
45
- class House
45
+ class ::House
46
46
  is :no_plugin_by_this_name
47
47
  end
48
48
  end.should raise_error(DataMapper::PluginNotFoundError)
@@ -50,14 +50,14 @@ describe "DataMapper::Is" do
50
50
 
51
51
  it "should call plugin is_* method" do
52
52
  lambda do
53
- class House
53
+ class ::House
54
54
  is :example
55
55
  end
56
56
  end.should_not raise_error
57
57
  end
58
58
 
59
59
  it "should pass through arguments to plugin is_* method" do
60
- class House
60
+ class ::House
61
61
  is :example ,:option1 => :ping, :option2 => :pong
62
62
  end
63
63
 
@@ -68,7 +68,7 @@ describe "DataMapper::Is" do
68
68
  it "should not add class_methods before the plugin is activated" do
69
69
  Cabin.respond_to?(:example_class_method).should be_false
70
70
 
71
- class Cabin
71
+ class ::Cabin
72
72
  is :example
73
73
  end
74
74
 
@@ -3,14 +3,14 @@ require File.expand_path(File.join(File.dirname(__FILE__), '..', 'spec_helper'))
3
3
  describe DataMapper::Property do
4
4
  before :each do
5
5
  Object.send(:remove_const, :Zoo) if defined?(Zoo)
6
- class Zoo
6
+ class ::Zoo
7
7
  include DataMapper::Resource
8
8
 
9
9
  property :id, DataMapper::Types::Serial
10
10
  end
11
11
 
12
12
  Object.send(:remove_const, :Name) if defined?(Name)
13
- class Name < DataMapper::Type
13
+ class ::Name < DataMapper::Type
14
14
  primitive String
15
15
  track :hash
16
16
 
@@ -28,7 +28,7 @@ describe DataMapper::Property do
28
28
  end
29
29
 
30
30
  Object.send(:remove_const, :Tomato) if defined?(Tomato)
31
- class Tomato
31
+ class ::Tomato
32
32
  include DataMapper::Resource
33
33
  end
34
34
  end
@@ -286,7 +286,7 @@ describe DataMapper::Property do
286
286
 
287
287
  it "should not have key that is lazy" do
288
288
  Zoo.class_eval do
289
- property :id, DataMapper::Types::Text, :key => true
289
+ property :id, String, :lazy => true, :key => true
290
290
  property :name, String, :lazy => true
291
291
  end
292
292
  Zoo.auto_migrate!
@@ -429,8 +429,8 @@ describe DataMapper::Property do
429
429
  Tomato.class_eval <<-RUBY
430
430
  property :botanical_name, String, #{input.inspect}
431
431
  RUBY
432
- Tomato.send("#{output[0]}_instance_methods").should include("botanical_name")
433
- Tomato.send("#{output[1]}_instance_methods").should include("botanical_name=")
432
+ Tomato.send("#{output[0]}_instance_methods").map { |m| m.to_s }.should include("botanical_name")
433
+ Tomato.send("#{output[1]}_instance_methods").map { |m| m.to_s }.should include("botanical_name=")
434
434
  end
435
435
  end
436
436
 
@@ -466,7 +466,7 @@ describe DataMapper::Property do
466
466
  # end
467
467
 
468
468
  it "should append ? to TrueClass property reader methods" do
469
- class Potato
469
+ class ::Potato
470
470
  include DataMapper::Resource
471
471
  property :id, Integer, :key => true
472
472
  property :fresh, TrueClass
@@ -60,7 +60,7 @@ end
60
60
  describe DataMapper::Resource do
61
61
  before(:each) do
62
62
  Object.send(:remove_const, :Planet) if defined?(Planet)
63
- class Planet
63
+ class ::Planet
64
64
  include DataMapper::Resource
65
65
 
66
66
  storage_names[:legacy] = "dying_planets"
@@ -86,7 +86,7 @@ describe DataMapper::Resource do
86
86
  end
87
87
 
88
88
  Object.send(:remove_const, :Phone) if defined?(Phone)
89
- class Phone
89
+ class ::Phone
90
90
  include DataMapper::Resource
91
91
 
92
92
  property :name, String, :key => true
@@ -94,7 +94,7 @@ describe DataMapper::Resource do
94
94
  end
95
95
 
96
96
  Object.send(:remove_const, :Fruit) if defined?(Fruit)
97
- class Fruit
97
+ class ::Fruit
98
98
  include DataMapper::Resource
99
99
 
100
100
  property :id, Integer, :key => true
@@ -102,7 +102,7 @@ describe DataMapper::Resource do
102
102
  end
103
103
 
104
104
  Object.send(:remove_const, :Grain) if defined?(Grain)
105
- class Grain
105
+ class ::Grain
106
106
  include DataMapper::Resource
107
107
 
108
108
  property :id, Serial
@@ -110,7 +110,7 @@ describe DataMapper::Resource do
110
110
  end
111
111
 
112
112
  Object.send(:remove_const, :Vegetable) if defined?(Vegetable)
113
- class Vegetable
113
+ class ::Vegetable
114
114
  include DataMapper::Resource
115
115
 
116
116
  property :id, Serial
@@ -118,12 +118,12 @@ describe DataMapper::Resource do
118
118
  end
119
119
 
120
120
  Object.send(:remove_const, :Banana) if defined?(Banana)
121
- class Banana < Fruit
121
+ class ::Banana < Fruit
122
122
  property :type, Discriminator
123
123
  end
124
124
 
125
125
  Object.send(:remove_const, :Cyclist) if defined?(Cyclist)
126
- class Cyclist
126
+ class ::Cyclist
127
127
  include DataMapper::Resource
128
128
  property :id, Serial
129
129
  property :victories, Integer
@@ -568,7 +568,7 @@ describe DataMapper::Resource do
568
568
 
569
569
  describe "inheritance" do
570
570
  before(:all) do
571
- class Media
571
+ class ::Media
572
572
  include DataMapper::Resource
573
573
 
574
574
  storage_names[:default] = 'media'
@@ -577,7 +577,7 @@ describe DataMapper::Resource do
577
577
  property :name, String, :key => true
578
578
  end
579
579
 
580
- class NewsPaper < Media
580
+ class ::NewsPaper < Media
581
581
 
582
582
  storage_names[:east_coast] = 'mother'
583
583
 
@@ -600,7 +600,7 @@ describe DataMapper::Resource do
600
600
 
601
601
  describe "Single-table Inheritance" do
602
602
  before(:all) do
603
- class Plant
603
+ class ::Plant
604
604
  include DataMapper::Resource
605
605
 
606
606
  property :id, Integer, :key => true
@@ -615,13 +615,13 @@ describe DataMapper::Resource do
615
615
  end
616
616
  end
617
617
 
618
- class HousePlant < Plant
618
+ class ::HousePlant < Plant
619
619
  def calculate(int)
620
620
  int ** 3
621
621
  end
622
622
  end
623
623
 
624
- class PoisonIvy < Plant
624
+ class ::PoisonIvy < Plant
625
625
  def length=(len)
626
626
  attribute_set(:length, len - 1)
627
627
  end
@@ -3,7 +3,7 @@ require File.expand_path(File.join(File.dirname(__FILE__), '..', 'spec_helper'))
3
3
  describe DataMapper::Transaction do
4
4
 
5
5
  before :all do
6
- class Smurf
6
+ class ::Smurf
7
7
  include DataMapper::Resource
8
8
  property :id, Integer, :key => true
9
9
  end
data/tasks/dm.rb CHANGED
@@ -16,7 +16,7 @@ namespace :dm do
16
16
  def run_spec(name, files, rcov)
17
17
  Spec::Rake::SpecTask.new(name) do |t|
18
18
  t.spec_opts << '--colour' << '--loadby' << 'random'
19
- t.spec_files = Pathname.glob(ENV['FILES'] || files.to_s)
19
+ t.spec_files = Pathname.glob(ENV['FILES'] || files.to_s).map { |f| f.to_s }
20
20
  t.rcov = rcov
21
21
  t.rcov_opts << '--exclude' << 'spec,environment.rb'
22
22
  t.rcov_opts << '--text-summary'
metadata CHANGED
@@ -1,15 +1,15 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dm-core
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.9.9
4
+ version: 0.9.10
5
5
  platform: ruby
6
6
  authors:
7
- - Sam Smoot
7
+ - Dan Kubb
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2009-01-04 00:00:00 -08:00
12
+ date: 2009-01-19 00:00:00 -08:00
13
13
  default_executable:
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
@@ -20,7 +20,7 @@ dependencies:
20
20
  requirements:
21
21
  - - ~>
22
22
  - !ruby/object:Gem::Version
23
- version: 0.9.10
23
+ version: 0.9.11
24
24
  version:
25
25
  - !ruby/object:Gem::Dependency
26
26
  name: extlib
@@ -30,7 +30,7 @@ dependencies:
30
30
  requirements:
31
31
  - - ~>
32
32
  - !ruby/object:Gem::Version
33
- version: 0.9.9
33
+ version: 0.9.10
34
34
  version:
35
35
  - !ruby/object:Gem::Dependency
36
36
  name: addressable
@@ -44,7 +44,7 @@ dependencies:
44
44
  version:
45
45
  description: Faster, Better, Simpler.
46
46
  email:
47
- - ssmoot@gmail.com
47
+ - dan.kubb@gmail.com
48
48
  executables: []
49
49
 
50
50
  extensions: []