health_check 1.7.2 → 2.0.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.
- data/.travis.yml +60 -40
- data/CHANGELOG +1 -25
- data/Gemfile +0 -11
- data/README.rdoc +39 -41
- data/config/routes.rb +6 -3
- data/health_check.gemspec +3 -4
- data/lib/health_check.rb +4 -15
- data/lib/health_check/health_check_controller.rb +2 -37
- data/lib/health_check/health_check_routes.rb +8 -10
- data/lib/health_check/utils.rb +2 -1
- data/lib/health_check/version.rb +1 -1
- data/test/init_variables +0 -2
- data/test/rails_4.0.gemfile +23 -0
- data/test/rails_4.1.gemfile +23 -0
- data/test/rails_4.2.gemfile +19 -0
- data/test/rails_edge.gemfile +25 -0
- data/test/setup_railsapp +96 -95
- data/test/test_with_railsapp +8 -1
- metadata +15 -40
- data/VERSION +0 -1
- data/Vagrantfile +0 -20
- data/lib/health_check/add_23_routes.rb +0 -25
- data/test/provision_vagrant +0 -79
- data/test/rails_3.0.gemfile +0 -23
- data/test/rails_3.1.gemfile +0 -29
- data/test/rails_3.2.gemfile +0 -30
data/.travis.yml
CHANGED
@@ -7,68 +7,88 @@ notifications:
|
|
7
7
|
before_install:
|
8
8
|
- gem update --system $RUBYGEMS_VERSION
|
9
9
|
- gem --version
|
10
|
-
- gem install bundler
|
11
|
-
- gem install smarter_bundler
|
10
|
+
- gem install bundler
|
12
11
|
- bundle --version
|
13
|
-
- bundle ${BUNDLER_VERSION:+_${BUNDLER_VERSION}_} --version
|
14
12
|
- mkdir -p tmp/bundle
|
15
13
|
|
16
14
|
bundler_args: "--binstubs"
|
17
15
|
|
18
16
|
script: ./test/test_with_railsapp
|
19
17
|
|
20
|
-
rvm:
|
21
|
-
-
|
18
|
+
#rvm:
|
19
|
+
# - 2.2.0
|
22
20
|
|
23
|
-
gemfile:
|
24
|
-
- test/
|
21
|
+
#gemfile:
|
22
|
+
# - test/rails_4.2.gemfile
|
25
23
|
|
26
24
|
matrix:
|
27
25
|
allow_failures:
|
26
|
+
- rvm: 2.2.0
|
27
|
+
gemfile: test/rails_edge.gemfile
|
28
|
+
env: RAILS_VERSION=edge
|
29
|
+
|
30
|
+
- rvm: ruby-head
|
31
|
+
gemfile: test/rails_4.2.gemfile
|
32
|
+
env: RAILS_VERSION=4.2
|
28
33
|
|
29
34
|
include:
|
30
|
-
#
|
35
|
+
# ruby / rails edge
|
31
36
|
|
32
|
-
- rvm:
|
33
|
-
gemfile: test/
|
34
|
-
env:
|
37
|
+
- rvm: 2.2.0
|
38
|
+
gemfile: test/rails_edge.gemfile
|
39
|
+
env: RAILS_VERSION=edge
|
35
40
|
|
36
|
-
- rvm:
|
37
|
-
gemfile: test/
|
38
|
-
env:
|
41
|
+
- rvm: ruby-head
|
42
|
+
gemfile: test/rails_4.2.gemfile
|
43
|
+
env: RAILS_VERSION=4.2
|
39
44
|
|
40
|
-
|
41
|
-
|
42
|
-
|
45
|
+
# rails 4.2 Dec, 2014
|
46
|
+
|
47
|
+
- rvm: 2.2.0
|
48
|
+
gemfile: test/rails_4.2.gemfile
|
49
|
+
env: RAILS_VERSION=4.2
|
43
50
|
|
44
|
-
- rvm: 1.
|
45
|
-
gemfile: test/
|
46
|
-
env: RAILS_SERVER=
|
51
|
+
- rvm: 2.1.2
|
52
|
+
gemfile: test/rails_4.2.gemfile
|
53
|
+
env: RAILS_SERVER=puma RAILS_VERSION=4.2
|
47
54
|
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
# env: BUNDLER_VERSION=1.12.5 RAILS_VERSION=3.2
|
55
|
+
- rvm: 2.1.2
|
56
|
+
gemfile: test/rails_4.2.gemfile
|
57
|
+
env: RAILS_SERVER=passenger RAILS_VERSION=4.2
|
52
58
|
|
53
|
-
- rvm: 2.2
|
54
|
-
gemfile: test/
|
55
|
-
env: RAILS_VERSION=
|
59
|
+
- rvm: 2.1.2
|
60
|
+
gemfile: test/rails_4.2.gemfile
|
61
|
+
env: RAILS_SERVER=thin RAILS_VERSION=4.2
|
56
62
|
|
57
|
-
- rvm:
|
58
|
-
gemfile: test/
|
59
|
-
env: RAILS_VERSION=
|
63
|
+
- rvm: rbx-2.2.6
|
64
|
+
gemfile: test/rails_4.0.gemfile
|
65
|
+
env: RAILS_ENV2=development RAILS_VERSION=4.0
|
66
|
+
|
67
|
+
- rvm: 2.1.2
|
68
|
+
gemfile: test/rails_4.2.gemfile
|
69
|
+
env: RAILS_SERVER=unicorn RAILS_VERSION=4.2
|
60
70
|
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
# env: BUNDLER_VERSION=1.12.5 RAILS_VERSION=3.2
|
71
|
+
- rvm: jruby-19mode
|
72
|
+
gemfile: test/rails_4.2.gemfile
|
73
|
+
env: RAILS_VERSION=4.2
|
65
74
|
|
66
|
-
# rails
|
75
|
+
# rails 4.1 April 8, 2014
|
76
|
+
|
77
|
+
- rvm: 2.1.2
|
78
|
+
gemfile: test/rails_4.1.gemfile
|
79
|
+
env: RAILS_SERVER=puma RAILS_VERSION=4.1
|
80
|
+
|
81
|
+
# rails 4.0 June 25, 2013
|
82
|
+
|
67
83
|
- rvm: 1.9.3
|
68
|
-
gemfile: test/
|
69
|
-
env: RAILS_VERSION=
|
84
|
+
gemfile: test/rails_4.0.gemfile
|
85
|
+
env: RAILS_VERSION=4.0
|
86
|
+
|
87
|
+
- rvm: rbx-2.2.6
|
88
|
+
gemfile: test/rails_4.0.gemfile
|
89
|
+
env: RAILS_ENV2=development RAILS_VERSION=4.0
|
70
90
|
|
71
|
-
- rvm:
|
72
|
-
gemfile: test/
|
73
|
-
env: RAILS_VERSION=
|
91
|
+
- rvm: 2.0.0
|
92
|
+
gemfile: test/rails_4.0.gemfile
|
93
|
+
env: RAILS_VERSION=4.0
|
74
94
|
|
data/CHANGELOG
CHANGED
@@ -1,29 +1,6 @@
|
|
1
1
|
= Change Log =
|
2
2
|
|
3
|
-
*
|
4
|
-
|
5
|
-
*1.7.2
|
6
|
-
* Change to using smarter_bundler to improve test robustness and pin gems that have newer versions with imcompatibilities
|
7
|
-
* Depends on railties rather than rails so it can be used with trimmed down stacks
|
8
|
-
* Cleanup test code
|
9
|
-
*1.7.1
|
10
|
-
* Restricted sass version for ruby 1.9.7 compatibility
|
11
|
-
* Added Vgrantfile for easier testing
|
12
|
-
* removed badges that don't work with branches
|
13
|
-
*1.7.0
|
14
|
-
* Split away from rails2.3 branch
|
15
|
-
* removed rails 2.3 and 4.0 artifacts
|
16
|
-
* Fixed route reload issue
|
17
|
-
|
18
|
-
*1.6.0
|
19
|
-
* Added basic auth support - Thanks Kyle Conarro <kyle.conarro@gmail.com>
|
20
|
-
* Explicitly limit rails to < 4.0 for this branch
|
21
|
-
* Test against rails 2.3 LTS, updated gemfile's used for testing as the latest version of gems become incompatible
|
22
|
-
*1.5.1
|
23
|
-
* Created pre_rails4 branch (versions < 2.0) for rails 2.3 and 3.x; with master branch for rails 4.0+
|
24
|
-
*1.5.0
|
25
|
-
* Fixed SMTP test now uses CRNL as per RFC
|
26
|
-
* Check Action
|
3
|
+
* 2.0.0 - Removed silence - recommend to use a log filtering gem instead
|
27
4
|
* 1.4.1 - Rails 4 and route changes
|
28
5
|
* Now handles routes being generated multiple times by some gem / rails / ruby combinations - Previously multiple calls to health_check_routes where ignored, now explicit calls to health_check_route always adds the route but flags that it doesn't have to be added again on the end of the list
|
29
6
|
* Uses ActiveRecord::Migration.check_pending! if available and returns the message if an exception is raised (Rails 4.0+)
|
@@ -41,4 +18,3 @@
|
|
41
18
|
* 1.0.2 - Included travis config and gemfiles used in travis tests in gem and changes to test setup so that gem test
|
42
19
|
* 1.x - Includes Rails 3.x suppprt as an Engine
|
43
20
|
* 0.x - Rails 2.3
|
44
|
-
|
data/Gemfile
CHANGED
@@ -7,15 +7,6 @@ ruby '1.9.3' if RUBY_VERSION > '1.9.3'
|
|
7
7
|
|
8
8
|
gemspec
|
9
9
|
|
10
|
-
# mime-types 2.0 requires Ruby version >= 1.9.2
|
11
|
-
gem "mime-types", "< 2.0" if RUBY_VERSION < '1.9.2' # REQUIRED
|
12
|
-
# 0.7 requires ruby 1.9.3
|
13
|
-
gem 'i18n', '< 0.7' if RUBY_VERSION < '1.9.3' # REQUIRED
|
14
|
-
# rack 2.0 requires ruby 2.2.2, rails 3.2 requires rack ~> 1.4.5
|
15
|
-
gem 'rack', "< 1.5" # REQUIRED
|
16
|
-
|
17
|
-
gem 'rack-cache', '< 1.3' if RUBY_VERSION < '1.9.3'
|
18
|
-
|
19
10
|
group :development, :test do
|
20
11
|
if defined?(JRUBY_VERSION)
|
21
12
|
gem 'jruby-openssl'
|
@@ -29,8 +20,6 @@ group :development, :test do
|
|
29
20
|
# mime-types 2.0 requires Ruby version >= 1.9.2
|
30
21
|
gem "mime-types", "< 2.0"
|
31
22
|
end
|
32
|
-
#gem 'rake', ">= 0.8.3", "< 11.0"
|
33
|
-
#gem 'rack', "< 2.0"
|
34
23
|
|
35
24
|
end
|
36
25
|
|
data/README.rdoc
CHANGED
@@ -1,11 +1,10 @@
|
|
1
|
-
= health_check gem
|
1
|
+
= health_check gem
|
2
2
|
|
3
|
-
Simple health check of Rails
|
3
|
+
Simple health check of Rails 4.x+ apps for use with Pingdom, NewRelic, EngineYard or uptime.openacs.org etc.
|
4
4
|
|
5
|
-
|
5
|
+
Use {pre_rails4}[https://github.com/ianheggie/health_check/tree/pre_rails4] branch or gem versions < 2.0 for Rails 2.3 and 3.x
|
6
6
|
|
7
|
-
|
8
|
-
Consider using {RAILS LTS 3.2}[https://railslts.com/] rather than the unsupported 3.x versions.
|
7
|
+
The basic goal is to quickly check that rails is up and running and that it has access to correctly configured resources (database, email gateway)
|
9
8
|
|
10
9
|
health_check provides various monitoring URIs, for example:
|
11
10
|
|
@@ -27,7 +26,7 @@ On failure a 500 http status is returned with a simple explanation of the failur
|
|
27
26
|
curl localhost:3000/health_check/fail
|
28
27
|
health_check failed: invalid argument to health_test.
|
29
28
|
|
30
|
-
The health_check controller disables sessions for versions that eagerly load sessions. Only failures are logged.
|
29
|
+
The health_check controller disables sessions for versions that eagerly load sessions. Only failures are logged for rails < '4.1'.
|
31
30
|
|
32
31
|
== Checks
|
33
32
|
|
@@ -44,11 +43,13 @@ The email gateway is not checked unless the smtp settings have been changed.
|
|
44
43
|
Specify full or include email in the list of checks to verify the smtp settings
|
45
44
|
(eg use 127.0.0.1 instead of localhost).
|
46
45
|
|
46
|
+
Note: rails 4.0 also checks migrations by default in development mode and throws an ActiveRecord::PendingMigrationError exception (http error 500) if there is an error
|
47
|
+
|
47
48
|
== Installation
|
48
49
|
|
49
50
|
Add the following line to Gemfile
|
50
51
|
|
51
|
-
gem "health_check"
|
52
|
+
gem "health_check"
|
52
53
|
|
53
54
|
And then execute
|
54
55
|
|
@@ -56,7 +57,7 @@ And then execute
|
|
56
57
|
|
57
58
|
Or install it yourself as:
|
58
59
|
|
59
|
-
gem install
|
60
|
+
gem install health_check
|
60
61
|
|
61
62
|
== Configuration
|
62
63
|
|
@@ -93,17 +94,16 @@ To change the configuration of health_check, create a file `config/initializers/
|
|
93
94
|
CustomHealthCheck.perform_check # any code that returns blank on success and non blank string upon failure
|
94
95
|
end
|
95
96
|
|
96
|
-
# Protect health endpoints with basic auth
|
97
|
-
# These default to nil and the endpoint is not protected
|
98
|
-
config.basic_auth_username = 'my_username'
|
99
|
-
config.basic_auth_password = 'my_password'
|
100
97
|
end
|
101
98
|
|
102
99
|
You may call add_custom_check multiple times with different tests. These tests will be included in the default list ("standard").
|
103
100
|
|
104
|
-
If you have a catchall route
|
101
|
+
If you have a catchall route then add the following line above the catch all route (in `config/routes.rb`):
|
105
102
|
health_check_routes
|
106
103
|
|
104
|
+
To change the url prefix (eg to /ping), add the following line in `config/routes.rb`:
|
105
|
+
health_check_routes('ping')
|
106
|
+
|
107
107
|
== Uptime Monitoring
|
108
108
|
|
109
109
|
Use a website monitoring service to check the url regularly for the word "success" (without the quotes) rather than just a 200 http status so
|
@@ -155,6 +155,16 @@ Will return a result with Content-Type: application/xml and body like:
|
|
155
155
|
|
156
156
|
See https://github.com/ianheggie/health_check/wiki/Ajax-Example for an Ajax example
|
157
157
|
|
158
|
+
== Silencing log output
|
159
|
+
|
160
|
+
It is recomended that you use silencer, lograge or one of the other log filtering gems.
|
161
|
+
|
162
|
+
For example, with lograge use the following to exclude health_check from being logged:
|
163
|
+
|
164
|
+
config.lograge.ignore_actions = ["health_check/health_check#index"]
|
165
|
+
|
166
|
+
Likewise you will probably want to exclude health_check from monitoring systems like newrelic.
|
167
|
+
|
158
168
|
== Note on Patches/Pull Requests
|
159
169
|
|
160
170
|
<em>Feedback welcome! Especially with suggested replacement code and corresponding tests</em>
|
@@ -176,50 +186,38 @@ See https://github.com/ianheggie/health_check/wiki/Ajax-Example for an Ajax exam
|
|
176
186
|
|
177
187
|
== Testing
|
178
188
|
|
179
|
-
=== Automated testing
|
189
|
+
=== Automated testing and other checks
|
180
190
|
|
181
|
-
* {<img src="https://
|
191
|
+
* {<img src="https://badge.fury.io/rb/health_check.png" alt="Gem Version" />}[http://badge.fury.io/rb/health_check] - Latest Gem
|
192
|
+
* {<img src="https://travis-ci.org/ianheggie/health_check.png">}[https://travis-ci.org/ianheggie/health_check] - Travis CI
|
193
|
+
* {<img src="https://codeclimate.com/github/ianheggie/health_check.png" />}[https://codeclimate.com/github/ianheggie/health_check] - Code quality
|
194
|
+
* {<img src="https://gemnasium.com/ianheggie/health_check.png">}[https://gemnasium.com/ianheggie/health_check] - Gem dependencies
|
182
195
|
|
183
196
|
=== Manual testing
|
184
197
|
|
185
|
-
The
|
198
|
+
The test will package up and install the gem under a temporary path, create a dummy rails app configured for sqlite,
|
199
|
+
install the gem, and then run up tests against the server.
|
200
|
+
This will require TCP port 3456 to be free.
|
201
|
+
|
202
|
+
Using rbenv or rvm, install and set the version of ruby you wish to test against.
|
203
|
+
You will need to install the bundler gem if using rbenv.
|
204
|
+
See the <tt>.travis.yml</tt> file for the list of ruby versions that we test against.
|
186
205
|
|
187
|
-
|
206
|
+
* rbenv command: <tt>rbenv shell 1.8.7-p371</tt>
|
207
|
+
* rvm command: <tt>rvm use 1.9.3</tt>
|
188
208
|
|
189
209
|
Create a temp directory for throw away testing, and clone the health_check gem into it
|
190
210
|
|
191
211
|
mkdir -p ~/tmp
|
192
212
|
cd ~/tmp
|
193
|
-
git clone https://github.com/ianheggie/health_check.git
|
194
|
-
|
195
|
-
The Vagrantfile includes provisioning rules to install chruby (ruby version control),
|
196
|
-
ruby-build will also be installed and run to build various rubies under /opt/rubies.
|
197
|
-
|
198
|
-
Use <tt>vagrant ssh</tt> to connect to the virtual box and run tests.
|
199
|
-
|
200
|
-
The test script will package up and install the gem under a temporary path, create a dummy rails app configured for sqlite,
|
201
|
-
install the gem, and then run up tests against the server.
|
202
|
-
This will require TCP port 3456 to be free.
|
213
|
+
git clone https://github.com/ianheggie/health_check.git
|
203
214
|
|
204
215
|
Cd to the checked out health_check directory and then run the test as follows:
|
205
216
|
|
206
217
|
cd ~/tmp/health_check
|
207
218
|
|
208
|
-
vagrant up # this will also run vagrant provision and take some time
|
209
|
-
# chruby and various ruby versions will be installed
|
210
|
-
|
211
|
-
vagrant ssh
|
212
|
-
|
213
|
-
cd /vagrant # the current directory on your host is mounted here on the virtual machine
|
214
|
-
|
215
|
-
chruby 1.8.7
|
216
|
-
# or
|
217
|
-
chruby 1.9.3
|
218
|
-
|
219
219
|
test/test_with_railsapp
|
220
220
|
|
221
|
-
exit # from viretual machine when finished
|
222
|
-
|
223
221
|
The script will first call `test/setup_railsapp` to setup a rails app with health_check installed and then
|
224
222
|
run up the rails server and perform veraious tests.
|
225
223
|
|
@@ -230,7 +228,7 @@ The command `rake test` will also launch these tests, except it cannot install t
|
|
230
228
|
|
231
229
|
== Copyright
|
232
230
|
|
233
|
-
Copyright (c) 2010-
|
231
|
+
Copyright (c) 2010-2014 Ian Heggie, released under the MIT license.
|
234
232
|
See MIT-LICENSE for details.
|
235
233
|
|
236
234
|
== Contributors
|
data/config/routes.rb
CHANGED
@@ -1,5 +1,8 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
1
|
+
if defined?(HealthCheck::Engine)
|
2
|
+
unless HealthCheck::Engine.routes_already_defined
|
3
|
+
# Ifmountable use: HealthCheck::Engine.routes.draw do
|
4
|
+
Rails.application.routes.draw do
|
5
|
+
health_check_routes()
|
6
|
+
end
|
4
7
|
end
|
5
8
|
end
|
data/health_check.gemspec
CHANGED
@@ -20,10 +20,9 @@ Gem::Specification.new do |gem|
|
|
20
20
|
gem.test_files = gem.files.grep(%r{^(test|spec|features)/})
|
21
21
|
gem.extra_rdoc_files = [ "README.rdoc" ]
|
22
22
|
gem.require_paths = ["lib"]
|
23
|
-
gem.required_ruby_version = '>= 1.
|
24
|
-
gem.add_dependency(%q<
|
25
|
-
gem.add_development_dependency(%q<
|
26
|
-
gem.add_development_dependency(%q<rake>, [">= 0.8.3", "< 11.0"])
|
23
|
+
gem.required_ruby_version = '>= 1.9.3'
|
24
|
+
gem.add_dependency(%q<rails>, [">= 4.0"])
|
25
|
+
gem.add_development_dependency(%q<rake>, [">= 0.8.3"])
|
27
26
|
gem.add_development_dependency(%q<shoulda>, ["~> 2.11.0"])
|
28
27
|
gem.add_development_dependency(%q<bundler>, ["~> 1.2"])
|
29
28
|
end
|
data/lib/health_check.rb
CHANGED
@@ -4,7 +4,7 @@
|
|
4
4
|
module HealthCheck
|
5
5
|
|
6
6
|
class Engine < Rails::Engine
|
7
|
-
cattr_accessor :
|
7
|
+
cattr_accessor :routes_already_defined
|
8
8
|
end
|
9
9
|
|
10
10
|
# Text output upon success
|
@@ -23,24 +23,18 @@ module HealthCheck
|
|
23
23
|
mattr_accessor :http_status_for_error_object
|
24
24
|
self.http_status_for_error_object = 500
|
25
25
|
|
26
|
-
#
|
27
|
-
mattr_accessor :basic_auth_username, :basic_auth_password
|
28
|
-
self.basic_auth_username = nil
|
29
|
-
self.basic_auth_password = nil
|
30
|
-
|
31
|
-
|
32
26
|
# Array of custom check blocks
|
33
27
|
mattr_accessor :custom_checks
|
34
28
|
mattr_accessor :full_checks
|
35
29
|
mattr_accessor :standard_checks
|
36
30
|
self.custom_checks = [ ]
|
37
31
|
self.full_checks = ['database', 'migrations', 'custom', 'email', 'cache']
|
38
|
-
self.standard_checks = [ 'database', 'migrations', 'custom' ]
|
32
|
+
self.standard_checks = [ 'database', 'migrations', 'custom', 'emailconf' ]
|
39
33
|
|
40
34
|
def self.add_custom_check(&block)
|
41
35
|
custom_checks << block
|
42
36
|
end
|
43
|
-
|
37
|
+
|
44
38
|
def self.setup
|
45
39
|
yield self
|
46
40
|
end
|
@@ -50,11 +44,6 @@ end
|
|
50
44
|
require "health_check/version"
|
51
45
|
require 'health_check/utils'
|
52
46
|
require 'health_check/health_check_controller'
|
53
|
-
|
54
|
-
if defined?(HealthCheck::Engine)
|
55
|
-
require 'health_check/health_check_routes'
|
56
|
-
else
|
57
|
-
require 'health_check/add_23_routes'
|
58
|
-
end
|
47
|
+
require 'health_check/health_check_routes'
|
59
48
|
|
60
49
|
# vi: sw=2 sm ai:
|
@@ -5,15 +5,14 @@ module HealthCheck
|
|
5
5
|
class HealthCheckController < ActionController::Base
|
6
6
|
|
7
7
|
layout false if self.respond_to? :layout
|
8
|
-
before_filter :authenticate
|
9
8
|
|
10
9
|
def index
|
11
10
|
checks = params[:checks] || 'standard'
|
12
11
|
begin
|
13
12
|
errors = HealthCheck::Utils.process_checks(checks)
|
14
13
|
rescue Exception => e
|
15
|
-
errors = e.message
|
16
|
-
end
|
14
|
+
errors = e.message.blank? ? e.class.to_s : e.message.to_s
|
15
|
+
end
|
17
16
|
if errors.blank?
|
18
17
|
obj = { :healthy => true, :message => HealthCheck.success }
|
19
18
|
respond_to do |format|
|
@@ -33,9 +32,7 @@ module HealthCheck
|
|
33
32
|
end
|
34
33
|
# Log a single line as some uptime checkers only record that it failed, not the text returned
|
35
34
|
if logger
|
36
|
-
silence_level, logger.level = logger.level, @old_logger_level if @old_logger_level
|
37
35
|
logger.info msg
|
38
|
-
logger.level = silence_level if @old_logger_level
|
39
36
|
end
|
40
37
|
end
|
41
38
|
end
|
@@ -43,42 +40,10 @@ module HealthCheck
|
|
43
40
|
|
44
41
|
protected
|
45
42
|
|
46
|
-
def authenticate
|
47
|
-
return unless HealthCheck.basic_auth_username && HealthCheck.basic_auth_password
|
48
|
-
authenticate_or_request_with_http_basic do |username, password|
|
49
|
-
username == HealthCheck.basic_auth_username && password == HealthCheck.basic_auth_password
|
50
|
-
end
|
51
|
-
end
|
52
|
-
|
53
43
|
# turn cookies for CSRF off
|
54
44
|
def protect_against_forgery?
|
55
45
|
false
|
56
46
|
end
|
57
47
|
|
58
|
-
# Silence logger as much as we can
|
59
|
-
|
60
|
-
if Rails.version < '4.1'
|
61
|
-
|
62
|
-
def process_with_silent_log(method_name, *args)
|
63
|
-
if logger
|
64
|
-
@old_logger_level = logger.level
|
65
|
-
if Rails.version >= '3.2'
|
66
|
-
silence do
|
67
|
-
process_without_silent_log(method_name, *args)
|
68
|
-
end
|
69
|
-
else
|
70
|
-
logger.silence do
|
71
|
-
process_without_silent_log(method_name, *args)
|
72
|
-
end
|
73
|
-
end
|
74
|
-
else
|
75
|
-
process_without_silent_log(method_name, *args)
|
76
|
-
end
|
77
|
-
end
|
78
|
-
|
79
|
-
alias_method_chain :process, :silent_log
|
80
|
-
|
81
|
-
end
|
82
|
-
|
83
48
|
end
|
84
49
|
end
|
@@ -1,14 +1,12 @@
|
|
1
|
-
|
2
|
-
class Mapper
|
1
|
+
if defined?(HealthCheck::Engine)
|
3
2
|
|
4
|
-
|
5
|
-
|
6
|
-
|
3
|
+
module ActionDispatch::Routing
|
4
|
+
class Mapper
|
5
|
+
def health_check_routes(prefix = nil)
|
6
|
+
HealthCheck::Engine.routes_already_defined ||= true
|
7
|
+
get "#{prefix || 'health_check'}(/:checks)(.:format)", :to => 'health_check/health_check#index'
|
8
|
+
end
|
7
9
|
end
|
8
|
-
|
9
|
-
def add_health_check_routes(prefix = nil)
|
10
|
-
get "#{prefix || 'health_check'}(/:checks)(.:format)", :to => 'health_check/health_check#index'
|
11
|
-
end
|
12
|
-
|
13
10
|
end
|
11
|
+
|
14
12
|
end
|
data/lib/health_check/utils.rb
CHANGED
@@ -28,6 +28,8 @@ module HealthCheck
|
|
28
28
|
HealthCheck::Utils.get_database_version
|
29
29
|
when "email"
|
30
30
|
errors << HealthCheck::Utils.check_email
|
31
|
+
when "emailconf"
|
32
|
+
errors << HealthCheck::Utils.check_email if HealthCheck::Utils.mailer_configured?
|
31
33
|
when "migrations", "migration"
|
32
34
|
if defined?(ActiveRecord::Migration) and ActiveRecord::Migration.respond_to?(:check_pending!)
|
33
35
|
# Rails 4+
|
@@ -47,7 +49,6 @@ module HealthCheck
|
|
47
49
|
errors << HealthCheck::Utils.check_cache
|
48
50
|
when "standard"
|
49
51
|
errors << HealthCheck::Utils.process_checks(HealthCheck.standard_checks.join('_'))
|
50
|
-
errors << HealthCheck::Utils.process_checks("email") if HealthCheck::Utils.mailer_configured?
|
51
52
|
when "custom"
|
52
53
|
HealthCheck.custom_checks.each do |custom_check|
|
53
54
|
errors << custom_check.call(self)
|
data/lib/health_check/version.rb
CHANGED
data/test/init_variables
CHANGED
@@ -20,8 +20,6 @@ if [[ -s "$HOME/.rvm/scripts/rvm" ]] ; then
|
|
20
20
|
echo "Detected user installed rvm"
|
21
21
|
elif [[ -s "/usr/local/rvm/scripts/rvm" ]] ; then
|
22
22
|
echo "Detected root installed rvm"
|
23
|
-
elif [[ -s /usr/local/share/chruby/chruby.sh ]] ; then
|
24
|
-
echo "Detected root installed chruby"
|
25
23
|
elif [[ -d "$HOME/.rbenv" ]] ; then
|
26
24
|
echo "Detected rbenv: `rbenv version`"
|
27
25
|
rehash='rbenv rehash'
|
@@ -0,0 +1,23 @@
|
|
1
|
+
# Gemfile for health_test testing
|
2
|
+
|
3
|
+
source 'https://rubygems.org'
|
4
|
+
|
5
|
+
ruby '1.9.3' if RUBY_VERSION < '1.9.3'
|
6
|
+
|
7
|
+
gem 'rails', "~> 4.0.0"
|
8
|
+
gem 'rake', '>= 0.8.3'
|
9
|
+
gem "rack", '~> 1.5.2'
|
10
|
+
|
11
|
+
group :development, :test do
|
12
|
+
if defined?(JRUBY_VERSION)
|
13
|
+
gem 'jruby-openssl'
|
14
|
+
gem 'activerecord-jdbcsqlite3-adapter'
|
15
|
+
else
|
16
|
+
gem 'sqlite3', "~> 1.3.7"
|
17
|
+
end
|
18
|
+
gem 'shoulda'
|
19
|
+
end
|
20
|
+
|
21
|
+
# Initial Gemfile has therubyracer commented out
|
22
|
+
gem 'therubyrhino', :platform => :jruby # REQUIRED
|
23
|
+
gem 'therubyracer', :platform => :ruby # REQUIRED
|
@@ -0,0 +1,23 @@
|
|
1
|
+
# Gemfile for health_test testing
|
2
|
+
|
3
|
+
source 'https://rubygems.org'
|
4
|
+
|
5
|
+
ruby '1.9.3' if RUBY_VERSION < '1.9.3'
|
6
|
+
|
7
|
+
gem 'rails', "~> 4.1.0"
|
8
|
+
gem 'rake', '>= 0.8.3'
|
9
|
+
gem "rack", '~> 1.5.2'
|
10
|
+
|
11
|
+
group :development, :test do
|
12
|
+
if defined?(JRUBY_VERSION)
|
13
|
+
gem 'jruby-openssl'
|
14
|
+
gem 'activerecord-jdbcsqlite3-adapter'
|
15
|
+
else
|
16
|
+
gem 'sqlite3', "~> 1.3.7"
|
17
|
+
end
|
18
|
+
gem 'shoulda'
|
19
|
+
end
|
20
|
+
|
21
|
+
# Initial Gemfile has therubyracer commented out
|
22
|
+
gem 'therubyrhino', :platform => :jruby # REQUIRED
|
23
|
+
gem 'therubyracer', :platform => :ruby # REQUIRED
|
@@ -0,0 +1,19 @@
|
|
1
|
+
# Gemfile for health_test testing
|
2
|
+
|
3
|
+
source 'https://rubygems.org'
|
4
|
+
|
5
|
+
ruby '1.9.3' if RUBY_VERSION < '1.9.3'
|
6
|
+
|
7
|
+
gem 'rails', "~> 4.2.0"
|
8
|
+
gem 'rake', '>= 0.8.3'
|
9
|
+
#gem "rack", '~> 1.6.0'
|
10
|
+
|
11
|
+
group :development, :test do
|
12
|
+
if defined?(JRUBY_VERSION)
|
13
|
+
gem 'jruby-openssl'
|
14
|
+
gem 'activerecord-jdbcsqlite3-adapter'
|
15
|
+
else
|
16
|
+
gem 'sqlite3', "~> 1.3.7"
|
17
|
+
end
|
18
|
+
gem 'shoulda'
|
19
|
+
end
|
@@ -0,0 +1,25 @@
|
|
1
|
+
# Gemfile for health_test testing
|
2
|
+
|
3
|
+
source 'https://rubygems.org'
|
4
|
+
|
5
|
+
# Bundle edge Rails instead:
|
6
|
+
|
7
|
+
ruby '1.9.3' if RUBY_VERSION < '1.9.3'
|
8
|
+
|
9
|
+
gem 'rails'
|
10
|
+
gem 'rake'
|
11
|
+
gem 'rack'
|
12
|
+
|
13
|
+
group :development, :test do
|
14
|
+
if defined?(JRUBY_VERSION)
|
15
|
+
gem 'jruby-openssl'
|
16
|
+
gem 'activerecord-jdbcsqlite3-adapter'
|
17
|
+
else
|
18
|
+
gem 'sqlite3'
|
19
|
+
end
|
20
|
+
gem 'shoulda'
|
21
|
+
end
|
22
|
+
|
23
|
+
# Initial Gemfile has therubyracer commented out
|
24
|
+
gem 'therubyrhino', :platform => :jruby # REQUIRED
|
25
|
+
gem 'therubyracer', :platform => :ruby # REQUIRED
|
data/test/setup_railsapp
CHANGED
@@ -1,5 +1,12 @@
|
|
1
1
|
#!/bin/bash
|
2
2
|
|
3
|
+
err_report() {
|
4
|
+
echo "$0: Error on line $1 - aborted"
|
5
|
+
exit 1
|
6
|
+
}
|
7
|
+
|
8
|
+
trap 'err_report $LINENO' ERR
|
9
|
+
|
3
10
|
# Any failure causes exit
|
4
11
|
set -e
|
5
12
|
|
@@ -45,21 +52,17 @@ else
|
|
45
52
|
fi
|
46
53
|
|
47
54
|
echo "Running bundle with BUNDLE_GEMFILE=$BUNDLE_GEMFILE ..."
|
48
|
-
if !
|
55
|
+
if ! bundle ; then
|
49
56
|
echo "Test aborted (missing required gems)"
|
50
57
|
exit 2
|
51
|
-
else
|
52
|
-
echo bundle passed - lock file contains:
|
53
|
-
cat $BUNDLE_GEMFILE.lock
|
54
|
-
echo
|
55
58
|
fi
|
56
59
|
$rehash
|
57
60
|
|
58
61
|
rails="$base_dir/test/bin/rails"
|
59
62
|
|
60
63
|
echo Checking $rails is present ...
|
61
|
-
[ -f $rails ] || bundle
|
62
|
-
[ -f $rails ] || bundle
|
64
|
+
[ -f $rails ] || bundle binstub railties || echo '(ignored bundle exit status)'
|
65
|
+
[ -f $rails ] || bundle binstub rails || echo '(ignored bundle exit status)'
|
63
66
|
if [ ! -f $rails ]; then
|
64
67
|
echo "Test aborted (unable to create $rails)"
|
65
68
|
exit 2
|
@@ -67,45 +70,24 @@ fi
|
|
67
70
|
|
68
71
|
rake="$base_dir/test/bin/rake"
|
69
72
|
|
70
|
-
echo Checking $rake is present ...
|
71
|
-
[ -f $rake ] || bundle ${BUNDLER_VERSION:+_${BUNDLER_VERSION}_} binstub rake || echo '(ignored bundle exit status)'
|
72
73
|
if [ ! -f $rake ]; then
|
73
|
-
echo "
|
74
|
-
|
74
|
+
echo "Running bundle --binstub rake ..."
|
75
|
+
if ! bundle --binstub rake || [ ! -f $rake ]; then
|
76
|
+
echo "Test aborted (unable to create $rake)"
|
77
|
+
exit 2
|
78
|
+
fi
|
75
79
|
fi
|
76
80
|
|
77
81
|
actual_rails_version=`$rails -v`
|
78
82
|
|
79
83
|
[ -d lib/health_check ] || exec echo setup_railsapp MUST be executed in the base of the health_check gem/clone of git repository
|
80
84
|
|
85
|
+
echo Installing health_check as a gem into tmp/gems
|
86
|
+
env GEM_HOME=$tmp_dir/gems rake install
|
87
|
+
|
81
88
|
export GEM_PATH="$tmp_dir/gems:`gem environment gempath`"
|
82
89
|
echo Set GEM_PATH=$GEM_PATH
|
83
90
|
|
84
|
-
case "$BUNDLE_GEMFILE" in
|
85
|
-
*_lts*)
|
86
|
-
echo "Re-running bundle with changed GEM_PATH (required by git install of rails lts) ..."
|
87
|
-
if ! smarter_bundle ; then
|
88
|
-
echo "Test aborted (missing required gems)"
|
89
|
-
exit 2
|
90
|
-
else
|
91
|
-
echo bundle passed - lock file contains:
|
92
|
-
cat $BUNDLE_GEMFILE.lock
|
93
|
-
echo
|
94
|
-
fi
|
95
|
-
;;
|
96
|
-
esac
|
97
|
-
echo Installing health_check as a gem into $tmp_dir/gems
|
98
|
-
rm -f pkg/health_check-*.gem
|
99
|
-
if env GEM_HOME=$tmp_dir/gems $rake install
|
100
|
-
then
|
101
|
-
echo rake install passed
|
102
|
-
else
|
103
|
-
echo rake install failed! running gem install pkg/health_check-*.gem manually to see error message:
|
104
|
-
env GEM_HOME=$tmp_dir/gems gem install pkg/health_check-*.gem
|
105
|
-
echo gem install worked, but flagging it as a FAIL anyway since rake install failed!
|
106
|
-
exit 2
|
107
|
-
fi
|
108
|
-
|
109
91
|
echo Gems in tmp/gems:
|
110
92
|
ls tmp/gems
|
111
93
|
|
@@ -125,13 +107,23 @@ case `ruby -e 'puts JRUBY_VERSION' 2> /dev/null` in
|
|
125
107
|
esac
|
126
108
|
|
127
109
|
echo "Creating $actual_rails_version app in $tmp_dir/railsapp using adapter $db"
|
128
|
-
case "$
|
129
|
-
*
|
130
|
-
|
131
|
-
|
132
|
-
*)
|
133
|
-
|
134
|
-
|
110
|
+
case "$actual_rails_version" in
|
111
|
+
*' '[12].*)
|
112
|
+
$rails railsapp -d $db
|
113
|
+
;;
|
114
|
+
*' '[34].*)
|
115
|
+
case "$BUNDLE_GEMFILE" in
|
116
|
+
*rails_edge.gemfile)
|
117
|
+
$rails new railsapp -d $db --edge
|
118
|
+
;;
|
119
|
+
*)
|
120
|
+
$rails new railsapp -d $db
|
121
|
+
;;
|
122
|
+
esac
|
123
|
+
;;
|
124
|
+
*)
|
125
|
+
echo "Unknown rails version"
|
126
|
+
;;
|
135
127
|
esac
|
136
128
|
|
137
129
|
cd $railsapp
|
@@ -166,66 +158,75 @@ HealthCheck.setup do |config|
|
|
166
158
|
end
|
167
159
|
!
|
168
160
|
|
161
|
+
echo Setting INITIAL_BUNDLE_GEMFILE=$BUNDLE_GEMFILE
|
162
|
+
INITIAL_BUNDLE_GEMFILE="$BUNDLE_GEMFILE"
|
169
163
|
echo Unsetting BUNDLE_GEMFILE '(so Gemfile for rails application will be used)'
|
170
|
-
INITIAL_BUNDLE_GEMFILE=$BUNDLE_GEMFILE
|
171
164
|
unset BUNDLE_GEMFILE
|
172
165
|
|
173
|
-
if [
|
166
|
+
if [ -s Gemfile ]
|
174
167
|
then
|
175
|
-
echo
|
176
|
-
|
177
|
-
fi
|
178
|
-
|
179
|
-
rm -f Gemfile.lock
|
180
|
-
|
181
|
-
echo Adding health_check as gem to Gemfile...
|
182
|
-
echo "gem 'health_check', :path => '$base_dir'" >> Gemfile
|
168
|
+
echo Adding health_check as gem to Gemfile...
|
169
|
+
echo "gem 'health_check', :path => '$base_dir'" >> Gemfile
|
183
170
|
|
184
|
-
case "$RAILS_SERVER" in
|
185
|
-
webrick|'')
|
186
|
-
|
187
|
-
|
188
|
-
*)
|
189
|
-
|
190
|
-
|
191
|
-
|
192
|
-
esac
|
193
|
-
echo
|
194
|
-
|
195
|
-
echo
|
196
|
-
|
197
|
-
|
198
|
-
echo
|
199
|
-
|
200
|
-
|
201
|
-
$
|
202
|
-
|
203
|
-
|
204
|
-
|
205
|
-
|
206
|
-
[ -f $rails ] || bundle
|
207
|
-
[ -f $rails ]
|
208
|
-
|
209
|
-
|
210
|
-
|
211
|
-
|
171
|
+
case "$RAILS_SERVER" in
|
172
|
+
webrick|'')
|
173
|
+
echo "Using default webrick server"
|
174
|
+
;;
|
175
|
+
*)
|
176
|
+
echo "Adding $RAILS_SERVER gem to Gemfile (for use as server)"
|
177
|
+
echo "gem '$RAILS_SERVER'" >> Gemfile
|
178
|
+
;;
|
179
|
+
esac
|
180
|
+
egrep REQUIRED < ${INITIAL_BUNDLE_GEMFILE} >> Gemfile || echo No required gems found...
|
181
|
+
echo
|
182
|
+
echo ================= Gemfile ===================
|
183
|
+
cat Gemfile
|
184
|
+
echo
|
185
|
+
echo running bundle install
|
186
|
+
bundle install
|
187
|
+
$rehash
|
188
|
+
echo "Using binstubs in $railsapp/bin for rails and rake commands"
|
189
|
+
rails="$railsapp/bin/rails"
|
190
|
+
|
191
|
+
echo Checking $rails is present ...
|
192
|
+
[ -f $rails ] || bundle binstub railties || echo '(ignored bundle exit status)'
|
193
|
+
[ -f $rails ] || bundle binstub rails || echo '(ignored bundle exit status)'
|
194
|
+
if [ ! -f $rails ]; then
|
195
|
+
echo "Test aborted (unable to create $rails)"
|
196
|
+
exit 2
|
197
|
+
fi
|
198
|
+
rake="$railsapp/bin/rake"
|
212
199
|
|
213
|
-
|
200
|
+
echo Checking $rake is present ...
|
201
|
+
[ -f $rake ] || bundle binstub rake || echo '(ignored bundle exit status)'
|
202
|
+
if [ ! -f $rake ]; then
|
203
|
+
echo "Test aborted (unable to create $rake)"
|
204
|
+
exit 2
|
205
|
+
fi
|
214
206
|
|
215
|
-
|
216
|
-
|
217
|
-
|
218
|
-
echo
|
219
|
-
|
207
|
+
$rehash
|
208
|
+
# Fix for rvm, otherwise bundle run from rails create fails
|
209
|
+
export PATH="`pwd`/bin:$PATH"
|
210
|
+
echo ================= Gemfile.lock ===================
|
211
|
+
cat Gemfile.lock
|
212
|
+
echo
|
213
|
+
else
|
214
|
+
dest=$railsapp/vendor/plugins/health_check
|
215
|
+
echo Installing health_check as plugin in $dest ...
|
216
|
+
mkdir -p $dest
|
217
|
+
(
|
218
|
+
cd $base_dir
|
219
|
+
|
220
|
+
git ls-files | cpio -pdl $dest
|
221
|
+
|
222
|
+
cd $dest
|
223
|
+
|
224
|
+
echo Files installed as plugin:
|
225
|
+
find . -type f
|
226
|
+
echo
|
227
|
+
)
|
220
228
|
fi
|
221
229
|
|
222
|
-
$rehash
|
223
|
-
# Fix for rvm, otherwise bundle run from rails create fails
|
224
|
-
export PATH="`pwd`/bin:$PATH"
|
225
|
-
echo ================= Gemfile.lock ===================
|
226
|
-
cat Gemfile.lock
|
227
|
-
echo
|
228
|
-
|
229
230
|
for e in test ${RAILS_ENV2:-production}
|
230
231
|
do
|
231
232
|
if [ -f config/environments/$e.rb ]; then
|
@@ -363,7 +364,7 @@ if [ -s config/routes.rb ]; then
|
|
363
364
|
echo " end"
|
364
365
|
echo " # END OF SECTION FOR TESTING HEALTH_CHECK"
|
365
366
|
echo " # ---------------------------------------"
|
366
|
-
ruby -n -e 'print if /^end/..9999' config/routes.rb-old | tee /tmp/t$$
|
367
|
+
ruby -n -e 'print if /^end/..9999' config/routes.rb-old | tee /tmp/t$$
|
367
368
|
if [ ! -s /tmp/t$$ ]; then
|
368
369
|
echo "WARNING: ruby -n -e failed silently - using sed instead!! (rbx-19mode has that problem)" >&3
|
369
370
|
sed -n -e '/^end/,$p' config/routes.rb-old
|
data/test/test_with_railsapp
CHANGED
@@ -1,5 +1,12 @@
|
|
1
1
|
#!/bin/bash
|
2
2
|
|
3
|
+
err_report() {
|
4
|
+
echo "$0: Error on line $1 - aborted"
|
5
|
+
exit 1
|
6
|
+
}
|
7
|
+
|
8
|
+
trap 'err_report $LINENO' ERR
|
9
|
+
|
3
10
|
# Any failure causes exit
|
4
11
|
set -e
|
5
12
|
|
@@ -68,7 +75,7 @@ start_server()
|
|
68
75
|
bundle_prefix=''
|
69
76
|
if [ -f Gemfile ]
|
70
77
|
then
|
71
|
-
bundle_prefix=
|
78
|
+
bundle_prefix='bundle exec'
|
72
79
|
fi
|
73
80
|
server_arg=${RAILS_SERVER:-webrick}
|
74
81
|
case "$server_arg" in
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: health_check
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 2.0.0
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,40 +9,24 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date:
|
12
|
+
date: 2016-07-08 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
|
-
name:
|
16
|
-
requirement: !ruby/object:Gem::Requirement
|
17
|
-
none: false
|
18
|
-
requirements:
|
19
|
-
- - ~>
|
20
|
-
- !ruby/object:Gem::Version
|
21
|
-
version: '3.0'
|
22
|
-
type: :runtime
|
23
|
-
prerelease: false
|
24
|
-
version_requirements: !ruby/object:Gem::Requirement
|
25
|
-
none: false
|
26
|
-
requirements:
|
27
|
-
- - ~>
|
28
|
-
- !ruby/object:Gem::Version
|
29
|
-
version: '3.0'
|
30
|
-
- !ruby/object:Gem::Dependency
|
31
|
-
name: smarter_bundler
|
15
|
+
name: rails
|
32
16
|
requirement: !ruby/object:Gem::Requirement
|
33
17
|
none: false
|
34
18
|
requirements:
|
35
19
|
- - ! '>='
|
36
20
|
- !ruby/object:Gem::Version
|
37
|
-
version:
|
38
|
-
type: :
|
21
|
+
version: '4.0'
|
22
|
+
type: :runtime
|
39
23
|
prerelease: false
|
40
24
|
version_requirements: !ruby/object:Gem::Requirement
|
41
25
|
none: false
|
42
26
|
requirements:
|
43
27
|
- - ! '>='
|
44
28
|
- !ruby/object:Gem::Version
|
45
|
-
version:
|
29
|
+
version: '4.0'
|
46
30
|
- !ruby/object:Gem::Dependency
|
47
31
|
name: rake
|
48
32
|
requirement: !ruby/object:Gem::Requirement
|
@@ -51,9 +35,6 @@ dependencies:
|
|
51
35
|
- - ! '>='
|
52
36
|
- !ruby/object:Gem::Version
|
53
37
|
version: 0.8.3
|
54
|
-
- - <
|
55
|
-
- !ruby/object:Gem::Version
|
56
|
-
version: '11.0'
|
57
38
|
type: :development
|
58
39
|
prerelease: false
|
59
40
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -62,9 +43,6 @@ dependencies:
|
|
62
43
|
- - ! '>='
|
63
44
|
- !ruby/object:Gem::Version
|
64
45
|
version: 0.8.3
|
65
|
-
- - <
|
66
|
-
- !ruby/object:Gem::Version
|
67
|
-
version: '11.0'
|
68
46
|
- !ruby/object:Gem::Dependency
|
69
47
|
name: shoulda
|
70
48
|
requirement: !ruby/object:Gem::Requirement
|
@@ -114,13 +92,10 @@ files:
|
|
114
92
|
- MIT-LICENSE
|
115
93
|
- README.rdoc
|
116
94
|
- Rakefile
|
117
|
-
- VERSION
|
118
|
-
- Vagrantfile
|
119
95
|
- config/routes.rb
|
120
96
|
- health_check.gemspec
|
121
97
|
- init.rb
|
122
98
|
- lib/health_check.rb
|
123
|
-
- lib/health_check/add_23_routes.rb
|
124
99
|
- lib/health_check/health_check_controller.rb
|
125
100
|
- lib/health_check/health_check_routes.rb
|
126
101
|
- lib/health_check/utils.rb
|
@@ -132,10 +107,10 @@ files:
|
|
132
107
|
- test/migrate/twelve/011_create_roles.roles.rb
|
133
108
|
- test/migrate/twelve/012_create_users.rb
|
134
109
|
- test/migrate/twelve/9_create_countries.rb
|
135
|
-
- test/
|
136
|
-
- test/
|
137
|
-
- test/
|
138
|
-
- test/
|
110
|
+
- test/rails_4.0.gemfile
|
111
|
+
- test/rails_4.1.gemfile
|
112
|
+
- test/rails_4.2.gemfile
|
113
|
+
- test/rails_edge.gemfile
|
139
114
|
- test/setup_railsapp
|
140
115
|
- test/test_helper.rb
|
141
116
|
- test/test_with_railsapp
|
@@ -153,7 +128,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
153
128
|
requirements:
|
154
129
|
- - ! '>='
|
155
130
|
- !ruby/object:Gem::Version
|
156
|
-
version: 1.
|
131
|
+
version: 1.9.3
|
157
132
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
158
133
|
none: false
|
159
134
|
requirements:
|
@@ -175,10 +150,10 @@ test_files:
|
|
175
150
|
- test/migrate/twelve/011_create_roles.roles.rb
|
176
151
|
- test/migrate/twelve/012_create_users.rb
|
177
152
|
- test/migrate/twelve/9_create_countries.rb
|
178
|
-
- test/
|
179
|
-
- test/
|
180
|
-
- test/
|
181
|
-
- test/
|
153
|
+
- test/rails_4.0.gemfile
|
154
|
+
- test/rails_4.1.gemfile
|
155
|
+
- test/rails_4.2.gemfile
|
156
|
+
- test/rails_edge.gemfile
|
182
157
|
- test/setup_railsapp
|
183
158
|
- test/test_helper.rb
|
184
159
|
- test/test_with_railsapp
|
data/VERSION
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
1.1.0
|
data/Vagrantfile
DELETED
@@ -1,20 +0,0 @@
|
|
1
|
-
# -*- mode: ruby -*-
|
2
|
-
# vi: set ft=ruby :
|
3
|
-
|
4
|
-
Vagrant.configure("2") do |config|
|
5
|
-
# For a complete reference, please see the online documentation at
|
6
|
-
# https://docs.vagrantup.com.
|
7
|
-
|
8
|
-
config.vm.box = "ubuntu/xenial64"
|
9
|
-
|
10
|
-
# set auto_update to false, if you do NOT want to check the correct
|
11
|
-
# additions version when booting this machine
|
12
|
-
config.vbguest.auto_update = false
|
13
|
-
|
14
|
-
# do NOT download the iso file from a webserver
|
15
|
-
config.vbguest.no_remote = true
|
16
|
-
|
17
|
-
# provision with a shell script.
|
18
|
-
config.vm.provision "shell", path: "./test/provision_vagrant"
|
19
|
-
|
20
|
-
end
|
@@ -1,25 +0,0 @@
|
|
1
|
-
# Copyright (c) 2010-2013 Ian Heggie, released under the MIT license.
|
2
|
-
# See MIT-LICENSE for details.
|
3
|
-
|
4
|
-
# rails prior to 3.0
|
5
|
-
module ActionController
|
6
|
-
module Routing #:nodoc:
|
7
|
-
class RouteSet #:nodoc:
|
8
|
-
alias_method :draw_without_health_check_routes, :draw
|
9
|
-
|
10
|
-
def draw
|
11
|
-
draw_without_health_check_routes do |map|
|
12
|
-
map.connect 'health_check',
|
13
|
-
:controller => 'health_check/health_check', :action => 'index'
|
14
|
-
map.connect 'health_check.:format',
|
15
|
-
:controller => 'health_check/health_check', :action => 'index'
|
16
|
-
map.connect 'health_check/:checks',
|
17
|
-
:controller => 'health_check/health_check', :action => 'index'
|
18
|
-
map.connect 'health_check/:checks.:format',
|
19
|
-
:controller => 'health_check/health_check', :action => 'index'
|
20
|
-
yield map
|
21
|
-
end
|
22
|
-
end
|
23
|
-
end
|
24
|
-
end
|
25
|
-
end
|
data/test/provision_vagrant
DELETED
@@ -1,79 +0,0 @@
|
|
1
|
-
#!/bin/bash
|
2
|
-
|
3
|
-
case `id` in
|
4
|
-
*root*)
|
5
|
-
;;
|
6
|
-
*)
|
7
|
-
exec echo Must be run as root
|
8
|
-
;;
|
9
|
-
esac
|
10
|
-
|
11
|
-
chruby_version=0.3.9
|
12
|
-
chruby=chruby-${chruby_version}
|
13
|
-
|
14
|
-
set -xe
|
15
|
-
id
|
16
|
-
pwd
|
17
|
-
export DEBIAN_FRONTEND=noninteractive
|
18
|
-
find /tmp/got-apt-update -mtime -1 || ( apt-get update && touch /tmp/got-apt-update )
|
19
|
-
apt install --yes --force-yes -q ruby ruby-dev sqlite3 libsqlite3-dev nodejs subversion git git-core
|
20
|
-
# https://github.com/rbenv/ruby-build/wiki#suggested-build-environment
|
21
|
-
# using default gcc-5 since xenial doesn't have gcc-6
|
22
|
-
apt install --yes --force-yes -q gcc-5 autoconf bison build-essential libssl-dev libyaml-dev libreadline6-dev zlib1g-dev libncurses5-dev libffi-dev libgdbm3 libgdbm-dev
|
23
|
-
|
24
|
-
# The following is not required for testing, install if you are doing manual tests with extra gems
|
25
|
-
# apt install --yes --force-yes -q mysql-client mysql-server libmysqlclient-dev
|
26
|
-
# apt install --yes --force-yes -q libcurl4-openssl-dev libncurses5-dev libxml2-dev libxslt1-dev
|
27
|
-
(
|
28
|
-
echo Install chruby
|
29
|
-
[ -s ${chruby}.tar.gz ] || wget -q -O ${chruby}.tar.gz https://github.com/postmodern/chruby/archive/v${chruby_version}.tar.gz
|
30
|
-
[ -d ${chruby} ] || tar -xzf ${chruby}.tar.gz
|
31
|
-
cd ${chruby}/
|
32
|
-
./scripts/setup.sh
|
33
|
-
cat > /etc/profile.d/chruby.sh <<'EOF'
|
34
|
-
if [ -n "$BASH_VERSION" ] || [ -n "$ZSH_VERSION" ]; then
|
35
|
-
source /usr/local/share/chruby/chruby.sh
|
36
|
-
#source /usr/local/share/chruby/auto
|
37
|
-
fi
|
38
|
-
EOF
|
39
|
-
chmod a+r /etc/profile.d/chruby.sh
|
40
|
-
)
|
41
|
-
|
42
|
-
(
|
43
|
-
[ -d ruby-build ] || git clone https://github.com/rbenv/ruby-build.git
|
44
|
-
which ruby-build || PREFIX=/usr/local ./ruby-build/install.sh
|
45
|
-
|
46
|
-
mkdir -p /opt/rubies
|
47
|
-
v=1.8.7-p375
|
48
|
-
[ -x /opt/rubies/${v}/bin/bundle ] || ( ruby-build ${v} /opt/rubies/${v} && /opt/rubies/${v}/bin/gem update --system 1.8.25 && /opt/rubies/${v}/bin/gem install bundler )
|
49
|
-
|
50
|
-
v=1.9.3-p551
|
51
|
-
[ -x /opt/rubies/${v}/bin/bundle ] || ( ruby-build ${v} /opt/rubies/${v} && /opt/rubies/${v}/bin/gem install bundler )
|
52
|
-
|
53
|
-
for v in 2.2.0
|
54
|
-
do
|
55
|
-
[ -x /opt/rubies/${v}/bin/bundle ] || ( ruby-build ${v} /opt/rubies/${v} && /opt/rubies/${v}/bin/gem install bundler )
|
56
|
-
done
|
57
|
-
)
|
58
|
-
|
59
|
-
echo Setup system ruby
|
60
|
-
which bundle || gem install bundler
|
61
|
-
bundle --version
|
62
|
-
set +x
|
63
|
-
cat <<EOF
|
64
|
-
|
65
|
-
Now test by running the following commands:
|
66
|
-
|
67
|
-
vagrant ssh
|
68
|
-
cd /vagrant
|
69
|
-
|
70
|
-
chruby RUBY_VERSION
|
71
|
-
or
|
72
|
-
chruby system # for system version 2.3.1
|
73
|
-
|
74
|
-
./test/test_with_railsapp
|
75
|
-
|
76
|
-
exit
|
77
|
-
|
78
|
-
EOF
|
79
|
-
exit
|
data/test/rails_3.0.gemfile
DELETED
@@ -1,23 +0,0 @@
|
|
1
|
-
# Gemfile for health_test testing
|
2
|
-
|
3
|
-
source 'https://rubygems.org'
|
4
|
-
|
5
|
-
gem 'rails', "~> 3.0.19"
|
6
|
-
gem 'rake', '>= 0.8.3', '< 11.0' # REQUIRED
|
7
|
-
|
8
|
-
# mime-types 2.0 requires Ruby version >= 1.9.2
|
9
|
-
gem "mime-types", "< 2.0" if RUBY_VERSION < '1.9.2' # REQUIRED
|
10
|
-
# 0.7 requires ruby 1.9.3
|
11
|
-
gem 'i18n', '< 0.7' if RUBY_VERSION < '1.9.3' # REQUIRED
|
12
|
-
# rack 2.0 requires ruby 2.2.2
|
13
|
-
gem 'rack', "< 2.0" if RUBY_VERSION < '2.2.2' # REQUIRED
|
14
|
-
|
15
|
-
group :development, :test do
|
16
|
-
if defined?(JRUBY_VERSION)
|
17
|
-
gem 'jruby-openssl'
|
18
|
-
gem 'activerecord-jdbcsqlite3-adapter'
|
19
|
-
else
|
20
|
-
gem 'sqlite3', "~> 1.3.7"
|
21
|
-
end
|
22
|
-
gem 'shoulda', "~> 2.11.0"
|
23
|
-
end
|
data/test/rails_3.1.gemfile
DELETED
@@ -1,29 +0,0 @@
|
|
1
|
-
# Gemfile for health_test testing
|
2
|
-
|
3
|
-
source 'https://rubygems.org'
|
4
|
-
|
5
|
-
gem 'rails', "~> 3.1.0"
|
6
|
-
gem 'rake', '>= 0.8.3', '< 11.0' # REQUIRED
|
7
|
-
|
8
|
-
group :development, :test do
|
9
|
-
if defined?(JRUBY_VERSION)
|
10
|
-
gem 'jruby-openssl'
|
11
|
-
gem 'activerecord-jdbcsqlite3-adapter'
|
12
|
-
else
|
13
|
-
gem 'sqlite3', "~> 1.3.7"
|
14
|
-
end
|
15
|
-
gem 'shoulda', "~> 2.11.0"
|
16
|
-
end
|
17
|
-
|
18
|
-
# mime-types 2.0 requires Ruby version >= 1.9.2
|
19
|
-
gem "mime-types", "< 2.0" if RUBY_VERSION < '1.9.2' # REQUIRED
|
20
|
-
# 0.7 requires ruby 1.9.3
|
21
|
-
gem 'i18n', '< 0.7' if RUBY_VERSION < '1.9.3' # REQUIRED
|
22
|
-
# rack 2.0 requires ruby 2.2.2
|
23
|
-
gem 'rack', "< 2.0" if RUBY_VERSION < '2.2.2' # REQUIRED
|
24
|
-
|
25
|
-
gem 'sass', '< 3.5' if RUBY_VERSION < '1.9.3' # REQUIRED
|
26
|
-
|
27
|
-
# Initial Gemfile has therubyracer commented out
|
28
|
-
gem 'therubyrhino', :platform => :jruby # REQUIRED
|
29
|
-
gem 'therubyracer', :platform => :ruby # REQUIRED
|
data/test/rails_3.2.gemfile
DELETED
@@ -1,30 +0,0 @@
|
|
1
|
-
# Gemfile for health_test testing
|
2
|
-
|
3
|
-
source 'https://rubygems.org'
|
4
|
-
|
5
|
-
gem 'rails', "~> 3.2.0"
|
6
|
-
gem 'rake', '>= 0.8.3', '< 11.0' # REQUIRED
|
7
|
-
|
8
|
-
group :development, :test do
|
9
|
-
if defined?(JRUBY_VERSION)
|
10
|
-
gem 'jruby-openssl'
|
11
|
-
gem 'activerecord-jdbcsqlite3-adapter'
|
12
|
-
else
|
13
|
-
gem 'sqlite3', "~> 1.3.7"
|
14
|
-
end
|
15
|
-
gem 'shoulda', "~> 2.11.0"
|
16
|
-
end
|
17
|
-
|
18
|
-
# mime-types 2.0 requires Ruby version >= 1.9.2
|
19
|
-
gem "mime-types", "< 2.0" if RUBY_VERSION < '1.9.2' # REQUIRED
|
20
|
-
# 0.7 requires ruby 1.9.3
|
21
|
-
gem 'i18n', '< 0.7' if RUBY_VERSION < '1.9.3' # REQUIRED
|
22
|
-
# rack 2.0 requires ruby 2.2.2
|
23
|
-
gem 'rack', "< 2.0" if RUBY_VERSION < '2.2.2' # REQUIRED
|
24
|
-
|
25
|
-
# Initial Gemfile has therubyracer commented out
|
26
|
-
gem 'therubyrhino', :platform => :jruby # REQUIRED
|
27
|
-
gem 'therubyracer', :platform => :ruby # REQUIRED
|
28
|
-
|
29
|
-
# Pin gems to avoid incompatible versions
|
30
|
-
gem 'sass', '< 3.5.0' # REQUIRED
|