tarantool16 0.1.0 → 0.1.1
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.
- checksums.yaml +4 -4
- data/lib/tarantool16/dumb_db.rb +2 -13
- data/lib/tarantool16/schema.rb +9 -2
- data/lib/tarantool16/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6a75caf062fcb068dee8490ba33bd62ea7059f38
|
4
|
+
data.tar.gz: d926b35082fdc68ebee9b41b97c0df18b8bba52c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f891c0ddf1ac0d61f33b4469a8840d878b4e182df7ef2d0485d0c67f8c5cf52f92a8a3f4f10d2aa293a09b8d7046b19668b2a1db79b4bf573f5a213406f6d7fd
|
7
|
+
data.tar.gz: dcae53598bc994d80c54303fcc1240690e97d59012624fa6272b0bce18605a625d10f8ea6c7dfccba72dbf4121e5ed38b77fd8c562589830cb8262e503c5f945
|
data/lib/tarantool16/dumb_db.rb
CHANGED
@@ -96,34 +96,23 @@ module Tarantool16
|
|
96
96
|
UNDEF = Object.new.freeze
|
97
97
|
def initialize
|
98
98
|
@r = UNDEF
|
99
|
-
@cb = nil
|
100
99
|
end
|
101
100
|
def then(cb)
|
102
101
|
unless @r.equal? UNDEF
|
103
102
|
return cb.call(@r)
|
104
103
|
end
|
105
|
-
|
106
|
-
raise "Blocking future accepts only 1 callback"
|
107
|
-
end
|
108
|
-
@cb = cb
|
104
|
+
raise "DumbDB::ShemaFuture future is not real future :-("
|
109
105
|
end
|
110
106
|
|
111
107
|
def then_blk
|
112
108
|
unless @r.equal? UNDEF
|
113
109
|
return yield @r
|
114
110
|
end
|
115
|
-
|
116
|
-
raise "Blocking future accepts only 1 callback"
|
117
|
-
end
|
118
|
-
@cb = lambda{|r| yield r}
|
111
|
+
raise "DumbDB::ShemaFuture future is not real future :-("
|
119
112
|
end
|
120
113
|
|
121
114
|
def set(r)
|
122
115
|
@r = r
|
123
|
-
if cb = @cb
|
124
|
-
@cb = nil
|
125
|
-
cb.call(r)
|
126
|
-
end
|
127
116
|
end
|
128
117
|
end
|
129
118
|
|
data/lib/tarantool16/schema.rb
CHANGED
@@ -18,9 +18,10 @@ module Tarantool16
|
|
18
18
|
@field_names = {}
|
19
19
|
@fields = []
|
20
20
|
@has_tail = false
|
21
|
-
flds.each_with_index do |fld, i|
|
21
|
+
flds.each_with_index do |fld, i; name|
|
22
22
|
if @has_tail
|
23
|
-
|
23
|
+
$stderr.puts "no fields allowed after tail: #{flds}"
|
24
|
+
break
|
24
25
|
end
|
25
26
|
case fld
|
26
27
|
when String, Symbol
|
@@ -33,7 +34,12 @@ module Tarantool16
|
|
33
34
|
type = fld['type'] || fld[:type]
|
34
35
|
tail = fld['tail'] || fld[:tail]
|
35
36
|
end
|
37
|
+
unless name.is_a?(String) || name.is_a?(Symbol)
|
38
|
+
$stderr.puts "no field name found for field_#{i} in #{flds}"
|
39
|
+
name = "field_#{i}"
|
40
|
+
end
|
36
41
|
name_s = name.to_sym
|
42
|
+
name = name.to_s
|
37
43
|
field = Field.new(name_s, i, type)
|
38
44
|
@field_names[name] = field
|
39
45
|
@field_names[name_s] = field
|
@@ -41,6 +47,7 @@ module Tarantool16
|
|
41
47
|
@fields << field
|
42
48
|
@has_tail = true if tail
|
43
49
|
end
|
50
|
+
# refresh indices ?
|
44
51
|
if @index_defs
|
45
52
|
self.indices= @index_defs
|
46
53
|
end
|
data/lib/tarantool16/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: tarantool16
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Sokolov Yura aka funny_falcon
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2017-08-26 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -101,7 +101,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
101
101
|
version: '0'
|
102
102
|
requirements: []
|
103
103
|
rubyforge_project:
|
104
|
-
rubygems_version: 2.5.
|
104
|
+
rubygems_version: 2.5.2
|
105
105
|
signing_key:
|
106
106
|
specification_version: 4
|
107
107
|
summary: adapter for Tarantool 1.6
|