etcd 0.2.1 → 0.2.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- NGYzZDQ1YzNlZDcwZDBmZjQ2ZDMxYmMzNzU1Yjc0NGJmMmFjMzE4NA==
4
+ NTQyMjkyOGM4NDVjZDUxZjkxZTBlYmMyMzdlMjYwMDAyOGJiZGEwYg==
5
5
  data.tar.gz: !binary |-
6
- MDU0ZWU1Yzc2MTU0ZTYwNDU1YzczZTE3ODViODEyY2Q0MTNhMTI1NQ==
6
+ ZGY4MjJlZGJhODY1NTQ0YTA1YjkxYmNhYmJiNDI2ZGVhMDMxMTZhYQ==
7
7
  SHA512:
8
8
  metadata.gz: !binary |-
9
- NWUzM2UwNDc5Njc3NzA2ZjVmOTljYzIzM2QzZmQyMGUwODFkYTQzYjdhMzVi
10
- NjMyODBiNDk4YmMxNjFhODQyOTE0MTQzZmYwNzIzYzA5NDFjM2JmZjAxYTNm
11
- NmQ5ZGQ4ZWJkYzc0MGI0ZTRhZWU3MDJhMzY5YWU1YWMyYTU1ZWE=
9
+ NDc5NmZkOTAwZGNhZjNkMjBmMTM3NWRmYTViYzE3YTkyMWY3Yzc3NjcxYjRi
10
+ OWVmZDZkNWE3MzdjNWJhODgzN2RhZDg0NThhZWFiOTUxY2Y5ODU5MGE5NzJj
11
+ NWRhZWJjZmNlM2IyNDJlNjBkZDVkZjYwZjgzNzEwMTY1NzhiOGE=
12
12
  data.tar.gz: !binary |-
13
- M2VhNzQ3NjIyY2YxMDQxZWM2MjFkYjU5MTQwMDlkYWZiYTU4YjJmYzcyODUx
14
- YTIxOGI2MjZiNTFjMDc5MzgxZWFkOWRkNTI3MThmYmE3OThkMTE2NmVmZTJi
15
- YjY3M2VjNWM1MmJhNzNiMDljNDQ1ODA3MTczZTc1MzkyODk1N2I=
13
+ Njc1NGI2NWUyZGEzMWZhMmU0M2JkYjdiNDFmMWNkNzUxYTQ2YzI4NjFiNmVh
14
+ NjBjYjcyNDBlMzczODg3YzcyNmZkNTllZTY0Y2UxMWM1ODU2ZDBlNzI5Y2M1
15
+ NDJkNzAzYTZjYzlmNzRkY2E1OWI4NWI3ZmZkNjI3YWY3MTg4NDM=
@@ -14,7 +14,7 @@ module Etcd
14
14
  path = mod_lock_endpoint + key + "?ttl=#{ttl}"
15
15
  timeout = opts[:timeout] || 60
16
16
  Timeout.timeout(timeout) do
17
- api_execute(path, :post, params: opts)
17
+ return api_execute(path, :post, params: opts).body
18
18
  end
19
19
  end
20
20
 
@@ -42,14 +42,14 @@ module Etcd
42
42
 
43
43
  # rubocop:disable RescueException
44
44
  def lock(key, ttl, opts = {})
45
- acquire_lock('/' + key, ttl, opts)
46
- index = get_lock('/' + key, field: index)
45
+ key = "/" + key unless key.start_with? '/'
46
+ lock_index = acquire_lock(key, ttl, opts)
47
47
  begin
48
48
  yield key
49
49
  rescue Exception => e
50
50
  raise e
51
51
  ensure
52
- delete_lock(key, index: index)
52
+ delete_lock(key, index: lock_index)
53
53
  end
54
54
  end
55
55
  # rubocop:enable RescueException
@@ -1,5 +1,5 @@
1
1
  # Encoding: utf-8
2
2
  # Version const
3
3
  module Etcd
4
- VERSION = '0.2.1'
4
+ VERSION = '0.2.2'
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: etcd
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.1
4
+ version: 0.2.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ranjib Dey
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-03-06 00:00:00.000000000 Z
11
+ date: 2014-03-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: mixlib-log