tenacity 0.4.1 → 0.5.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (71) hide show
  1. data/.gitignore +1 -0
  2. data/EXTEND.rdoc +18 -21
  3. data/Gemfile +0 -2
  4. data/README.rdoc +3 -1
  5. data/Rakefile +7 -0
  6. data/history.txt +17 -0
  7. data/lib/tenacity.rb +4 -0
  8. data/lib/tenacity/associates_proxy.rb +5 -7
  9. data/lib/tenacity/association.rb +9 -47
  10. data/lib/tenacity/associations/belongs_to.rb +1 -2
  11. data/lib/tenacity/associations/has_many.rb +27 -21
  12. data/lib/tenacity/associations/has_one.rb +3 -2
  13. data/lib/tenacity/class_methods.rb +14 -60
  14. data/lib/tenacity/errors.rb +8 -0
  15. data/lib/tenacity/instance_methods.rb +42 -12
  16. data/lib/tenacity/orm_ext/activerecord.rb +11 -32
  17. data/lib/tenacity/orm_ext/couchrest.rb +14 -22
  18. data/lib/tenacity/orm_ext/datamapper.rb +14 -31
  19. data/lib/tenacity/orm_ext/helpers.rb +3 -3
  20. data/lib/tenacity/orm_ext/mongo_mapper.rb +16 -22
  21. data/lib/tenacity/orm_ext/mongoid.rb +10 -18
  22. data/lib/tenacity/orm_ext/ripple.rb +270 -0
  23. data/lib/tenacity/orm_ext/sequel.rb +21 -33
  24. data/lib/tenacity/orm_ext/toystore.rb +114 -0
  25. data/lib/tenacity/version.rb +1 -1
  26. data/tenacity.gemspec +10 -3
  27. data/test/association_features/belongs_to_test.rb +12 -0
  28. data/test/association_features/has_many_test.rb +32 -2
  29. data/test/association_features/has_one_test.rb +18 -4
  30. data/test/associations/has_one_test.rb +0 -1
  31. data/test/core/classmethods_test.rb +7 -0
  32. data/test/fixtures/active_record_has_many_target.rb +4 -0
  33. data/test/fixtures/active_record_has_one_target.rb +4 -0
  34. data/test/fixtures/active_record_object.rb +8 -0
  35. data/test/fixtures/couch_rest_has_many_target.rb +4 -0
  36. data/test/fixtures/couch_rest_has_one_target.rb +4 -0
  37. data/test/fixtures/couch_rest_object.rb +8 -0
  38. data/test/fixtures/data_mapper_has_many_target.rb +10 -0
  39. data/test/fixtures/data_mapper_has_one_target.rb +10 -0
  40. data/test/fixtures/data_mapper_object.rb +8 -0
  41. data/test/fixtures/mongo_mapper_has_many_target.rb +4 -0
  42. data/test/fixtures/mongo_mapper_has_one_target.rb +4 -0
  43. data/test/fixtures/mongo_mapper_object.rb +8 -0
  44. data/test/fixtures/mongoid_has_many_target.rb +4 -0
  45. data/test/fixtures/mongoid_has_one_target.rb +4 -0
  46. data/test/fixtures/mongoid_object.rb +8 -0
  47. data/test/fixtures/no_associations.rb +4 -0
  48. data/test/fixtures/ripple_has_many_target.rb +24 -0
  49. data/test/fixtures/ripple_has_one_target.rb +24 -0
  50. data/test/fixtures/ripple_object.rb +42 -0
  51. data/test/fixtures/sequel_has_many_target.rb +4 -0
  52. data/test/fixtures/sequel_has_one_target.rb +4 -0
  53. data/test/fixtures/sequel_object.rb +8 -0
  54. data/test/fixtures/toystore_has_many_target.rb +28 -0
  55. data/test/fixtures/toystore_has_one_target.rb +28 -0
  56. data/test/fixtures/toystore_object.rb +46 -0
  57. data/test/helpers/active_record_test_helper.rb +12 -95
  58. data/test/helpers/data_mapper_test_helper.rb +0 -64
  59. data/test/helpers/ripple_test_helper.rb +19 -0
  60. data/test/helpers/sequel_test_helper.rb +13 -60
  61. data/test/helpers/toystore_test_helper.rb +17 -0
  62. data/test/orm_ext/activerecord_test.rb +16 -26
  63. data/test/orm_ext/couchrest_test.rb +10 -29
  64. data/test/orm_ext/datamapper_test.rb +16 -29
  65. data/test/orm_ext/mongo_mapper_test.rb +11 -29
  66. data/test/orm_ext/mongoid_test.rb +11 -29
  67. data/test/orm_ext/ripple_test.rb +140 -0
  68. data/test/orm_ext/sequel_test.rb +15 -26
  69. data/test/orm_ext/toystore_test.rb +103 -0
  70. data/test/test_helper.rb +35 -23
  71. metadata +99 -133
