raygun4ruby 3.2.6 → 4.0.0.pre

Sign up to get free protection for your applications and to get access to all the features.
Files changed (232) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/tests.yml +48 -0
  3. data/.gitignore +22 -21
  4. data/.rspec +1 -1
  5. data/Appraisals +19 -0
  6. data/CHANGELOG.md +169 -133
  7. data/Gemfile +4 -4
  8. data/LICENSE.txt +22 -22
  9. data/README.md +424 -420
  10. data/Rakefile +32 -27
  11. data/examples/sinatras_raygun.rb +17 -17
  12. data/gemfiles/rails_6.gemfile +9 -0
  13. data/gemfiles/rails_7.gemfile +10 -0
  14. data/gemfiles/rails_7_sidekiq_6.gemfile +10 -0
  15. data/lib/generators/raygun/install_generator.rb +26 -26
  16. data/lib/raygun/affected_user.rb +59 -59
  17. data/lib/raygun/breadcrumbs/breadcrumb.rb +34 -34
  18. data/lib/raygun/breadcrumbs/store.rb +86 -86
  19. data/lib/raygun/breadcrumbs.rb +34 -34
  20. data/lib/raygun/client.rb +313 -308
  21. data/lib/raygun/configuration.rb +197 -194
  22. data/lib/raygun/demo_exception.rb +22 -22
  23. data/lib/raygun/error.rb +10 -10
  24. data/lib/raygun/error_subscriber.rb +21 -0
  25. data/lib/raygun/javascript_tracker.rb +42 -42
  26. data/lib/raygun/middleware/breadcrumbs_store_initializer.rb +19 -19
  27. data/lib/raygun/middleware/javascript_exception_tracking.rb +40 -32
  28. data/lib/raygun/middleware/rack_exception_interceptor.rb +18 -18
  29. data/lib/raygun/middleware/rails_insert_affected_user.rb +26 -26
  30. data/lib/raygun/railtie.rb +47 -39
  31. data/lib/raygun/services/apply_whitelist_filter_to_payload.rb +27 -27
  32. data/lib/raygun/sidekiq.rb +51 -71
  33. data/lib/raygun/version.rb +3 -3
  34. data/lib/raygun.rb +197 -179
  35. data/lib/raygun4ruby.rb +1 -1
  36. data/lib/resque/failure/raygun.rb +25 -25
  37. data/lib/tasks/raygun.tasks +7 -7
  38. data/raygun4ruby.gemspec +43 -45
  39. data/spec/features/javascript_spec.rb +48 -48
  40. data/spec/rails_applications/6.1.4/Gemfile +56 -0
  41. data/spec/{dummy/README.rdoc → rails_applications/6.1.4/README.md} +24 -28
  42. data/spec/{dummy → rails_applications/6.1.4}/Rakefile +6 -6
  43. data/spec/rails_applications/6.1.4/app/assets/config/manifest.js +2 -0
  44. data/spec/{dummy → rails_applications/6.1.4}/app/assets/images/.keep +0 -0
  45. data/spec/{dummy → rails_applications/6.1.4}/app/assets/stylesheets/application.css +15 -15
  46. data/spec/rails_applications/6.1.4/app/channels/application_cable/channel.rb +4 -0
  47. data/spec/rails_applications/6.1.4/app/channels/application_cable/connection.rb +4 -0
  48. data/spec/rails_applications/6.1.4/app/controllers/application_controller.rb +2 -0
  49. data/spec/{dummy → rails_applications/6.1.4}/app/controllers/concerns/.keep +0 -0
  50. data/spec/{dummy → rails_applications/6.1.4}/app/controllers/home_controller.rb +4 -4
  51. data/spec/{dummy → rails_applications/6.1.4}/app/helpers/application_helper.rb +2 -2
  52. data/spec/rails_applications/6.1.4/app/javascript/channels/consumer.js +6 -0
  53. data/spec/rails_applications/6.1.4/app/javascript/channels/index.js +5 -0
  54. data/spec/rails_applications/6.1.4/app/javascript/packs/application.js +13 -0
  55. data/spec/rails_applications/6.1.4/app/jobs/application_job.rb +7 -0
  56. data/spec/rails_applications/6.1.4/app/mailers/application_mailer.rb +4 -0
  57. data/spec/rails_applications/6.1.4/app/models/application_record.rb +3 -0
  58. data/spec/{dummy/app/mailers → rails_applications/6.1.4/app/models/concerns}/.keep +0 -0
  59. data/spec/{dummy → rails_applications/6.1.4}/app/views/home/index.html.erb +3 -3
  60. data/spec/{dummy → rails_applications/6.1.4}/app/views/home/index.json.erb +1 -1
  61. data/spec/rails_applications/6.1.4/app/views/layouts/application.html.erb +13 -0
  62. data/spec/rails_applications/6.1.4/app/views/layouts/mailer.html.erb +13 -0
  63. data/spec/rails_applications/6.1.4/app/views/layouts/mailer.text.erb +1 -0
  64. data/spec/rails_applications/6.1.4/bin/rails +5 -0
  65. data/spec/rails_applications/6.1.4/bin/rake +5 -0
  66. data/spec/rails_applications/6.1.4/bin/setup +36 -0
  67. data/spec/rails_applications/6.1.4/bin/spring +14 -0
  68. data/spec/rails_applications/6.1.4/bin/yarn +17 -0
  69. data/spec/rails_applications/6.1.4/config/application.rb +22 -0
  70. data/spec/rails_applications/6.1.4/config/boot.rb +3 -0
  71. data/spec/rails_applications/6.1.4/config/cable.yml +10 -0
  72. data/spec/rails_applications/6.1.4/config/credentials.yml.enc +1 -0
  73. data/spec/{dummy → rails_applications/6.1.4}/config/database.yml +25 -25
  74. data/spec/{dummy → rails_applications/6.1.4}/config/environment.rb +5 -5
  75. data/spec/rails_applications/6.1.4/config/environments/development.rb +76 -0
  76. data/spec/rails_applications/6.1.4/config/environments/production.rb +120 -0
  77. data/spec/rails_applications/6.1.4/config/environments/test.rb +60 -0
  78. data/spec/rails_applications/6.1.4/config/initializers/application_controller_renderer.rb +8 -0
  79. data/spec/rails_applications/6.1.4/config/initializers/assets.rb +14 -0
  80. data/spec/rails_applications/6.1.4/config/initializers/backtrace_silencers.rb +8 -0
  81. data/spec/rails_applications/6.1.4/config/initializers/content_security_policy.rb +30 -0
  82. data/spec/{dummy → rails_applications/6.1.4}/config/initializers/cookies_serializer.rb +5 -3
  83. data/spec/{dummy → rails_applications/6.1.4}/config/initializers/filter_parameter_logging.rb +6 -4
  84. data/spec/{dummy → rails_applications/6.1.4}/config/initializers/inflections.rb +16 -16
  85. data/spec/{dummy → rails_applications/6.1.4}/config/initializers/mime_types.rb +4 -4
  86. data/spec/rails_applications/6.1.4/config/initializers/permissions_policy.rb +11 -0
  87. data/spec/{dummy → rails_applications/6.1.4}/config/initializers/wrap_parameters.rb +14 -14
  88. data/spec/{dummy → rails_applications/6.1.4}/config/locales/en.yml +33 -23
  89. data/spec/rails_applications/6.1.4/config/master.key +1 -0
  90. data/spec/rails_applications/6.1.4/config/puma.rb +43 -0
  91. data/spec/rails_applications/6.1.4/config/routes.rb +4 -0
  92. data/spec/rails_applications/6.1.4/config/spring.rb +6 -0
  93. data/spec/rails_applications/6.1.4/config/storage.yml +34 -0
  94. data/spec/{dummy → rails_applications/6.1.4}/config.ru +6 -4
  95. data/spec/rails_applications/6.1.4/db/seeds.rb +7 -0
  96. data/spec/{dummy → rails_applications/6.1.4}/db/test.sqlite3 +0 -0
  97. data/spec/{dummy/app/models → rails_applications/6.1.4/lib/assets}/.keep +0 -0
  98. data/spec/{dummy/app/models/concerns → rails_applications/6.1.4/lib/tasks}/.keep +0 -0
  99. data/spec/rails_applications/6.1.4/package.json +11 -0
  100. data/spec/{dummy → rails_applications/6.1.4}/public/404.html +67 -67
  101. data/spec/{dummy → rails_applications/6.1.4}/public/422.html +67 -67
  102. data/spec/{dummy → rails_applications/6.1.4}/public/500.html +66 -66
  103. data/spec/{dummy/lib/assets/.keep → rails_applications/6.1.4/public/apple-touch-icon-precomposed.png} +0 -0
  104. data/spec/{dummy/lib/tasks/.keep → rails_applications/6.1.4/public/apple-touch-icon.png} +0 -0
  105. data/spec/{dummy → rails_applications/6.1.4}/public/favicon.ico +0 -0
  106. data/spec/rails_applications/6.1.4/public/robots.txt +1 -0
  107. data/spec/{dummy/log → rails_applications/6.1.4/storage}/.keep +0 -0
  108. data/spec/rails_applications/7.1.3/.dockerignore +37 -0
  109. data/spec/rails_applications/7.1.3/.gitattributes +9 -0
  110. data/spec/rails_applications/7.1.3/.gitignore +35 -0
  111. data/spec/rails_applications/7.1.3/.ruby-version +1 -0
  112. data/spec/rails_applications/7.1.3/Dockerfile +62 -0
  113. data/spec/rails_applications/7.1.3/Gemfile +67 -0
  114. data/spec/rails_applications/7.1.3/README.md +24 -0
  115. data/spec/rails_applications/7.1.3/Rakefile +6 -0
  116. data/spec/rails_applications/7.1.3/app/assets/config/manifest.js +4 -0
  117. data/spec/{dummy/test/controllers → rails_applications/7.1.3/app/assets/images}/.keep +0 -0
  118. data/spec/rails_applications/7.1.3/app/assets/stylesheets/application.css +15 -0
  119. data/spec/rails_applications/7.1.3/app/channels/application_cable/channel.rb +4 -0
  120. data/spec/rails_applications/7.1.3/app/channels/application_cable/connection.rb +4 -0
  121. data/spec/rails_applications/7.1.3/app/controllers/application_controller.rb +2 -0
  122. data/spec/{dummy/test/fixtures → rails_applications/7.1.3/app/controllers/concerns}/.keep +0 -0
  123. data/spec/rails_applications/7.1.3/app/controllers/home_controller.rb +2 -0
  124. data/spec/rails_applications/7.1.3/app/helpers/application_helper.rb +2 -0
  125. data/spec/rails_applications/7.1.3/app/helpers/home_helper.rb +2 -0
  126. data/spec/rails_applications/7.1.3/app/javascript/application.js +3 -0
  127. data/spec/rails_applications/7.1.3/app/javascript/controllers/application.js +9 -0
  128. data/spec/rails_applications/7.1.3/app/javascript/controllers/hello_controller.js +7 -0
  129. data/spec/rails_applications/7.1.3/app/javascript/controllers/index.js +11 -0
  130. data/spec/rails_applications/7.1.3/app/jobs/application_job.rb +7 -0
  131. data/spec/rails_applications/7.1.3/app/mailers/application_mailer.rb +4 -0
  132. data/spec/rails_applications/7.1.3/app/models/application_record.rb +3 -0
  133. data/spec/{dummy/test/helpers → rails_applications/7.1.3/app/models/concerns}/.keep +0 -0
  134. data/spec/rails_applications/7.1.3/app/views/home/index.html.erb +3 -0
  135. data/spec/rails_applications/7.1.3/app/views/home/index.json.erb +1 -0
  136. data/spec/rails_applications/7.1.3/app/views/layouts/application.html.erb +16 -0
  137. data/spec/rails_applications/7.1.3/app/views/layouts/mailer.html.erb +13 -0
  138. data/spec/rails_applications/7.1.3/app/views/layouts/mailer.text.erb +1 -0
  139. data/spec/rails_applications/7.1.3/bin/bundle +109 -0
  140. data/spec/rails_applications/7.1.3/bin/docker-entrypoint +8 -0
  141. data/spec/rails_applications/7.1.3/bin/importmap +4 -0
  142. data/spec/rails_applications/7.1.3/bin/rails +4 -0
  143. data/spec/rails_applications/7.1.3/bin/rake +4 -0
  144. data/spec/rails_applications/7.1.3/bin/setup +33 -0
  145. data/spec/rails_applications/7.1.3/config/application.rb +27 -0
  146. data/spec/rails_applications/7.1.3/config/boot.rb +4 -0
  147. data/spec/rails_applications/7.1.3/config/cable.yml +11 -0
  148. data/spec/rails_applications/7.1.3/config/credentials.yml.enc +1 -0
  149. data/spec/rails_applications/7.1.3/config/database.yml +25 -0
  150. data/spec/rails_applications/7.1.3/config/environment.rb +5 -0
  151. data/spec/rails_applications/7.1.3/config/environments/development.rb +76 -0
  152. data/spec/rails_applications/7.1.3/config/environments/production.rb +97 -0
  153. data/spec/rails_applications/7.1.3/config/environments/test.rb +64 -0
  154. data/spec/rails_applications/7.1.3/config/importmap.rb +7 -0
  155. data/spec/rails_applications/7.1.3/config/initializers/assets.rb +12 -0
  156. data/spec/rails_applications/7.1.3/config/initializers/content_security_policy.rb +25 -0
  157. data/spec/rails_applications/7.1.3/config/initializers/filter_parameter_logging.rb +8 -0
  158. data/spec/rails_applications/7.1.3/config/initializers/inflections.rb +16 -0
  159. data/spec/rails_applications/7.1.3/config/initializers/permissions_policy.rb +13 -0
  160. data/spec/rails_applications/7.1.3/config/locales/en.yml +31 -0
  161. data/spec/rails_applications/7.1.3/config/puma.rb +35 -0
  162. data/spec/rails_applications/7.1.3/config/routes.rb +11 -0
  163. data/spec/rails_applications/7.1.3/config/storage.yml +34 -0
  164. data/spec/rails_applications/7.1.3/config.ru +6 -0
  165. data/spec/rails_applications/7.1.3/db/seeds.rb +9 -0
  166. data/spec/{dummy/test/integration → rails_applications/7.1.3/lib/assets}/.keep +0 -0
  167. data/spec/{dummy/test/mailers → rails_applications/7.1.3/lib/tasks}/.keep +0 -0
  168. data/spec/rails_applications/7.1.3/public/404.html +67 -0
  169. data/spec/rails_applications/7.1.3/public/422.html +67 -0
  170. data/spec/rails_applications/7.1.3/public/500.html +66 -0
  171. data/spec/{dummy/test/models/.keep → rails_applications/7.1.3/public/apple-touch-icon-precomposed.png} +0 -0
  172. data/spec/{dummy/vendor/assets/javascripts/.keep → rails_applications/7.1.3/public/apple-touch-icon.png} +0 -0
  173. data/spec/{dummy/vendor/assets/stylesheets/.keep → rails_applications/7.1.3/public/favicon.ico} +0 -0
  174. data/spec/rails_applications/7.1.3/public/robots.txt +1 -0
  175. data/spec/rails_applications/7.1.3/storage/.keep +0 -0
  176. data/spec/rails_applications/7.1.3/test/application_system_test_case.rb +5 -0
  177. data/spec/rails_applications/7.1.3/test/channels/application_cable/connection_test.rb +13 -0
  178. data/spec/rails_applications/7.1.3/test/controllers/.keep +0 -0
  179. data/spec/rails_applications/7.1.3/test/controllers/home_controller_test.rb +7 -0
  180. data/spec/rails_applications/7.1.3/test/fixtures/files/.keep +0 -0
  181. data/spec/rails_applications/7.1.3/test/helpers/.keep +0 -0
  182. data/spec/rails_applications/7.1.3/test/integration/.keep +0 -0
  183. data/spec/rails_applications/7.1.3/test/mailers/.keep +0 -0
  184. data/spec/rails_applications/7.1.3/test/models/.keep +0 -0
  185. data/spec/rails_applications/7.1.3/test/system/.keep +0 -0
  186. data/spec/rails_applications/7.1.3/test/test_helper.rb +15 -0
  187. data/spec/rails_applications/7.1.3/vendor/.keep +0 -0
  188. data/spec/rails_applications/7.1.3/vendor/javascript/.keep +0 -0
  189. data/spec/rails_helper.rb +8 -4
  190. data/spec/raygun/breadcrumbs/breadcrumb_spec.rb +171 -171
  191. data/spec/raygun/breadcrumbs/store_spec.rb +170 -170
  192. data/spec/services/apply_whitelist_filter_to_payload_spec.rb +251 -251
  193. data/spec/spec_helper.rb +24 -24
  194. data/spec/support/fake_logger.rb +17 -17
  195. data/test/integration/client_test.rb +19 -19
  196. data/test/rails_helper.rb +6 -0
  197. data/test/test_helper.rb +76 -72
  198. data/test/unit/affected_user_test.rb +136 -136
  199. data/test/unit/client_test.rb +812 -812
  200. data/test/unit/configuration_test.rb +202 -206
  201. data/test/unit/error_subscriber_test.rb +43 -0
  202. data/test/unit/raygun_test.rb +106 -25
  203. data/test/unit/resque_failure_test.rb +27 -24
  204. data/test/unit/sidekiq_failure_test.rb +42 -32
  205. metadata +186 -125
  206. data/.travis.yml +0 -20
  207. data/spec/dummy/.gitignore +0 -17
  208. data/spec/dummy/Gemfile +0 -47
  209. data/spec/dummy/app/assets/config/manifest.js +0 -3
  210. data/spec/dummy/app/assets/javascripts/application.js +0 -13
  211. data/spec/dummy/app/controllers/application_controller.rb +0 -5
  212. data/spec/dummy/app/views/layouts/application.html.erb +0 -14
  213. data/spec/dummy/bin/bundle +0 -3
  214. data/spec/dummy/bin/rails +0 -9
  215. data/spec/dummy/bin/rake +0 -9
  216. data/spec/dummy/bin/setup +0 -29
  217. data/spec/dummy/bin/spring +0 -17
  218. data/spec/dummy/config/application.rb +0 -26
  219. data/spec/dummy/config/boot.rb +0 -3
  220. data/spec/dummy/config/environments/development.rb +0 -41
  221. data/spec/dummy/config/environments/production.rb +0 -79
  222. data/spec/dummy/config/environments/test.rb +0 -42
  223. data/spec/dummy/config/initializers/assets.rb +0 -11
  224. data/spec/dummy/config/initializers/backtrace_silencers.rb +0 -7
  225. data/spec/dummy/config/initializers/session_store.rb +0 -3
  226. data/spec/dummy/config/initializers/to_time_preserves_timezone.rb +0 -10
  227. data/spec/dummy/config/routes.rb +0 -58
  228. data/spec/dummy/config/secrets.yml +0 -22
  229. data/spec/dummy/db/seeds.rb +0 -7
  230. data/spec/dummy/public/robots.txt +0 -5
  231. data/spec/dummy/test/test_helper.rb +0 -10
  232. data/spec/raygun/raygun_spec.rb +0 -47
