health_monitor_lb 1.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.
Files changed (66) hide show
  1. checksums.yaml +7 -0
  2. data/README.md +78 -0
  3. data/Rakefile +8 -0
  4. data/app/controllers/health_monitor/application_controller.rb +11 -0
  5. data/app/controllers/health_monitor/health_controller.rb +13 -0
  6. data/app/services/health_monitor/health_check_service.rb +40 -0
  7. data/bin/rails +14 -0
  8. data/config/routes.rb +3 -0
  9. data/lib/health_monitor/engine.rb +5 -0
  10. data/lib/health_monitor/version.rb +3 -0
  11. data/lib/health_monitor.rb +11 -0
  12. data/lib/tasks/health_monitor_tasks.rake +4 -0
  13. data/spec/controllers/health_monitor/health_controller_spec.rb +40 -0
  14. data/spec/dummy/Rakefile +6 -0
  15. data/spec/dummy/app/assets/config/manifest.js +3 -0
  16. data/spec/dummy/app/assets/stylesheets/application.css +15 -0
  17. data/spec/dummy/app/channels/application_cable/channel.rb +4 -0
  18. data/spec/dummy/app/channels/application_cable/connection.rb +4 -0
  19. data/spec/dummy/app/controllers/application_controller.rb +2 -0
  20. data/spec/dummy/app/helpers/application_helper.rb +2 -0
  21. data/spec/dummy/app/javascript/packs/application.js +15 -0
  22. data/spec/dummy/app/jobs/application_job.rb +7 -0
  23. data/spec/dummy/app/mailers/application_mailer.rb +4 -0
  24. data/spec/dummy/app/models/application_record.rb +3 -0
  25. data/spec/dummy/app/views/layouts/application.html.erb +15 -0
  26. data/spec/dummy/app/views/layouts/mailer.html.erb +13 -0
  27. data/spec/dummy/app/views/layouts/mailer.text.erb +1 -0
  28. data/spec/dummy/bin/rails +4 -0
  29. data/spec/dummy/bin/rake +4 -0
  30. data/spec/dummy/bin/setup +33 -0
  31. data/spec/dummy/config/application.rb +22 -0
  32. data/spec/dummy/config/boot.rb +5 -0
  33. data/spec/dummy/config/cable.yml +10 -0
  34. data/spec/dummy/config/database.yml +2 -0
  35. data/spec/dummy/config/environment.rb +5 -0
  36. data/spec/dummy/config/environments/development.rb +76 -0
  37. data/spec/dummy/config/environments/production.rb +120 -0
  38. data/spec/dummy/config/environments/test.rb +59 -0
  39. data/spec/dummy/config/initializers/application_controller_renderer.rb +8 -0
  40. data/spec/dummy/config/initializers/assets.rb +12 -0
  41. data/spec/dummy/config/initializers/backtrace_silencers.rb +8 -0
  42. data/spec/dummy/config/initializers/content_security_policy.rb +28 -0
  43. data/spec/dummy/config/initializers/cookies_serializer.rb +5 -0
  44. data/spec/dummy/config/initializers/filter_parameter_logging.rb +6 -0
  45. data/spec/dummy/config/initializers/inflections.rb +16 -0
  46. data/spec/dummy/config/initializers/mime_types.rb +4 -0
  47. data/spec/dummy/config/initializers/permissions_policy.rb +11 -0
  48. data/spec/dummy/config/initializers/wrap_parameters.rb +14 -0
  49. data/spec/dummy/config/locales/en.yml +33 -0
  50. data/spec/dummy/config/puma.rb +43 -0
  51. data/spec/dummy/config/routes.rb +3 -0
  52. data/spec/dummy/config/storage.yml +34 -0
  53. data/spec/dummy/config.ru +6 -0
  54. data/spec/dummy/log/development.log +0 -0
  55. data/spec/dummy/log/test.log +184 -0
  56. data/spec/dummy/public/404.html +67 -0
  57. data/spec/dummy/public/422.html +67 -0
  58. data/spec/dummy/public/500.html +66 -0
  59. data/spec/dummy/public/apple-touch-icon-precomposed.png +0 -0
  60. data/spec/dummy/public/apple-touch-icon.png +0 -0
  61. data/spec/dummy/public/favicon.ico +0 -0
  62. data/spec/dummy/tmp/development_secret.txt +1 -0
  63. data/spec/health_monitor_spec.rb +8 -0
  64. data/spec/rails_helper.rb +1 -0
  65. data/spec/spec_helper.rb +31 -0
  66. metadata +178 -0