@@ -37,11 +37,12 @@ class SequelTest < Test::Unit::TestCase
37
37
  end
38
38
 
39
39
  should "be able to find all associates of an object" do
40
- object = SequelObject.create
41
- has_many_target_1 = SequelHasManyTarget.create(:sequel_object_id => object.id)
42
- has_many_target_2 = SequelHasManyTarget.create(:sequel_object_id => object.id)
43
- has_many_target_3 = SequelHasManyTarget.create(:sequel_object_id => '9999999')
44
- assert_set_equal [has_many_target_1, has_many_target_2], SequelHasManyTarget._t_find_all_by_associate(:sequel_object_id, object.id)
40
+ object_1 = SequelObject.create
41
+ object_2 = SequelObject.create
42
+ has_many_target_1 = SequelHasManyTarget.create(:sequel_object_id => object_1.id)
43
+ has_many_target_2 = SequelHasManyTarget.create(:sequel_object_id => object_1.id)
44
+ has_many_target_3 = SequelHasManyTarget.create(:sequel_object_id => object_2.id)
45
+ assert_set_equal [has_many_target_1, has_many_target_2], SequelHasManyTarget._t_find_all_by_associate(:sequel_object_id, object_1.id)
45
46
  end
46
47
 
47
48
  should "return an empty array able to find the associates of an object" do
@@ -52,36 +53,24 @@ class SequelTest < Test::Unit::TestCase
52
53
  object = SequelHasOneTarget.create
53
54
  object.mongo_mapper_object_id = 'abc123'
54
55
  assert_equal 'abc123', object.mongo_mapper_object_id
55
- object.reload
56
+ object._t_reload
56
57
  assert_nil object.mongo_mapper_object_id
57
58
  end
58
59
 
59
- should "be able to clear the associates of a given object" do
60
+ should "be able to get the ids of the objects associated with the given object" do
60
61
  object = SequelObject.create
61
- object._t_associate_many(association, ['abc123', 'def456', 'ghi789'])
62
+ has_many_target_1 = SequelHasManyTarget.create
63
+ has_many_target_2 = SequelHasManyTarget.create
64
+ has_many_target_3 = SequelHasManyTarget.create
65
+ object.sequel_has_many_targets = [has_many_target_1, has_many_target_2, has_many_target_3]
62
66
  object.save
63
- object._t_clear_associates(association)
64
- assert_set_equal [], object._t_get_associate_ids(association)
65
- end
66
67
 
67
- should "be able to associate many objects with the given object" do
68
- object = SequelObject.create
69
- object._t_associate_many(association, ['abc123', 'def456', 'ghi789'])
70
-
71
- rows = DB["select mongo_mapper_has_many_target_id from mongo_mapper_has_many_targets_sequel_objects where sequel_object_id = #{object.id}"].all
72
- ids = rows.map { |row| row[:mongo_mapper_has_many_target_id] }
73
- assert_set_equal ['abc123', 'def456', 'ghi789'], ids
74
- end
75
-
76
- should "be able to get the ids of the objects associated with the given object" do
77
- object = SequelObject.create
78
- object._t_associate_many(association, ['abc123', 'def456', 'ghi789'])
79
- assert_set_equal ['abc123', 'def456', 'ghi789'], object._t_get_associate_ids(association)
68
+ assert_set_equal [has_many_target_1.id, has_many_target_2.id, has_many_target_3.id], SequelHasManyTarget._t_find_all_ids_by_associate("sequel_object_id", object.id)
80
69
  end
81
70
 
82
71
  should "return an empty array if there are no objects associated with the given object ids" do
83
72
  object = SequelObject.create
84
- assert_set_equal [], object._t_get_associate_ids(association)
73
+ assert_set_equal [], SequelHasManyTarget._t_find_all_ids_by_associate("sequel_object_id", object.id)
85
74
  end
