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.
- checksums.yaml +4 -4
- data/.github/workflows/tests.yml +48 -0
- data/.gitignore +22 -21
- data/.rspec +1 -1
- data/Appraisals +19 -0
- data/CHANGELOG.md +169 -133
- data/Gemfile +4 -4
- data/LICENSE.txt +22 -22
- data/README.md +424 -420
- data/Rakefile +32 -27
- data/examples/sinatras_raygun.rb +17 -17
- data/gemfiles/rails_6.gemfile +9 -0
- data/gemfiles/rails_7.gemfile +10 -0
- data/gemfiles/rails_7_sidekiq_6.gemfile +10 -0
- data/lib/generators/raygun/install_generator.rb +26 -26
- data/lib/raygun/affected_user.rb +59 -59
- data/lib/raygun/breadcrumbs/breadcrumb.rb +34 -34
- data/lib/raygun/breadcrumbs/store.rb +86 -86
- data/lib/raygun/breadcrumbs.rb +34 -34
- data/lib/raygun/client.rb +313 -308
- data/lib/raygun/configuration.rb +197 -194
- data/lib/raygun/demo_exception.rb +22 -22
- data/lib/raygun/error.rb +10 -10
- data/lib/raygun/error_subscriber.rb +21 -0
- data/lib/raygun/javascript_tracker.rb +42 -42
- data/lib/raygun/middleware/breadcrumbs_store_initializer.rb +19 -19
- data/lib/raygun/middleware/javascript_exception_tracking.rb +40 -32
- data/lib/raygun/middleware/rack_exception_interceptor.rb +18 -18
- data/lib/raygun/middleware/rails_insert_affected_user.rb +26 -26
- data/lib/raygun/railtie.rb +47 -39
- data/lib/raygun/services/apply_whitelist_filter_to_payload.rb +27 -27
- data/lib/raygun/sidekiq.rb +51 -71
- data/lib/raygun/version.rb +3 -3
- data/lib/raygun.rb +197 -179
- data/lib/raygun4ruby.rb +1 -1
- data/lib/resque/failure/raygun.rb +25 -25
- data/lib/tasks/raygun.tasks +7 -7
- data/raygun4ruby.gemspec +43 -45
- data/spec/features/javascript_spec.rb +48 -48
- data/spec/rails_applications/6.1.4/Gemfile +56 -0
- data/spec/{dummy/README.rdoc → rails_applications/6.1.4/README.md} +24 -28
- data/spec/{dummy → rails_applications/6.1.4}/Rakefile +6 -6
- data/spec/rails_applications/6.1.4/app/assets/config/manifest.js +2 -0
- data/spec/{dummy → rails_applications/6.1.4}/app/assets/images/.keep +0 -0
- data/spec/{dummy → rails_applications/6.1.4}/app/assets/stylesheets/application.css +15 -15
- data/spec/rails_applications/6.1.4/app/channels/application_cable/channel.rb +4 -0
- data/spec/rails_applications/6.1.4/app/channels/application_cable/connection.rb +4 -0
- data/spec/rails_applications/6.1.4/app/controllers/application_controller.rb +2 -0
- data/spec/{dummy → rails_applications/6.1.4}/app/controllers/concerns/.keep +0 -0
- data/spec/{dummy → rails_applications/6.1.4}/app/controllers/home_controller.rb +4 -4
- data/spec/{dummy → rails_applications/6.1.4}/app/helpers/application_helper.rb +2 -2
- data/spec/rails_applications/6.1.4/app/javascript/channels/consumer.js +6 -0
- data/spec/rails_applications/6.1.4/app/javascript/channels/index.js +5 -0
- data/spec/rails_applications/6.1.4/app/javascript/packs/application.js +13 -0
- data/spec/rails_applications/6.1.4/app/jobs/application_job.rb +7 -0
- data/spec/rails_applications/6.1.4/app/mailers/application_mailer.rb +4 -0
- data/spec/rails_applications/6.1.4/app/models/application_record.rb +3 -0
- data/spec/{dummy/app/mailers → rails_applications/6.1.4/app/models/concerns}/.keep +0 -0
- data/spec/{dummy → rails_applications/6.1.4}/app/views/home/index.html.erb +3 -3
- data/spec/{dummy → rails_applications/6.1.4}/app/views/home/index.json.erb +1 -1
- data/spec/rails_applications/6.1.4/app/views/layouts/application.html.erb +13 -0
- data/spec/rails_applications/6.1.4/app/views/layouts/mailer.html.erb +13 -0
- data/spec/rails_applications/6.1.4/app/views/layouts/mailer.text.erb +1 -0
- data/spec/rails_applications/6.1.4/bin/rails +5 -0
- data/spec/rails_applications/6.1.4/bin/rake +5 -0
- data/spec/rails_applications/6.1.4/bin/setup +36 -0
- data/spec/rails_applications/6.1.4/bin/spring +14 -0
- data/spec/rails_applications/6.1.4/bin/yarn +17 -0
- data/spec/rails_applications/6.1.4/config/application.rb +22 -0
- data/spec/rails_applications/6.1.4/config/boot.rb +3 -0
- data/spec/rails_applications/6.1.4/config/cable.yml +10 -0
- data/spec/rails_applications/6.1.4/config/credentials.yml.enc +1 -0
- data/spec/{dummy → rails_applications/6.1.4}/config/database.yml +25 -25
- data/spec/{dummy → rails_applications/6.1.4}/config/environment.rb +5 -5
- data/spec/rails_applications/6.1.4/config/environments/development.rb +76 -0
- data/spec/rails_applications/6.1.4/config/environments/production.rb +120 -0
- data/spec/rails_applications/6.1.4/config/environments/test.rb +60 -0
- data/spec/rails_applications/6.1.4/config/initializers/application_controller_renderer.rb +8 -0
- data/spec/rails_applications/6.1.4/config/initializers/assets.rb +14 -0
- data/spec/rails_applications/6.1.4/config/initializers/backtrace_silencers.rb +8 -0
- data/spec/rails_applications/6.1.4/config/initializers/content_security_policy.rb +30 -0
- data/spec/{dummy → rails_applications/6.1.4}/config/initializers/cookies_serializer.rb +5 -3
- data/spec/{dummy → rails_applications/6.1.4}/config/initializers/filter_parameter_logging.rb +6 -4
- data/spec/{dummy → rails_applications/6.1.4}/config/initializers/inflections.rb +16 -16
- data/spec/{dummy → rails_applications/6.1.4}/config/initializers/mime_types.rb +4 -4
- data/spec/rails_applications/6.1.4/config/initializers/permissions_policy.rb +11 -0
- data/spec/{dummy → rails_applications/6.1.4}/config/initializers/wrap_parameters.rb +14 -14
- data/spec/{dummy → rails_applications/6.1.4}/config/locales/en.yml +33 -23
- data/spec/rails_applications/6.1.4/config/master.key +1 -0
- data/spec/rails_applications/6.1.4/config/puma.rb +43 -0
- data/spec/rails_applications/6.1.4/config/routes.rb +4 -0
- data/spec/rails_applications/6.1.4/config/spring.rb +6 -0
- data/spec/rails_applications/6.1.4/config/storage.yml +34 -0
- data/spec/{dummy → rails_applications/6.1.4}/config.ru +6 -4
- data/spec/rails_applications/6.1.4/db/seeds.rb +7 -0
- data/spec/{dummy → rails_applications/6.1.4}/db/test.sqlite3 +0 -0
- data/spec/{dummy/app/models → rails_applications/6.1.4/lib/assets}/.keep +0 -0
- data/spec/{dummy/app/models/concerns → rails_applications/6.1.4/lib/tasks}/.keep +0 -0
- data/spec/rails_applications/6.1.4/package.json +11 -0
- data/spec/{dummy → rails_applications/6.1.4}/public/404.html +67 -67
- data/spec/{dummy → rails_applications/6.1.4}/public/422.html +67 -67
- data/spec/{dummy → rails_applications/6.1.4}/public/500.html +66 -66
- data/spec/{dummy/lib/assets/.keep → rails_applications/6.1.4/public/apple-touch-icon-precomposed.png} +0 -0
- data/spec/{dummy/lib/tasks/.keep → rails_applications/6.1.4/public/apple-touch-icon.png} +0 -0
- data/spec/{dummy → rails_applications/6.1.4}/public/favicon.ico +0 -0
- data/spec/rails_applications/6.1.4/public/robots.txt +1 -0
- data/spec/{dummy/log → rails_applications/6.1.4/storage}/.keep +0 -0
- data/spec/rails_applications/7.1.3/.dockerignore +37 -0
- data/spec/rails_applications/7.1.3/.gitattributes +9 -0
- data/spec/rails_applications/7.1.3/.gitignore +35 -0
- data/spec/rails_applications/7.1.3/.ruby-version +1 -0
- data/spec/rails_applications/7.1.3/Dockerfile +62 -0
- data/spec/rails_applications/7.1.3/Gemfile +67 -0
- data/spec/rails_applications/7.1.3/README.md +24 -0
- data/spec/rails_applications/7.1.3/Rakefile +6 -0
- data/spec/rails_applications/7.1.3/app/assets/config/manifest.js +4 -0
- data/spec/{dummy/test/controllers → rails_applications/7.1.3/app/assets/images}/.keep +0 -0
- data/spec/rails_applications/7.1.3/app/assets/stylesheets/application.css +15 -0
- data/spec/rails_applications/7.1.3/app/channels/application_cable/channel.rb +4 -0
- data/spec/rails_applications/7.1.3/app/channels/application_cable/connection.rb +4 -0
- data/spec/rails_applications/7.1.3/app/controllers/application_controller.rb +2 -0
- data/spec/{dummy/test/fixtures → rails_applications/7.1.3/app/controllers/concerns}/.keep +0 -0
- data/spec/rails_applications/7.1.3/app/controllers/home_controller.rb +2 -0
- data/spec/rails_applications/7.1.3/app/helpers/application_helper.rb +2 -0
- data/spec/rails_applications/7.1.3/app/helpers/home_helper.rb +2 -0
- data/spec/rails_applications/7.1.3/app/javascript/application.js +3 -0
- data/spec/rails_applications/7.1.3/app/javascript/controllers/application.js +9 -0
- data/spec/rails_applications/7.1.3/app/javascript/controllers/hello_controller.js +7 -0
- data/spec/rails_applications/7.1.3/app/javascript/controllers/index.js +11 -0
- data/spec/rails_applications/7.1.3/app/jobs/application_job.rb +7 -0
- data/spec/rails_applications/7.1.3/app/mailers/application_mailer.rb +4 -0
- data/spec/rails_applications/7.1.3/app/models/application_record.rb +3 -0
- data/spec/{dummy/test/helpers → rails_applications/7.1.3/app/models/concerns}/.keep +0 -0
- data/spec/rails_applications/7.1.3/app/views/home/index.html.erb +3 -0
- data/spec/rails_applications/7.1.3/app/views/home/index.json.erb +1 -0
- data/spec/rails_applications/7.1.3/app/views/layouts/application.html.erb +16 -0
- data/spec/rails_applications/7.1.3/app/views/layouts/mailer.html.erb +13 -0
- data/spec/rails_applications/7.1.3/app/views/layouts/mailer.text.erb +1 -0
- data/spec/rails_applications/7.1.3/bin/bundle +109 -0
- data/spec/rails_applications/7.1.3/bin/docker-entrypoint +8 -0
- data/spec/rails_applications/7.1.3/bin/importmap +4 -0
- data/spec/rails_applications/7.1.3/bin/rails +4 -0
- data/spec/rails_applications/7.1.3/bin/rake +4 -0
- data/spec/rails_applications/7.1.3/bin/setup +33 -0
- data/spec/rails_applications/7.1.3/config/application.rb +27 -0
- data/spec/rails_applications/7.1.3/config/boot.rb +4 -0
- data/spec/rails_applications/7.1.3/config/cable.yml +11 -0
- data/spec/rails_applications/7.1.3/config/credentials.yml.enc +1 -0
- data/spec/rails_applications/7.1.3/config/database.yml +25 -0
- data/spec/rails_applications/7.1.3/config/environment.rb +5 -0
- data/spec/rails_applications/7.1.3/config/environments/development.rb +76 -0
- data/spec/rails_applications/7.1.3/config/environments/production.rb +97 -0
- data/spec/rails_applications/7.1.3/config/environments/test.rb +64 -0
- data/spec/rails_applications/7.1.3/config/importmap.rb +7 -0
- data/spec/rails_applications/7.1.3/config/initializers/assets.rb +12 -0
- data/spec/rails_applications/7.1.3/config/initializers/content_security_policy.rb +25 -0
- data/spec/rails_applications/7.1.3/config/initializers/filter_parameter_logging.rb +8 -0
- data/spec/rails_applications/7.1.3/config/initializers/inflections.rb +16 -0
- data/spec/rails_applications/7.1.3/config/initializers/permissions_policy.rb +13 -0
- data/spec/rails_applications/7.1.3/config/locales/en.yml +31 -0
- data/spec/rails_applications/7.1.3/config/puma.rb +35 -0
- data/spec/rails_applications/7.1.3/config/routes.rb +11 -0
- data/spec/rails_applications/7.1.3/config/storage.yml +34 -0
- data/spec/rails_applications/7.1.3/config.ru +6 -0
- data/spec/rails_applications/7.1.3/db/seeds.rb +9 -0
- data/spec/{dummy/test/integration → rails_applications/7.1.3/lib/assets}/.keep +0 -0
- data/spec/{dummy/test/mailers → rails_applications/7.1.3/lib/tasks}/.keep +0 -0
- data/spec/rails_applications/7.1.3/public/404.html +67 -0
- data/spec/rails_applications/7.1.3/public/422.html +67 -0
- data/spec/rails_applications/7.1.3/public/500.html +66 -0
- data/spec/{dummy/test/models/.keep → rails_applications/7.1.3/public/apple-touch-icon-precomposed.png} +0 -0
- data/spec/{dummy/vendor/assets/javascripts/.keep → rails_applications/7.1.3/public/apple-touch-icon.png} +0 -0
- data/spec/{dummy/vendor/assets/stylesheets/.keep → rails_applications/7.1.3/public/favicon.ico} +0 -0
- data/spec/rails_applications/7.1.3/public/robots.txt +1 -0
- data/spec/rails_applications/7.1.3/storage/.keep +0 -0
- data/spec/rails_applications/7.1.3/test/application_system_test_case.rb +5 -0
- data/spec/rails_applications/7.1.3/test/channels/application_cable/connection_test.rb +13 -0
- data/spec/rails_applications/7.1.3/test/controllers/.keep +0 -0
- data/spec/rails_applications/7.1.3/test/controllers/home_controller_test.rb +7 -0
- data/spec/rails_applications/7.1.3/test/fixtures/files/.keep +0 -0
- data/spec/rails_applications/7.1.3/test/helpers/.keep +0 -0
- data/spec/rails_applications/7.1.3/test/integration/.keep +0 -0
- data/spec/rails_applications/7.1.3/test/mailers/.keep +0 -0
- data/spec/rails_applications/7.1.3/test/models/.keep +0 -0
- data/spec/rails_applications/7.1.3/test/system/.keep +0 -0
- data/spec/rails_applications/7.1.3/test/test_helper.rb +15 -0
- data/spec/rails_applications/7.1.3/vendor/.keep +0 -0
- data/spec/rails_applications/7.1.3/vendor/javascript/.keep +0 -0
- data/spec/rails_helper.rb +8 -4
- data/spec/raygun/breadcrumbs/breadcrumb_spec.rb +171 -171
- data/spec/raygun/breadcrumbs/store_spec.rb +170 -170
- data/spec/services/apply_whitelist_filter_to_payload_spec.rb +251 -251
- data/spec/spec_helper.rb +24 -24
- data/spec/support/fake_logger.rb +17 -17
- data/test/integration/client_test.rb +19 -19
- data/test/rails_helper.rb +6 -0
- data/test/test_helper.rb +76 -72
- data/test/unit/affected_user_test.rb +136 -136
- data/test/unit/client_test.rb +812 -812
- data/test/unit/configuration_test.rb +202 -206
- data/test/unit/error_subscriber_test.rb +43 -0
- data/test/unit/raygun_test.rb +106 -25
- data/test/unit/resque_failure_test.rb +27 -24
- data/test/unit/sidekiq_failure_test.rb +42 -32
- metadata +186 -125
- data/.travis.yml +0 -20
- data/spec/dummy/.gitignore +0 -17
- data/spec/dummy/Gemfile +0 -47
- data/spec/dummy/app/assets/config/manifest.js +0 -3
- data/spec/dummy/app/assets/javascripts/application.js +0 -13
- data/spec/dummy/app/controllers/application_controller.rb +0 -5
- data/spec/dummy/app/views/layouts/application.html.erb +0 -14
- data/spec/dummy/bin/bundle +0 -3
- data/spec/dummy/bin/rails +0 -9
- data/spec/dummy/bin/rake +0 -9
- data/spec/dummy/bin/setup +0 -29
- data/spec/dummy/bin/spring +0 -17
- data/spec/dummy/config/application.rb +0 -26
- data/spec/dummy/config/boot.rb +0 -3
- data/spec/dummy/config/environments/development.rb +0 -41
- data/spec/dummy/config/environments/production.rb +0 -79
- data/spec/dummy/config/environments/test.rb +0 -42
- data/spec/dummy/config/initializers/assets.rb +0 -11
- data/spec/dummy/config/initializers/backtrace_silencers.rb +0 -7
- data/spec/dummy/config/initializers/session_store.rb +0 -3
- data/spec/dummy/config/initializers/to_time_preserves_timezone.rb +0 -10
- data/spec/dummy/config/routes.rb +0 -58
- data/spec/dummy/config/secrets.yml +0 -22
- data/spec/dummy/db/seeds.rb +0 -7
- data/spec/dummy/public/robots.txt +0 -5
- data/spec/dummy/test/test_helper.rb +0 -10
- 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
|
+
*/
|
File without changes
|
@@ -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
|
File without changes
|
@@ -0,0 +1 @@
|
|
1
|
+
{}
|
@@ -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 @@
|
|
1
|
+
<%= yield %>
|
@@ -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,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 @@
|
|
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,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"
|