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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 9268124fdbf87b4a54885c060b24a2108d0ad1af
4
- data.tar.gz: 9ed43a200aea9617c44754af597f2c6eeb507b1b
3
+ metadata.gz: b812534cc64ea2d62713fc45f157328f39cc65bd
4
+ data.tar.gz: 9491b4230918e0f3a5ee6b659894df6d4175db77
5
5
  SHA512:
6
- metadata.gz: 6635fc4eb45da4d9ff41ad88dec2a0b8da286e9600379363f878bf319899b437367e4547b6492d4eb14176b7afe1a811ff2d45cbdf29982ff6eeab0cb63ef667
7
- data.tar.gz: 03f1bced39e075f5a1fbe4cc0f8bca89dcb46b886a14f545266e4e31b9b10b60591c43a1a200ce47ed38d320aa9a9fc6f27f6f1f2c0120f3645289a41871f5cd
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 Change of JSON Output
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
@@ -5,7 +5,7 @@ module OKComputer
5
5
  mark_message "Schema version: #{schema_version}"
6
6
  rescue ConnectionFailed => e
7
7
  mark_failure
8
- mark_message "Failed to connect: '#{e}'"
8
+ mark_message "Error: '#{e}'"
9
9
  end
10
10
 
11
11
  # Public: The scema version of the app's database
@@ -2,7 +2,7 @@ module OKComputer
2
2
  class DefaultCheck < Check
3
3
  # Public: Check that Rails can render anything at all
4
4
  def check
5
- mark_message "OKComputer Site Check Passed"
5
+ mark_message "Application is running"
6
6
  end
7
7
  end
8
8
  end
@@ -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 "Successfully connected to mongodb #{mongodb_name}"
5
+ mark_message "Connected to mongodb #{mongodb_name}"
6
6
  rescue ConnectionFailed => e
7
7
  mark_failure
8
- mark_message "Failed to connect: '#{e}'"
8
+ mark_message "Error: '#{e}'"
9
9
  end
10
10
 
11
11
  # Public: The stats for the app's mongodb
@@ -34,7 +34,8 @@ module OKComputer
34
34
  #
35
35
  # Returns a String
36
36
  def to_text
37
- "#{registrant_name}: #{message}"
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
@@ -1,3 +1,3 @@
1
1
  module OKComputer
2
- VERSION = "0.5.4"
2
+ VERSION = "0.6.0"
3
3
  end
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.5.4
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-01-08 00:00:00.000000000 Z
11
+ date: 2014-02-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: sqlite3