health_check 1.1.0 → 1.1.2
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +44 -0
- data/CHANGELOG +7 -0
- data/Gemfile +4 -7
- data/MIT-LICENSE +2 -0
- data/README.rdoc +92 -83
- data/Rakefile +6 -23
- data/health_check.gemspec +24 -79
- data/lib/health_check/utils.rb +4 -0
- data/lib/health_check/version.rb +4 -0
- data/lib/health_check.rb +1 -0
- data/test/test_with_railsapp +6 -0
- metadata +40 -44
- data/Gemfile.lock +0 -104
data/.gitignore
ADDED
@@ -0,0 +1,44 @@
|
|
1
|
+
# Suggested by bundler
|
2
|
+
*.gem
|
3
|
+
*.rbc
|
4
|
+
.bundle
|
5
|
+
.config
|
6
|
+
.yardoc
|
7
|
+
Gemfile.lock
|
8
|
+
InstalledFiles
|
9
|
+
_yardoc
|
10
|
+
coverage
|
11
|
+
doc/
|
12
|
+
lib/bundler/man
|
13
|
+
pkg
|
14
|
+
rdoc
|
15
|
+
spec/reports
|
16
|
+
test/tmp
|
17
|
+
test/version_tmp
|
18
|
+
tmp
|
19
|
+
|
20
|
+
## MAC OS
|
21
|
+
.DS_Store
|
22
|
+
|
23
|
+
## TEXTMATE
|
24
|
+
*.tmproj
|
25
|
+
tmtags
|
26
|
+
|
27
|
+
## EMACS
|
28
|
+
*~
|
29
|
+
\#*
|
30
|
+
.\#*
|
31
|
+
|
32
|
+
## VIM
|
33
|
+
*.swp
|
34
|
+
*~
|
35
|
+
|
36
|
+
## PROJECT::SPECIFIC
|
37
|
+
bin/
|
38
|
+
railsapps/
|
39
|
+
,*
|
40
|
+
|
41
|
+
# Local ruby version config
|
42
|
+
.rbenv-version
|
43
|
+
.ruby-version
|
44
|
+
.rvmrc
|
data/CHANGELOG
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
= Change Log =
|
2
|
+
|
3
|
+
* 1.1.2 - Change to bundler support for building gems, as jeweler gem was broken by v2.0.0 of rubygems
|
4
|
+
* 1.1.0 - Include cache check (Thanks to https://github.com/mgomes1 ) and some changes to test setup to workaround and diagnose test failures under rvm
|
5
|
+
* 1.0.2 - Included travis config and gemfiles used in travis tests in gem and changes to test setup so that gem test
|
6
|
+
* 1.x - Includes Rails 3.x suppprt as an Engine
|
7
|
+
* 0.x - Rails 2.3
|
data/Gemfile
CHANGED
@@ -1,13 +1,10 @@
|
|
1
|
-
# Gemfile for health_test
|
2
|
-
|
3
1
|
source 'https://rubygems.org'
|
4
2
|
|
5
|
-
gem
|
3
|
+
# Specify your gem's dependencies in health_check.gemspec
|
4
|
+
|
5
|
+
gemspec
|
6
6
|
|
7
7
|
group :development, :test do
|
8
|
-
gem 'rake', '>= 0.8.3'
|
9
|
-
gem 'jeweler', '~> 1.8.4'
|
10
|
-
gem 'shoulda', "~> 2.11.0"
|
11
8
|
if defined?(JRUBY_VERSION)
|
12
9
|
gem 'jruby-openssl'
|
13
10
|
gem 'activerecord-jdbcsqlite3-adapter'
|
@@ -20,6 +17,6 @@ group :misc do
|
|
20
17
|
# run travis-lint to check .travis.yml
|
21
18
|
gem 'travis-lint'
|
22
19
|
# required to run rake test:plugins
|
23
|
-
gem 'ruby-prof', '>= 0.6.1'
|
20
|
+
#gem 'ruby-prof', '>= 0.6.1'
|
24
21
|
end
|
25
22
|
|
data/MIT-LICENSE
CHANGED
data/README.rdoc
CHANGED
@@ -1,29 +1,41 @@
|
|
1
|
-
=
|
1
|
+
= health\_check gem
|
2
2
|
|
3
3
|
Simple health check of Rails app for use with Pingdom, NewRelic, EngineYard or uptime.openacs.org etc.
|
4
4
|
|
5
5
|
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)
|
6
6
|
|
7
|
-
|
8
|
-
Specify full or include email in the list of checks to varify the smtp settings
|
9
|
-
(eg use 127.0.0.1 instead of localhost).
|
10
|
-
|
11
|
-
health_check provides various monitoring URIs
|
7
|
+
health_check provides various monitoring URIs, for example:
|
12
8
|
|
13
|
-
|
9
|
+
curl localhost:3000/health_check
|
14
10
|
success
|
15
11
|
|
16
|
-
|
12
|
+
curl localhost:3000/health_check/all
|
17
13
|
success
|
18
14
|
|
19
|
-
|
15
|
+
curl localhost:3000/health_check/database_cache_migration
|
20
16
|
success
|
21
17
|
|
22
|
-
|
23
|
-
|
18
|
+
On failure a 500 http status is returned with a simple explination of the failure
|
19
|
+
|
20
|
+
curl localhost:3000/health_check/fail
|
21
|
+
health_check failed: invalid argument to health_test.
|
24
22
|
|
25
23
|
The health_check controller disables sessions and logging for its actions to minimise the impact of frequent uptime checks on the session store and the log file.
|
26
24
|
|
25
|
+
== Checks
|
26
|
+
|
27
|
+
* standard (default) - site, database and migrations checks are run plus email if settings have been changed
|
28
|
+
* all / full - all checks are run
|
29
|
+
* database - checks that the current migration level can be read from the database
|
30
|
+
* email - basic check of email - :test returns true, :sendmail checks file is present and executable, :smtp sends HELO command to server and checks response
|
31
|
+
* migration - checks that the database migration level matches that in db/migrations
|
32
|
+
* cache - checks that a value can be written to the cache
|
33
|
+
* site - checks rails is running sufficiently to render text
|
34
|
+
|
35
|
+
The email gateway is not checked unless the smtp settings have been changed.
|
36
|
+
Specify full or include email in the list of checks to varify the smtp settings
|
37
|
+
(eg use 127.0.0.1 instead of localhost).
|
38
|
+
|
27
39
|
== Installation
|
28
40
|
|
29
41
|
=== As a Gem from rubygems (Rails 3.0 and above)
|
@@ -32,15 +44,19 @@ Add the following line to Gemfile
|
|
32
44
|
|
33
45
|
gem "health_check"
|
34
46
|
|
35
|
-
|
47
|
+
And then execute
|
48
|
+
|
49
|
+
bundle
|
36
50
|
|
37
|
-
|
51
|
+
Or install it yourself as:
|
52
|
+
|
53
|
+
gem install health_check
|
38
54
|
|
39
55
|
=== As a Gem from rubygems (Rails 2.3)
|
40
56
|
|
41
57
|
Install the gem using the following command
|
42
58
|
|
43
|
-
|
59
|
+
gem install health_check
|
44
60
|
|
45
61
|
Then add the following line to config/environment.rb within the config block
|
46
62
|
|
@@ -50,100 +66,93 @@ Then add the following line to config/environment.rb within the config block
|
|
50
66
|
|
51
67
|
Run the following commands from the root of your rails application
|
52
68
|
|
53
|
-
|
54
|
-
|
69
|
+
cd vendor/plugins
|
70
|
+
git clone git://github.com/ianheggie/health_check.git
|
55
71
|
|
56
|
-
|
72
|
+
== Uptime Monitoring
|
57
73
|
|
58
|
-
|
59
|
-
|
60
|
-
See the .travis.yml file for a list of supported ruby versions.
|
74
|
+
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
|
75
|
+
that any substitution of a different server or generic information page should also be reported as an error.
|
61
76
|
|
62
|
-
|
63
|
-
# or
|
64
|
-
rvm use 1.9.3
|
77
|
+
If an error is encounted, the text "health_check failed: some error message/s" will be returned and the http status will be 500.
|
65
78
|
|
66
|
-
|
79
|
+
See
|
67
80
|
|
68
|
-
|
69
|
-
|
70
|
-
|
81
|
+
* Pingdom Website Monitoring - https://www.pingdom.com
|
82
|
+
* NewRelic Availability Monitoring - http://newrelic.com/docs/features/availability-monitoring-faq
|
83
|
+
* Uptime by OpenACS - http://uptime.openacs.org/uptime/
|
84
|
+
* Engine Yard's guide - https://support.cloud.engineyard.com/entries/20996821-monitor-application-uptime (although the guide is based on fitter_happier plugin it will also work with this gem)
|
85
|
+
* Any other montoring service that can be set to check for the word success in the test returned from a url
|
71
86
|
|
72
|
-
|
87
|
+
== Note on Patches/Pull Requests
|
73
88
|
|
74
|
-
|
89
|
+
<em>Feedback welcome! Especially with suggested replacement code and corresponding tests</em>
|
75
90
|
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
# or
|
82
|
-
export BUNDLE_GEMFILE=rails3_2.gemfile
|
91
|
+
1. Fork it
|
92
|
+
2. Create your feature branch (<tt>git checkout -b my-new-feature</tt>)
|
93
|
+
3. Commit your changes (<tt>git commit -am 'Add some feature'</tt>)
|
94
|
+
4. Push to the branch (<tt>git push origin my-new-feature</tt>)
|
95
|
+
5. Create new Pull Request.
|
83
96
|
|
84
|
-
|
85
|
-
bundle install --binstubs
|
86
|
-
rbenv rehash # if using rbenv
|
97
|
+
== Known Issues
|
87
98
|
|
88
|
-
|
99
|
+
* No inline documentation for methods
|
100
|
+
* <b>rvm gemsets breaks the test</b> - specifically <tt>rvm use 1.9.3</tt> works but <tt>rvm gemset use ruby-1.9.3-p385@health_check --create</tt> triggers a "Could not find gem 'coffee-rails (~> 3.2.1) ruby' in the gems available on this machine." error in the last call to bundle (installing health_check as a gem via a path into the temp railsapp)
|
89
101
|
|
90
|
-
|
102
|
+
== Similar projects
|
91
103
|
|
92
|
-
|
93
|
-
bin/rake test
|
104
|
+
* fitter_happier plugin by atmos - plugin with similar goals, but not compatible with uptime, and does not check email gateway
|
94
105
|
|
95
|
-
==
|
106
|
+
== Testing
|
96
107
|
|
97
|
-
|
108
|
+
=== Automated continuous integration tests
|
98
109
|
|
99
|
-
See
|
100
|
-
* Pingdom Website Monitoring - https://www.pingdom.com
|
101
|
-
* NewRelic Availability Monitoring - http://newrelic.com/docs/features/availability-monitoring-faq
|
102
|
-
* Uptime by OpenACS - http://uptime.openacs.org/uptime/
|
103
|
-
* Engine Yard's guide - https://support.cloud.engineyard.com/entries/20996821-monitor-application-uptime (although the guide is based on fitter_happier plugin it will also work with this gem)
|
104
|
-
* Any other montoring service that can be set to check for the word success in the test returned from a url
|
110
|
+
See Travis CI testing result: {<img src="https://travis-ci.org/ianheggie/health_check.png">}[https://travis-ci.org/ianheggie/health_check]
|
105
111
|
|
106
|
-
|
112
|
+
Code Climate also monitors this project: {<img src="https://codeclimate.com/github/ianheggie/health_check.png" />}[https://codeclimate.com/github/ianheggie/health_check]
|
107
113
|
|
108
|
-
|
109
|
-
* all / full - all checks are run
|
110
|
-
* database - checks that the current migration level can be read from the database
|
111
|
-
* email - basic check of email - :test returns true, :sendmail checks file is present and executable, :smtp sends HELO command to server and checks response
|
112
|
-
* migration - checks that the database migration level matches that in db/migrations
|
113
|
-
* cache - checks that a value can be written to the cache
|
114
|
-
* site - checks rails is running sufficiently to render text
|
114
|
+
=== Manual testing
|
115
115
|
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
* Make your feature addition or bug fix.
|
120
|
-
* Add tests for it. This is important so I don't break it in a
|
121
|
-
future version unintentionally.
|
122
|
-
* Commit, do not mess with rakefile, version, or history.
|
123
|
-
(if you want to have your own version, that is fine but bump version in a commit by itself I can ignore when I pull)
|
124
|
-
* Send me a pull request. Bonus points for topic branches.
|
116
|
+
The test will package up and install the gem under a temporary path, create a dummy rails app configured for sqlite,
|
117
|
+
install the gem, and then run up tests against the server.
|
118
|
+
This will require TCP port 3456 to be free.
|
125
119
|
|
126
|
-
|
120
|
+
Using rbenv or rvm, install and set the version of ruby you wish to test against.
|
121
|
+
You will need to install the bundler gem if using rbenv.
|
122
|
+
See the <tt>.travis.yml</tt> file for a list of supported ruby versions.
|
127
123
|
|
128
|
-
|
129
|
-
|
124
|
+
* rbenv command: <tt>rbenv shell 1.8.7-p371</tt>
|
125
|
+
* rvm command: <tt>rvm use 1.9.3</tt>
|
130
126
|
|
131
|
-
|
127
|
+
Create a temp directory for throw away testing, and clone the health_check gem into it
|
132
128
|
|
133
|
-
|
134
|
-
|
129
|
+
mkdir -p ~/tmp
|
130
|
+
cd ~/tmp
|
131
|
+
git clone https://github.com/ianheggie/health_check.git
|
135
132
|
|
136
|
-
|
133
|
+
All of the following commands should be run under the checked out gem
|
134
|
+
|
135
|
+
cd ~/tmp/health_check
|
137
136
|
|
138
|
-
|
137
|
+
Configure which rails version you want to test against, and load the gems appropriate for the ruby version - use one of the following commands:
|
139
138
|
|
140
|
-
|
139
|
+
export BUNDLE_GEMFILE=$PWD/rails2_3.gemfile
|
140
|
+
export BUNDLE_GEMFILE=$PWD/rails3_0.gemfile
|
141
|
+
export BUNDLE_GEMFILE=$PWD/rails3_1.gemfile
|
142
|
+
export BUNDLE_GEMFILE=$PWD/rails3_2.gemfile
|
143
|
+
unset BUNDLE_GEMFILE # for installed version of rails
|
141
144
|
|
142
|
-
|
145
|
+
Then install the required gems, and update rbenv shims (if using rbenv)
|
143
146
|
|
144
|
-
|
147
|
+
bundle install --binstubs
|
148
|
+
rbenv rehash
|
149
|
+
|
150
|
+
Run the tests
|
151
|
+
|
152
|
+
bin/rake test
|
153
|
+
|
154
|
+
== Copyright
|
155
|
+
|
156
|
+
Copyright (c) 2010-2013 Ian Heggie, released under the MIT license.
|
157
|
+
See MIT-LICENSE for details.
|
145
158
|
|
146
|
-
* 0.x - Rails 2.3
|
147
|
-
* 1.x - Includes Rails 3.x suppprt as an Engine
|
148
|
-
* 1.0.2 - Included travis config and gemfiles used in travis tests in gem and changes to test setup so that gem test
|
149
|
-
* 1.1.0 - Include cache check (Thanks to https://github.com/mgomes1 ) and some changes to test setup to workaround and diagnose test failures under rvm
|
data/Rakefile
CHANGED
@@ -1,26 +1,7 @@
|
|
1
|
-
require
|
2
|
-
require 'rake'
|
3
|
-
|
4
|
-
begin
|
5
|
-
require 'jeweler'
|
6
|
-
Jeweler::Tasks.new do |gem|
|
7
|
-
gem.name = "health_check"
|
8
|
-
gem.summary = %Q{Simple health check of Rails app for uptime monitoring}
|
9
|
-
gem.description = %Q{Simple health check of Rails app for use with Pingdom, NewRelic, EngineYard or uptime.openacs.org etc.}
|
10
|
-
gem.email = "ian@heggie.biz"
|
11
|
-
gem.homepage = "http://github.com/ianheggie/health_check"
|
12
|
-
gem.authors = ["Ian Heggie"]
|
13
|
-
# Gemfile contains gem dependencies, apart from bundler itself
|
14
|
-
gem.add_development_dependency 'bundler', '~> 1.2.0'
|
1
|
+
require "bundler/gem_tasks"
|
15
2
|
|
16
|
-
|
17
|
-
|
18
|
-
Jeweler::GemcutterTasks.new
|
19
|
-
|
20
|
-
#task :test => :check_dependencies
|
21
|
-
rescue LoadError
|
22
|
-
puts "Jeweler (or a dependency) not available. Install it with: gem install jeweler"
|
23
|
-
end
|
3
|
+
#require 'rubygems'
|
4
|
+
require 'rake'
|
24
5
|
|
25
6
|
# Tests are conducted with health_test as a plugin
|
26
7
|
environment_file = File.join(File.dirname(__FILE__), '..', '..', '..', 'config', 'environment.rb')
|
@@ -63,11 +44,13 @@ begin
|
|
63
44
|
require 'rdoc/task'
|
64
45
|
|
65
46
|
Rake::RDocTask.new do |rdoc|
|
66
|
-
version =
|
47
|
+
version = HealthCheck::VERSION
|
67
48
|
|
68
49
|
rdoc.rdoc_dir = 'rdoc'
|
69
50
|
rdoc.title = "health_check #{version}"
|
70
51
|
rdoc.rdoc_files.include('README*')
|
52
|
+
rdoc.rdoc_files.include('CHANGELOG')
|
53
|
+
rdoc.rdoc_files.include('MIT-LICENSE')
|
71
54
|
rdoc.rdoc_files.include('lib/**/*.rb')
|
72
55
|
end
|
73
56
|
rescue Gem::LoadError
|
data/health_check.gemspec
CHANGED
@@ -1,83 +1,28 @@
|
|
1
|
-
# Generated by jeweler
|
2
|
-
# DO NOT EDIT THIS FILE DIRECTLY
|
3
|
-
# Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
|
4
1
|
# -*- encoding: utf-8 -*-
|
2
|
+
lib = File.expand_path('../lib', __FILE__)
|
3
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
|
+
require 'health_check/version'
|
5
5
|
|
6
|
-
Gem::Specification.new do |
|
7
|
-
|
8
|
-
|
6
|
+
Gem::Specification.new do |gem|
|
7
|
+
gem.name = "health_check"
|
8
|
+
gem.version = HealthCheck::VERSION
|
9
|
+
gem.required_rubygems_version = Gem::Requirement.new(">= 0") if gem.respond_to? :required_rubygems_version=
|
10
|
+
gem.authors = ["Ian Heggie"]
|
11
|
+
gem.email = ["ian@heggie.biz"]
|
12
|
+
gem.summary = %q{Simple health check of Rails app for uptime monitoring with Pingdom, NewRelic, EngineYard or uptime.openacs.org etc.}
|
13
|
+
gem.description = <<-EOF
|
14
|
+
Simple health check of Rails app for uptime monitoring with Pingdom, NewRelic, EngineYard or uptime.openacs.org etc.
|
15
|
+
EOF
|
16
|
+
gem.homepage = "https://github.com/ianheggie/health_check"
|
9
17
|
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
]
|
18
|
-
|
19
|
-
|
20
|
-
".travis.yml",
|
21
|
-
"Gemfile",
|
22
|
-
"Gemfile.lock",
|
23
|
-
"MIT-LICENSE",
|
24
|
-
"README.rdoc",
|
25
|
-
"Rakefile",
|
26
|
-
"VERSION",
|
27
|
-
"config/routes.rb",
|
28
|
-
"health_check.gemspec",
|
29
|
-
"init.rb",
|
30
|
-
"lib/health_check.rb",
|
31
|
-
"lib/health_check/add_23_routes.rb",
|
32
|
-
"lib/health_check/health_check_controller.rb",
|
33
|
-
"lib/health_check/utils.rb",
|
34
|
-
"rails1_2.gemfile",
|
35
|
-
"rails2_3.gemfile",
|
36
|
-
"rails3_0.gemfile",
|
37
|
-
"rails3_1.gemfile",
|
38
|
-
"rails3_2.gemfile",
|
39
|
-
"rails_edge.gemfile",
|
40
|
-
"test/fake_smtp_server",
|
41
|
-
"test/migrate/empty/do_not_remove.txt",
|
42
|
-
"test/migrate/nine/9_create_countries.rb",
|
43
|
-
"test/migrate/twelve/012_create_users.rb",
|
44
|
-
"test/migrate/twelve/9_create_countries.rb",
|
45
|
-
"test/test_helper.rb",
|
46
|
-
"test/test_with_railsapp",
|
47
|
-
"test/testurl",
|
48
|
-
"test/unit/health_check_controller_test.rb",
|
49
|
-
"test/unit/routes_test.rb"
|
50
|
-
]
|
51
|
-
s.homepage = %q{http://github.com/ianheggie/health_check}
|
52
|
-
s.require_paths = ["lib"]
|
53
|
-
s.rubygems_version = %q{1.6.2}
|
54
|
-
s.summary = %q{Simple health check of Rails app for uptime monitoring}
|
55
|
-
|
56
|
-
if s.respond_to? :specification_version then
|
57
|
-
s.specification_version = 3
|
58
|
-
|
59
|
-
if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
|
60
|
-
s.add_runtime_dependency(%q<rails>, [">= 2.3.0"])
|
61
|
-
s.add_development_dependency(%q<rake>, [">= 0.8.3"])
|
62
|
-
s.add_development_dependency(%q<jeweler>, ["~> 1.8.4"])
|
63
|
-
s.add_development_dependency(%q<shoulda>, ["~> 2.11.0"])
|
64
|
-
s.add_development_dependency(%q<sqlite3>, ["~> 1.3.7"])
|
65
|
-
s.add_development_dependency(%q<bundler>, ["~> 1.2.0"])
|
66
|
-
else
|
67
|
-
s.add_dependency(%q<rails>, [">= 2.3.0"])
|
68
|
-
s.add_dependency(%q<rake>, [">= 0.8.3"])
|
69
|
-
s.add_dependency(%q<jeweler>, ["~> 1.8.4"])
|
70
|
-
s.add_dependency(%q<shoulda>, ["~> 2.11.0"])
|
71
|
-
s.add_dependency(%q<sqlite3>, ["~> 1.3.7"])
|
72
|
-
s.add_dependency(%q<bundler>, ["~> 1.2.0"])
|
73
|
-
end
|
74
|
-
else
|
75
|
-
s.add_dependency(%q<rails>, [">= 2.3.0"])
|
76
|
-
s.add_dependency(%q<rake>, [">= 0.8.3"])
|
77
|
-
s.add_dependency(%q<jeweler>, ["~> 1.8.4"])
|
78
|
-
s.add_dependency(%q<shoulda>, ["~> 2.11.0"])
|
79
|
-
s.add_dependency(%q<sqlite3>, ["~> 1.3.7"])
|
80
|
-
s.add_dependency(%q<bundler>, ["~> 1.2.0"])
|
81
|
-
end
|
18
|
+
gem.files = `git ls-files`.split($/)
|
19
|
+
gem.executables = gem.files.grep(%r{^bin/}).map{ |f| File.basename(f) }
|
20
|
+
gem.test_files = gem.files.grep(%r{^(test|spec|features)/})
|
21
|
+
gem.extra_rdoc_files = [ "README.rdoc" ]
|
22
|
+
gem.require_paths = ["lib"]
|
23
|
+
gem.add_dependency(%q<rails>, [">= 2.3.0"])
|
24
|
+
gem.add_development_dependency(%q<rake>, [">= 0.8.3"])
|
25
|
+
gem.add_development_dependency(%q<shoulda>, ["~> 2.11.0"])
|
26
|
+
gem.add_development_dependency(%q<sqlite3>, ["~> 1.3.7"])
|
27
|
+
gem.add_development_dependency(%q<bundler>, ["~> 1.2.0"])
|
82
28
|
end
|
83
|
-
|
data/lib/health_check/utils.rb
CHANGED
data/lib/health_check.rb
CHANGED
data/test/test_with_railsapp
CHANGED
@@ -3,12 +3,14 @@
|
|
3
3
|
# Any failure causes exit
|
4
4
|
set -e
|
5
5
|
|
6
|
+
rehash=''
|
6
7
|
if [[ -s "$HOME/.rvm/scripts/rvm" ]] ; then
|
7
8
|
echo "Detected user installed rvm"
|
8
9
|
elif [[ -s "/usr/local/rvm/scripts/rvm" ]] ; then
|
9
10
|
echo "Detected root installed rvm"
|
10
11
|
elif [[ -d "$HOME/.rbenv" ]] ; then
|
11
12
|
echo "Detected rbenv ..."
|
13
|
+
rehash='rbenv rehash'
|
12
14
|
else
|
13
15
|
printf "Note: Neither rvm nor rbenv was not found.\n"
|
14
16
|
fi
|
@@ -19,6 +21,10 @@ do
|
|
19
21
|
echo -n " "
|
20
22
|
which $cmd || ( echo "Aborting test: Missing $cmd command!" && exit 2 )
|
21
23
|
done
|
24
|
+
if ! bundle check ; then
|
25
|
+
echo "Test aborted (missing required gems)"
|
26
|
+
exit 2
|
27
|
+
fi
|
22
28
|
|
23
29
|
base_dir=`pwd`
|
24
30
|
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: health_check
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 23
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 1
|
8
8
|
- 1
|
9
|
-
-
|
10
|
-
version: 1.1.
|
9
|
+
- 2
|
10
|
+
version: 1.1.2
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Ian Heggie
|
@@ -15,7 +15,7 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2013-02-
|
18
|
+
date: 2013-02-28 00:00:00 +11:00
|
19
19
|
default_executable:
|
20
20
|
dependencies:
|
21
21
|
- !ruby/object:Gem::Dependency
|
@@ -30,10 +30,10 @@ dependencies:
|
|
30
30
|
- 3
|
31
31
|
- 0
|
32
32
|
version: 2.3.0
|
33
|
-
type: :runtime
|
34
|
-
prerelease: false
|
35
|
-
name: rails
|
36
33
|
version_requirements: *id001
|
34
|
+
name: rails
|
35
|
+
prerelease: false
|
36
|
+
type: :runtime
|
37
37
|
- !ruby/object:Gem::Dependency
|
38
38
|
requirement: &id002 !ruby/object:Gem::Requirement
|
39
39
|
none: false
|
@@ -46,28 +46,12 @@ dependencies:
|
|
46
46
|
- 8
|
47
47
|
- 3
|
48
48
|
version: 0.8.3
|
49
|
-
type: :development
|
50
|
-
prerelease: false
|
51
|
-
name: rake
|
52
49
|
version_requirements: *id002
|
53
|
-
|
54
|
-
requirement: &id003 !ruby/object:Gem::Requirement
|
55
|
-
none: false
|
56
|
-
requirements:
|
57
|
-
- - ~>
|
58
|
-
- !ruby/object:Gem::Version
|
59
|
-
hash: 63
|
60
|
-
segments:
|
61
|
-
- 1
|
62
|
-
- 8
|
63
|
-
- 4
|
64
|
-
version: 1.8.4
|
65
|
-
type: :development
|
50
|
+
name: rake
|
66
51
|
prerelease: false
|
67
|
-
|
68
|
-
version_requirements: *id003
|
52
|
+
type: :development
|
69
53
|
- !ruby/object:Gem::Dependency
|
70
|
-
requirement: &
|
54
|
+
requirement: &id003 !ruby/object:Gem::Requirement
|
71
55
|
none: false
|
72
56
|
requirements:
|
73
57
|
- - ~>
|
@@ -78,12 +62,12 @@ dependencies:
|
|
78
62
|
- 11
|
79
63
|
- 0
|
80
64
|
version: 2.11.0
|
81
|
-
|
82
|
-
prerelease: false
|
65
|
+
version_requirements: *id003
|
83
66
|
name: shoulda
|
84
|
-
|
67
|
+
prerelease: false
|
68
|
+
type: :development
|
85
69
|
- !ruby/object:Gem::Dependency
|
86
|
-
requirement: &
|
70
|
+
requirement: &id004 !ruby/object:Gem::Requirement
|
87
71
|
none: false
|
88
72
|
requirements:
|
89
73
|
- - ~>
|
@@ -94,12 +78,12 @@ dependencies:
|
|
94
78
|
- 3
|
95
79
|
- 7
|
96
80
|
version: 1.3.7
|
97
|
-
|
98
|
-
prerelease: false
|
81
|
+
version_requirements: *id004
|
99
82
|
name: sqlite3
|
100
|
-
|
83
|
+
prerelease: false
|
84
|
+
type: :development
|
101
85
|
- !ruby/object:Gem::Dependency
|
102
|
-
requirement: &
|
86
|
+
requirement: &id005 !ruby/object:Gem::Requirement
|
103
87
|
none: false
|
104
88
|
requirements:
|
105
89
|
- - ~>
|
@@ -110,12 +94,13 @@ dependencies:
|
|
110
94
|
- 2
|
111
95
|
- 0
|
112
96
|
version: 1.2.0
|
113
|
-
|
114
|
-
prerelease: false
|
97
|
+
version_requirements: *id005
|
115
98
|
name: bundler
|
116
|
-
|
117
|
-
|
118
|
-
|
99
|
+
prerelease: false
|
100
|
+
type: :development
|
101
|
+
description: " \tSimple health check of Rails app for uptime monitoring with Pingdom, NewRelic, EngineYard or uptime.openacs.org etc.\n"
|
102
|
+
email:
|
103
|
+
- ian@heggie.biz
|
119
104
|
executables: []
|
120
105
|
|
121
106
|
extensions: []
|
@@ -124,9 +109,10 @@ extra_rdoc_files:
|
|
124
109
|
- README.rdoc
|
125
110
|
files:
|
126
111
|
- .document
|
112
|
+
- .gitignore
|
127
113
|
- .travis.yml
|
114
|
+
- CHANGELOG
|
128
115
|
- Gemfile
|
129
|
-
- Gemfile.lock
|
130
116
|
- MIT-LICENSE
|
131
117
|
- README.rdoc
|
132
118
|
- Rakefile
|
@@ -138,6 +124,7 @@ files:
|
|
138
124
|
- lib/health_check/add_23_routes.rb
|
139
125
|
- lib/health_check/health_check_controller.rb
|
140
126
|
- lib/health_check/utils.rb
|
127
|
+
- lib/health_check/version.rb
|
141
128
|
- rails1_2.gemfile
|
142
129
|
- rails2_3.gemfile
|
143
130
|
- rails3_0.gemfile
|
@@ -155,7 +142,7 @@ files:
|
|
155
142
|
- test/unit/health_check_controller_test.rb
|
156
143
|
- test/unit/routes_test.rb
|
157
144
|
has_rdoc: true
|
158
|
-
homepage:
|
145
|
+
homepage: https://github.com/ianheggie/health_check
|
159
146
|
licenses: []
|
160
147
|
|
161
148
|
post_install_message:
|
@@ -187,6 +174,15 @@ rubyforge_project:
|
|
187
174
|
rubygems_version: 1.6.2
|
188
175
|
signing_key:
|
189
176
|
specification_version: 3
|
190
|
-
summary: Simple health check of Rails app for uptime monitoring
|
191
|
-
test_files:
|
192
|
-
|
177
|
+
summary: Simple health check of Rails app for uptime monitoring with Pingdom, NewRelic, EngineYard or uptime.openacs.org etc.
|
178
|
+
test_files:
|
179
|
+
- test/fake_smtp_server
|
180
|
+
- test/migrate/empty/do_not_remove.txt
|
181
|
+
- test/migrate/nine/9_create_countries.rb
|
182
|
+
- test/migrate/twelve/012_create_users.rb
|
183
|
+
- test/migrate/twelve/9_create_countries.rb
|
184
|
+
- test/test_helper.rb
|
185
|
+
- test/test_with_railsapp
|
186
|
+
- test/testurl
|
187
|
+
- test/unit/health_check_controller_test.rb
|
188
|
+
- test/unit/routes_test.rb
|
data/Gemfile.lock
DELETED
@@ -1,104 +0,0 @@
|
|
1
|
-
GEM
|
2
|
-
remote: https://rubygems.org/
|
3
|
-
specs:
|
4
|
-
actionmailer (3.2.12)
|
5
|
-
actionpack (= 3.2.12)
|
6
|
-
mail (~> 2.4.4)
|
7
|
-
actionpack (3.2.12)
|
8
|
-
activemodel (= 3.2.12)
|
9
|
-
activesupport (= 3.2.12)
|
10
|
-
builder (~> 3.0.0)
|
11
|
-
erubis (~> 2.7.0)
|
12
|
-
journey (~> 1.0.4)
|
13
|
-
rack (~> 1.4.5)
|
14
|
-
rack-cache (~> 1.2)
|
15
|
-
rack-test (~> 0.6.1)
|
16
|
-
sprockets (~> 2.2.1)
|
17
|
-
activemodel (3.2.12)
|
18
|
-
activesupport (= 3.2.12)
|
19
|
-
builder (~> 3.0.0)
|
20
|
-
activerecord (3.2.12)
|
21
|
-
activemodel (= 3.2.12)
|
22
|
-
activesupport (= 3.2.12)
|
23
|
-
arel (~> 3.0.2)
|
24
|
-
tzinfo (~> 0.3.29)
|
25
|
-
activeresource (3.2.12)
|
26
|
-
activemodel (= 3.2.12)
|
27
|
-
activesupport (= 3.2.12)
|
28
|
-
activesupport (3.2.12)
|
29
|
-
i18n (~> 0.6)
|
30
|
-
multi_json (~> 1.0)
|
31
|
-
arel (3.0.2)
|
32
|
-
builder (3.0.4)
|
33
|
-
erubis (2.7.0)
|
34
|
-
git (1.2.5)
|
35
|
-
hashr (0.0.22)
|
36
|
-
hike (1.2.1)
|
37
|
-
i18n (0.6.1)
|
38
|
-
jeweler (1.8.4)
|
39
|
-
bundler (~> 1.0)
|
40
|
-
git (>= 1.2.5)
|
41
|
-
rake
|
42
|
-
rdoc
|
43
|
-
journey (1.0.4)
|
44
|
-
json (1.7.6)
|
45
|
-
mail (2.4.4)
|
46
|
-
i18n (>= 0.4.0)
|
47
|
-
mime-types (~> 1.16)
|
48
|
-
treetop (~> 1.4.8)
|
49
|
-
mime-types (1.21)
|
50
|
-
multi_json (1.6.1)
|
51
|
-
polyglot (0.3.3)
|
52
|
-
rack (1.4.5)
|
53
|
-
rack-cache (1.2)
|
54
|
-
rack (>= 0.4)
|
55
|
-
rack-ssl (1.3.3)
|
56
|
-
rack
|
57
|
-
rack-test (0.6.2)
|
58
|
-
rack (>= 1.0)
|
59
|
-
rails (3.2.12)
|
60
|
-
actionmailer (= 3.2.12)
|
61
|
-
actionpack (= 3.2.12)
|
62
|
-
activerecord (= 3.2.12)
|
63
|
-
activeresource (= 3.2.12)
|
64
|
-
activesupport (= 3.2.12)
|
65
|
-
bundler (~> 1.0)
|
66
|
-
railties (= 3.2.12)
|
67
|
-
railties (3.2.12)
|
68
|
-
actionpack (= 3.2.12)
|
69
|
-
activesupport (= 3.2.12)
|
70
|
-
rack-ssl (~> 1.3.2)
|
71
|
-
rake (>= 0.8.7)
|
72
|
-
rdoc (~> 3.4)
|
73
|
-
thor (>= 0.14.6, < 2.0)
|
74
|
-
rake (10.0.3)
|
75
|
-
rdoc (3.12)
|
76
|
-
json (~> 1.4)
|
77
|
-
ruby-prof (0.12.1)
|
78
|
-
shoulda (2.11.3)
|
79
|
-
sprockets (2.2.2)
|
80
|
-
hike (~> 1.2)
|
81
|
-
multi_json (~> 1.0)
|
82
|
-
rack (~> 1.0)
|
83
|
-
tilt (~> 1.1, != 1.3.0)
|
84
|
-
sqlite3 (1.3.7)
|
85
|
-
thor (0.17.0)
|
86
|
-
tilt (1.3.3)
|
87
|
-
travis-lint (1.5.0)
|
88
|
-
hashr (~> 0.0.22)
|
89
|
-
treetop (1.4.12)
|
90
|
-
polyglot
|
91
|
-
polyglot (>= 0.3.1)
|
92
|
-
tzinfo (0.3.35)
|
93
|
-
|
94
|
-
PLATFORMS
|
95
|
-
ruby
|
96
|
-
|
97
|
-
DEPENDENCIES
|
98
|
-
jeweler (~> 1.8.4)
|
99
|
-
rails (>= 2.3.0)
|
100
|
-
rake (>= 0.8.3)
|
101
|
-
ruby-prof (>= 0.6.1)
|
102
|
-
shoulda (~> 2.11.0)
|
103
|
-
sqlite3 (~> 1.3.7)
|
104
|
-
travis-lint
|