86
75
 
87
76
  should "be able to delete a set of objects, issuing their callbacks" do
@@ -108,6 +97,6 @@ class SequelTest < Test::Unit::TestCase
108
97
  private
109
98
 
110
99
  def association
111
- Tenacity::Association.new(:t_has_many, :mongo_mapper_has_many_targets, SequelObject)
100
+ Tenacity::Association.new(:t_has_many, :sequel_has_many_targets, SequelObject)
112
101
  end
113
102
  end
@@ -0,0 +1,103 @@
1
+ require 'test_helper'
2
+
3
+ require_toystore do
4
+ class ToystoreTest < Test::Unit::TestCase
5
+
6
+ context "The Toystore extension" do
7
+ setup do
8
+ setup_fixtures
9
+ end
10
+
11
+ should "be able to find the object in the database" do
12
+ object = ToystoreObject.create
13
+ assert_equal object, ToystoreObject._t_find(object.id)
14
+ end
15
+
16
+ should "return nil if the specified id could not be found in the database" do
17
+ assert_nil ToystoreObject._t_find('4d0e1224b28cdbfb72000042')
18
+ end
19
+
20
+ should "be able to find multiple objects in the database" do
21
+ object_1 = ToystoreObject.create
22
+ object_2 = ToystoreObject.create
23
+ assert_set_equal [object_1], ToystoreObject._t_find_bulk([object_1.id])
24
+ assert_set_equal [object_1, object_2], ToystoreObject._t_find_bulk([object_1.id, object_2.id, '4d0e1224b28cdbfb72000042'])
25
+ end
26
+
27
+ should "return an empty array if none of the specified object ids could be found in the database" do
28
+ assert_equal [], ToystoreObject._t_find_bulk(['4d0e1224b28cdbfb72000042', '4d0e1224b28cdbfb72000043', '4d0e1224b28cdbfb72000044'])
29
+ end
30
+
31
+ should "be able to find the first associate of an object" do
32
+ object = ToystoreObject.create
33
+ target = ToystoreHasOneTarget.create(:toystore_object_id => object.id)
34
+ assert_equal target, ToystoreHasOneTarget._t_find_first_by_associate(:toystore_object_id, object.id)
35
+ end
36
+
37
+ should "return nil if the first associate of an object could not be found" do
38
+ assert_nil ToystoreHasOneTarget._t_find_first_by_associate(:toystore_object_id, 12345)
39
+ end
40
+
41
+ should "be able to find the associates of an object" do
42
+ object_1 = ToystoreObject.create
43
+ object_2 = ToystoreObject.create
44
+ target_1 = ToystoreHasOneTarget.create(:toystore_object_id => object_1.id)
45
+ target_2 = ToystoreHasOneTarget.create(:toystore_object_id => object_1.id)
46
+ target_3 = ToystoreHasOneTarget.create(:toystore_object_id => object_2.id)
47
+ assert_set_equal [target_1, target_2], ToystoreHasOneTarget._t_find_all_by_associate(:toystore_object_id, object_1.id)
48
+ end
49
+
50
+ should "return an empty array if the object has no associates" do
51
+ assert_equal [], ToystoreHasOneTarget._t_find_all_by_associate(:toystore_object_id, '1234')
52
+ end
53
+
54
+ should "be able to get the ids of the objects associated with the given object" do
55
+ object = ToystoreObject.create
56
+ target_1 = ToystoreHasManyTarget.create
57
+ target_2 = ToystoreHasManyTarget.create
58
+ target_3 = ToystoreHasManyTarget.create
59
+ object.toystore_has_many_targets = [target_1, target_2, target_3]
60
+ object.save
61
+
62
+ assert_set_equal [target_1.id, target_2.id, target_3.id], ToystoreHasManyTarget._t_find_all_ids_by_associate(:toystore_object_id, object.id)
63
+ end
64
+
65
+ should "return an empty array when trying to fetch associate ids for an object with no associates" do
66
+ object = ToystoreObject.create
67
+ assert_set_equal [], ToystoreHasManyTarget._t_find_all_ids_by_associate(:toystore_object_id, object.id)
68
+ end
69
+
70
+ should "be able to reload an object from the database" do
71
+ target = ToystoreHasOneTarget.create
72
+ target.toystore_object_id = '101'
73
+ assert_equal '101', target.toystore_object_id
74
+ target._t_reload
75
+ assert_nil target.toystore_object_id
76
+ end
77
+
78
+ should "be able to delete a set of objects, issuing their callbacks" do
79
+ object_1 = ToystoreHasManyTarget.create
80
+ object_2 = ToystoreHasManyTarget.create
81
+ object_3 = ToystoreHasManyTarget.create
82
+
83
+ assert_equal 3, ToystoreHasManyTarget.get_multi(object_1.id, object_2.id, object_3.id).compact.size
84
+ ToystoreHasManyTarget._t_delete([object_1.id, object_2.id, object_3.id])
85
+ assert_equal 0, ToystoreHasManyTarget.get_multi(object_1.id, object_2.id, object_3.id).compact.size
86
+ end
87
+
88
+ should "be able to delete a setup of objects, without issuing their callbacks" do
89
+ object_1 = ToystoreHasManyTarget.create
90
+ object_2 = ToystoreHasManyTarget.create
91
+ object_3 = ToystoreHasManyTarget.create
92
+
93
+ assert_equal 3, ToystoreHasManyTarget.get_multi(object_1.id, object_2.id, object_3.id).compact.size
94
+ ToystoreHasManyTarget._t_delete([object_1.id, object_2.id, object_3.id], false)
95
+ assert_equal 0, ToystoreHasManyTarget.get_multi(object_1.id, object_2.id, object_3.id).compact.size
96
+ end
97
+ end
98
+
99
+ def association
100
+ Tenacity::Association.new(:t_has_many, :toystore_has_many_targets, ToystoreObject)
101
+ end
102
+ end
103
+ end
data/test/test_helper.rb CHANGED
@@ -21,7 +21,9 @@ require File.join(File.dirname(__FILE__), 'helpers', 'couch_rest_test_helper')
21
21
  require File.join(File.dirname(__FILE__), 'helpers', 'data_mapper_test_helper')
