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 +4 -4
- data/README.md +1 -1
- data/lib/diplomat/kv.rb +10 -4
- data/lib/diplomat/version.rb +1 -1
- metadata +8 -8
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9bae583f9421ac7bbb79234002855e0d8c88c322
|
4
|
+
data.tar.gz: 2dbabe8e600b42ab651a81f34d72430e27c8818f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
-
|
25
|
-
|
26
|
-
|
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
|
data/lib/diplomat/version.rb
CHANGED
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.
|
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-
|
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:
|
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:
|
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: '
|
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: '
|
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.
|
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.
|
96
|
+
version: 0.4.0
|
97
97
|
- !ruby/object:Gem::Dependency
|
98
98
|
name: fivemat
|
99
99
|
requirement: !ruby/object:Gem::Requirement
|