From 93e5f5b8a2276b73b1809431ab341319bcf272de Mon Sep 17 00:00:00 2001 From: Jeremy Kennedy Date: Thu, 8 Apr 2021 21:18:34 -0400 Subject: [PATCH 1/3] fixes so code runs better on windows --- config/initializers/assets.rb | 5 +++++ docker-compose.yml | 10 ++++++++-- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/config/initializers/assets.rb b/config/initializers/assets.rb index 4b828e80c..a0eaad981 100644 --- a/config/initializers/assets.rb +++ b/config/initializers/assets.rb @@ -12,3 +12,8 @@ # application.js, application.css, and all non-JS/CSS in the app/assets # folder are already added. # Rails.application.config.assets.precompile += %w( admin.js admin.css ) +Rails.application.config.assets.configure do |env| + env.cache = Sprockets::Cache::FileStore.new( + ENV.fetch("SPROCKETS_CACHE", "#{env.root}/tmp/cache/assets"), 0, env.logger + ) +end diff --git a/docker-compose.yml b/docker-compose.yml index 2d2e788fe..e274c3d1e 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -4,7 +4,7 @@ services: db: image: postgres volumes: - - ./tmp/db:/var/lib/postgresql/data + - postgres_data:/var/lib/postgresql/data environment: POSTGRES_HOST_AUTH_METHOD: trust ports: @@ -15,10 +15,16 @@ services: volumes: - .:/sample_rails_application - /sample_rails_application/node_modules + - sprockets_cache:/sprockets_cache ports: - "3000:3000" # Ports required for debugging - "1234:1234" - "26166:26168" + environment: + - SPROCKETS_CACHE=/sprockets_cache depends_on: - - db \ No newline at end of file + - db +volumes: + postgres_data: + sprockets_cache: From b079a9504af629b2f8eb115da4d3aa5f88e11d03 Mon Sep 17 00:00:00 2001 From: Jeremy Kennedy Date: Thu, 8 Apr 2021 21:19:02 -0400 Subject: [PATCH 2/3] update Gemfile.lock to match updated Gemfile from previous commit --- Gemfile.lock | 172 +++++++++++++++++++++++++-------------------------- 1 file changed, 85 insertions(+), 87 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index abb4076db..27b9b2393 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,63 +1,63 @@ GEM remote: https://rubygems.org/ specs: - actioncable (6.0.2.1) - actionpack (= 6.0.2.1) + actioncable (6.0.3.6) + actionpack (= 6.0.3.6) nio4r (~> 2.0) websocket-driver (>= 0.6.1) - actionmailbox (6.0.2.1) - actionpack (= 6.0.2.1) - activejob (= 6.0.2.1) - activerecord (= 6.0.2.1) - activestorage (= 6.0.2.1) - activesupport (= 6.0.2.1) + actionmailbox (6.0.3.6) + actionpack (= 6.0.3.6) + activejob (= 6.0.3.6) + activerecord (= 6.0.3.6) + activestorage (= 6.0.3.6) + activesupport (= 6.0.3.6) mail (>= 2.7.1) - actionmailer (6.0.2.1) - actionpack (= 6.0.2.1) - actionview (= 6.0.2.1) - activejob (= 6.0.2.1) + actionmailer (6.0.3.6) + actionpack (= 6.0.3.6) + actionview (= 6.0.3.6) + activejob (= 6.0.3.6) mail (~> 2.5, >= 2.5.4) rails-dom-testing (~> 2.0) - actionpack (6.0.2.1) - actionview (= 6.0.2.1) - activesupport (= 6.0.2.1) + actionpack (6.0.3.6) + actionview (= 6.0.3.6) + activesupport (= 6.0.3.6) rack (~> 2.0, >= 2.0.8) rack-test (>= 0.6.3) rails-dom-testing (~> 2.0) rails-html-sanitizer (~> 1.0, >= 1.2.0) - actiontext (6.0.2.1) - actionpack (= 6.0.2.1) - activerecord (= 6.0.2.1) - activestorage (= 6.0.2.1) - activesupport (= 6.0.2.1) + actiontext (6.0.3.6) + actionpack (= 6.0.3.6) + activerecord (= 6.0.3.6) + activestorage (= 6.0.3.6) + activesupport (= 6.0.3.6) nokogiri (>= 1.8.5) - actionview (6.0.2.1) - activesupport (= 6.0.2.1) + actionview (6.0.3.6) + activesupport (= 6.0.3.6) builder (~> 3.1) erubi (~> 1.4) rails-dom-testing (~> 2.0) rails-html-sanitizer (~> 1.1, >= 1.2.0) active_storage_validations (0.8.2) rails (>= 5.2.0) - activejob (6.0.2.1) - activesupport (= 6.0.2.1) + activejob (6.0.3.6) + activesupport (= 6.0.3.6) globalid (>= 0.3.6) - activemodel (6.0.2.1) - activesupport (= 6.0.2.1) - activerecord (6.0.2.1) - activemodel (= 6.0.2.1) - activesupport (= 6.0.2.1) - activestorage (6.0.2.1) - actionpack (= 6.0.2.1) - activejob (= 6.0.2.1) - activerecord (= 6.0.2.1) - marcel (~> 0.3.1) - activesupport (6.0.2.1) + activemodel (6.0.3.6) + activesupport (= 6.0.3.6) + activerecord (6.0.3.6) + activemodel (= 6.0.3.6) + activesupport (= 6.0.3.6) + activestorage (6.0.3.6) + actionpack (= 6.0.3.6) + activejob (= 6.0.3.6) + activerecord (= 6.0.3.6) + marcel (~> 1.0.0) + activesupport (6.0.3.6) concurrent-ruby (~> 1.0, >= 1.0.2) i18n (>= 0.7, < 2) minitest (~> 5.1) tzinfo (~> 1.1) - zeitwerk (~> 2.2) + zeitwerk (~> 2.2, >= 2.2.2) addressable (2.7.0) public_suffix (>= 2.0.2, < 5.0) ansi (1.5.0) @@ -101,17 +101,17 @@ GEM childprocess (1.0.1) rake (< 13.0) coderay (1.1.2) - concurrent-ruby (1.1.6) + concurrent-ruby (1.1.8) crass (1.0.6) diff-lcs (1.3) - docile (1.3.2) - erubi (1.9.0) + docile (1.3.5) + erubi (1.10.0) execjs (2.7.0) - factory_bot (5.1.1) - activesupport (>= 4.2.0) - factory_bot_rails (5.1.1) - factory_bot (~> 5.1.0) - railties (>= 4.2.0) + factory_bot (6.1.0) + activesupport (>= 5.0.0) + factory_bot_rails (6.1.0) + factory_bot (~> 6.1.0) + railties (>= 5.0.0) faker (2.1.2) i18n (>= 0.8) ffi (1.12.2) @@ -131,7 +131,7 @@ GEM guard-minitest (2.4.6) guard-compat (~> 1.2) minitest (>= 3.0) - i18n (1.8.2) + i18n (1.8.10) concurrent-ruby (~> 1.0) image_processing (1.9.3) mini_magick (>= 4.9.5, < 5) @@ -139,24 +139,21 @@ GEM jbuilder (2.9.1) activesupport (>= 4.2.0) jmespath (1.4.0) - json (2.3.0) listen (3.1.5) rb-fsevent (~> 0.9, >= 0.9.4) rb-inotify (~> 0.9, >= 0.9.7) ruby_dep (~> 1.2) - loofah (2.4.0) + loofah (2.9.1) crass (~> 1.0.2) nokogiri (>= 1.5.9) lumberjack (1.2.4) mail (2.7.1) mini_mime (>= 0.1.1) - marcel (0.3.3) - mimemagic (~> 0.3.2) + marcel (1.0.1) method_source (0.9.2) - mimemagic (0.3.4) mini_magick (4.9.5) - mini_mime (1.0.2) - mini_portile2 (2.4.0) + mini_mime (1.1.0) + mini_portile2 (2.5.0) minitest (5.11.3) minitest-reporters (1.3.8) ansi @@ -165,9 +162,10 @@ GEM ruby-progressbar msgpack (1.3.3) nenv (0.3.0) - nio4r (2.5.2) - nokogiri (1.10.9) - mini_portile2 (~> 2.4.0) + nio4r (2.5.7) + nokogiri (1.11.3) + mini_portile2 (~> 2.5.0) + racc (~> 1.4) notiffany (0.1.3) nenv (~> 0.1) shellany (~> 0.0) @@ -177,25 +175,26 @@ GEM method_source (~> 0.9.0) public_suffix (4.0.3) puma (3.12.2) - rack (2.2.2) + racc (1.5.2) + rack (2.2.3) rack-proxy (0.6.5) rack rack-test (1.1.0) rack (>= 1.0, < 3) - rails (6.0.2.1) - actioncable (= 6.0.2.1) - actionmailbox (= 6.0.2.1) - actionmailer (= 6.0.2.1) - actionpack (= 6.0.2.1) - actiontext (= 6.0.2.1) - actionview (= 6.0.2.1) - activejob (= 6.0.2.1) - activemodel (= 6.0.2.1) - activerecord (= 6.0.2.1) - activestorage (= 6.0.2.1) - activesupport (= 6.0.2.1) + rails (6.0.3.6) + actioncable (= 6.0.3.6) + actionmailbox (= 6.0.3.6) + actionmailer (= 6.0.3.6) + actionpack (= 6.0.3.6) + actiontext (= 6.0.3.6) + actionview (= 6.0.3.6) + activejob (= 6.0.3.6) + activemodel (= 6.0.3.6) + activerecord (= 6.0.3.6) + activestorage (= 6.0.3.6) + activesupport (= 6.0.3.6) bundler (>= 1.3.0) - railties (= 6.0.2.1) + railties (= 6.0.3.6) sprockets-rails (>= 2.0.0) rails-controller-testing (1.0.4) actionpack (>= 5.0.1.x) @@ -206,9 +205,9 @@ GEM nokogiri (>= 1.6) rails-html-sanitizer (1.3.0) loofah (~> 2.3) - railties (6.0.2.1) - actionpack (= 6.0.2.1) - activesupport (= 6.0.2.1) + railties (6.0.3.6) + actionpack (= 6.0.3.6) + activesupport (= 6.0.3.6) method_source rake (>= 0.8.7) thor (>= 0.20.3, < 2.0) @@ -256,11 +255,10 @@ GEM childprocess (>= 0.5, < 2.0) rubyzip (~> 1.2, >= 1.2.2) shellany (0.0.1) - simplecov (0.17.1) + simplecov (0.19.0) docile (~> 1.1) - json (>= 1.8, < 3) - simplecov-html (~> 0.10.0) - simplecov-html (0.10.2) + simplecov-html (~> 0.11) + simplecov-html (0.12.3) spring (2.1.0) spring-watcher-listen (2.0.1) listen (>= 2.7, < 4.0) @@ -268,18 +266,18 @@ GEM sprockets (3.7.2) concurrent-ruby (~> 1.0) rack (> 1, < 3) - sprockets-rails (3.2.1) + sprockets-rails (3.2.2) actionpack (>= 4.0) activesupport (>= 4.0) sprockets (>= 3.0.0) sqlite3 (1.4.1) - thor (1.0.1) + thor (1.1.0) thread_safe (0.3.6) tilt (2.0.10) turbolinks (5.2.0) turbolinks-source (~> 5.2) turbolinks-source (5.2.0) - tzinfo (1.2.6) + tzinfo (1.2.9) thread_safe (~> 0.1) web-console (4.0.1) actionview (>= 6.0.0) @@ -294,13 +292,13 @@ GEM activesupport (>= 4.2) rack-proxy (>= 0.6.1) railties (>= 4.2) - websocket-driver (0.7.1) + websocket-driver (0.7.3) websocket-extensions (>= 0.1.0) - websocket-extensions (0.1.4) + websocket-extensions (0.1.5) will_paginate (3.1.8) xpath (3.2.0) nokogiri (~> 1.8) - zeitwerk (2.3.0) + zeitwerk (2.4.2) PLATFORMS ruby @@ -314,8 +312,8 @@ DEPENDENCIES bootstrap-will_paginate (= 1.0.0) byebug (= 11.0.1) capybara (= 3.28.0) - factory_bot (= 5.1.1) - factory_bot_rails (= 5.1.1) + factory_bot (= 6.1.0) + factory_bot_rails (= 6.1.0) faker (= 2.1.2) guard (= 2.15.0) guard-minitest (= 2.4.6) @@ -327,12 +325,12 @@ DEPENDENCIES minitest-reporters (= 1.3.8) pg (= 1.1.4) puma (= 3.12.2) - rails (= 6.0.2.1) + rails (= 6.0.3.6) rails-controller-testing (= 1.0.4) rspec-rails (= 3.9.0) sass-rails (= 5.1.0) selenium-webdriver (= 3.142.3) - simplecov (= 0.17.1) + simplecov (= 0.19.0) spring (= 2.1.0) spring-watcher-listen (= 2.0.1) sqlite3 (= 1.4.1) @@ -344,4 +342,4 @@ DEPENDENCIES will_paginate (= 3.1.8) BUNDLED WITH - 2.0.2 + 2.2.15 From 6afd27596af70b5507eb3fc9f4f23c1dd6f15ffe Mon Sep 17 00:00:00 2001 From: Jeremy Kennedy Date: Thu, 8 Apr 2021 21:53:58 -0400 Subject: [PATCH 3/3] add rubocop to Gemfile --- Gemfile | 1 + Gemfile.lock | 19 +++++++++++++++++++ 2 files changed, 20 insertions(+) diff --git a/Gemfile b/Gemfile index 68b0558d7..342478bd6 100644 --- a/Gemfile +++ b/Gemfile @@ -33,6 +33,7 @@ group :development do gem 'listen', '3.1.5' gem 'spring', '2.1.0' gem 'spring-watcher-listen', '2.0.1' + gem "rubocop", '0.92.0' end group :test do diff --git a/Gemfile.lock b/Gemfile.lock index 27b9b2393..17b65fa2b 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -61,6 +61,7 @@ GEM addressable (2.7.0) public_suffix (>= 2.0.2, < 5.0) ansi (1.5.0) + ast (2.4.2) autoprefixer-rails (9.7.4) execjs aws-eventstream (1.0.3) @@ -169,6 +170,9 @@ GEM notiffany (0.1.3) nenv (~> 0.1) shellany (~> 0.0) + parallel (1.20.1) + parser (3.0.1.0) + ast (~> 2.4.1) pg (1.1.4) pry (0.12.2) coderay (~> 1.1.0) @@ -211,11 +215,13 @@ GEM method_source rake (>= 0.8.7) thor (>= 0.20.3, < 2.0) + rainbow (3.0.0) rake (12.3.3) rb-fsevent (0.10.3) rb-inotify (0.10.1) ffi (~> 1.0) regexp_parser (1.7.0) + rexml (3.2.5) rspec-core (3.9.1) rspec-support (~> 3.9.1) rspec-expectations (3.9.0) @@ -233,6 +239,17 @@ GEM rspec-mocks (~> 3.9.0) rspec-support (~> 3.9.0) rspec-support (3.9.2) + rubocop (0.92.0) + parallel (~> 1.10) + parser (>= 2.7.1.5) + rainbow (>= 2.2.2, < 4.0) + regexp_parser (>= 1.7) + rexml + rubocop-ast (>= 0.5.0) + ruby-progressbar (~> 1.7) + unicode-display_width (>= 1.4.0, < 2.0) + rubocop-ast (1.4.1) + parser (>= 2.7.1.5) ruby-progressbar (1.10.1) ruby-vips (2.0.17) ffi (~> 1.9) @@ -279,6 +296,7 @@ GEM turbolinks-source (5.2.0) tzinfo (1.2.9) thread_safe (~> 0.1) + unicode-display_width (1.7.0) web-console (4.0.1) actionview (>= 6.0.0) activemodel (>= 6.0.0) @@ -328,6 +346,7 @@ DEPENDENCIES rails (= 6.0.3.6) rails-controller-testing (= 1.0.4) rspec-rails (= 3.9.0) + rubocop (= 0.92.0) sass-rails (= 5.1.0) selenium-webdriver (= 3.142.3) simplecov (= 0.19.0)