22
22
  require File.join(File.dirname(__FILE__), 'helpers', 'mongo_mapper_test_helper')
23
23
  require File.join(File.dirname(__FILE__), 'helpers', 'mongoid_test_helper')
24
+ require File.join(File.dirname(__FILE__), 'helpers', 'ripple_test_helper')
24
25
  require File.join(File.dirname(__FILE__), 'helpers', 'sequel_test_helper')
26
+ require File.join(File.dirname(__FILE__), 'helpers', 'toystore_test_helper')
25
27
 
26
28
  Dir[File.join(File.dirname(__FILE__), 'fixtures', '*.rb')].each { |file| autoload(file[file.rindex('/') + 1..-4].camelcase, file) }
27
29
 
@@ -36,44 +38,44 @@ def setup_fixtures
36
38
  clazz.delete_all
37
39
  elsif clazz.respond_to?(:db)
38
40
  clazz.db["delete from #{clazz.table_name}"].delete
39
- elsif clazz.respond_to?(:destroy)
40
- clazz.destroy
41
+ elsif clazz.respond_to?(:destroy!)
42
+ clazz.destroy!
43
+ elsif filename =~ /\/toystore/
44
+ # No way to easily delete toystore instances per class, so delete them all.
45
+ Mongo::Connection.new.db('tenacity_test')['toystore'].remove
41
46
  elsif filename =~ /\/couch_rest/
42
47
  # CouchDB fixtures are destroyed with the database
48
+ elsif filename =~ /\/ripple/
49
+ # Ripple fixtures are destroyed explicitly in setup_ripple_fixtures
43
50
  else
44
- puts "WARN: Don't know how to clear fixtures for #{clazz}"
51
+ puts "WARNING: Don't know how to clear fixtures for #{clazz}"
45
52
  end
46
53
  rescue NameError
47
54
  end
48
55
  end
49
-
50
- join_tables = %w{
51
- active_record_cars_mongo_mapper_wheels
52
- active_record_cars_couch_rest_doors
53
- nuts_and_wheels
54
- active_record_has_many_targets_active_record_objects
55
- active_record_objects_mongo_mapper_has_many_targets
56
- active_record_objects_couch_rest_has_many_targets
57
- active_record_objects_mongoid_has_many_targets
58
- }
59
- join_tables.each { |join_table| ActiveRecordCar.connection.execute("delete from #{join_table}") }
60
56
  end
