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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 779a566e5bf928898b95b22d1068425f92d0861729ddf040629a684aa264bf54
4
- data.tar.gz: b104cfaf6aa9520897a329ac5901c6d81726d082029ddde6836f3d4433170f80
3
+ metadata.gz: 6e9bc98175effba9f3974205f648bb8ae83d81a6056a2715eeada035c08302bd
4
+ data.tar.gz: 724ef1b826f7f12a392d724149ead769a16c9c1d307fa1e057581ae7e9c82d08
5
5
  SHA512:
6
- metadata.gz: d5f7e81607249b27cba23d86f4aaefb67e07eee51e990f57480c8220bd2ed3a0c2c70f16c68a7b49dd8ea7ec8e4d88324f892dcdc803d5a5c330a9450819a086
7
- data.tar.gz: fddc23e4f857365440c4d70b621b6b15713097b44aa3b9ecb2eb1f42865bca70b8307643f8c6609c183140b9780f99729b1343e17c7e49d42931d85b53939c30
6
+ metadata.gz: 687de4fd6e3a18f11526f5d3d119d9f6e75ecdddd79ef4ffd91fb4962018b116dffce7e8bed48e1fbbbbed6a6c170ee66d64ad65c4b265364d9d829eecf32bee
7
+ data.tar.gz: 886f5170b21d2ad9595a24cc9805bb22e760c43cf9c90647ba9c4642c552c3c6eb0b2c6c2073fcbca480259ad40ed2f348987736475c3b1491fc7c93176bde92
data/.travis.yml CHANGED
@@ -2,6 +2,6 @@ sudo: false
2
2
  language: ruby
3
3
  before_install: gem install bundler -v 1.13.6
4
4
  rvm:
5
- - "2.2"
6
5
  - "2.3"
7
6
  - "2.4"
7
+ - "2.5"
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.0'
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', '~> 10.0'
29
+ spec.add_development_dependency 'rake', '~> 12.0'
30
30
  spec.add_development_dependency 'rspec', '~> 3.0'
31
- spec.add_development_dependency 'webmock', '~> 2.3.2'
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
@@ -27,7 +27,8 @@ module Imperium
27
27
  return @success if defined? @success
28
28
  @success = JSON.parse(body)
29
29
  rescue JSON::ParserError
30
- body.empty? ? @success = false : raise
30
+ (status == 403 or body.empty?) ?
31
+ @success = false : raise
31
32
  end
32
33
  end
33
34
  end
@@ -38,7 +38,7 @@ module Imperium
38
38
  headers['X-Consul-KnownLeader'] == 'true'
39
39
  end
40
40
 
41
- # The time in miliseconds since the contacted server has been in contact
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
@@ -1,3 +1,3 @@
1
1
  module Imperium
2
- VERSION = "0.5.0"
2
+ VERSION = "0.5.1"
3
3
  end
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.0
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: 2018-07-31 00:00:00.000000000 Z
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.0
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.0
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: '10.0'
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: '10.0'
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: 2.3.2
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: 2.3.2
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
- rubyforge_project:
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