health_check 1.4.4 → 1.5.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 +0 -3
- data/README.rdoc +4 -1
- data/lib/health_check.rb +2 -0
- data/lib/health_check/utils.rb +4 -4
- data/lib/health_check/version.rb +1 -1
- data/test/setup_railsapp +3 -0
- metadata +2 -2
data/.travis.yml
CHANGED
data/README.rdoc
CHANGED
@@ -28,7 +28,7 @@ The health_check controller disables sessions for versions that eagerly load ses
|
|
28
28
|
|
29
29
|
== Checks
|
30
30
|
|
31
|
-
* standard (default) - site, database and migrations checks are run plus email if
|
31
|
+
* standard (default) - site, database and migrations checks are run plus email if ActionMailer is defined and it is not using the default configuration
|
32
32
|
* all / full - all checks are run (can be overriden in config block)
|
33
33
|
* database - checks that the current migration level can be read from the database
|
34
34
|
* email - basic check of email - :test returns true, :sendmail checks file is present and executable, :smtp sends HELO command to server and checks response
|
@@ -100,6 +100,9 @@ To change the configuration of health_check, create a file `config/initializers/
|
|
100
100
|
|
101
101
|
config.http_status_for_error_object = 500
|
102
102
|
|
103
|
+
# You can customize which checks happen on a standard health check
|
104
|
+
config.standard_checks = [ 'database', 'migrations', 'custom' ]
|
105
|
+
|
103
106
|
# You can set what tests are run with the 'full' or 'all' parameter
|
104
107
|
config.full_checks = ['database', 'migrations', 'custom', 'email', 'cache']
|
105
108
|
|
data/lib/health_check.rb
CHANGED
@@ -28,8 +28,10 @@ module HealthCheck
|
|
28
28
|
# Array of custom check blocks
|
29
29
|
mattr_accessor :custom_checks
|
30
30
|
mattr_accessor :full_checks
|
31
|
+
mattr_accessor :standard_checks
|
31
32
|
self.custom_checks = [ ]
|
32
33
|
self.full_checks = ['database', 'migrations', 'custom', 'email', 'cache']
|
34
|
+
self.standard_checks = [ 'database', 'migrations', 'custom' ]
|
33
35
|
|
34
36
|
def self.add_custom_check(&block)
|
35
37
|
custom_checks << block
|
data/lib/health_check/utils.rb
CHANGED
@@ -46,8 +46,8 @@ module HealthCheck
|
|
46
46
|
when 'cache'
|
47
47
|
errors << HealthCheck::Utils.check_cache
|
48
48
|
when "standard"
|
49
|
-
errors << HealthCheck::Utils.process_checks(
|
50
|
-
errors << HealthCheck::Utils.process_checks("email")
|
49
|
+
errors << HealthCheck::Utils.process_checks(HealthCheck.standard_checks.join('_'))
|
50
|
+
errors << HealthCheck::Utils.process_checks("email") if HealthCheck::Utils.mailer_configured?
|
51
51
|
when "custom"
|
52
52
|
HealthCheck.custom_checks.each do |custom_check|
|
53
53
|
errors << custom_check.call(self)
|
@@ -71,8 +71,8 @@ module HealthCheck
|
|
71
71
|
@@db_migrate_path = value
|
72
72
|
end
|
73
73
|
|
74
|
-
def self.
|
75
|
-
ActionMailer::Base.delivery_method
|
74
|
+
def self.mailer_configured?
|
75
|
+
defined?(ActionMailer::Base) && (ActionMailer::Base.delivery_method != :smtp || HealthCheck::Utils.default_smtp_settings != ActionMailer::Base.smtp_settings)
|
76
76
|
end
|
77
77
|
|
78
78
|
def self.get_database_version
|
data/lib/health_check/version.rb
CHANGED
data/test/setup_railsapp
CHANGED
@@ -164,6 +164,9 @@ then
|
|
164
164
|
echo ================= Gemfile ===================
|
165
165
|
cat Gemfile
|
166
166
|
echo
|
167
|
+
echo ================= Gemfile.lock ===================
|
168
|
+
cat Gemfile.lock
|
169
|
+
echo
|
167
170
|
else
|
168
171
|
dest=$railsapp/vendor/plugins/health_check
|
169
172
|
echo Installing health_check as plugin in $dest ...
|
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: 1.
|
4
|
+
version: 1.5.0
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2014-
|
12
|
+
date: 2014-08-08 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rails
|