61
57
 
62
58
  def setup_couchdb_fixtures
63
59
  COUCH_DB.recreate! rescue nil
64
60
  end
65
61
 
66
- def setup_all_fixtures
67
- setup_fixtures
68
- setup_couchdb_fixtures
62
+ def setup_ripple_fixtures
63
+ require_ripple do
64
+ bucket_names = ripple_classes.map { |clazz| clazz.bucket.name }
65
+
66
+ # XXX: This is --INCREDIBLY-- slow, but I cannot find a better/faster way of doing it
67
+ Ripple.client.buckets.each do |bucket|
68
+ if bucket_names.include?(bucket.name) || bucket.name =~ /^tenacity_test_/
69
+ bucket.keys { |keys| keys.each { |k| bucket.delete(k) } }
70
+ end
71
+ end
72
+ end
69
73
  end
70
74
 
71
75
  def setup_fixtures_for(source, target)
72
- if source == :couch_rest || target == :couch_rest
73
- setup_all_fixtures
74
- else
75
- setup_fixtures
76
- end
76
+ setup_fixtures
77
+ setup_couchdb_fixtures if source == :couch_rest || target == :couch_rest
78
+ setup_ripple_fixtures if source == :ripple || target == :ripple
77
79
  end
78
80
 
79
81
  def orm_extensions
@@ -82,6 +84,8 @@ def orm_extensions
82
84
  else
83
85
  extensions = [:active_record, :couch_rest, :data_mapper, :mongo_mapper, :sequel]
84
86
  require_mongoid { extensions << :mongoid }
87
+ require_ripple { extensions << :ripple } if ENV['LONG'] == 'true'
88
+ require_toystore { extensions << :toystore }
85
89
  extensions
86
90
  end
87
91
  end
@@ -126,10 +130,18 @@ def foreign_key_id_for(extension, type)
126
130
  end
127
131
 
128
132
  def assert_set_equal(expecteds, actuals, message = nil)
129
- assert_equal expecteds && Set.new(expecteds), actuals && Set.new(actuals), message
133
+ assert ((expecteds && Set.new(expecteds)) == (actuals && Set.new(actuals))) || (expecteds == actuals),
134
+ "#{expecteds.inspect} expected but was #{actuals.inspect}"
130
135
  end
131
136
 
132
137
  def serialize_id(object)
133
138
  object.class._t_serialize(object.id)
134
139
  end
135
140
 
141
+ def ripple_classes
142
+ Dir.glob(File.join(File.dirname(__FILE__), 'fixtures', 'ripple_*.rb')).map do |filename|
143
+ filename =~ /.*\/(.*)\.rb/
144
+ Kernel.const_get($1.camelcase)
145
+ end
146
+ end
147
+
metadata CHANGED
@@ -1,13 +1,8 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: tenacity
3
3
  version: !ruby/object:Gem::Version
4
- hash: 13
5
4
  prerelease:
6
- segments:
7
- - 0
8
- - 4
9
- - 1
10
- version: 0.4.1
5
+ version: 0.5.0
11
6
  platform: ruby
12
7
  authors:
13
8
  - John Wood
@@ -15,266 +10,229 @@ autorequire:
15
10
  bindir: bin
16
11
  cert_chain: []
17
12
 
18
- date: 2011-04-05 00:00:00 -05:00
13
+ date: 2011-06-14 00:00:00 -05:00
19
14
  default_executable:
20
15
  dependencies:
21
16
  - !ruby/object:Gem::Dependency
22
17
  name: activesupport
23
- prerelease: false
24
- type: :runtime
25
18
  requirement: &id001 !ruby/object:Gem::Requirement
26
19
  none: false
27
20
  requirements:
28
21
  - - ">="
29
22
  - !ruby/object:Gem::Version
30
- hash: 5
31
- segments:
32
- - 2
33
- - 3
34
23
  version: "2.3"
24
+ type: :runtime
25
+ prerelease: false
35
26
  version_requirements: *id001
36
27
  - !ruby/object:Gem::Dependency
37
28
  name: bundler
38
- prerelease: false
39
- type: :development
40
29
  requirement: &id002 !ruby/object:Gem::Requirement
41
30
  none: false
42
31
  requirements:
43
32
  - - ~>
44
33
  - !ruby/object:Gem::Version
