okcomputer 1.8.0 → 1.9.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: 161950434c3da5a4b521fc015247990a91339d93
4
- data.tar.gz: 2ace45ea756b34aba4346f7ddacd5b0faeae158f
3
+ metadata.gz: b75010b5b64ee83ad4d0c3a60a31e54ee2f8cc66
4
+ data.tar.gz: 447930608cd2de52c23369f190190e9ca4c7375c
5
5
  SHA512:
6
- metadata.gz: de92606a0f4424d51d0b76a243b092bcc6b076f101a6a73f8d0866d455672caf8be4feb503eee85d1da9470239f1167229e6f548acea680b9e11ed2354ead834
7
- data.tar.gz: fc4b63fe2d2eb780598ae201fd2beee97a4fa57792bf16615a60a1d32e2aa2b1bf312ef48c362545fa77da31639dcb92288e568f5ce066fca055ab0acb7618da
6
+ metadata.gz: 98e01dfe30d9e5ddba45c82fcba45aeeebfe93c1c216632d18b91127259ddc31d2fa24a030671ddb69a0d02286b4deb688c1a95b3b274270db4b0ee0f14625b8
7
+ data.tar.gz: ab3b3ca90ad9c8307ff83de7bcc69d7915ab7b84a650be60a43d554d07a7ebadc8e1d578cd9c11215bdf03819ed0814be3fa2132227c9db7cd9825dd9171cdea
@@ -1,8 +1,10 @@
1
1
  module OkComputer
2
2
  class OkComputerController < ActionController::Base
3
+ include LegacyRailsControllerSupport if Rails::VERSION::MAJOR < 5
4
+
3
5
  layout nil
4
6
 
5
- before_filter :authenticate
7
+ before_action :authenticate
6
8
 
7
9
  if OkComputer.analytics_ignore && defined?(NewRelic::Agent::Instrumentation::ControllerInstrumentation)
8
10
  include NewRelic::Agent::Instrumentation::ControllerInstrumentation
@@ -11,7 +13,7 @@ module OkComputer
11
13
 
12
14
  rescue_from OkComputer::Registry::CheckNotFound do |e|
13
15
  respond_to do |f|
14
- f.any(:text, :html) { render text: e.message, status: :not_found }
16
+ f.any(:text, :html) { render plain: e.message, status: :not_found }
15
17
  f.json { render json: { error: e.message }, status: :not_found }
16
18
  end
17
19
  end
@@ -34,7 +36,7 @@ module OkComputer
34
36
 
35
37
  def respond(data, status)
36
38
  respond_to do |format|
37
- format.any(:text, :html) { render text: data, status: status }
39
+ format.any(:text, :html) { render plain: data, status: status }
38
40
  format.json { render json: data, status: status }
39
41
  end
40
42
  end
@@ -1,5 +1,5 @@
1
1
  OkComputer::Engine.routes.draw do
2
- root to: "ok_computer#show", defaults: {check: "default"}, via: [:get, :options]
2
+ root to: "ok_computer#show", via: [:get, :options], check: "default"
3
3
  match "/all" => "ok_computer#index", via: [:get, :options], as: :okcomputer_checks
4
4
  match "/:check" => "ok_computer#show", via: [:get, :options], as: :okcomputer_check
5
5
  end
@@ -0,0 +1,18 @@
1
+ module OkComputer
2
+ module LegacyRailsControllerSupport
3
+ def self.included(base)
4
+ # Support <callback>_action for Rails 3
5
+ %w(before after around).each do |callback|
6
+ unless base.respond_to?("#{callback}_action")
7
+ base.singleton_class.send(:alias_method, "#{callback}_action", "#{callback}_filter")
8
+ end
9
+ end
10
+ end
11
+
12
+ # Support 'render plain' for Rails 3
13
+ def render(**options, &block)
14
+ options[:text] = options.delete(:plain) if options.include?(:plain)
15
+ super
16
+ end
17
+ end
18
+ end
@@ -1,3 +1,3 @@
1
1
  module OkComputer
2
- VERSION = '1.8.0'
2
+ VERSION = '1.9.0'
3
3
  end
@@ -3,6 +3,7 @@ require "ok_computer/engine" if defined?(Rails)
3
3
  require "ok_computer/check"
4
4
  require "ok_computer/check_collection"
5
5
  require "ok_computer/registry"
6
+ require "ok_computer/legacy_rails_controller_support"
6
7
 
7
8
  # and the built-in checks
8
9
  require "ok_computer/built_in_checks/size_threshold_check"
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: 1.8.0
4
+ version: 1.9.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: 2016-07-11 00:00:00.000000000 Z
11
+ date: 2016-08-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: sqlite3
@@ -91,6 +91,7 @@ files:
91
91
  - lib/ok_computer/check_collection.rb
92
92
  - lib/ok_computer/configuration.rb
93
93
  - lib/ok_computer/engine.rb
94
+ - lib/ok_computer/legacy_rails_controller_support.rb
94
95
  - lib/ok_computer/registry.rb
95
96
  - lib/ok_computer/version.rb
96
97
  - lib/okcomputer.rb
@@ -114,7 +115,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
114
115
  version: '0'
115
116
  requirements: []
116
117
  rubyforge_project:
117
- rubygems_version: 2.5.1
118
+ rubygems_version: 2.6.3
118
119
  signing_key:
119
120
  specification_version: 4
120
121
  summary: A simple, extensible health-check monitor