rapporteur 3.6.0 → 3.6.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +5 -5
- data/Appraisals +10 -8
- data/CHANGELOG.md +15 -4
- data/Gemfile +2 -0
- data/Rakefile +5 -3
- data/app/controllers/rapporteur/application_controller.rb +2 -0
- data/app/controllers/rapporteur/statuses_controller.rb +4 -4
- data/bin/console +4 -3
- data/config.ru +2 -0
- data/config/routes.rb +2 -0
- data/lib/rapporteur.rb +5 -4
- data/lib/rapporteur/check_list.rb +3 -2
- data/lib/rapporteur/checker.rb +23 -21
- data/lib/rapporteur/checker_deprecations.rb +5 -3
- data/lib/rapporteur/checks.rb +4 -2
- data/lib/rapporteur/checks/active_record_check.rb +3 -1
- data/lib/rapporteur/engine.rb +2 -0
- data/lib/rapporteur/message_list.rb +12 -17
- data/lib/rapporteur/revision.rb +3 -1
- data/lib/rapporteur/rspec.rb +7 -5
- data/lib/rapporteur/rspec3.rb +6 -4
- data/lib/rapporteur/version.rb +3 -1
- data/rapporteur.gemspec +18 -16
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: fc0ef74bb8c678f77be9dbad7aa078ab01e363d0588edd10d310dd7faebd4a14
|
4
|
+
data.tar.gz: cf5d2636d5922c5ca0d9afe2fa23508b1a0866d96890daa069dd1c88919e5bf3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4592348f579f226daac44efc57c5be1351481ee743494531fa7c4dde78db1354b584651e926879c7e275462567f8d77f2c995ec53c5fad7dbc3a91f31063410e
|
7
|
+
data.tar.gz: 06e560141febd75c535f6f61b318b8b4d6e606799809f02a5b91997c69989154156a0e4238bbef31c60269194e8e3b2ecbb3ff8cfa87f37e62e68eea0e888be0
|
data/Appraisals
CHANGED
@@ -1,15 +1,17 @@
|
|
1
|
-
|
2
|
-
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
appraise 'rails4.2.x' do
|
4
|
+
gem 'railties', '~> 4.2.0'
|
3
5
|
end
|
4
6
|
|
5
|
-
appraise
|
6
|
-
gem
|
7
|
+
appraise 'rails5.x' do
|
8
|
+
gem 'railties', '~> 5.0'
|
7
9
|
end
|
8
10
|
|
9
|
-
appraise
|
10
|
-
gem
|
11
|
+
appraise 'sinatra1.x' do
|
12
|
+
gem 'sinatra', '~> 1.4'
|
11
13
|
end
|
12
14
|
|
13
|
-
appraise
|
14
|
-
gem
|
15
|
+
appraise 'sinatra2.x' do
|
16
|
+
gem 'sinatra', '~> 2.0'
|
15
17
|
end
|
data/CHANGELOG.md
CHANGED
@@ -10,6 +10,13 @@
|
|
10
10
|
|
11
11
|
* No significant changes.
|
12
12
|
|
13
|
+
## [3.6.1][] / 2018-05-20
|
14
|
+
|
15
|
+
* Convert Checker#messages and #errors into Thread-local variables. See
|
16
|
+
[#17](https://github.com/envylabs/rapporteur/issues/17) and
|
17
|
+
[#18](https://github.com/envylabs/rapporteur/issues/18), thanks to
|
18
|
+
[nevinera][].
|
19
|
+
|
13
20
|
## [3.6.0][] / 2017-06-10
|
14
21
|
|
15
22
|
* Add `expires_now` to the Rails controller's status response. This ensures the
|
@@ -20,7 +27,8 @@
|
|
20
27
|
|
21
28
|
* Fix automatic Rapporteur mount detection logic under Rails 4.0 and 4.1. The
|
22
29
|
mapper constraints used in 4.2 were not used in 4.0 and 4.1, causing a method
|
23
|
-
reference error. See #15
|
30
|
+
reference error. See [#15](https://github.com/envylabs/rapporteur/issues/15),
|
31
|
+
thanks to [sshaw][].
|
24
32
|
|
25
33
|
## [3.5.0][] / 2016-01-28
|
26
34
|
|
@@ -31,7 +39,8 @@
|
|
31
39
|
in their Rails application. This adds mount point flexibility at the cost of
|
32
40
|
configuration.
|
33
41
|
* Change ActiveRecord to use a more database agnostic `select_value` query to
|
34
|
-
determine availability. See
|
42
|
+
determine availability. See
|
43
|
+
[#12](https://github.com/envylabs/rapporteur/issues/12).
|
35
44
|
|
36
45
|
## [3.4.0][] / 2016-01-06
|
37
46
|
|
@@ -54,7 +63,7 @@
|
|
54
63
|
* Update the Rails route definition to force (and default) a JSON format. The
|
55
64
|
intent is to fix an issue where Rails auto-appended a `(.:format)` segment to
|
56
65
|
the fixed route and broke `/status.json` route matching. See
|
57
|
-
[
|
66
|
+
[#9](https://github.com/envylabs/rapporteur/issues/9).
|
58
67
|
|
59
68
|
## [3.1.0][] / 2014-07-03
|
60
69
|
|
@@ -145,6 +154,7 @@
|
|
145
154
|
|
146
155
|
|
147
156
|
[lsylvester]: https://github.com/lsylvester
|
157
|
+
[nevinera]: https://github.com/nevinera
|
148
158
|
[sshaw]: https://github.com/sshaw
|
149
159
|
|
150
160
|
[1.0.1]: https://github.com/envylabs/rapporteur/compare/v1.0.0...v1.0.1
|
@@ -162,4 +172,5 @@
|
|
162
172
|
[3.5.0]: https://github.com/envylabs/rapporteur/compare/v3.4.0...v3.5.0
|
163
173
|
[3.5.1]: https://github.com/envylabs/rapporteur/compare/v3.5.0...v3.5.1
|
164
174
|
[3.6.0]: https://github.com/envylabs/rapporteur/compare/v3.5.1...v3.6.0
|
165
|
-
[
|
175
|
+
[3.6.1]: https://github.com/envylabs/rapporteur/compare/v3.6.0...v3.6.1
|
176
|
+
[HEAD]: https://github.com/envylabs/rapporteur/compare/v3.6.1...master
|
data/Gemfile
CHANGED
data/Rakefile
CHANGED
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
module Rapporteur
|
2
4
|
class StatusesController < ApplicationController
|
3
5
|
def show
|
@@ -7,7 +9,7 @@ module Rapporteur
|
|
7
9
|
resource = Rapporteur.run
|
8
10
|
|
9
11
|
if resource.errors.empty?
|
10
|
-
render(
|
12
|
+
render(json: resource)
|
11
13
|
else
|
12
14
|
display_errors(resource, :json)
|
13
15
|
end
|
@@ -15,12 +17,10 @@ module Rapporteur
|
|
15
17
|
end
|
16
18
|
end
|
17
19
|
|
18
|
-
|
19
20
|
private
|
20
21
|
|
21
|
-
|
22
22
|
def display_errors(resource, format)
|
23
|
-
render(
|
23
|
+
render(format => { errors: resource.errors }, :status => :internal_server_error)
|
24
24
|
end
|
25
25
|
end
|
26
26
|
end
|
data/bin/console
CHANGED
@@ -1,7 +1,8 @@
|
|
1
1
|
#!/usr/bin/env ruby
|
2
|
+
# frozen_string_literal: true
|
2
3
|
|
3
|
-
require
|
4
|
-
require
|
4
|
+
require 'bundler/setup'
|
5
|
+
require 'rapporteur'
|
5
6
|
|
6
7
|
# You can add fixtures and/or initialization code here to make experimenting
|
7
8
|
# with your gem easier. You can also use a different console, if you like.
|
@@ -10,5 +11,5 @@ require "rapporteur"
|
|
10
11
|
# require "pry"
|
11
12
|
# Pry.start
|
12
13
|
|
13
|
-
require
|
14
|
+
require 'irb'
|
14
15
|
IRB.start(__FILE__)
|
data/config.ru
CHANGED
data/config/routes.rb
CHANGED
data/lib/rapporteur.rb
CHANGED
@@ -1,5 +1,7 @@
|
|
1
|
-
|
2
|
-
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'rapporteur/engine' if defined?(Rails)
|
4
|
+
require 'rapporteur/version'
|
3
5
|
|
4
6
|
# Rapporteur is a Rails Engine which provides your application with an
|
5
7
|
# application status endpoint.
|
@@ -12,7 +14,6 @@ module Rapporteur
|
|
12
14
|
autoload :MessageList, 'rapporteur/message_list'
|
13
15
|
autoload :Revision, 'rapporteur/revision'
|
14
16
|
|
15
|
-
|
16
17
|
# Public: Add a pre-built or custom check to your status endpoint. These
|
17
18
|
# checks are used to test the state of the world of the application, and
|
18
19
|
# need only respond to `#call`.
|
@@ -30,7 +31,7 @@ module Rapporteur
|
|
30
31
|
# Returns the Checker instance.
|
31
32
|
# Raises ArgumentError if the given check does not respond to call.
|
32
33
|
#
|
33
|
-
def self.add_check(object_or_nil_with_block=nil, &block)
|
34
|
+
def self.add_check(object_or_nil_with_block = nil, &block)
|
34
35
|
checker.add_check(object_or_nil_with_block, &block)
|
35
36
|
end
|
36
37
|
|
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
module Rapporteur
|
2
4
|
# Manages a list of checks.
|
3
5
|
#
|
@@ -13,10 +15,9 @@ module Rapporteur
|
|
13
15
|
# Public: Returns a new, empty CheckList instance.
|
14
16
|
#
|
15
17
|
def initialize
|
16
|
-
@list =
|
18
|
+
@list = []
|
17
19
|
end
|
18
20
|
|
19
|
-
|
20
21
|
# Public: Add a new check to the list.
|
21
22
|
#
|
22
23
|
# Returns the CheckList instance.
|
data/lib/rapporteur/checker.rb
CHANGED
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
module Rapporteur
|
2
4
|
# The center of the Rapporteur library, Checker manages holding and running
|
3
5
|
# the custom checks, holding any application error messages, and provides the
|
@@ -6,15 +8,11 @@ module Rapporteur
|
|
6
8
|
class Checker
|
7
9
|
extend CheckerDeprecations
|
8
10
|
|
9
|
-
|
10
11
|
def initialize
|
11
|
-
@messages = MessageList.new(:messages)
|
12
|
-
@errors = MessageList.new(:errors)
|
13
12
|
@check_list = CheckList.new
|
14
13
|
reset
|
15
14
|
end
|
16
15
|
|
17
|
-
|
18
16
|
# Public: Add a pre-built or custom check to your status endpoint. These
|
19
17
|
# checks are used to test the state of the world of the application, and
|
20
18
|
# need only respond to `#call`.
|
@@ -32,13 +30,13 @@ module Rapporteur
|
|
32
30
|
# Returns self.
|
33
31
|
# Raises ArgumentError if the given check does not respond to call.
|
34
32
|
#
|
35
|
-
def add_check(object_or_nil_with_block=nil, &block)
|
33
|
+
def add_check(object_or_nil_with_block = nil, &block)
|
36
34
|
if block_given?
|
37
|
-
|
35
|
+
check_list.add(block)
|
38
36
|
elsif object_or_nil_with_block.respond_to?(:call)
|
39
|
-
|
37
|
+
check_list.add(object_or_nil_with_block)
|
40
38
|
else
|
41
|
-
raise ArgumentError,
|
39
|
+
raise ArgumentError, 'A check must respond to #call.'
|
42
40
|
end
|
43
41
|
self
|
44
42
|
end
|
@@ -51,7 +49,7 @@ module Rapporteur
|
|
51
49
|
# Returns self.
|
52
50
|
#
|
53
51
|
def clear
|
54
|
-
|
52
|
+
check_list.clear
|
55
53
|
self
|
56
54
|
end
|
57
55
|
|
@@ -76,7 +74,7 @@ module Rapporteur
|
|
76
74
|
#
|
77
75
|
def run
|
78
76
|
reset
|
79
|
-
|
77
|
+
check_list.each do |object|
|
80
78
|
object.call(self)
|
81
79
|
break if @halted
|
82
80
|
end
|
@@ -116,8 +114,8 @@ module Rapporteur
|
|
116
114
|
#
|
117
115
|
# Returns self.
|
118
116
|
#
|
119
|
-
def add_error(name, message, i18n_options={})
|
120
|
-
|
117
|
+
def add_error(name, message, i18n_options = {})
|
118
|
+
errors.add(name, message, i18n_options)
|
121
119
|
self
|
122
120
|
end
|
123
121
|
|
@@ -143,42 +141,46 @@ module Rapporteur
|
|
143
141
|
#
|
144
142
|
# Returns self.
|
145
143
|
#
|
146
|
-
def add_message(name, message, i18n_options={})
|
147
|
-
|
144
|
+
def add_message(name, message, i18n_options = {})
|
145
|
+
messages.add(name, message, i18n_options)
|
148
146
|
self
|
149
147
|
end
|
150
148
|
|
151
149
|
##
|
152
150
|
# Internal: Returns a hash of messages suitable for conversion into JSON.
|
153
151
|
#
|
154
|
-
def as_json(
|
155
|
-
|
152
|
+
def as_json(_args = {})
|
153
|
+
messages.to_hash
|
156
154
|
end
|
157
155
|
|
158
156
|
##
|
159
157
|
# Internal: Used by Rails' JSON serialization to render error messages.
|
160
158
|
#
|
161
159
|
def errors
|
162
|
-
|
160
|
+
Thread.current[:rapporteur_errors] ||= MessageList.new(:errors)
|
163
161
|
end
|
164
162
|
|
165
163
|
##
|
166
164
|
# Internal: Used by Rails' JSON serialization.
|
167
165
|
#
|
168
166
|
def read_attribute_for_serialization(key)
|
169
|
-
|
167
|
+
messages[key]
|
170
168
|
end
|
171
169
|
|
172
170
|
alias read_attribute_for_validation read_attribute_for_serialization
|
173
171
|
|
174
|
-
|
175
172
|
private
|
176
173
|
|
174
|
+
attr_reader :check_list
|
175
|
+
|
176
|
+
def messages
|
177
|
+
Thread.current[:rapporteur_messages] ||= MessageList.new(:messages)
|
178
|
+
end
|
177
179
|
|
178
180
|
def reset
|
179
181
|
@halted = false
|
180
|
-
|
181
|
-
|
182
|
+
messages.clear
|
183
|
+
errors.clear
|
182
184
|
end
|
183
185
|
end
|
184
186
|
end
|
@@ -1,19 +1,21 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
require 'active_support/deprecation'
|
2
4
|
|
3
5
|
module Rapporteur
|
4
6
|
module CheckerDeprecations
|
5
7
|
def add_check(*args, &block)
|
6
|
-
ActiveSupport::Deprecation.warn(
|
8
|
+
ActiveSupport::Deprecation.warn('use Rapporteur.add_check', caller)
|
7
9
|
Rapporteur.add_check(*args, &block)
|
8
10
|
end
|
9
11
|
|
10
12
|
def clear
|
11
|
-
ActiveSupport::Deprecation.warn(
|
13
|
+
ActiveSupport::Deprecation.warn('use Rapporteur.clear_checks', caller)
|
12
14
|
Rapporteur.clear_checks
|
13
15
|
end
|
14
16
|
|
15
17
|
def run
|
16
|
-
ActiveSupport::Deprecation.warn(
|
18
|
+
ActiveSupport::Deprecation.warn('use Rapporteur.run', caller)
|
17
19
|
Rapporteur.run
|
18
20
|
end
|
19
21
|
end
|
data/lib/rapporteur/checks.rb
CHANGED
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
module Rapporteur
|
2
4
|
module Checks
|
3
5
|
autoload :ActiveRecordCheck, 'rapporteur/checks/active_record_check'
|
@@ -14,7 +16,7 @@ module Rapporteur
|
|
14
16
|
# time: "2013-06-21T05:18:59Z"
|
15
17
|
# }
|
16
18
|
#
|
17
|
-
TimeCheck =
|
19
|
+
TimeCheck = ->(checker) { checker.add_message(:time, Time.now.utc) }
|
18
20
|
|
19
21
|
# A check which reports the current revision of the running application.
|
20
22
|
#
|
@@ -26,6 +28,6 @@ module Rapporteur
|
|
26
28
|
# revision: "c74edd04f64b25ff6691308bcfdefcee149aa4b5"
|
27
29
|
# }
|
28
30
|
#
|
29
|
-
RevisionCheck =
|
31
|
+
RevisionCheck = ->(checker) { checker.add_message(:revision, Revision.current) }
|
30
32
|
end
|
31
33
|
end
|
@@ -1,8 +1,10 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
module Rapporteur
|
2
4
|
module Checks
|
3
5
|
class ActiveRecordCheck
|
4
6
|
def self.call(checker)
|
5
|
-
ActiveRecord::Base.connection.select_value(
|
7
|
+
ActiveRecord::Base.connection.select_value('SELECT current_time AS time')
|
6
8
|
rescue
|
7
9
|
checker.add_error(:database, :unavailable)
|
8
10
|
end
|
data/lib/rapporteur/engine.rb
CHANGED
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
require 'forwardable'
|
2
4
|
require 'set'
|
3
5
|
|
@@ -8,11 +10,9 @@ module Rapporteur
|
|
8
10
|
class MessageList
|
9
11
|
extend Forwardable
|
10
12
|
|
11
|
-
|
12
13
|
def_delegator :@messages, :clear
|
13
14
|
def_delegator :@messages, :empty?
|
14
15
|
|
15
|
-
|
16
16
|
# Public: Initialize a new MessageList instance.
|
17
17
|
#
|
18
18
|
# list_type - A Symbol representing the type of this list. This Symbol is
|
@@ -27,7 +27,6 @@ module Rapporteur
|
|
27
27
|
@messages = Hash.new { |hash, key| hash[key] = Set.new }
|
28
28
|
end
|
29
29
|
|
30
|
-
|
31
30
|
# Public: Adds a new message to the list for the given attribute.
|
32
31
|
#
|
33
32
|
# attribute - A Symbol describing the category, attribute, or name to which
|
@@ -76,9 +75,9 @@ module Rapporteur
|
|
76
75
|
# Returns an Array containing Strings of messages.
|
77
76
|
#
|
78
77
|
def full_messages
|
79
|
-
@messages.map
|
78
|
+
@messages.map do |attribute, attribute_messages|
|
80
79
|
attribute_messages.collect { |message| "#{attribute} #{message}" }
|
81
|
-
|
80
|
+
end.flatten
|
82
81
|
end
|
83
82
|
|
84
83
|
# Public: Returns the added attributes and their messages as a Hash, keyed
|
@@ -96,26 +95,22 @@ module Rapporteur
|
|
96
95
|
# Returns a Hash instance.
|
97
96
|
#
|
98
97
|
def to_hash
|
99
|
-
hash =
|
98
|
+
hash = {}
|
100
99
|
@messages.each_pair do |key, value|
|
101
|
-
if value.size == 1
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
100
|
+
hash[key] = if value.size == 1
|
101
|
+
value.first
|
102
|
+
else
|
103
|
+
value.to_a
|
104
|
+
end
|
106
105
|
end
|
107
106
|
hash
|
108
107
|
end
|
109
108
|
|
110
|
-
|
111
109
|
private
|
112
110
|
|
113
|
-
|
114
111
|
def generate_message(key, type, i18n_options)
|
115
|
-
I18n.translate(type, i18n_options.merge(
|
116
|
-
|
117
|
-
:scope => [:rapporteur, @list_type, key]
|
118
|
-
}))
|
112
|
+
I18n.translate(type, i18n_options.merge(default: [type, type.to_s],
|
113
|
+
scope: [:rapporteur, @list_type, key]))
|
119
114
|
end
|
120
115
|
|
121
116
|
def normalize_message(attribute, message, i18n_options)
|
data/lib/rapporteur/revision.rb
CHANGED
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
module Rapporteur
|
2
4
|
# Manages memoizing and maintaining the current application revision.
|
3
5
|
#
|
@@ -47,7 +49,7 @@ module Rapporteur
|
|
47
49
|
when Proc
|
48
50
|
revision.call.to_s
|
49
51
|
when NilClass
|
50
|
-
|
52
|
+
'You must provide a Rapporteur::Revision.current= String or Proc'
|
51
53
|
else
|
52
54
|
raise ArgumentError, "Unknown revision type given: #{revision.inspect}"
|
53
55
|
end
|
data/lib/rapporteur/rspec.rb
CHANGED
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
require 'rapporteur'
|
2
4
|
|
3
5
|
shared_examples_for 'a successful status response' do
|
@@ -63,11 +65,11 @@ RSpec::Matchers.define :include_status_error_message do |attribute, message|
|
|
63
65
|
@body.fetch('errors', {}).fetch(attribute.to_s).match(message)
|
64
66
|
end
|
65
67
|
|
66
|
-
failure_message_for_should do |
|
68
|
+
failure_message_for_should do |_actual|
|
67
69
|
"expected #{@body.inspect} to include a #{attribute}:#{message.inspect} error message"
|
68
70
|
end
|
69
71
|
|
70
|
-
failure_message_for_should_not do |
|
72
|
+
failure_message_for_should_not do |_actual|
|
71
73
|
"expected #{@body.inspect} to not include a #{attribute}:#{message.inspect} error message"
|
72
74
|
end
|
73
75
|
end
|
@@ -75,14 +77,14 @@ end
|
|
75
77
|
RSpec::Matchers.define :include_status_message do |name, message|
|
76
78
|
match do |response|
|
77
79
|
@body = JSON.parse(response.body)
|
78
|
-
@body.
|
80
|
+
@body.key?(name) && @body.fetch(name).match(message)
|
79
81
|
end
|
80
82
|
|
81
|
-
failure_message_for_should do |
|
83
|
+
failure_message_for_should do |_actual|
|
82
84
|
"expected #{@body.inspect} to include a #{name.inspect}: #{message.inspect} message"
|
83
85
|
end
|
84
86
|
|
85
|
-
failure_message_for_should_not do |
|
87
|
+
failure_message_for_should_not do |_actual|
|
86
88
|
"expected #{@body.inspect} to not include a #{name.inspect}: #{message.inspect} message"
|
87
89
|
end
|
88
90
|
end
|
data/lib/rapporteur/rspec3.rb
CHANGED
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
require 'rapporteur'
|
2
4
|
|
3
5
|
shared_examples_for 'a successful status response' do
|
@@ -63,7 +65,7 @@ RSpec::Matchers.define :include_status_error_message do |attribute, message|
|
|
63
65
|
@body.fetch('errors', {}).fetch(attribute.to_s).match(message)
|
64
66
|
end
|
65
67
|
|
66
|
-
failure_message_when_negated do |
|
68
|
+
failure_message_when_negated do |_actual|
|
67
69
|
"expected #{@body.inspect} to not include a #{attribute}:#{message.inspect} error message"
|
68
70
|
end
|
69
71
|
end
|
@@ -72,14 +74,14 @@ RSpec::Matchers.define :include_status_message do |name, message|
|
|
72
74
|
match do |response|
|
73
75
|
@body = JSON.parse(response.body)
|
74
76
|
|
75
|
-
@body.
|
77
|
+
@body.key?(name) && @body.fetch(name).match(message)
|
76
78
|
end
|
77
79
|
|
78
|
-
failure_message do |
|
80
|
+
failure_message do |_actual|
|
79
81
|
"expected #{@body.inspect} to include a #{name.inspect}: #{message.inspect} message"
|
80
82
|
end
|
81
83
|
|
82
|
-
failure_message_when_negated do |
|
84
|
+
failure_message_when_negated do |_actual|
|
83
85
|
"expected #{@body.inspect} to not include a #{name.inspect}: #{message.inspect} message"
|
84
86
|
end
|
85
87
|
end
|
data/lib/rapporteur/version.rb
CHANGED
data/rapporteur.gemspec
CHANGED
@@ -1,32 +1,34 @@
|
|
1
1
|
# coding: utf-8
|
2
|
+
# frozen_string_literal: true
|
3
|
+
|
2
4
|
lib = File.expand_path('../lib', __FILE__)
|
3
5
|
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
6
|
require 'rapporteur/version'
|
5
7
|
|
6
8
|
Gem::Specification.new do |spec|
|
7
|
-
spec.name =
|
9
|
+
spec.name = 'rapporteur'
|
8
10
|
spec.version = Rapporteur::VERSION
|
9
|
-
spec.authors = [
|
10
|
-
spec.email = [
|
11
|
-
spec.description =
|
12
|
-
spec.summary =
|
13
|
-
spec.homepage =
|
14
|
-
spec.license =
|
11
|
+
spec.authors = ['Envy Labs', 'Code School']
|
12
|
+
spec.email = ['']
|
13
|
+
spec.description = 'An engine that provides common status polling endpoint.'
|
14
|
+
spec.summary = 'An engine that provides common status polling endpoint.'
|
15
|
+
spec.homepage = 'https://github.com/envylabs/rapporteur'
|
16
|
+
spec.license = 'MIT'
|
15
17
|
|
16
18
|
spec.files = `git ls-files -z`.split("\x0").reject do |f|
|
17
19
|
f.match(%r{^(test|spec|features)/})
|
18
20
|
end
|
19
|
-
spec.bindir =
|
21
|
+
spec.bindir = 'exe'
|
20
22
|
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
21
|
-
spec.require_paths = [
|
23
|
+
spec.require_paths = ['lib']
|
22
24
|
|
23
25
|
spec.add_dependency 'i18n', '~> 0.6'
|
24
26
|
|
25
|
-
spec.add_development_dependency
|
26
|
-
spec.add_development_dependency
|
27
|
-
spec.add_development_dependency
|
28
|
-
spec.add_development_dependency
|
29
|
-
spec.add_development_dependency
|
30
|
-
spec.add_development_dependency
|
31
|
-
spec.add_development_dependency
|
27
|
+
spec.add_development_dependency 'appraisal', '~> 2.1'
|
28
|
+
spec.add_development_dependency 'bundler', '~> 1.15'
|
29
|
+
spec.add_development_dependency 'combustion', '~> 0.5', '>= 0.5.1'
|
30
|
+
spec.add_development_dependency 'rails', '>= 3.1', '< 6'
|
31
|
+
spec.add_development_dependency 'rake', '~> 12.0'
|
32
|
+
spec.add_development_dependency 'rspec-collection_matchers', '~> 1.0'
|
33
|
+
spec.add_development_dependency 'rspec-rails', '~> 3.2'
|
32
34
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rapporteur
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.6.
|
4
|
+
version: 3.6.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Envy Labs
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: exe
|
11
11
|
cert_chain: []
|
12
|
-
date:
|
12
|
+
date: 2018-05-21 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: i18n
|
@@ -195,7 +195,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
195
195
|
version: '0'
|
196
196
|
requirements: []
|
197
197
|
rubyforge_project:
|
198
|
-
rubygems_version: 2.
|
198
|
+
rubygems_version: 2.7.3
|
199
199
|
signing_key:
|
200
200
|
specification_version: 4
|
201
201
|
summary: An engine that provides common status polling endpoint.
|