45
- hash: 23
46
- segments:
47
- - 1
48
- - 0
49
- - 0
50
34
  version: 1.0.0
35
+ type: :development
36
+ prerelease: false
51
37
  version_requirements: *id002
52
38
  - !ruby/object:Gem::Dependency
53
39
  name: rake
54
- prerelease: false
55
- type: :development
56
40
  requirement: &id003 !ruby/object:Gem::Requirement
57
41
  none: false
58
42
  requirements:
59
43
  - - ~>
60
44
  - !ruby/object:Gem::Version
61
- hash: 49
62
- segments:
63
- - 0
64
- - 8
65
- - 7
66
45
  version: 0.8.7
46
+ type: :development
47
+ prerelease: false
67
48
  version_requirements: *id003
68
49
  - !ruby/object:Gem::Dependency
69
50
  name: rcov
70
- prerelease: false
71
- type: :development
72
51
  requirement: &id004 !ruby/object:Gem::Requirement
73
52
  none: false
74
53
  requirements:
75
54
  - - ~>
76
55
  - !ruby/object:Gem::Version
77
- hash: 41
78
- segments:
79
- - 0
80
- - 9
81
- - 9
82
56
  version: 0.9.9
57
+ type: :development
58
+ prerelease: false
83
59
  version_requirements: *id004
84
60
  - !ruby/object:Gem::Dependency
85
61
  name: shoulda
86
- prerelease: false
87
- type: :development
88
62
  requirement: &id005 !ruby/object:Gem::Requirement
89
63
  none: false
90
64
  requirements:
91
65
  - - ~>
92
66
  - !ruby/object:Gem::Version
93
- hash: 37
94
- segments:
95
- - 2
96
- - 11
97
- - 3
98
67
  version: 2.11.3
68
+ type: :development
69
+ prerelease: false
99
70
  version_requirements: *id005
100
71
  - !ruby/object:Gem::Dependency
101
72
  name: mocha
102
- prerelease: false
103
- type: :development
104
73
  requirement: &id006 !ruby/object:Gem::Requirement
105
74
  none: false
106
75
  requirements:
107
76
  - - ~>
108
77
  - !ruby/object:Gem::Version
109
- hash: 47
110
- segments:
111
- - 0
112
- - 9
113
- - 10
114
78
  version: 0.9.10
79
+ type: :development
80
+ prerelease: false
115
81
  version_requirements: *id006
116
82
  - !ruby/object:Gem::Dependency
117
83
  name: yard
118
- prerelease: false
119
- type: :development
120
84
  requirement: &id007 !ruby/object:Gem::Requirement
121
85
  none: false
122
86
  requirements:
123
87
  - - ~>
124
88
  - !ruby/object:Gem::Version
125
- hash: 15
126
- segments:
127
- - 0
128
- - 6
129
- - 4
130
89
  version: 0.6.4
90
+ type: :development
91
+ prerelease: false
131
92
  version_requirements: *id007
132
93
  - !ruby/object:Gem::Dependency
133
94
  name: sqlite3-ruby
134
- prerelease: false
135
- type: :development
136
95
  requirement: &id008 !ruby/object:Gem::Requirement
137
96
  none: false
138
97
  requirements:
139
98
  - - ~>
140
99
  - !ruby/object:Gem::Version
141
- hash: 25
142
- segments:
143
- - 1
144
- - 3
145
- - 1
146
100
  version: 1.3.1
101
+ type: :development
102
+ prerelease: false
147
103
  version_requirements: *id008
148
104
  - !ruby/object:Gem::Dependency
149
105
  name: activerecord
150
- prerelease: false
151
- type: :development
152
106
  requirement: &id009 !ruby/object:Gem::Requirement
153
107
  none: false
154
108
  requirements:
155
109
  - - ~>
156
110
  - !ruby/object:Gem::Version
157
- hash: 7
158
- segments:
159
- - 3
160
- - 0
161
- - 0
162
111
  version: 3.0.0
112
+ type: :development
113
+ prerelease: false
163
114
  version_requirements: *id009
164
115
  - !ruby/object:Gem::Dependency
165
116
  name: datamapper
166
- prerelease: false
167
- type: :development
168
117
  requirement: &id010 !ruby/object:Gem::Requirement
169
118
  none: false
170
119
  requirements:
171
120
  - - ~>
172
121
  - !ruby/object:Gem::Version
