Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,10 @@ gem 'jbuilder', '~> 2.7'
# Use Active Model has_secure_password
# gem 'bcrypt', '~> 3.1.7'


gem "sentry-ruby"
gem "sentry-rails"

# Use Active Storage variant
# gem 'image_processing', '~> 1.2'

Expand Down
13 changes: 13 additions & 0 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,9 @@ GEM
concurrent-ruby (1.1.7)
crass (1.0.6)
erubi (1.10.0)
faraday (1.1.0)
multipart-post (>= 1.2, < 3)
ruby2_keywords
ffi (1.13.1)
globalid (0.4.2)
activesupport (>= 4.2.0)
Expand All @@ -102,6 +105,7 @@ GEM
mini_portile2 (2.4.0)
minitest (5.14.2)
msgpack (1.3.3)
multipart-post (2.1.1)
nio4r (2.5.4)
nokogiri (1.10.10)
mini_portile2 (~> 2.4.0)
Expand Down Expand Up @@ -146,6 +150,7 @@ GEM
rb-inotify (0.10.1)
ffi (~> 1.0)
regexp_parser (1.8.2)
ruby2_keywords (0.0.2)
rubyzip (2.3.0)
sass-rails (6.0.0)
sassc-rails (~> 2.1, >= 2.1.1)
Expand All @@ -161,6 +166,12 @@ GEM
childprocess (>= 0.5, < 4.0)
rubyzip (>= 1.2.2)
semantic_range (2.3.1)
sentry-rails (4.1.0)
rails (>= 5.0)
sentry-ruby (>= 4.1.0)
sentry-ruby (4.1.0)
concurrent-ruby
faraday (>= 1.0)
spring (2.1.1)
sprockets (4.0.2)
concurrent-ruby (~> 1.0)
Expand Down Expand Up @@ -212,6 +223,8 @@ DEPENDENCIES
rails (~> 6.1.0)
sass-rails (>= 6)
selenium-webdriver
sentry-rails
sentry-ruby
spring
sqlite3 (~> 1.4)
turbolinks (~> 5)
Expand Down
3 changes: 3 additions & 0 deletions app/assets/stylesheets/catch_all.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
// Place all the styles related to the catch_all controller here.
// They will automatically be included in application.css.
// You can use Sass (SCSS) here: https://sass-lang.com/
5 changes: 5 additions & 0 deletions app/controllers/catch_all_controller.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
class CatchAllController < ApplicationController
def log_request
raise "random url called"
end
end
2 changes: 2 additions & 0 deletions app/helpers/catch_all_helper.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
module CatchAllHelper
end
2 changes: 2 additions & 0 deletions app/views/catch_all/log_request.html.erb
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
<h1>CatchAll#log_request</h1>
<p>Find me in app/views/catch_all/log_request.html.erb</p>
13 changes: 13 additions & 0 deletions config/initializers/sentry-init.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
Sentry.init do |config|
config.dsn = 'https://21e1d6525c40490e99d912ddea3969a1@o213594.ingest.sentry.io/5562963'
config.breadcrumbs_logger = [:active_support_logger]

# To activate performance monitoring, set one of these options.
# We recommend adjusting the value in production:
config.traces_sample_rate = 0.5
# or
config.traces_sampler = lambda do |context|
true
end
end

4 changes: 3 additions & 1 deletion config/routes.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# For details on the DSL available within this file, see https://guides.rubyonrails.org/routing.html
Rails.application.routes.draw do
# For details on the DSL available within this file, see https://guides.rubyonrails.org/routing.html
get 'catch_all/log_request'
get '*magic_request_path', to: 'catch_all#log_request'
end
15 changes: 15 additions & 0 deletions db/schema.rb

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

13 changes: 13 additions & 0 deletions test/controllers/catch_all_controller_test.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
require "test_helper"

class CatchAllControllerTest < ActionDispatch::IntegrationTest
test "should get log_request" do
get catch_all_log_request_url
assert_response :success
end

test "hitting any paths should get log_request" do
get "/foo/bar"
assert_response :success
end
end