diplomat 0.2.2 → 0.2.3

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: 16afe93a848c61faa819d4e4a30cf6ff7ba25047
4
- data.tar.gz: 49389f757e990d27619c4c5863c00d3691e0fdad
3
+ metadata.gz: 9bae583f9421ac7bbb79234002855e0d8c88c322
4
+ data.tar.gz: 2dbabe8e600b42ab651a81f34d72430e27c8818f
5
5
  SHA512:
6
- metadata.gz: 5bcd8d4eb6b4675bcc99d0bb2aba4240d3e710c316403529bca27f898fb6597721f654ef0dfeda98e4c1ded9f4ef1f2526eb1b52ce0968c554d943f2536e05cb
7
- data.tar.gz: 9488168bcc6a5f9527a42f9f5d4e1806696a63e9cb8403aaa9ec5ea38e694e3e6e11b07e58d435def608836bf4fb839d03ca5663697884136b1f1494df1aa38f
6
+ metadata.gz: 161b7548c9caf5354480dafad55110a15a7fa07afb4d3d58b41681eb12b1e22780a67259d3eee17c9308cae5466b8f9a69eca6cc1bbfb989f07d1977acb8ba66
7
+ data.tar.gz: b08de784d1e1b3a81a3f5f89d4554ffb38ca45642fc4e2ed39242730492daec6c729176b6047a1213d4b3b86d2317cc624b05916f55b532f1390460ff61370db
data/README.md CHANGED
@@ -1,5 +1,5 @@
1
1
  # Diplomat
2
- [![Gem Version](https://badge.fury.io/rb/diplomat.svg)](http://badge.fury.io/rb/diplomat) [![Build Status](https://travis-ci.org/WeAreFarmGeek/diplomat.svg?branch=master)](https://travis-ci.org/WeAreFarmGeek/diplomat) [![Code Climate](https://codeclimate.com/github/johnhamelink/diplomat.png)](https://codeclimate.com/github/WeAreFarmGeek/diplomat)
2
+ [![Gem Version](https://badge.fury.io/rb/diplomat.svg)](http://badge.fury.io/rb/diplomat) [![Build Status](https://travis-ci.org/WeAreFarmGeek/diplomat.svg?branch=master)](https://travis-ci.org/WeAreFarmGeek/diplomat) [![Code Climate](https://codeclimate.com/github/johnhamelink/diplomat.png)](https://codeclimate.com/github/WeAreFarmGeek/diplomat) [![Dependency Status](https://gemnasium.com/WeAreFarmGeek/diplomat.svg)](https://gemnasium.com/WeAreFarmGeek/diplomat)
3
3
  ### A HTTP Ruby API for [Consul](http://www.consul.io/)
4
4
 
5
5
  ![Diplomacy Boad Game](http://i.imgur.com/Nkuy4b7.jpg)
data/lib/diplomat/kv.rb CHANGED
@@ -19,12 +19,18 @@ module Diplomat
19
19
  # Get a value by it's key
20
20
  # @param key [String] the key
21
21
  # @param value [String] the value
22
+ # @param options [Hash] the query params
23
+ # @option options [Integer] :cas The modify index
22
24
  # @return [String] The base64-decoded value associated with the key
23
- def put key, value
24
- @raw = @conn.put do |req|
25
- req.url "/v1/kv/#{key}"
26
- req.body = value
25
+ def put key, value, options=nil
26
+ qs = ""
27
+
28
+ if options and options[:cas]
29
+ qs = "?cas=#{options[:cas]}"
27
30
  end
31
+
32
+ @raw = @conn.put("/v1/kv/#{key}#{qs}", value)
33
+
28
34
  if @raw.body == "true\n"
29
35
  @key = key
30
36
  @value = value
@@ -1,3 +1,3 @@
1
1
  module Diplomat
2
- VERSION = "0.2.2"
2
+ VERSION = "0.2.3"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: diplomat
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.2
4
+ version: 0.2.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - John Hamelink
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-01-07 00:00:00.000000000 Z
11
+ date: 2015-02-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -58,42 +58,42 @@ dependencies:
58
58
  requirements:
59
59
  - - "~>"
60
60
  - !ruby/object:Gem::Version
61
- version: '2.14'
61
+ version: 2.14.1
62
62
  type: :development
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
66
  - - "~>"
67
67
  - !ruby/object:Gem::Version
68
- version: '2.14'
68
+ version: 2.14.1
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: fakes-rspec
71
71
  requirement: !ruby/object:Gem::Requirement
72
72
  requirements:
73
73
  - - "~>"
74
74
  - !ruby/object:Gem::Version
75
- version: '1.0'
75
+ version: '2.0'
76
76
  type: :development
77
77
  prerelease: false
78
78
  version_requirements: !ruby/object:Gem::Requirement
79
79
  requirements:
80
80
  - - "~>"
81
81
  - !ruby/object:Gem::Version
82
- version: '1.0'
82
+ version: '2.0'
83
83
  - !ruby/object:Gem::Dependency
84
84
  name: codeclimate-test-reporter
85
85
  requirement: !ruby/object:Gem::Requirement
86
86
  requirements:
87
87
  - - "~>"
88
88
  - !ruby/object:Gem::Version
89
- version: 0.3.0
89
+ version: 0.4.0
90
90
  type: :development
91
91
  prerelease: false
92
92
  version_requirements: !ruby/object:Gem::Requirement
93
93
  requirements:
94
94
  - - "~>"
95
95
  - !ruby/object:Gem::Version
96
- version: 0.3.0
96
+ version: 0.4.0
97
97
  - !ruby/object:Gem::Dependency
98
98
  name: fivemat
99
99
  requirement: !ruby/object:Gem::Requirement