173
- hash: 19
174
- segments:
175
- - 1
176
- - 0
177
- - 2
178
122
  version: 1.0.2
123
+ type: :development
124
+ prerelease: false
179
125
  version_requirements: *id010
180
126
  - !ruby/object:Gem::Dependency
181
127
  name: dm-sqlite-adapter
182
- prerelease: false
183
- type: :development
184
128
  requirement: &id011 !ruby/object:Gem::Requirement
185
129
  none: false
186
130
  requirements:
187
131
  - - ~>
188
132
  - !ruby/object:Gem::Version
189
- hash: 19
190
- segments:
191
- - 1
192
- - 0
193
- - 2
194
133
  version: 1.0.2
134
+ type: :development
135
+ prerelease: false
195
136
  version_requirements: *id011
196
137
  - !ruby/object:Gem::Dependency
197
138
  name: sequel
198
- prerelease: false
199
- type: :development
200
139
  requirement: &id012 !ruby/object:Gem::Requirement
201
140
  none: false
202
141
  requirements:
203
142
  - - ~>
204
143
  - !ruby/object:Gem::Version
205
- hash: 75
206
- segments:
207
- - 3
208
- - 19
209
- - 0
210
144
  version: 3.19.0
145
+ type: :development
146
+ prerelease: false
211
147
  version_requirements: *id012
212
148
  - !ruby/object:Gem::Dependency
213
- name: bson_ext
214
- prerelease: false
215
- type: :development
149
+ name: mongo_mapper
216
150
  requirement: &id013 !ruby/object:Gem::Requirement
217
151
  none: false
218
152
  requirements:
219
153
  - - ~>
220
154
  - !ruby/object:Gem::Version
221
- hash: 27
222
- segments:
223
- - 1
224
- - 3
225
- - 0
226
- version: 1.3.0
155
+ version: 0.9.0
156
+ type: :development
157
+ prerelease: false
227
158
  version_requirements: *id013
228
159
  - !ruby/object:Gem::Dependency
229
- name: mongoid
230
- prerelease: false
231
- type: :development
160
+ name: bson_ext
232
161
  requirement: &id014 !ruby/object:Gem::Requirement
233
162
  none: false
234
163
  requirements:
235
164
  - - ~>
236
165
  - !ruby/object:Gem::Version
237
- hash: 31098209
238
- segments:
239
- - 2
240
- - 0
241
- - 0
242
- - beta
243
- version: 2.0.0.beta
166
+ version: 1.3.0
167
+ type: :development
168
+ prerelease: false
244
169
  version_requirements: *id014
245
170
  - !ruby/object:Gem::Dependency
246
- name: couchrest
247
- prerelease: false
248
- type: :development
171
+ name: mongoid
249
172
  requirement: &id015 !ruby/object:Gem::Requirement
250
173
  none: false
251
174
  requirements:
252
175
  - - ~>
253
176
  - !ruby/object:Gem::Version
254
- hash: 23
255
- segments:
256
- - 1
257
- - 0
258
- - 0
259
- version: 1.0.0
177
+ version: 2.0.0
178
+ type: :development
179
+ prerelease: false
260
180
  version_requirements: *id015
181
+ - !ruby/object:Gem::Dependency
182
+ name: couchrest
183
+ requirement: &id016 !ruby/object:Gem::Requirement
184
+ none: false
185
+ requirements:
186
+ - - ~>
187
+ - !ruby/object:Gem::Version
188
+ version: 1.0.0
189
+ type: :development
190
+ prerelease: false
191
+ version_requirements: *id016
261
192
  - !ruby/object:Gem::Dependency
262
193
  name: couchrest_model
194
+ requirement: &id017 !ruby/object:Gem::Requirement
195
+ none: false
196
+ requirements:
197
+ - - ~>
198
+ - !ruby/object:Gem::Version
199
+ version: 1.0.0
200
+ type: :development
263
201
  prerelease: false
202
+ version_requirements: *id017
203
+ - !ruby/object:Gem::Dependency
204
+ name: ripple
205
+ requirement: &id018 !ruby/object:Gem::Requirement
206
+ none: false
207
+ requirements:
208
+ - - ~>
209
+ - !ruby/object:Gem::Version
210
+ version: 0.9.2
264
211
  type: :development