@@ -0,0 +1,15 @@
1
+ /*
2
+ * This is a manifest file that'll be compiled into application.css, which will include all the files
3
+ * listed below.
4
+ *
5
+ * Any CSS (and SCSS, if configured) file within this directory, lib/assets/stylesheets, or any plugin's
6
+ * vendor/assets/stylesheets directory can be referenced here using a relative path.
7
+ *
8
+ * You're free to add application-wide styles to this file and they'll appear at the bottom of the
9
+ * compiled file so the styles you add here take precedence over styles defined in any other CSS
10
+ * files in this directory. Styles in this file should be added after the last require_* statement.
11
+ * It is generally better to create a new file per style scope.
12
+ *
13
+ *= require_tree .
14
+ *= require_self
15
+ */
@@ -0,0 +1,4 @@
1
+ module ApplicationCable
2
+ class Channel < ActionCable::Channel::Base
3
+ end
4
+ end
@@ -0,0 +1,4 @@
1
+ module ApplicationCable
2
+ class Connection < ActionCable::Connection::Base
3
+ end
4
+ end
@@ -0,0 +1,2 @@
1
+ class ApplicationController < ActionController::Base
2
+ end
@@ -0,0 +1,2 @@
1
+ class HomeController < ApplicationController
2
+ end
@@ -0,0 +1,2 @@
1
+ module ApplicationHelper
2
+ end
@@ -0,0 +1,2 @@
1
+ module HomeHelper
2
+ end
@@ -0,0 +1,3 @@
1
+ // Configure your import map in config/importmap.rb. Read more: https://github.com/rails/importmap-rails
2
+ import "@hotwired/turbo-rails"
3
+ import "controllers"
@@ -0,0 +1,9 @@
1
+ import { Application } from "@hotwired/stimulus"
2
+
3
+ const application = Application.start()
4
+
5
+ // Configure Stimulus development experience
6
+ application.debug = false
7
+ window.Stimulus = application
8
+
9
+ export { application }
@@ -0,0 +1,7 @@
1
+ import { Controller } from "@hotwired/stimulus"
2
+
3
+ export default class extends Controller {
4
+ connect() {
5
+ this.element.textContent = "Hello World!"
6
+ }
7
+ }
@@ -0,0 +1,11 @@
1
+ // Import and register all your controllers from the importmap under controllers/*
2
+
3
+ import { application } from "controllers/application"
4
+
5
+ // Eager load all controllers defined in the import map under controllers/**/*_controller
6
+ import { eagerLoadControllersFrom } from "@hotwired/stimulus-loading"
7
+ eagerLoadControllersFrom("controllers", application)
8
+
9
+ // Lazy load controllers as they appear in the DOM (remember not to preload controllers in import map!)
10
+ // import { lazyLoadControllersFrom } from "@hotwired/stimulus-loading"
11
+ // lazyLoadControllersFrom("controllers", application)
@@ -0,0 +1,7 @@
1
+ class ApplicationJob < ActiveJob::Base
2
+ # Automatically retry jobs that encountered a deadlock
3
+ # retry_on ActiveRecord::Deadlocked
4
+
5
+ # Most jobs are safe to ignore if the underlying records are no longer available
6
+ # discard_on ActiveJob::DeserializationError
7
+ end
@@ -0,0 +1,4 @@
1
+ class ApplicationMailer < ActionMailer::Base
2
+ default from: "from@example.com"
3
+ layout "mailer"
4
+ end
@@ -0,0 +1,3 @@
1
+ class ApplicationRecord < ActiveRecord::Base
2
+ primary_abstract_class
3
+ end
@@ -0,0 +1,3 @@
1
+ <h1>Home#index</h1>
2
+ <p>Find me in app/views/home/index.html.erb</p>
3
+ <p><%= Raygun.configuration.js_api_key %></p>
@@ -0,0 +1,16 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <title>Dummy</title>
5
+ <meta name="viewport" content="width=device-width,initial-scale=1">
6
+ <%= csrf_meta_tags %>
7
+ <%= csp_meta_tag %>
8
+
9
+ <%= stylesheet_link_tag "application", "data-turbo-track": "reload" %>
10
+ <%= javascript_importmap_tags %>
11
+ </head>
12
+
13
+ <body>
14
+ <%= yield %>
15
+ </body>
16
+ </html>
@@ -0,0 +1,13 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
5
+ <style>
6
+ /* Email styles need to be inline */
7
+ </style>
8
+ </head>
9
+
10
+ <body>
11
+ <%= yield %>
12
+ </body>
13
+ </html>
@@ -0,0 +1,109 @@
1
+ #!/usr/bin/env ruby
2
+ # frozen_string_literal: true
3
+
4
+ #
5
+ # This file was generated by Bundler.
6
+ #
7
+ # The application 'bundle' is installed as part of a gem, and
8
+ # this file is here to facilitate running it.
9
+ #
10
+
11
+ require "rubygems"
12
+
13
+ m = Module.new do
14
+ module_function
15
+
16
+ def invoked_as_script?
17
+ File.expand_path($0) == File.expand_path(__FILE__)
18
+ end
19
+
20
+ def env_var_version
21
+ ENV["BUNDLER_VERSION"]
22
+ end
23
+
24
+ def cli_arg_version
25
+ return unless invoked_as_script? # don't want to hijack other binstubs
26
+ return unless "update".start_with?(ARGV.first || " ") # must be running `bundle update`
27
+ bundler_version = nil
28
+ update_index = nil
29
+ ARGV.each_with_index do |a, i|
30
+ if update_index && update_index.succ == i && a.match?(Gem::Version::ANCHORED_VERSION_PATTERN)
31
+ bundler_version = a
32
+ end
33
+ next unless a =~ /\A--bundler(?:[= ](#{Gem::Version::VERSION_PATTERN}))?\z/
34
+ bundler_version = $1
35
+ update_index = i
36
+ end
37
+ bundler_version
38
+ end
39
+
40
+ def gemfile
41
+ gemfile = ENV["BUNDLE_GEMFILE"]
42
+ return gemfile if gemfile && !gemfile.empty?
43
+
44
+ File.expand_path("../Gemfile", __dir__)
45
+ end
46
+
47
+ def lockfile
48
+ lockfile =
49
+ case File.basename(gemfile)
50
+ when "gems.rb" then gemfile.sub(/\.rb$/, ".locked")
51
+ else "#{gemfile}.lock"
52
+ end
53
+ File.expand_path(lockfile)
54
+ end
55
+
56
+ def lockfile_version
57
+ return unless File.file?(lockfile)
58
+ lockfile_contents = File.read(lockfile)
59
+ return unless lockfile_contents =~ /\n\nBUNDLED WITH\n\s{2,}(#{Gem::Version::VERSION_PATTERN})\n/
60
+ Regexp.last_match(1)
61
+ end
62
+
63
+ def bundler_requirement
64
+ @bundler_requirement ||=
65
+ env_var_version ||
66
+ cli_arg_version ||
67
+ bundler_requirement_for(lockfile_version)
68
+ end
69
+
70
+ def bundler_requirement_for(version)
71
+ return "#{Gem::Requirement.default}.a" unless version
72
+
73
+ bundler_gem_version = Gem::Version.new(version)
74
+
75
+ bundler_gem_version.approximate_recommendation
76
+ end
77
+
78
+ def load_bundler!
79
+ ENV["BUNDLE_GEMFILE"] ||= gemfile
80
+
81
+ activate_bundler
82
+ end
83
+
84
+ def activate_bundler
85
+ gem_error = activation_error_handling do
86
+ gem "bundler", bundler_requirement
87
+ end
88
+ return if gem_error.nil?
89
+ require_error = activation_error_handling do
90
+ require "bundler/version"
91
+ end
92
+ return if require_error.nil? && Gem::Requirement.new(bundler_requirement).satisfied_by?(Gem::Version.new(Bundler::VERSION))
93
+ warn "Activating bundler (#{bundler_requirement}) failed:\n#{gem_error.message}\n\nTo install the version of bundler this project requires, run `gem install bundler -v '#{bundler_requirement}'`"
94
+ exit 42
95
+ end
96
+
97
+ def activation_error_handling
98
+ yield
99
+ nil
100
+ rescue StandardError, LoadError => e
101
+ e
102
+ end
103
+ end
104
+
105
+ m.load_bundler!
106
+
107
+ if m.invoked_as_script?
108
+ load Gem.bin_path("bundler", "bundle")
109
+ end
@@ -0,0 +1,8 @@
1
+ #!/bin/bash -e
2
+
3
+ # If running the rails server then create or migrate existing database
4
+ if [ "${1}" == "./bin/rails" ] && [ "${2}" == "server" ]; then
5
+ ./bin/rails db:prepare
6
+ fi
7
+
8
+ exec "${@}"
@@ -0,0 +1,4 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require_relative "../config/application"
4
+ require "importmap/commands"
@@ -0,0 +1,4 @@
1
+ #!/usr/bin/env ruby
2
+ APP_PATH = File.expand_path("../config/application", __dir__)
3
+ require_relative "../config/boot"
4
+ require "rails/commands"
@@ -0,0 +1,4 @@
1
+ #!/usr/bin/env ruby
2
+ require_relative "../config/boot"
3
+ require "rake"
4
+ Rake.application.run
@@ -0,0 +1,33 @@
1
+ #!/usr/bin/env ruby
2
+ require "fileutils"
3
+
4
+ # path to your application root.
5
+ APP_ROOT = File.expand_path("..", __dir__)
6
+
7
+ def system!(*args)
8
+ system(*args, exception: true)
9
+ end
10
+
11
+ FileUtils.chdir APP_ROOT do
12
+ # This script is a way to set up or update your development environment automatically.
13
+ # This script is idempotent, so that you can run it at any time and get an expectable outcome.
14
+ # Add necessary setup steps to this file.
15
+
16
+ puts "== Installing dependencies =="
17
+ system! "gem install bundler --conservative"
18
+ system("bundle check") || system!("bundle install")
19
+
20
+ # puts "\n== Copying sample files =="
21
+ # unless File.exist?("config/database.yml")
22
+ # FileUtils.cp "config/database.yml.sample", "config/database.yml"
23
+ # end
24
+
25
+ puts "\n== Preparing database =="
26
+ system! "bin/rails db:prepare"
27
+
28
+ puts "\n== Removing old logs and tempfiles =="
29
+ system! "bin/rails log:clear tmp:clear"
30
+
31
+ puts "\n== Restarting application server =="
32
+ system! "bin/rails restart"
33
+ end
@@ -0,0 +1,27 @@
1
+ require_relative "boot"
2
+
3
+ require "rails/all"
4
+
5
+ # Require the gems listed in Gemfile, including any gems
6
+ # you've limited to :test, :development, or :production.
7
+ Bundler.require(*Rails.groups)
8
+
9
+ module Dummy
10
+ class Application < Rails::Application
11
+ # Initialize configuration defaults for originally generated Rails version.
12
+ config.load_defaults 7.1
13
+
14
+ # Please, add to the `ignore` list any other `lib` subdirectories that do
15
+ # not contain `.rb` files, or that should not be reloaded or eager loaded.
16
+ # Common ones are `templates`, `generators`, or `middleware`, for example.
17
+ config.autoload_lib(ignore: %w(assets tasks))
18
+
19
+ # Configuration for the application, engines, and railties goes here.
20
+ #
21
+ # These settings can be overridden in specific environments using the files
22
+ # in config/environments, which are processed later.
23
+ #
24
+ # config.time_zone = "Central Time (US & Canada)"
25
+ # config.eager_load_paths << Rails.root.join("extras")
26
+ end
27
+ end
@@ -0,0 +1,4 @@
1
+ ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../Gemfile", __dir__)
2
+
3
+ require "bundler/setup" # Set up gems listed in the Gemfile.
4
+ # require "bootsnap/setup" # Speed up boot time by caching expensive operations.
@@ -0,0 +1,11 @@
1
+ development:
2
+ adapter: redis
3
+ url: redis://localhost:6379/1
4
+
5
+ test:
6
+ adapter: test
7
+
8
+ production:
9
+ adapter: redis
10
+ url: <%= ENV.fetch("REDIS_URL") { "redis://localhost:6379/1" } %>
11
+ channel_prefix: dummy_production
@@ -0,0 +1 @@
1
+ v+qpJS9dHtYdjpHPCRVcjajq+Tlb6ONmeul+eI9CFyFtJQMcejkgV8w8H0w90kwselljjrjD+YxZUq8zarwhrmWC+03M4JOwJGDE5C/Iaofa2pT5qtjZSP7/wL9v4G6/lFpKBvT+teCRhXs+6uvcWACyFotEKZq89v6ApMBgzF94sioz5LmY51gFSIk1EhaMuEut0lUWOYn/mzBRA/sdYymEM4ynOg5AglQ2Q1c34JIQtrWnGrtwMD9C/XnQ96vUZcQd4wUQUjYtF0xnJNx/MknaHMdbrS26zXMpmBveh/O8a67x/ozO/c8hjnYeMPMZ0lOdHnbyWsrdpCjhHkKA7foc3KuCkMEsHXvFbWnlip7doOaF4tKwTq9z79gxshYJTzQ2CXrIgDignUcNlecVj3Krkmpb--A0mHiuQO+RWqb84v--VvD6hXbRbSQZ5vYc2YVqjw==
@@ -0,0 +1,25 @@
1
+ # SQLite. Versions 3.8.0 and up are supported.
2
+ # gem install sqlite3
3
+ #
4
+ # Ensure the SQLite 3 gem is defined in your Gemfile
5
+ # gem "sqlite3"
6
+ #
7
+ default: &default
8
+ adapter: sqlite3
9
+ pool: <%= ENV.fetch("RAILS_MAX_THREADS") { 5 } %>
10
+ timeout: 5000
11
+
12
+ development:
13
+ <<: *default
14
+ database: storage/development.sqlite3
15
+
16
+ # Warning: The database defined as "test" will be erased and
17
+ # re-generated from your development database when you run "rake".
18
+ # Do not set this db to the same as development or production.
19
+ test:
20
+ <<: *default
21
+ database: storage/test.sqlite3
22
+
23
+ production:
24
+ <<: *default
25
+ database: storage/production.sqlite3
@@ -0,0 +1,5 @@
1
+ # Load the Rails application.
2
+ require_relative "application"
3
+
4
+ # Initialize the Rails application.
5
+ Rails.application.initialize!
@@ -0,0 +1,76 @@
1
+ require "active_support/core_ext/integer/time"
2
+
3
+ Rails.application.configure do
4
+ # Settings specified here will take precedence over those in config/application.rb.
5
+
6
+ # In the development environment your application's code is reloaded any time
7
+ # it changes. This slows down response time but is perfect for development
8
+ # since you don't have to restart the web server when you make code changes.
9
+ config.enable_reloading = true
10
+
11
+ # Do not eager load code on boot.
12
+ config.eager_load = false
13
+
14
+ # Show full error reports.
15
+ config.consider_all_requests_local = true
16
+
17
+ # Enable server timing
18
+ config.server_timing = true
19
+
20
+ # Enable/disable caching. By default caching is disabled.
21
+ # Run rails dev:cache to toggle caching.
22
+ if Rails.root.join("tmp/caching-dev.txt").exist?
23
+ config.action_controller.perform_caching = true
24
+ config.action_controller.enable_fragment_cache_logging = true
25
+
26
+ config.cache_store = :memory_store
27
+ config.public_file_server.headers = {
28
+ "Cache-Control" => "public, max-age=#{2.days.to_i}"
29
+ }
30
+ else
31
+ config.action_controller.perform_caching = false
32
+
33
+ config.cache_store = :null_store
34
+ end
35
+
36
+ # Store uploaded files on the local file system (see config/storage.yml for options).
37
+ config.active_storage.service = :local
38
+
39
+ # Don't care if the mailer can't send.
40
+ config.action_mailer.raise_delivery_errors = false
41
+
42
+ config.action_mailer.perform_caching = false
43
+
44
+ # Print deprecation notices to the Rails logger.
45
+ config.active_support.deprecation = :log
46
+
47
+ # Raise exceptions for disallowed deprecations.
48
+ config.active_support.disallowed_deprecation = :raise
49
+
50
+ # Tell Active Support which deprecation messages to disallow.
51
+ config.active_support.disallowed_deprecation_warnings = []
52
+
53
+ # Raise an error on page load if there are pending migrations.
54
+ config.active_record.migration_error = :page_load
55
+
56
+ # Highlight code that triggered database queries in logs.
57
+ config.active_record.verbose_query_logs = true
58
+
59
+ # Highlight code that enqueued background job in logs.
60
+ config.active_job.verbose_enqueue_logs = true
61
+
62
+ # Suppress logger output for asset requests.
63
+ config.assets.quiet = true
64
+
65
+ # Raises error for missing translations.
66
+ # config.i18n.raise_on_missing_translations = true
67
+
68
+ # Annotate rendered view with file names.
69
+ # config.action_view.annotate_rendered_view_with_filenames = true
70
+
71
+ # Uncomment if you wish to allow Action Cable access from any origin.
72
+ # config.action_cable.disable_request_forgery_protection = true
73
+
74
+ # Raise error when a before_action's only/except options reference missing actions
75
+ config.action_controller.raise_on_missing_callback_actions = true
76
+ end
@@ -0,0 +1,97 @@
1
+ require "active_support/core_ext/integer/time"
2
+
3
+ Rails.application.configure do
4
+ # Settings specified here will take precedence over those in config/application.rb.
5
+
6
+ # Code is not reloaded between requests.
7
+ config.enable_reloading = false
8
+
9
+ # Eager load code on boot. This eager loads most of Rails and
10
+ # your application in memory, allowing both threaded web servers
11
+ # and those relying on copy on write to perform better.
12
+ # Rake tasks automatically ignore this option for performance.
13
+ config.eager_load = true
14
+
15
+ # Full error reports are disabled and caching is turned on.
16
+ config.consider_all_requests_local = false
17
+ config.action_controller.perform_caching = true
18
+
19
+ # Ensures that a master key has been made available in ENV["RAILS_MASTER_KEY"], config/master.key, or an environment
20
+ # key such as config/credentials/production.key. This key is used to decrypt credentials (and other encrypted files).
21
+ # config.require_master_key = true
22
+
23
+ # Disable serving static files from `public/`, relying on NGINX/Apache to do so instead.
24
+ # config.public_file_server.enabled = false
25
+
26
+ # Compress CSS using a preprocessor.
27
+ # config.assets.css_compressor = :sass
28
+
29
+ # Do not fall back to assets pipeline if a precompiled asset is missed.
30
+ config.assets.compile = false
31
+
32
+ # Enable serving of images, stylesheets, and JavaScripts from an asset server.
33
+ # config.asset_host = "http://assets.example.com"
34
+
35
+ # Specifies the header that your server uses for sending files.
36
+ # config.action_dispatch.x_sendfile_header = "X-Sendfile" # for Apache
37
+ # config.action_dispatch.x_sendfile_header = "X-Accel-Redirect" # for NGINX
38
+
39
+ # Store uploaded files on the local file system (see config/storage.yml for options).
40
+ config.active_storage.service = :local
41
+
42
+ # Mount Action Cable outside main process or domain.
43
+ # config.action_cable.mount_path = nil
44
+ # config.action_cable.url = "wss://example.com/cable"
45
+ # config.action_cable.allowed_request_origins = [ "http://example.com", /http:\/\/example.*/ ]
46
+
47
+ # Assume all access to the app is happening through a SSL-terminating reverse proxy.
48
+ # Can be used together with config.force_ssl for Strict-Transport-Security and secure cookies.
49
+ # config.assume_ssl = true
50
+
51
+ # Force all access to the app over SSL, use Strict-Transport-Security, and use secure cookies.
52
+ config.force_ssl = true
53
+
54
+ # Log to STDOUT by default
55
+ config.logger = ActiveSupport::Logger.new(STDOUT)
56
+ .tap { |logger| logger.formatter = ::Logger::Formatter.new }
57
+ .then { |logger| ActiveSupport::TaggedLogging.new(logger) }
58
+
59
+ # Prepend all log lines with the following tags.
60
+ config.log_tags = [ :request_id ]
61
+
62
+ # "info" includes generic and useful information about system operation, but avoids logging too much
63
+ # information to avoid inadvertent exposure of personally identifiable information (PII). If you
64
+ # want to log everything, set the level to "debug".
65
+ config.log_level = ENV.fetch("RAILS_LOG_LEVEL", "info")
66
+
67
+ # Use a different cache store in production.
68
+ # config.cache_store = :mem_cache_store
69
+
70
+ # Use a real queuing backend for Active Job (and separate queues per environment).
71
+ # config.active_job.queue_adapter = :resque
72
+ # config.active_job.queue_name_prefix = "dummy_production"
73
+
74
+ config.action_mailer.perform_caching = false
75
+
76
+ # Ignore bad email addresses and do not raise email delivery errors.
77
+ # Set this to true and configure the email server for immediate delivery to raise delivery errors.
78
+ # config.action_mailer.raise_delivery_errors = false
79
+
80
+ # Enable locale fallbacks for I18n (makes lookups for any locale fall back to
81
+ # the I18n.default_locale when a translation cannot be found).
82
+ config.i18n.fallbacks = true
83
+
84
+ # Don't log any deprecations.
85
+ config.active_support.report_deprecations = false
86
+
87
+ # Do not dump schema after migrations.
88
+ config.active_record.dump_schema_after_migration = false
89
+
90
+ # Enable DNS rebinding protection and other `Host` header attacks.
91
+ # config.hosts = [
92
+ # "example.com", # Allow requests from example.com
93
+ # /.*\.example\.com/ # Allow requests from subdomains like `www.example.com`
94
+ # ]
95
+ # Skip DNS rebinding protection for the default health check endpoint.
96
+ # config.host_authorization = { exclude: ->(request) { request.path == "/up" } }
97
+ end
@@ -0,0 +1,64 @@
1
+ require "active_support/core_ext/integer/time"
2
+
3
+ # The test environment is used exclusively to run your application's
4
+ # test suite. You never need to work with it otherwise. Remember that
5
+ # your test database is "scratch space" for the test suite and is wiped
6
+ # and recreated between test runs. Don't rely on the data there!
7
+
8
+ Rails.application.configure do
9
+ # Settings specified here will take precedence over those in config/application.rb.
10
+
11
+ # While tests run files are not watched, reloading is not necessary.
12
+ config.enable_reloading = false
13
+
14
+ # Eager loading loads your entire application. When running a single test locally,
15
+ # this is usually not necessary, and can slow down your test suite. However, it's
16
+ # recommended that you enable it in continuous integration systems to ensure eager
17
+ # loading is working properly before deploying your code.
18
+ config.eager_load = ENV["CI"].present?
19
+
20
+ # Configure public file server for tests with Cache-Control for performance.
21
+ config.public_file_server.enabled = true
22
+ config.public_file_server.headers = {
23
+ "Cache-Control" => "public, max-age=#{1.hour.to_i}"
24
+ }
25
+
26
+ # Show full error reports and disable caching.
27
+ config.consider_all_requests_local = true
28
+ config.action_controller.perform_caching = false
29
+ config.cache_store = :null_store
30
+
31
+ # Render exception templates for rescuable exceptions and raise for other exceptions.
32
+ config.action_dispatch.show_exceptions = :rescuable
33
+
34
+ # Disable request forgery protection in test environment.
35
+ config.action_controller.allow_forgery_protection = false
36
+
37
+ # Store uploaded files on the local file system in a temporary directory.
38
+ config.active_storage.service = :test
39
+
40
+ config.action_mailer.perform_caching = false
41
+
42
+ # Tell Action Mailer not to deliver emails to the real world.
43
+ # The :test delivery method accumulates sent emails in the
44
+ # ActionMailer::Base.deliveries array.
45
+ config.action_mailer.delivery_method = :test
46
+
47
+ # Print deprecation notices to the stderr.
48
+ config.active_support.deprecation = :stderr
49
+
50
+ # Raise exceptions for disallowed deprecations.
51
+ config.active_support.disallowed_deprecation = :raise
52
+
53
+ # Tell Active Support which deprecation messages to disallow.
54
+ config.active_support.disallowed_deprecation_warnings = []
55
+
56
+ # Raises error for missing translations.
57
+ # config.i18n.raise_on_missing_translations = true
58
+
59
+ # Annotate rendered view with file names.
60
+ # config.action_view.annotate_rendered_view_with_filenames = true
61
+
62
+ # Raise error when a before_action's only/except options reference missing actions
63
+ config.action_controller.raise_on_missing_callback_actions = true
64
+ end
@@ -0,0 +1,7 @@
1
+ # Pin npm packages by running ./bin/importmap
2
+
3
+ pin "application"
4
+ pin "@hotwired/turbo-rails", to: "turbo.min.js"
5
+ pin "@hotwired/stimulus", to: "stimulus.min.js"
6
+ pin "@hotwired/stimulus-loading", to: "stimulus-loading.js"
7
+ pin_all_from "app/javascript/controllers", under: "controllers"