etcdv3 0.11.3 → 0.11.4

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
  SHA256:
3
- metadata.gz: 59585a18eada27829edbf162733146e90e4c336bcbbefa761b3063e3f9400139
4
- data.tar.gz: edc026da35b1396e664a431a79eb2012238ea4bd49c8ef43e1f70f93366935fe
3
+ metadata.gz: 18d76403d57c3e56b75e603931345900a4583b2e94d773b33ca04aa1547e304d
4
+ data.tar.gz: f1d1f9336f62f18b32fb9d3f055e0043bddb6076022b922b097c0104a7467c8b
5
5
  SHA512:
6
- metadata.gz: d5afcdcad7f96e422bebcd6d4d4db148bbe48c8600be017650ae229d988cd2e5c6d3547f2026eb1db18a10c91643ba3e84bb0a2555b2f8add7f687dd9bfc014a
7
- data.tar.gz: 310680f7f8f11b65dfb9ea1a116536394678faf05f29087a77b87b1665138f85c4bc39614299dff22a528a63f0a0771dbb3841e9b60a610611dacff33048fbf1
6
+ metadata.gz: 9633a47e982b7777ccda7e5472a663a661e4cf6368689cfbbd8d06a6ca862be47e7c3a75d075919b645611879513d4c88c7f59686b2a0eac15cc160e3ea7520f
7
+ data.tar.gz: 5a330de810e02ebdec73c279e33b7c2ece0c2aa7c4c877da89a2b285976ce68578ca20b3c51206d9a14c9fccbf18ef6310254010053eaefa59b06b898e1c195a
data/.travis.yml CHANGED
@@ -1,5 +1,6 @@
1
1
  language: ruby
2
2
  rvm:
3
+ - 3.0.2
3
4
  - 2.5.3
4
5
  - 2.4.5
5
6
  - 2.3.8
data/README.md CHANGED
@@ -64,6 +64,12 @@ conn.put("test_key", "value").
64
64
 
65
65
  # Get the key we just wrote.
66
66
  conn.get("test_key")
67
+
68
+ # Retrieve everything under the namespace.
69
+ conn.get("", "\0")
70
+
71
+ # Delete everything under the namespace.
72
+ conn.del("", "\0")
67
73
  ```
68
74
 
69
75
  _Note: Namespaces are stripped from responses._
@@ -28,7 +28,13 @@ class Etcdv3
28
28
  end
29
29
 
30
30
  def call(stub, method, method_args=[])
31
- @handlers.fetch(stub).send(method, *method_args)
31
+ *method_args, method_kwargs = method_args if method_args.last.class == Hash
32
+
33
+ if method_kwargs.nil?
34
+ @handlers.fetch(stub).send(method, *method_args)
35
+ else
36
+ @handlers.fetch(stub).send(method, *method_args, **method_kwargs)
37
+ end
32
38
  end
33
39
 
34
40
  def refresh_metadata(metadata)
@@ -14,7 +14,13 @@ class Etcdv3
14
14
 
15
15
  private def retry_or_raise(*args)
16
16
  if @allow_reconnect
17
- handle(*args)
17
+ *args, kwargs = args if args.last.class == Hash
18
+
19
+ if kwargs.nil?
20
+ handle(*args)
21
+ else
22
+ handle(*args, **kwargs)
23
+ end
18
24
  else
19
25
  raise
20
26
  end
@@ -1,3 +1,3 @@
1
1
  class Etcdv3
2
- VERSION = '0.11.3'.freeze
2
+ VERSION = '0.11.4'.freeze
3
3
  end
data/spec/etcdv3_spec.rb CHANGED
@@ -293,7 +293,7 @@ describe Etcdv3 do
293
293
  describe '#role_grant_permission' do
294
294
  before { conn.role_add('grant') }
295
295
  after { conn.role_delete('grant') }
296
- subject { conn.role_grant_permission('grant', :readwrite, 'a', {range_end: 'Z'}) }
296
+ subject { conn.role_grant_permission('grant', :readwrite, 'a', **{range_end: 'Z'}) }
297
297
  it { is_expected.to_not be_nil }
298
298
  it_should_behave_like "Etcdv3 instance using a timeout", :role_grant_permission, 'grant', :readwrite, 'a'
299
299
  end
@@ -32,13 +32,13 @@ shared_examples_for "Etcdv3 instance using a timeout" do |command, *args|
32
32
  it "raises a GRPC::DeadlineExceeded exception when it takes too long" do
33
33
  expect do
34
34
  test_args = args.dup
35
- test_args.push({timeout: 0})
36
- conn.public_send(command, *test_args)
35
+ test_kwargs = {timeout: 0}
36
+ conn.public_send(command, *test_args, **test_kwargs)
37
37
  end.to raise_exception(GRPC::DeadlineExceeded)
38
38
  end
39
39
  it "accepts a timeout" do
40
40
  test_args = args.dup
41
- test_args.push({timeout: 10})
42
- expect{ conn.public_send(command, *test_args) }.to_not raise_exception
41
+ test_kwargs = {timeout: 10}
42
+ expect{ conn.public_send(command, *test_args, **test_kwargs) }.to_not raise_exception
43
43
  end
44
44
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: etcdv3
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.11.3
4
+ version: 0.11.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Shaun Davis
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-08-02 00:00:00.000000000 Z
11
+ date: 2021-09-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: grpc