mosql 0.4.2 → 0.4.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 6c0bef56bc688f403ccbc3ee8cb0e20a68a653b9
4
- data.tar.gz: 7a1ee9bfb170e668aa201e84897a19d26cd3ea6b
3
+ metadata.gz: ab6a5314ffebd1eeb1db35d8f9886c9263e69576
4
+ data.tar.gz: dfe8cf38a3834710a06a6cf392cb2a21e6fc4ef5
5
5
  SHA512:
6
- metadata.gz: 476b45cde7f4be786096327408a5e07f2124d5cee2e9a53d5da04a4aa5307df2c5aa7e4aef8eff48f3a676249eb39c65f1dd0e8cf0d9a90fd6cb89fc22d74851
7
- data.tar.gz: 866fb300b0608669bded7814e30d753749e1511af1008b56be79b032d1f108a3973bf39cf3ab825aa01ffe5155a4f2bdb15d4f7f8882e725118a3ad08a7797c2
6
+ metadata.gz: 7c540d934fa473697a0bc27980d891673dcb614d193e5227d4ebeb00c46db2ccd335d62d0f15e6881bbc6d2096bb8de53ebd607694800e80a13a627274c1422f
7
+ data.tar.gz: 2649f825c29f960adaaa2f36670ae00bc92021a957966b71f34e6bccfdbb96dd12d74a2598d8f51c3bd46eafb1b323eaf290046b60042b4d92245e200c24913d
@@ -241,7 +241,7 @@ module MoSQL
241
241
  keys = {}
242
242
  primary_sql_keys.each do |key|
243
243
  source = schema[:columns].find {|c| c[:name] == key }[:source]
244
- keys[key] = selector[source]
244
+ keys[source] = selector[source]
245
245
  end
246
246
 
247
247
  log.debug("upsert #{ns}: #{keys}")
@@ -1,3 +1,3 @@
1
1
  module MoSQL
2
- VERSION = "0.4.2"
2
+ VERSION = "0.4.3"
3
3
  end
@@ -16,10 +16,17 @@ Gem::Specification.new do |gem|
16
16
  gem.require_paths = ["lib"]
17
17
  gem.version = MoSQL::VERSION
18
18
 
19
- %w[sequel pg mongo bson_ext rake log4r json
20
- ].each { |dep| gem.add_runtime_dependency(dep) }
19
+ gem.add_runtime_dependency "sequel"
20
+ gem.add_runtime_dependency "pg"
21
+ gem.add_runtime_dependency "rake"
22
+ gem.add_runtime_dependency "log4r"
23
+ gem.add_runtime_dependency "json"
24
+
21
25
  gem.add_runtime_dependency "mongoriver", "0.4"
26
+
27
+ gem.add_runtime_dependency "mongo", "~> 1.10"
22
28
  gem.add_runtime_dependency "bson", "~> 1.10"
29
+ gem.add_runtime_dependency "bson_ext", "~> 1.10"
23
30
 
24
31
  gem.add_development_dependency "minitest"
25
32
  gem.add_development_dependency "mocha"
@@ -95,6 +95,18 @@ EOF
95
95
  assert_equal(27, sequel[:sqltable].where(:_id => o['_id'].to_s).select.first[:var])
96
96
  end
97
97
 
98
+ it 'handle "u" ops without _id and a renamed _id mapping' do
99
+ o = { '_id' => BSON::ObjectId.new, 'var' => 17 }
100
+ @adapter.upsert_ns('mosql_test.renameid', o)
101
+
102
+ @streamer.handle_op({ 'ns' => 'mosql_test.renameid',
103
+ 'op' => 'u',
104
+ 'o2' => { '_id' => o['_id'] },
105
+ 'o' => { 'goats' => 27 }
106
+ })
107
+ assert_equal(27, sequel[:sqltable2].where(:id => o['_id'].to_s).select.first[:goats])
108
+ end
109
+
98
110
  it 'applies ops performed via applyOps' do
99
111
  o = { '_id' => BSON::ObjectId.new, 'var' => 17 }
100
112
  @adapter.upsert_ns('mosql_test.collection', o)
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mosql
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.2
4
+ version: 0.4.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nelson Elhage
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-11-18 00:00:00.000000000 Z
11
+ date: 2015-04-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: sequel
@@ -39,7 +39,7 @@ dependencies:
39
39
  - !ruby/object:Gem::Version
40
40
  version: '0'
41
41
  - !ruby/object:Gem::Dependency
42
- name: mongo
42
+ name: rake
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
45
  - - ">="
@@ -53,7 +53,7 @@ dependencies:
53
53
  - !ruby/object:Gem::Version
54
54
  version: '0'
55
55
  - !ruby/object:Gem::Dependency
56
- name: bson_ext
56
+ name: log4r
57
57
  requirement: !ruby/object:Gem::Requirement
58
58
  requirements:
59
59
  - - ">="
@@ -67,7 +67,7 @@ dependencies:
67
67
  - !ruby/object:Gem::Version
68
68
  version: '0'
69
69
  - !ruby/object:Gem::Dependency
70
- name: rake
70
+ name: json
71
71
  requirement: !ruby/object:Gem::Requirement
72
72
  requirements:
73
73
  - - ">="
@@ -81,49 +81,49 @@ dependencies:
81
81
  - !ruby/object:Gem::Version
82
82
  version: '0'
83
83
  - !ruby/object:Gem::Dependency
84
- name: log4r
84
+ name: mongoriver
85
85
  requirement: !ruby/object:Gem::Requirement
86
86
  requirements:
87
- - - ">="
87
+ - - '='
88
88
  - !ruby/object:Gem::Version
89
- version: '0'
89
+ version: '0.4'
90
90
  type: :runtime
91
91
  prerelease: false
92
92
  version_requirements: !ruby/object:Gem::Requirement
93
93
  requirements:
94
- - - ">="
94
+ - - '='
95
95
  - !ruby/object:Gem::Version
96
- version: '0'
96
+ version: '0.4'
97
97
  - !ruby/object:Gem::Dependency
98
- name: json
98
+ name: mongo
99
99
  requirement: !ruby/object:Gem::Requirement
100
100
  requirements:
101
- - - ">="
101
+ - - "~>"
102
102
  - !ruby/object:Gem::Version
103
- version: '0'
103
+ version: '1.10'
104
104
  type: :runtime
105
105
  prerelease: false
106
106
  version_requirements: !ruby/object:Gem::Requirement
107
107
  requirements:
108
- - - ">="
108
+ - - "~>"
109
109
  - !ruby/object:Gem::Version
110
- version: '0'
110
+ version: '1.10'
111
111
  - !ruby/object:Gem::Dependency
112
- name: mongoriver
112
+ name: bson
113
113
  requirement: !ruby/object:Gem::Requirement
114
114
  requirements:
115
- - - '='
115
+ - - "~>"
116
116
  - !ruby/object:Gem::Version
117
- version: '0.4'
117
+ version: '1.10'
118
118
  type: :runtime
119
119
  prerelease: false
120
120
  version_requirements: !ruby/object:Gem::Requirement
121
121
  requirements:
122
- - - '='
122
+ - - "~>"
123
123
  - !ruby/object:Gem::Version
124
- version: '0.4'
124
+ version: '1.10'
125
125
  - !ruby/object:Gem::Dependency
126
- name: bson
126
+ name: bson_ext
127
127
  requirement: !ruby/object:Gem::Requirement
128
128
  requirements:
129
129
  - - "~>"