imperium 0.5.0 → 0.5.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +1 -1
- data/Jenkinsfile +30 -0
- data/imperium.gemspec +3 -3
- data/lib/imperium/kv_put_response.rb +2 -1
- data/lib/imperium/response.rb +13 -1
- data/lib/imperium/version.rb +1 -1
- metadata +10 -10
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6e9bc98175effba9f3974205f648bb8ae83d81a6056a2715eeada035c08302bd
|
4
|
+
data.tar.gz: 724ef1b826f7f12a392d724149ead769a16c9c1d307fa1e057581ae7e9c82d08
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 687de4fd6e3a18f11526f5d3d119d9f6e75ecdddd79ef4ffd91fb4962018b116dffce7e8bed48e1fbbbbed6a6c170ee66d64ad65c4b265364d9d829eecf32bee
|
7
|
+
data.tar.gz: 886f5170b21d2ad9595a24cc9805bb22e760c43cf9c90647ba9c4642c552c3c6eb0b2c6c2073fcbca480259ad40ed2f348987736475c3b1491fc7c93176bde92
|
data/.travis.yml
CHANGED
data/Jenkinsfile
ADDED
@@ -0,0 +1,30 @@
|
|
1
|
+
#! /usr/bin/env groovy
|
2
|
+
|
3
|
+
pipeline {
|
4
|
+
agent { label 'docker' }
|
5
|
+
|
6
|
+
stages {
|
7
|
+
stage("Build Image") {
|
8
|
+
steps {
|
9
|
+
timeout(time: 5, unit: 'MINUTES') {
|
10
|
+
dockerCacheLoad(image: "imperium_app")
|
11
|
+
sh """docker-compose build --pull"""
|
12
|
+
}
|
13
|
+
}
|
14
|
+
}
|
15
|
+
|
16
|
+
stage("Run Tests") {
|
17
|
+
steps {
|
18
|
+
sh """docker-compose run --rm app"""
|
19
|
+
}
|
20
|
+
}
|
21
|
+
}
|
22
|
+
|
23
|
+
post {
|
24
|
+
success {
|
25
|
+
timeout(time: 5, unit: 'MINUTES') {
|
26
|
+
dockerCacheStore(image: "imperium_app")
|
27
|
+
}
|
28
|
+
}
|
29
|
+
}
|
30
|
+
}
|
data/imperium.gemspec
CHANGED
@@ -21,14 +21,14 @@ Gem::Specification.new do |spec|
|
|
21
21
|
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
22
22
|
spec.require_paths = ['lib']
|
23
23
|
|
24
|
-
spec.add_dependency 'addressable', '~> 2.5
|
24
|
+
spec.add_dependency 'addressable', '~> 2.5'
|
25
25
|
spec.add_dependency 'httpclient', '~> 2.8'
|
26
26
|
|
27
27
|
spec.add_development_dependency 'bundler', '~> 1.13'
|
28
28
|
spec.add_development_dependency 'byebug'
|
29
|
-
spec.add_development_dependency 'rake', '~>
|
29
|
+
spec.add_development_dependency 'rake', '~> 12.0'
|
30
30
|
spec.add_development_dependency 'rspec', '~> 3.0'
|
31
|
-
spec.add_development_dependency 'webmock', '~>
|
31
|
+
spec.add_development_dependency 'webmock', '~> 3.0'
|
32
32
|
spec.add_development_dependency 'wwtd', '~> 1.3'
|
33
33
|
spec.add_development_dependency 'yard'
|
34
34
|
end
|
data/lib/imperium/response.rb
CHANGED
@@ -38,7 +38,7 @@ module Imperium
|
|
38
38
|
headers['X-Consul-KnownLeader'] == 'true'
|
39
39
|
end
|
40
40
|
|
41
|
-
# The time in
|
41
|
+
# The time in milliseconds since the contacted server has been in contact
|
42
42
|
# with the leader.
|
43
43
|
#
|
44
44
|
# @return [NilClass] When the X-Consul-LastContact header is not present.
|
@@ -48,6 +48,18 @@ module Imperium
|
|
48
48
|
Integer(headers['X-Consul-LastContact'])
|
49
49
|
end
|
50
50
|
|
51
|
+
# The index returned from a request via the X-Consul-Index header.
|
52
|
+
#
|
53
|
+
# @return [NilClass] When the X-Consul-Index header is not present.
|
54
|
+
# @return [Integer]
|
55
|
+
def index
|
56
|
+
return nil unless headers.key?('X-Consul-Index')
|
57
|
+
Integer(headers['X-Consul-Index'])
|
58
|
+
rescue ArgumentError
|
59
|
+
return nil
|
60
|
+
end
|
61
|
+
|
62
|
+
##
|
51
63
|
# A convenience method for checking if the response had a 404 status code.
|
52
64
|
def not_found?
|
53
65
|
status == 404
|
data/lib/imperium/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: imperium
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.5.
|
4
|
+
version: 0.5.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Tyler Pickett
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2019-07-22 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: addressable
|
@@ -16,14 +16,14 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: 2.5
|
19
|
+
version: '2.5'
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: 2.5
|
26
|
+
version: '2.5'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: httpclient
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
@@ -72,14 +72,14 @@ dependencies:
|
|
72
72
|
requirements:
|
73
73
|
- - "~>"
|
74
74
|
- !ruby/object:Gem::Version
|
75
|
-
version: '
|
75
|
+
version: '12.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: '12.0'
|
83
83
|
- !ruby/object:Gem::Dependency
|
84
84
|
name: rspec
|
85
85
|
requirement: !ruby/object:Gem::Requirement
|
@@ -100,14 +100,14 @@ dependencies:
|
|
100
100
|
requirements:
|
101
101
|
- - "~>"
|
102
102
|
- !ruby/object:Gem::Version
|
103
|
-
version:
|
103
|
+
version: '3.0'
|
104
104
|
type: :development
|
105
105
|
prerelease: false
|
106
106
|
version_requirements: !ruby/object:Gem::Requirement
|
107
107
|
requirements:
|
108
108
|
- - "~>"
|
109
109
|
- !ruby/object:Gem::Version
|
110
|
-
version:
|
110
|
+
version: '3.0'
|
111
111
|
- !ruby/object:Gem::Dependency
|
112
112
|
name: wwtd
|
113
113
|
requirement: !ruby/object:Gem::Requirement
|
@@ -147,6 +147,7 @@ files:
|
|
147
147
|
- ".travis.yml"
|
148
148
|
- Dockerfile.ci
|
149
149
|
- Gemfile
|
150
|
+
- Jenkinsfile
|
150
151
|
- README.md
|
151
152
|
- Rakefile
|
152
153
|
- bin/console
|
@@ -201,8 +202,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
201
202
|
- !ruby/object:Gem::Version
|
202
203
|
version: '0'
|
203
204
|
requirements: []
|
204
|
-
|
205
|
-
rubygems_version: 2.7.6
|
205
|
+
rubygems_version: 3.0.3
|
206
206
|
signing_key:
|
207
207
|
specification_version: 4
|
208
208
|
summary: A powerful, easy to use, Consul client
|