From 003f36a88950d31524244beff78fea2caef060ae Mon Sep 17 00:00:00 2001 From: James Jefferies Date: Fri, 29 Nov 2024 15:32:22 +0000 Subject: [PATCH 1/4] Add lograge and a Procfile --- Gemfile | 3 +++ Gemfile.lock | 8 ++++++++ Procfile | 2 ++ Procfile.dev | 1 + bin/dev | 9 +++++++++ config/initializers/lograge.rb | 3 +++ 6 files changed, 26 insertions(+) create mode 100644 Procfile create mode 100644 Procfile.dev create mode 100755 bin/dev create mode 100644 config/initializers/lograge.rb diff --git a/Gemfile b/Gemfile index 880ec15..7d5c471 100644 --- a/Gemfile +++ b/Gemfile @@ -18,6 +18,9 @@ gem 'jbuilder' # Reduces boot times through caching; required in config/boot.rb gem 'bootsnap', require: false +# Makes logs a bit more managable +gem 'lograge' + group :development, :test do # Call 'byebug' anywhere in the code to stop execution and get a debugger console gem 'byebug', platforms: [:mri, :mingw, :x64_mingw] diff --git a/Gemfile.lock b/Gemfile.lock index 0bb43ce..7789017 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -116,6 +116,11 @@ GEM rb-fsevent (~> 0.10, >= 0.10.3) rb-inotify (~> 0.9, >= 0.9.10) logger (1.6.2) + lograge (0.14.0) + actionpack (>= 4) + activesupport (>= 4) + railties (>= 4) + request_store (~> 1.0) loofah (2.23.1) crass (~> 1.0.2) nokogiri (>= 1.12.0) @@ -200,6 +205,8 @@ GEM regexp_parser (2.9.2) reline (0.5.12) io-console (~> 0.5) + request_store (1.7.0) + rack (>= 1.4) rexml (3.3.9) rspec-core (3.13.2) rspec-support (~> 3.13.0) @@ -279,6 +286,7 @@ DEPENDENCIES capybara jbuilder listen (~> 3.3) + lograge pg puma rack-mini-profiler (~> 2.0) diff --git a/Procfile b/Procfile new file mode 100644 index 0000000..c8f968a --- /dev/null +++ b/Procfile @@ -0,0 +1,2 @@ +release: ./release_tasks.sh +web: bundle exec puma -C config/puma.rb \ No newline at end of file diff --git a/Procfile.dev b/Procfile.dev new file mode 100644 index 0000000..13bda79 --- /dev/null +++ b/Procfile.dev @@ -0,0 +1 @@ +rails: bundle exec rails server -p 3000 diff --git a/bin/dev b/bin/dev new file mode 100755 index 0000000..2daf776 --- /dev/null +++ b/bin/dev @@ -0,0 +1,9 @@ +#!/usr/bin/env bash + +if ! command -v foreman &> /dev/null +then + echo "Installing foreman..." + gem install foreman +fi + +foreman start -f Procfile.dev diff --git a/config/initializers/lograge.rb b/config/initializers/lograge.rb new file mode 100644 index 0000000..0719fcd --- /dev/null +++ b/config/initializers/lograge.rb @@ -0,0 +1,3 @@ +Rails.application.configure do + config.lograge.enabled = true +end From 86acf0e9d9208cd5096cfc2baf043d81dc1649e4 Mon Sep 17 00:00:00 2001 From: James Jefferies Date: Thu, 19 Dec 2024 14:18:55 +0000 Subject: [PATCH 2/4] Minor rails bump too --- Gemfile.lock | 153 +++++++++++++++++++++++++-------------------------- 1 file changed, 76 insertions(+), 77 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index 7789017..80edb0c 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,29 +1,29 @@ GEM remote: https://rubygems.org/ specs: - actioncable (7.2.2) - actionpack (= 7.2.2) - activesupport (= 7.2.2) + actioncable (7.2.2.1) + actionpack (= 7.2.2.1) + activesupport (= 7.2.2.1) nio4r (~> 2.0) websocket-driver (>= 0.6.1) zeitwerk (~> 2.6) - actionmailbox (7.2.2) - actionpack (= 7.2.2) - activejob (= 7.2.2) - activerecord (= 7.2.2) - activestorage (= 7.2.2) - activesupport (= 7.2.2) + actionmailbox (7.2.2.1) + actionpack (= 7.2.2.1) + activejob (= 7.2.2.1) + activerecord (= 7.2.2.1) + activestorage (= 7.2.2.1) + activesupport (= 7.2.2.1) mail (>= 2.8.0) - actionmailer (7.2.2) - actionpack (= 7.2.2) - actionview (= 7.2.2) - activejob (= 7.2.2) - activesupport (= 7.2.2) + actionmailer (7.2.2.1) + actionpack (= 7.2.2.1) + actionview (= 7.2.2.1) + activejob (= 7.2.2.1) + activesupport (= 7.2.2.1) mail (>= 2.8.0) rails-dom-testing (~> 2.2) - actionpack (7.2.2) - actionview (= 7.2.2) - activesupport (= 7.2.2) + actionpack (7.2.2.1) + actionview (= 7.2.2.1) + activesupport (= 7.2.2.1) nokogiri (>= 1.8.5) racc rack (>= 2.2.4, < 3.2) @@ -32,35 +32,35 @@ GEM rails-dom-testing (~> 2.2) rails-html-sanitizer (~> 1.6) useragent (~> 0.16) - actiontext (7.2.2) - actionpack (= 7.2.2) - activerecord (= 7.2.2) - activestorage (= 7.2.2) - activesupport (= 7.2.2) + actiontext (7.2.2.1) + actionpack (= 7.2.2.1) + activerecord (= 7.2.2.1) + activestorage (= 7.2.2.1) + activesupport (= 7.2.2.1) globalid (>= 0.6.0) nokogiri (>= 1.8.5) - actionview (7.2.2) - activesupport (= 7.2.2) + actionview (7.2.2.1) + activesupport (= 7.2.2.1) builder (~> 3.1) erubi (~> 1.11) rails-dom-testing (~> 2.2) rails-html-sanitizer (~> 1.6) - activejob (7.2.2) - activesupport (= 7.2.2) + activejob (7.2.2.1) + activesupport (= 7.2.2.1) globalid (>= 0.3.6) - activemodel (7.2.2) - activesupport (= 7.2.2) - activerecord (7.2.2) - activemodel (= 7.2.2) - activesupport (= 7.2.2) + activemodel (7.2.2.1) + activesupport (= 7.2.2.1) + activerecord (7.2.2.1) + activemodel (= 7.2.2.1) + activesupport (= 7.2.2.1) timeout (>= 0.4.0) - activestorage (7.2.2) - actionpack (= 7.2.2) - activejob (= 7.2.2) - activerecord (= 7.2.2) - activesupport (= 7.2.2) + activestorage (7.2.2.1) + actionpack (= 7.2.2.1) + activejob (= 7.2.2.1) + activerecord (= 7.2.2.1) + activesupport (= 7.2.2.1) marcel (~> 1.0) - activesupport (7.2.2) + activesupport (7.2.2.1) base64 benchmark (>= 0.3) bigdecimal @@ -94,7 +94,7 @@ GEM concurrent-ruby (1.3.4) connection_pool (2.4.1) crass (1.0.6) - date (3.4.0) + date (3.4.1) diff-lcs (1.5.1) drb (2.2.1) erubi (1.13.0) @@ -105,8 +105,8 @@ GEM activesupport (>= 6.1) i18n (1.14.6) concurrent-ruby (~> 1.0) - io-console (0.7.2) - irb (1.14.1) + io-console (0.8.0) + irb (1.14.3) rdoc (>= 4.0.0) reline (>= 0.4.2) jbuilder (2.13.0) @@ -115,7 +115,7 @@ GEM listen (3.9.0) rb-fsevent (~> 0.10, >= 0.10.3) rb-inotify (~> 0.9, >= 0.9.10) - logger (1.6.2) + logger (1.6.4) lograge (0.14.0) actionpack (>= 4) activesupport (>= 4) @@ -132,9 +132,9 @@ GEM marcel (1.0.4) matrix (0.4.2) mini_mime (1.1.5) - minitest (5.25.2) + minitest (5.25.4) msgpack (1.7.5) - net-imap (0.5.1) + net-imap (0.5.2) date net-protocol net-pop (0.1.2) @@ -144,53 +144,53 @@ GEM net-smtp (0.5.0) net-protocol nio4r (2.7.4) - nokogiri (1.16.7-arm64-darwin) + nokogiri (1.17.2-arm64-darwin) racc (~> 1.4) - nokogiri (1.16.7-x86_64-darwin) + nokogiri (1.17.2-x86_64-darwin) racc (~> 1.4) - nokogiri (1.16.7-x86_64-linux) + nokogiri (1.17.2-x86_64-linux) racc (~> 1.4) pg (1.5.9) - psych (5.2.0) + psych (5.2.2) + date stringio public_suffix (6.0.1) puma (5.6.9) nio4r (~> 2.0) racc (1.8.1) - rack (2.2.10) + rack (3.1.8) rack-mini-profiler (2.3.4) rack (>= 1.2.0) - rack-session (1.0.2) - rack (< 3) + rack-session (2.0.0) + rack (>= 3.0.0) rack-test (2.1.0) rack (>= 1.3) - rackup (1.0.1) - rack (< 3) - webrick - rails (7.2.2) - actioncable (= 7.2.2) - actionmailbox (= 7.2.2) - actionmailer (= 7.2.2) - actionpack (= 7.2.2) - actiontext (= 7.2.2) - actionview (= 7.2.2) - activejob (= 7.2.2) - activemodel (= 7.2.2) - activerecord (= 7.2.2) - activestorage (= 7.2.2) - activesupport (= 7.2.2) + rackup (2.2.1) + rack (>= 3) + rails (7.2.2.1) + actioncable (= 7.2.2.1) + actionmailbox (= 7.2.2.1) + actionmailer (= 7.2.2.1) + actionpack (= 7.2.2.1) + actiontext (= 7.2.2.1) + actionview (= 7.2.2.1) + activejob (= 7.2.2.1) + activemodel (= 7.2.2.1) + activerecord (= 7.2.2.1) + activestorage (= 7.2.2.1) + activesupport (= 7.2.2.1) bundler (>= 1.15.0) - railties (= 7.2.2) + railties (= 7.2.2.1) rails-dom-testing (2.2.0) activesupport (>= 5.0.0) minitest nokogiri (>= 1.6) - rails-html-sanitizer (1.6.0) + rails-html-sanitizer (1.6.2) loofah (~> 2.21) - nokogiri (~> 1.14) - railties (7.2.2) - actionpack (= 7.2.2) - activesupport (= 7.2.2) + nokogiri (>= 1.15.7, != 1.16.7, != 1.16.6, != 1.16.5, != 1.16.4, != 1.16.3, != 1.16.2, != 1.16.1, != 1.16.0.rc1, != 1.16.0) + railties (7.2.2.1) + actionpack (= 7.2.2.1) + activesupport (= 7.2.2.1) irb (~> 1.13) rackup (>= 1.0.0) rake (>= 12.2) @@ -200,10 +200,10 @@ GEM rb-fsevent (0.11.2) rb-inotify (0.11.1) ffi (~> 1.0) - rdoc (6.8.1) + rdoc (6.10.0) psych (>= 4.0.0) regexp_parser (2.9.2) - reline (0.5.12) + reline (0.6.0) io-console (~> 0.5) request_store (1.7.0) rack (>= 1.4) @@ -236,7 +236,7 @@ GEM sprockets (> 3.0) sprockets-rails tilt - securerandom (0.3.2) + securerandom (0.4.1) selenium-webdriver (4.27.0) base64 (~> 0.2) logger (~> 1.4) @@ -253,16 +253,15 @@ GEM stringio (3.1.2) thor (1.3.2) tilt (2.4.0) - timeout (0.4.2) + timeout (0.4.3) tzinfo (2.0.6) concurrent-ruby (~> 1.0) - useragent (0.16.10) + useragent (0.16.11) web-console (4.2.1) actionview (>= 6.0.0) activemodel (>= 6.0.0) bindex (>= 0.4.0) railties (>= 6.0.0) - webrick (1.9.0) websocket (1.2.11) websocket-driver (0.7.6) websocket-extensions (>= 0.1.0) From fc290b5aecf147fce83101e1ee5b80f5ea42faa2 Mon Sep 17 00:00:00 2001 From: James Jefferies Date: Thu, 19 Dec 2024 14:20:48 +0000 Subject: [PATCH 3/4] Update rack-mini-profiler too --- Gemfile | 4 ++-- Gemfile.lock | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Gemfile b/Gemfile index 7d5c471..513783d 100644 --- a/Gemfile +++ b/Gemfile @@ -31,8 +31,8 @@ group :development do gem 'web-console', '>= 4.1.0' # Display performance information such as SQL time and flame graphs for each request in your browser. # Can be configured to work on production as well see: https://github.com/MiniProfiler/rack-mini-profiler/blob/master/README.md - gem 'rack-mini-profiler', '~> 2.0' - gem 'listen', '~> 3.3' + gem 'rack-mini-profiler' + gem 'listen' end group :test do diff --git a/Gemfile.lock b/Gemfile.lock index 80edb0c..5fff0e2 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -159,7 +159,7 @@ GEM nio4r (~> 2.0) racc (1.8.1) rack (3.1.8) - rack-mini-profiler (2.3.4) + rack-mini-profiler (3.3.1) rack (>= 1.2.0) rack-session (2.0.0) rack (>= 3.0.0) @@ -284,11 +284,11 @@ DEPENDENCIES byebug capybara jbuilder - listen (~> 3.3) + listen lograge pg puma - rack-mini-profiler (~> 2.0) + rack-mini-profiler rails (~> 7.2) rspec-rails sass-rails (>= 6) From 69e783b4d9ade1060ee19737f2447c36d19a897a Mon Sep 17 00:00:00 2001 From: James Jefferies Date: Thu, 19 Dec 2024 14:21:37 +0000 Subject: [PATCH 4/4] Update puma too --- Gemfile.lock | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Gemfile.lock b/Gemfile.lock index 5fff0e2..92b66ed 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -155,7 +155,7 @@ GEM date stringio public_suffix (6.0.1) - puma (5.6.9) + puma (6.5.0) nio4r (~> 2.0) racc (1.8.1) rack (3.1.8)