health_check 1.4.4 → 1.5.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -85,9 +85,6 @@ matrix:
85
85
  - rvm: 1.9.3
86
86
  gemfile: test/rails_3.2.gemfile
87
87
 
88
- - rvm: ree
89
- gemfile: test/rails_3.2.gemfile
90
-
91
88
  - rvm: jruby-19mode
92
89
  gemfile: test/rails_3.2.gemfile
93
90
 
@@ -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 settings have been changed
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
 
@@ -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
@@ -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("database_migrations_custom")
50
- errors << HealthCheck::Utils.process_checks("email") unless HealthCheck::Utils.default_action_mailer_configuration?
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.default_action_mailer_configuration?
75
- ActionMailer::Base.delivery_method == :smtp && HealthCheck::Utils.default_smtp_settings == ActionMailer::Base.smtp_settings
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
@@ -1,4 +1,4 @@
1
1
  module HealthCheck
2
- VERSION = "1.4.4"
2
+ VERSION = "1.5.0"
3
3
  end
4
4
 
@@ -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.4
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-05-15 00:00:00.000000000 Z
12
+ date: 2014-08-08 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rails