265
- requirement: &id016 !ruby/object:Gem::Requirement
212
+ prerelease: false
213
+ version_requirements: *id018
214
+ - !ruby/object:Gem::Dependency
215
+ name: toystore
216
+ requirement: &id019 !ruby/object:Gem::Requirement
266
217
  none: false
267
218
  requirements:
268
219
  - - ~>
269
220
  - !ruby/object:Gem::Version
270
- hash: 31098193
271
- segments:
272
- - 1
273
- - 0
274
- - 0
275
- - beta
276
- version: 1.0.0.beta
277
- version_requirements: *id016
221
+ version: 0.8.0
222
+ type: :development
223
+ prerelease: false
224
+ version_requirements: *id019
225
+ - !ruby/object:Gem::Dependency
226
+ name: adapter-mongo
227
+ requirement: &id020 !ruby/object:Gem::Requirement
228
+ none: false
229
+ requirements:
230
+ - - ~>
231
+ - !ruby/object:Gem::Version
232
+ version: 0.5.2
233
+ type: :development
234
+ prerelease: false
235
+ version_requirements: *id020
278
236
  description: Tenacity provides a database client independent way of specifying simple relationships between models backed by different databases.
279
237
  email:
280
238
  - john@johnpwood.net
@@ -308,7 +266,9 @@ files:
308
266
  - lib/tenacity/orm_ext/helpers.rb
309
267
  - lib/tenacity/orm_ext/mongo_mapper.rb
310
268
  - lib/tenacity/orm_ext/mongoid.rb
269
+ - lib/tenacity/orm_ext/ripple.rb
311
270
  - lib/tenacity/orm_ext/sequel.rb
271
+ - lib/tenacity/orm_ext/toystore.rb
312
272
  - lib/tenacity/version.rb
313
273
  - tenacity.gemspec
314
274
  - test/association_features/belongs_to_test.rb
@@ -351,21 +311,32 @@ files:
351
311
  - test/fixtures/mongoid_has_many_target.rb
352
312
  - test/fixtures/mongoid_has_one_target.rb
353
313
  - test/fixtures/mongoid_object.rb
314
+ - test/fixtures/no_associations.rb
315
+ - test/fixtures/ripple_has_many_target.rb
316
+ - test/fixtures/ripple_has_one_target.rb
317
+ - test/fixtures/ripple_object.rb
354
318
  - test/fixtures/sequel_has_many_target.rb
355
319
  - test/fixtures/sequel_has_one_target.rb
356
320
  - test/fixtures/sequel_object.rb
321
+ - test/fixtures/toystore_has_many_target.rb
322
+ - test/fixtures/toystore_has_one_target.rb
323
+ - test/fixtures/toystore_object.rb
357
324
  - test/helpers/active_record_test_helper.rb
358
325
  - test/helpers/couch_rest_test_helper.rb
359
326
  - test/helpers/data_mapper_test_helper.rb
360
327
  - test/helpers/mongo_mapper_test_helper.rb
361
328
  - test/helpers/mongoid_test_helper.rb
329
+ - test/helpers/ripple_test_helper.rb
362
330
  - test/helpers/sequel_test_helper.rb
331
+ - test/helpers/toystore_test_helper.rb
363
332
  - test/orm_ext/activerecord_test.rb
364
333
  - test/orm_ext/couchrest_test.rb
365
334
  - test/orm_ext/datamapper_test.rb
366
335
  - test/orm_ext/mongo_mapper_test.rb
367
336
  - test/orm_ext/mongoid_test.rb
337
+ - test/orm_ext/ripple_test.rb
368
338
  - test/orm_ext/sequel_test.rb
339
+ - test/orm_ext/toystore_test.rb
369
340
  - test/test_helper.rb
370
341
  has_rdoc: true
371
342
  homepage: http://github.com/jwood/tenacity
@@ -381,7 +352,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
381
352
  requirements:
382
353
  - - ">="
383
354
  - !ruby/object:Gem::Version
384
- hash: 3
355
+ hash: -1447988484574051328
385
356
  segments:
386
357
  - 0
387
358
  version: "0"
@@ -390,11 +361,6 @@ required_rubygems_version: !ruby/object:Gem::Requirement
390
361
  requirements:
391
362
  - - ">="
392
363
  - !ruby/object:Gem::Version
393
- hash: 23
394
- segments:
395
- - 1
396
- - 3
397
- - 6
398
364
  version: 1.3.6
399
365
  requirements: []
400
366