@@ -0,0 +1,67 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <title>The page you were looking for doesn't exist (404)</title>
5
+ <meta name="viewport" content="width=device-width,initial-scale=1">
6
+ <style>
7
+ .rails-default-error-page {
8
+ background-color: #EFEFEF;
9
+ color: #2E2F30;
10
+ text-align: center;
11
+ font-family: arial, sans-serif;
12
+ margin: 0;
13
+ }
14
+
15
+ .rails-default-error-page div.dialog {
16
+ width: 95%;
17
+ max-width: 33em;
18
+ margin: 4em auto 0;
19
+ }
20
+
21
+ .rails-default-error-page div.dialog > div {
22
+ border: 1px solid #CCC;
23
+ border-right-color: #999;
24
+ border-left-color: #999;
25
+ border-bottom-color: #BBB;
26
+ border-top: #B00100 solid 4px;
27
+ border-top-left-radius: 9px;
28
+ border-top-right-radius: 9px;
29
+ background-color: white;
30
+ padding: 7px 12% 0;
31
+ box-shadow: 0 3px 8px rgba(50, 50, 50, 0.17);
32
+ }
33
+
34
+ .rails-default-error-page h1 {
35
+ font-size: 100%;
36
+ color: #730E15;
37
+ line-height: 1.5em;
38
+ }
39
+
40
+ .rails-default-error-page div.dialog > p {
41
+ margin: 0 0 1em;
42
+ padding: 1em;
43
+ background-color: #F7F7F7;
44
+ border: 1px solid #CCC;
45
+ border-right-color: #999;
46
+ border-left-color: #999;
47
+ border-bottom-color: #999;
48
+ border-bottom-left-radius: 4px;
49
+ border-bottom-right-radius: 4px;
50
+ border-top-color: #DADADA;
51
+ color: #666;
52
+ box-shadow: 0 3px 8px rgba(50, 50, 50, 0.17);
53
+ }
54
+ </style>
55
+ </head>
56
+
57
+ <body class="rails-default-error-page">
58
+ <!-- This file lives in public/404.html -->
59
+ <div class="dialog">
60
+ <div>
61
+ <h1>The page you were looking for doesn't exist.</h1>
62
+ <p>You may have mistyped the address or the page may have moved.</p>
63
+ </div>
64
+ <p>If you are the application owner check the logs for more information.</p>
65
+ </div>
66
+ </body>
67
+ </html>
@@ -0,0 +1,67 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <title>The change you wanted was rejected (422)</title>
5
+ <meta name="viewport" content="width=device-width,initial-scale=1">
6
+ <style>
7
+ .rails-default-error-page {
8
+ background-color: #EFEFEF;
9
+ color: #2E2F30;
10
+ text-align: center;
11
+ font-family: arial, sans-serif;
12
+ margin: 0;
13
+ }
14
+
15
+ .rails-default-error-page div.dialog {
16
+ width: 95%;
17
+ max-width: 33em;
18
+ margin: 4em auto 0;
19
+ }
20
+
21
+ .rails-default-error-page div.dialog > div {
22
+ border: 1px solid #CCC;
23
+ border-right-color: #999;
24
+ border-left-color: #999;
25
+ border-bottom-color: #BBB;
26
+ border-top: #B00100 solid 4px;
27
+ border-top-left-radius: 9px;
28
+ border-top-right-radius: 9px;
29
+ background-color: white;
30
+ padding: 7px 12% 0;
31
+ box-shadow: 0 3px 8px rgba(50, 50, 50, 0.17);
32
+ }
33
+
34
+ .rails-default-error-page h1 {
35
+ font-size: 100%;
36
+ color: #730E15;
37
+ line-height: 1.5em;
38
+ }
39
+
40
+ .rails-default-error-page div.dialog > p {
41
+ margin: 0 0 1em;
42
+ padding: 1em;
43
+ background-color: #F7F7F7;
44
+ border: 1px solid #CCC;
45
+ border-right-color: #999;
46
+ border-left-color: #999;
47
+ border-bottom-color: #999;
48
+ border-bottom-left-radius: 4px;
49
+ border-bottom-right-radius: 4px;
50
+ border-top-color: #DADADA;
51
+ color: #666;
52
+ box-shadow: 0 3px 8px rgba(50, 50, 50, 0.17);
53
+ }
54
+ </style>
55
+ </head>
56
+
57
+ <body class="rails-default-error-page">
58
+ <!-- This file lives in public/422.html -->
59
+ <div class="dialog">
60
+ <div>
61
+ <h1>The change you wanted was rejected.</h1>
62
+ <p>Maybe you tried to change something you didn't have access to.</p>
63
+ </div>
64
+ <p>If you are the application owner check the logs for more information.</p>
65
+ </div>
66
+ </body>
67
+ </html>
@@ -0,0 +1,66 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <title>We're sorry, but something went wrong (500)</title>
5
+ <meta name="viewport" content="width=device-width,initial-scale=1">
6
+ <style>
7
+ .rails-default-error-page {
8
+ background-color: #EFEFEF;
9
+ color: #2E2F30;
10
+ text-align: center;
11
+ font-family: arial, sans-serif;
12
+ margin: 0;
13
+ }
14
+
15
+ .rails-default-error-page div.dialog {
16
+ width: 95%;
17
+ max-width: 33em;
18
+ margin: 4em auto 0;
19
+ }
20
+
21
+ .rails-default-error-page div.dialog > div {
22
+ border: 1px solid #CCC;
23
+ border-right-color: #999;
24
+ border-left-color: #999;
25
+ border-bottom-color: #BBB;
26
+ border-top: #B00100 solid 4px;
27
+ border-top-left-radius: 9px;
28
+ border-top-right-radius: 9px;
29
+ background-color: white;
30
+ padding: 7px 12% 0;
31
+ box-shadow: 0 3px 8px rgba(50, 50, 50, 0.17);
32
+ }
33
+
34
+ .rails-default-error-page h1 {
35
+ font-size: 100%;
36
+ color: #730E15;
37
+ line-height: 1.5em;
38
+ }
39
+
40
+ .rails-default-error-page div.dialog > p {
41
+ margin: 0 0 1em;
42
+ padding: 1em;
43
+ background-color: #F7F7F7;
44
+ border: 1px solid #CCC;
45
+ border-right-color: #999;
46
+ border-left-color: #999;
47
+ border-bottom-color: #999;
48
+ border-bottom-left-radius: 4px;
49
+ border-bottom-right-radius: 4px;
50
+ border-top-color: #DADADA;
51
+ color: #666;
52
+ box-shadow: 0 3px 8px rgba(50, 50, 50, 0.17);
53
+ }
54
+ </style>
55
+ </head>
56
+
57
+ <body class="rails-default-error-page">
58
+ <!-- This file lives in public/500.html -->
59
+ <div class="dialog">
60
+ <div>
61
+ <h1>We're sorry, but something went wrong.</h1>
62
+ </div>
63
+ <p>If you are the application owner check the logs for more information.</p>
64
+ </div>
65
+ </body>
66
+ </html>
File without changes
File without changes
@@ -0,0 +1 @@
1
+ f68b7ad872653516242d02c0df06f0a82260fe5815447c172989119038f93365a8b4a9893b60289c4902b8df7f9aaa60935f78b189da448fafd8d832b7196e3e
@@ -0,0 +1,8 @@
1
+ # frozen_string_literal: true
2
+ require "rails_helper"
3
+
4
+ RSpec.describe HealthMonitor do
5
+ it "has a version number" do
6
+ expect(HealthMonitor::VERSION).not_to be nil
7
+ end
8
+ end
@@ -0,0 +1 @@
1
+ require 'spec_helper'
@@ -0,0 +1,31 @@
1
+ # frozen_string_literal: true
2
+ ENV['RAILS_ENV'] ||= 'test'
3
+ ENV['RAILS_ENV'] = 'test' if ENV['RAILS_ENV'] == 'development' # AKA running rspec directly from the command line
4
+
5
+ require File.expand_path('../dummy/config/environment.rb', __FILE__)
6
+ require "action_controller/railtie"
7
+ require 'rspec/rails'
8
+ require 'nulldb_rspec'
9
+ include NullDB::RSpec::NullifiedDatabase
10
+
11
+ require "health_monitor"
12
+
13
+ RSpec.configure do |config|
14
+ # Enable flags like --only-failures and --next-failure
15
+ config.example_status_persistence_file_path = ".rspec_status"
16
+
17
+ # Disable RSpec exposing methods globally on `Module` and `main`
18
+ config.disable_monkey_patching!
19
+
20
+ config.expect_with :rspec do |c|
21
+ c.syntax = :expect
22
+ end
23
+
24
+ config.expose_dsl_globally = true
25
+
26
+ config.before(:suite) do
27
+ ENV['HEALTH_MONITOR_API_TOKEN'] = 'foobar'
28
+ end
29
+
30
+ config.include Rails.application.routes.url_helpers
31
+ end
metadata ADDED
@@ -0,0 +1,178 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: health_monitor_lb
3
+ version: !ruby/object:Gem::Version
4
+ version: 1.0.0
5
+ platform: ruby
6
+ authors:
7
+ - Alan Hecht
8
+ - Abe Petrillo
9
+ - Kevin Foster
10
+ bindir: bin
11
+ cert_chain: []
12
+ date: 2025-03-31 00:00:00.000000000 Z
13
+ dependencies:
14
+ - !ruby/object:Gem::Dependency
15
+ name: rails
16
+ requirement: !ruby/object:Gem::Requirement
17
+ requirements:
18
+ - - ">="
19
+ - !ruby/object:Gem::Version
20
+ version: '6.1'
21
+ type: :runtime
22
+ prerelease: false
23
+ version_requirements: !ruby/object:Gem::Requirement
24
+ requirements:
25
+ - - ">="
26
+ - !ruby/object:Gem::Version
27
+ version: '6.1'
28
+ - !ruby/object:Gem::Dependency
29
+ name: pg
30
+ requirement: !ruby/object:Gem::Requirement
31
+ requirements:
32
+ - - "~>"
33
+ - !ruby/object:Gem::Version
34
+ version: '1.2'
35
+ type: :runtime
36
+ prerelease: false
37
+ version_requirements: !ruby/object:Gem::Requirement
38
+ requirements:
39
+ - - "~>"
40
+ - !ruby/object:Gem::Version
41
+ version: '1.2'
42
+ - !ruby/object:Gem::Dependency
43
+ name: rspec-rails
44
+ requirement: !ruby/object:Gem::Requirement
45
+ requirements:
46
+ - - "~>"
47
+ - !ruby/object:Gem::Version
48
+ version: '6.1'
49
+ type: :development
50
+ prerelease: false
51
+ version_requirements: !ruby/object:Gem::Requirement
52
+ requirements:
53
+ - - "~>"
54
+ - !ruby/object:Gem::Version
55
+ version: '6.1'
56
+ - !ruby/object:Gem::Dependency
57
+ name: rspec-its
58
+ requirement: !ruby/object:Gem::Requirement
59
+ requirements:
60
+ - - ">="
61
+ - !ruby/object:Gem::Version
62
+ version: '0'
63
+ type: :development
64
+ prerelease: false
65
+ version_requirements: !ruby/object:Gem::Requirement
66
+ requirements:
67
+ - - ">="
68
+ - !ruby/object:Gem::Version
69
+ version: '0'
70
+ - !ruby/object:Gem::Dependency
71
+ name: activerecord-nulldb-adapter
72
+ requirement: !ruby/object:Gem::Requirement
73
+ requirements:
74
+ - - ">="
75
+ - !ruby/object:Gem::Version
76
+ version: '0'
77
+ type: :development
78
+ prerelease: false
79
+ version_requirements: !ruby/object:Gem::Requirement
80
+ requirements:
81
+ - - ">="
82
+ - !ruby/object:Gem::Version
83
+ version: '0'
84
+ description: Add a health check route to your Rails application for use with load
85
+ balancers.
86
+ email:
87
+ - alanghecht@gmail.com
88
+ - abe.petrillo@gmail.com
89
+ - finsync-gems@finsync.com
90
+ executables: []
91
+ extensions: []
92
+ extra_rdoc_files: []
93
+ files:
94
+ - README.md
95
+ - Rakefile
96
+ - app/controllers/health_monitor/application_controller.rb
97
+ - app/controllers/health_monitor/health_controller.rb
98
+ - app/services/health_monitor/health_check_service.rb
99
+ - bin/rails
100
+ - config/routes.rb
101
+ - lib/health_monitor.rb
102
+ - lib/health_monitor/engine.rb
103
+ - lib/health_monitor/version.rb
104
+ - lib/tasks/health_monitor_tasks.rake
105
+ - spec/controllers/health_monitor/health_controller_spec.rb
106
+ - spec/dummy/Rakefile
107
+ - spec/dummy/app/assets/config/manifest.js
108
+ - spec/dummy/app/assets/stylesheets/application.css
109
+ - spec/dummy/app/channels/application_cable/channel.rb
110
+ - spec/dummy/app/channels/application_cable/connection.rb
111
+ - spec/dummy/app/controllers/application_controller.rb
112
+ - spec/dummy/app/helpers/application_helper.rb
113
+ - spec/dummy/app/javascript/packs/application.js
114
+ - spec/dummy/app/jobs/application_job.rb
115
+ - spec/dummy/app/mailers/application_mailer.rb
116
+ - spec/dummy/app/models/application_record.rb
117
+ - spec/dummy/app/views/layouts/application.html.erb
118
+ - spec/dummy/app/views/layouts/mailer.html.erb
119
+ - spec/dummy/app/views/layouts/mailer.text.erb
120
+ - spec/dummy/bin/rails
121
+ - spec/dummy/bin/rake
122
+ - spec/dummy/bin/setup
123
+ - spec/dummy/config.ru
124
+ - spec/dummy/config/application.rb
125
+ - spec/dummy/config/boot.rb
126
+ - spec/dummy/config/cable.yml
127
+ - spec/dummy/config/database.yml
128
+ - spec/dummy/config/environment.rb
129
+ - spec/dummy/config/environments/development.rb
130
+ - spec/dummy/config/environments/production.rb
131
+ - spec/dummy/config/environments/test.rb
132
+ - spec/dummy/config/initializers/application_controller_renderer.rb
133
+ - spec/dummy/config/initializers/assets.rb
134
+ - spec/dummy/config/initializers/backtrace_silencers.rb
135
+ - spec/dummy/config/initializers/content_security_policy.rb
136
+ - spec/dummy/config/initializers/cookies_serializer.rb
137
+ - spec/dummy/config/initializers/filter_parameter_logging.rb
138
+ - spec/dummy/config/initializers/inflections.rb
139
+ - spec/dummy/config/initializers/mime_types.rb
140
+ - spec/dummy/config/initializers/permissions_policy.rb
141
+ - spec/dummy/config/initializers/wrap_parameters.rb
142
+ - spec/dummy/config/locales/en.yml
143
+ - spec/dummy/config/puma.rb
144
+ - spec/dummy/config/routes.rb
145
+ - spec/dummy/config/storage.yml
146
+ - spec/dummy/log/development.log
147
+ - spec/dummy/log/test.log
148
+ - spec/dummy/public/404.html
149
+ - spec/dummy/public/422.html
150
+ - spec/dummy/public/500.html
151
+ - spec/dummy/public/apple-touch-icon-precomposed.png
152
+ - spec/dummy/public/apple-touch-icon.png
153
+ - spec/dummy/public/favicon.ico
154
+ - spec/dummy/tmp/development_secret.txt
155
+ - spec/health_monitor_spec.rb
156
+ - spec/rails_helper.rb
157
+ - spec/spec_helper.rb
158
+ licenses:
159
+ - MIT
160
+ metadata: {}
161
+ rdoc_options: []
162
+ require_paths:
163
+ - lib
164
+ required_ruby_version: !ruby/object:Gem::Requirement
165
+ requirements:
166
+ - - ">="
167
+ - !ruby/object:Gem::Version
168
+ version: '0'
169
+ required_rubygems_version: !ruby/object:Gem::Requirement
170
+ requirements:
171
+ - - ">="
172
+ - !ruby/object:Gem::Version
173
+ version: '0'
174
+ requirements: []
175
+ rubygems_version: 3.6.6
176
+ specification_version: 4
177
+ summary: Add a health check route to your Rails application for use with load balancers.
178
+ test_files: []