okcomputer 0.5.4 → 0.6.0
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 +4 -4
- data/README.markdown +13 -1
- data/lib/okcomputer/built_in_checks/active_record_check.rb +1 -1
- data/lib/okcomputer/built_in_checks/default_check.rb +1 -1
- data/lib/okcomputer/built_in_checks/mongoid_check.rb +2 -2
- data/lib/okcomputer/check.rb +3 -2
- data/lib/okcomputer/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b812534cc64ea2d62713fc45f157328f39cc65bd
|
4
|
+
data.tar.gz: 9491b4230918e0f3a5ee6b659894df6d4175db77
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d13b8ef6db3eef841b9004e50ce131e9b9bc9facfdd891926ad23b92a506ad2b1ccfba87ad3a870697b6b228980444a16cc7ba77a5a227130b94995db60004c7
|
7
|
+
data.tar.gz: 8b03ede46d95b674fe64dade6ca95a3579ea74c97452bc129be28ab54bae7e9445b4d25304ee59abf7376166d46d006700d9a8980cc69a9e47ec4599c4d89940
|
data/README.markdown
CHANGED
@@ -116,7 +116,19 @@ define a #check method which calls `mark_failure` and `mark_message` as
|
|
116
116
|
appropriate. In the meantime, OKComputer displays a warning and uses the result
|
117
117
|
of the #call method as the message.
|
118
118
|
|
119
|
-
#### Breaking
|
119
|
+
#### Breaking Changes of JSON Output
|
120
|
+
|
121
|
+
Versions before 0.6.0 did not include whether a given check succeeded.
|
122
|
+
|
123
|
+
**before 0.6.0**
|
124
|
+
```json
|
125
|
+
{"check": "result"}
|
126
|
+
```
|
127
|
+
|
128
|
+
**after 0.6.0**
|
129
|
+
```json
|
130
|
+
{"check": {"message": "result", "success": true}
|
131
|
+
```
|
120
132
|
|
121
133
|
Versions before 0.3.0, when performing multiple checks, returned an Array of
|
122
134
|
the check results, each being a JSON object. Starting with 0.3.0, these are
|
@@ -2,10 +2,10 @@ module OKComputer
|
|
2
2
|
class MongoidCheck < Check
|
3
3
|
# Public: Return the status of the mongodb
|
4
4
|
def check
|
5
|
-
mark_message "
|
5
|
+
mark_message "Connected to mongodb #{mongodb_name}"
|
6
6
|
rescue ConnectionFailed => e
|
7
7
|
mark_failure
|
8
|
-
mark_message "
|
8
|
+
mark_message "Error: '#{e}'"
|
9
9
|
end
|
10
10
|
|
11
11
|
# Public: The stats for the app's mongodb
|
data/lib/okcomputer/check.rb
CHANGED
@@ -34,7 +34,8 @@ module OKComputer
|
|
34
34
|
#
|
35
35
|
# Returns a String
|
36
36
|
def to_text
|
37
|
-
"
|
37
|
+
passfail = success? ? "PASSED" : "FAILED"
|
38
|
+
"#{registrant_name}: #{passfail} #{message}"
|
38
39
|
end
|
39
40
|
|
40
41
|
# Public: The JSON output of performing the check
|
@@ -43,7 +44,7 @@ module OKComputer
|
|
43
44
|
def to_json(*args)
|
44
45
|
# NOTE swallowing the arguments that Rails passes by default since we don't care. This may prove to be a bad idea
|
45
46
|
# Rails passes stuff like this: {:prefixes=>["ok_computer", "application"], :template=>"show", :layout=>#<Proc>}]
|
46
|
-
{registrant_name => message}.to_json
|
47
|
+
{registrant_name => {:message => message, :success => success?}}.to_json
|
47
48
|
end
|
48
49
|
|
49
50
|
# Public: Whether the check passed
|
data/lib/okcomputer/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: okcomputer
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.6.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Patrick Byrne
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-
|
11
|
+
date: 2014-02-26 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: sqlite3
|