rails_kvs_driver 0.1.5 → 0.1.6

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: e16e83e57e175e02d6ebed33a8dd35bfbce7170b
4
- data.tar.gz: 1718c48d2c967b4b31e8b515d2ac5c3c701fc852
3
+ metadata.gz: 65825db278e173b70e7356bebb71e1706be19cbe
4
+ data.tar.gz: feb19bf2dcb02b2499395c27c71bb3523bb41dce
5
5
  SHA512:
6
- metadata.gz: 631039f1dda5aac88f54ba06ead4fac5bb6e2e861bada761998a784ba153b5821fbc7dff354a31572c28e9b5be6146666f806fdcb14f9d9ce6a0ddb783373c29
7
- data.tar.gz: 40b0eec8d9862a6d8c4f5d0c8075f49c547ab99693766c4b2d25fe0c0c7ea6da2034241e49c71f9f34d0b8d7b4c80c9031e99324a825a7883357488b2a56df6b
6
+ metadata.gz: 38119d7f68efb358baa88241b1a777102390b058110d760034539a6745e4edaad041bd455ea3679d8c0baa77483a950bf867ec16993fe08f851f0444c622eb75
7
+ data.tar.gz: 7fc6b26b52371aa7807240ebb1f06eadc10a8739b679c7e8dc8643857a8076b9a9481385f11d2b3051e32cc193391816b25e9fa33331ffe942d6355eafabeee1
data/README.md CHANGED
@@ -24,6 +24,10 @@ Or install it yourself as:
24
24
 
25
25
  * [rails_kvs_driver-redis_driver](https://github.com/alfa-jpn/rails_kvs_driver-redis_driver)
26
26
 
27
+ ## API Document
28
+
29
+ * [RailsKvsDriver](http://rubydoc.info/github/alfa-jpn/rails-kvs-driver/frames)
30
+
27
31
  ## Contributing
28
32
 
29
33
  1. Fork it
@@ -11,6 +11,7 @@ module RailsKvsDriver
11
11
 
12
12
  # return initialized SortedSet class.
13
13
  #
14
+ # @return [RailsKvsDriver::SortedSet] SortedSet
14
15
  def sorted_sets
15
16
  RailsKvsDriver::SortedSet.new(self)
16
17
  end
@@ -30,6 +31,8 @@ module RailsKvsDriver
30
31
  end
31
32
 
32
33
  # get length of keys.
34
+ #
35
+ # @return [Integer]length of keys.
33
36
  def length
34
37
  keys.length
35
38
  end
@@ -72,14 +72,23 @@ module RailsKvsDriver
72
72
  end
73
73
  end
74
74
 
75
- # check key in sorted set
75
+ # check key in sorted set.
76
76
  #
77
- # @param key [String] key name
78
- # @return [Boolean] result
77
+ # @param key [String] key name.
78
+ # @return [Boolean] result.
79
79
  def has_key?(key)
80
80
  !(self[key].nil?)
81
81
  end
82
82
 
83
+ # check member in sorted set.
84
+ #
85
+ # @param key [String] key name.
86
+ # @param member [String] member name.
87
+ # @return [Boolean] result.
88
+ def has_member?(key, member)
89
+ !(self[key, member].nil?)
90
+ end
91
+
83
92
  # increment member's score of sorted set.
84
93
  #
85
94
  # @param key [String] key of sorted set.
@@ -98,6 +107,8 @@ module RailsKvsDriver
98
107
  end
99
108
 
100
109
  # get length of sorted_set.
110
+ #
111
+ # @return [Integer] length of keys.
101
112
  def length
102
113
  keys.length
103
114
  end
@@ -1,3 +1,3 @@
1
1
  module RailsKvsDriver
2
- VERSION = "0.1.5"
2
+ VERSION = "0.1.6"
3
3
  end
@@ -8,8 +8,8 @@ Gem::Specification.new do |spec|
8
8
  spec.version = RailsKvsDriver::VERSION
9
9
  spec.authors = ["alfa-jpn"]
10
10
  spec.email = ["a.nkmr.ja@gmail.com"]
11
- spec.description = "rails kvs driver wrap access key-value store."
12
- spec.summary = "rails kvs driver wrap access key-value store."
11
+ spec.description = "rails_kvs_driver is available to use namespace and connection pool and ruby-like methods of kvs."
12
+ spec.summary = "rails_kvs_driver is available to use namespace and connection pool and ruby-like methods of kvs."
13
13
  spec.homepage = "https://github.com/alfa-jpn/rails-kvs-driver"
14
14
  spec.license = "MIT"
15
15
 
@@ -242,8 +242,18 @@ shared_examples_for 'RailsKvsDriver example' do |driver_class, driver_config|
242
242
  driver_class::session(driver_config) do |kvs|
243
243
  kvs.add_sorted_set('example', 'element', 10)
244
244
 
245
- expect(kvs.sorted_sets.has_key?('example')).to be_true
246
- expect(kvs.sorted_sets.has_key?('nothing key')).to be_false
245
+ expect(kvs.sorted_sets.has_key?('example')).to be_true
246
+ expect(kvs.sorted_sets.has_key?('nothing key')).to be_false
247
+ end
248
+ end
249
+
250
+ it 'call has_member?' do
251
+ driver_class::session(driver_config) do |kvs|
252
+ kvs.add_sorted_set('example', 'element', 10)
253
+
254
+ expect(kvs.sorted_sets.has_member?('example','element')).to be_true
255
+ expect(kvs.sorted_sets.has_member?('example','nothing member')).to be_false
256
+ expect(kvs.sorted_sets.has_member?('nothing key', 'element')).to be_false
247
257
  end
248
258
  end
249
259
 
@@ -65,6 +65,10 @@ describe RailsKvsDriver::SortedSet do
65
65
  expect(@driver.sorted_sets.has_key?(:a)).to be_true
66
66
  end
67
67
 
68
+ it 'call has_member?' do
69
+ expect(@driver.sorted_sets.has_member?(:a,:b)).to be_true
70
+ end
71
+
68
72
  it 'call length' do
69
73
  expect(@driver.sorted_sets.length).to eq(3)
70
74
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rails_kvs_driver
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.5
4
+ version: 0.1.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - alfa-jpn
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-11-11 00:00:00.000000000 Z
11
+ date: 2013-11-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -80,7 +80,8 @@ dependencies:
80
80
  - - '>='
81
81
  - !ruby/object:Gem::Version
82
82
  version: '0'
83
- description: rails kvs driver wrap access key-value store.
83
+ description: rails_kvs_driver is available to use namespace and connection pool and
84
+ ruby-like methods of kvs.
84
85
  email:
85
86
  - a.nkmr.ja@gmail.com
86
87
  executables: []
@@ -129,7 +130,8 @@ rubyforge_project:
129
130
  rubygems_version: 2.0.3
130
131
  signing_key:
131
132
  specification_version: 4
132
- summary: rails kvs driver wrap access key-value store.
133
+ summary: rails_kvs_driver is available to use namespace and connection pool and ruby-like
134
+ methods of kvs.
133
135
  test_files:
134
136
  - spec/common_example.rb
135
137
  - spec/rails_kvs_driver/defined_base_method_spec.rb