tarantool 0.2.3 → 0.2.4

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/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- tarantool (0.2.2)
4
+ tarantool (0.2.3)
5
5
  activemodel (>= 3.1, < 4.0)
6
6
  iproto (>= 0.2)
7
7
 
data/README.md CHANGED
@@ -111,6 +111,7 @@ in the tuple stored by Tarantool. By default, the primary key is field 0.
111
111
 
112
112
  # TODO
113
113
 
114
+ # .to_config
114
115
  * `#first`, `#all` without keys, batches requests via box.select_range
115
116
  * `#where` chains
116
117
  * admin-socket protocol
data/examples/record.rb CHANGED
@@ -51,7 +51,7 @@ end
51
51
  User.find('prepor').increment :apples_count
52
52
 
53
53
  # call lua func, which return record's tuples
54
- User.call('box.select_range', '0','0', '5')
54
+ User.call('box.select_range', 0, 0, 5)
55
55
 
56
56
  # update only dirty attributes
57
57
  user = User.find('prepor')
@@ -19,7 +19,7 @@ class Tarantool
19
19
  end
20
20
 
21
21
  def call(proc_name, *args)
22
- to_records record.space.call(proc_name: proc_name, args: args, return_tuple: true).tuples
22
+ to_records record.space.call(proc_name, *args, return_tuple: true).tuples
23
23
  end
24
24
 
25
25
  def limit(limit)
@@ -6,8 +6,8 @@ class Tarantool
6
6
  attr_reader :flags, :proc_name, :tuple
7
7
  def parse_args
8
8
  @flags = params[:return_tuple] ? 1 : 0
9
- @proc_name = params[:proc_name]
10
- @tuple = params[:args] || []
9
+ @proc_name = args.shift
10
+ @tuple = args.map(&:to_s)
11
11
  end
12
12
 
13
13
  def make_body
data/lib/tarantool.rb CHANGED
@@ -2,7 +2,7 @@
2
2
  require 'iproto'
3
3
 
4
4
  class Tarantool
5
- VERSION = '0.2.3'
5
+ VERSION = '0.2.4'
6
6
 
7
7
  require 'tarantool/space'
8
8
  require 'tarantool/requests'
@@ -1,7 +1,7 @@
1
1
  module Helpers
2
2
  module Truncate
3
3
  def teardown
4
- while (res = space.call(proc_name: 'box.select_range', args: [space.space_no.to_s, '0', '100'], return_tuple: true)) && res.tuples.size > 0
4
+ while (res = space.call('box.select_range', space.space_no, 0, 100, return_tuple: true)) && res.tuples.size > 0
5
5
  res.tuples.each do |k, *_|
6
6
  space.delete key: k
7
7
  end
data/spec/spec_helper.rb CHANGED
@@ -11,7 +11,7 @@ require 'rr'
11
11
 
12
12
  require 'tarantool'
13
13
 
14
- TARANTOOL_CONFIG = { host: '192.168.127.128', port: 33013, type: :block }
14
+ TARANTOOL_CONFIG = { host: 'localhost', port: 33013, type: :block }
15
15
 
16
16
  DB = Tarantool.new TARANTOOL_CONFIG
17
17
 
@@ -248,7 +248,7 @@ describe Tarantool::Record do
248
248
  end
249
249
 
250
250
  describe "call" do
251
- let(:res) { user.class.select.call('box.select_range', '0','0', '2')}
251
+ let(:res) { user.class.select.call('box.select_range', 0, 0, 2)}
252
252
  before do
253
253
  user_class.create login: 'prepor', name: 'Andrew', email: 'ceo@prepor.ru'
254
254
  user_class.create login: 'petro', name: 'Petr', email: 'petro@gmail.com'
@@ -61,14 +61,14 @@ describe Tarantool::Request do
61
61
 
62
62
  describe "call" do
63
63
  it "should call lua proc" do
64
- res = space.call proc_name: 'box.pack', args: ['i', '100'], return_tuple: true
64
+ res = space.call 'box.pack', 'i', '100', return_tuple: true
65
65
  res.tuple[0].to_i.must_equal 100
66
66
  end
67
67
 
68
68
  it "should return batches via select_range" do
69
69
  space.insert 100, 'привет'
70
70
  space.insert 101, 'hi'
71
- res = space.call proc_name: 'box.select_range', args: ['1', '0', '100'], return_tuple: true
71
+ res = space.call 'box.select_range', '1', '0', '100', return_tuple: true
72
72
  res.tuples.size.must_equal 2
73
73
  end
74
74
  end
data/tarantool.gemspec CHANGED
@@ -4,8 +4,8 @@ Gem::Specification.new do |s|
4
4
  s.rubygems_version = '1.3.5'
5
5
 
6
6
  s.name = 'tarantool'
7
- s.version = '0.2.3'
8
- s.date = '2012-02-24'
7
+ s.version = '0.2.4'
8
+ s.date = '2012-05-06'
9
9
  s.rubyforge_project = 'tarantool'
10
10
 
11
11
  s.summary = "Tarantool KV-storage client."
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: tarantool
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.3
4
+ version: 0.2.4
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,11 +9,11 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-02-24 00:00:00.000000000Z
12
+ date: 2012-05-06 00:00:00.000000000Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: iproto
16
- requirement: &70193355842780 !ruby/object:Gem::Requirement
16
+ requirement: &70109143146600 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ! '>='
@@ -21,10 +21,10 @@ dependencies:
21
21
  version: '0.2'
22
22
  type: :runtime
23
23
  prerelease: false
24
- version_requirements: *70193355842780
24
+ version_requirements: *70109143146600
25
25
  - !ruby/object:Gem::Dependency
26
26
  name: activemodel
27
- requirement: &70193355842080 !ruby/object:Gem::Requirement
27
+ requirement: &70109143145940 !ruby/object:Gem::Requirement
28
28
  none: false
29
29
  requirements:
30
30
  - - ! '>='
@@ -35,7 +35,7 @@ dependencies:
35
35
  version: '4.0'
36
36
  type: :runtime
37
37
  prerelease: false
38
- version_requirements: *70193355842080
38
+ version_requirements: *70109143145940
39
39
  description: Tarantool KV-storage client.
40
40
  email: ceo@prepor.ru
41
41
  executables: []
@@ -106,3 +106,4 @@ test_files:
106
106
  - spec/tarantool/em_spec.rb
107
107
  - spec/tarantool/record_spec.rb
108
108
  - spec/tarantool/request_spec.rb
109
+ has_rdoc: