app_status 1.1.1 → 1.1.2

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.
@@ -4,8 +4,11 @@ module AppStatus
4
4
  @checks = CheckCollection.new
5
5
  @checks.evaluate!
6
6
 
7
+ json_data = @checks.as_json
8
+ json_data['more_info'] = app_status_url
9
+
7
10
  respond_to do |format|
8
- format.json { render json: @checks.as_json}
11
+ format.json { render json: json_data}
9
12
  format.html
10
13
  end
11
14
  end
@@ -107,6 +107,10 @@ module AppStatus
107
107
  @@checks.each {|name,check| yield check }
108
108
  end
109
109
 
110
+ def size
111
+ @@checks.size
112
+ end
113
+
110
114
  # run the checks added via configure
111
115
  # results of the checks are available via as_json
112
116
  def evaluate!
@@ -2,23 +2,27 @@
2
2
 
3
3
  <h1 class="<%= @checks.status %>">Current Status : <%= @checks.status %></h1>
4
4
 
5
- <table>
6
- <% @checks.each do |check| %>
7
- <tr class="check <%= check.status %> <%= check.name %>" data-check-name="<%= check.name %>">
8
- <td class="status"><%= check.status %></td>
9
- <td class="name"><%= check.name %></td>
10
- <td class="details"><%= check.details %></td>
11
- <td class="ms"><%= check.ms %>ms</td>
12
- </tr>
13
- <% if check.description.present? -%>
14
- <tr class="<%= check.name %> description" style="display: none;">
15
- <td colspan="4">
16
- <%= check.html_description.html_safe %>
17
- </td>
5
+ <% if @checks.size > 0 %>
6
+ <table>
7
+ <% @checks.each do |check| %>
8
+ <tr class="check <%= check.status %> <%= check.name %>" data-check-name="<%= check.name %>">
9
+ <td class="status"><%= check.status %></td>
10
+ <td class="name"><%= check.name %></td>
11
+ <td class="details"><%= check.details %></td>
12
+ <td class="ms"><%= check.ms %>ms</td>
18
13
  </tr>
14
+ <% if check.description.present? -%>
15
+ <tr class="<%= check.name %> description" style="display: none;">
16
+ <td colspan="4">
17
+ <%= check.html_description.html_safe %>
18
+ </td>
19
+ </tr>
20
+ <% end %>
19
21
  <% end %>
22
+ </table>
23
+ <% else %>
24
+ <div>No checks are currently configured.</div>
20
25
  <% end %>
21
- </table>
22
26
 
23
27
  </div>
24
28
 
data/config/routes.rb CHANGED
@@ -1,4 +1,4 @@
1
1
  AppStatus::Engine.routes.draw do
2
2
  root :to => 'status#index', :defaults => {:format => 'json'}
3
- get "/index" => 'status#index'
3
+ get "/index" => 'status#index', :as => 'app_status'
4
4
  end
@@ -1,3 +1,3 @@
1
1
  module AppStatus
2
- VERSION = "1.1.1"
2
+ VERSION = "1.1.2"
3
3
  end
@@ -167,3 +167,7 @@ Processing by AppStatus::StatusController#index as JSON
167
167
  Completed 200 OK in 1ms (Views: 0.5ms)
168
168
  Processing by AppStatus::StatusController#index as HTML
169
169
  Completed 200 OK in 17ms (Views: 17.1ms)
170
+ Processing by AppStatus::StatusController#index as JSON
171
+ Completed 200 OK in 1ms (Views: 0.3ms)
172
+ Processing by AppStatus::StatusController#index as HTML
173
+ Completed 200 OK in 17ms (Views: 16.5ms)
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: app_status
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.1
4
+ version: 1.1.2
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -190,7 +190,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
190
190
  version: '0'
191
191
  segments:
192
192
  - 0
193
- hash: 4343832583864939072
193
+ hash: 1438929825745420102
194
194
  required_rubygems_version: !ruby/object:Gem::Requirement
195
195
  none: false
196
196
  requirements:
@@ -199,7 +199,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
199
199
  version: '0'
200
200
  segments:
201
201
  - 0
202
- hash: 4343832583864939072
202
+ hash: 1438929825745420102
203
203
  requirements: []
204
204
  rubyforge_project:
205
205
  rubygems_version: 1.8.24