diff --git a/.rubocop.yml b/.rubocop.yml index da0512c..4c9bfc2 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -11,6 +11,7 @@ AllCops: - 'db/schema.rb' - 'lib/tasks/cucumber.rake' - 'lib/templates/**/*' + - 'node_modules/**/*' - 'script/cucumber' - 'vendor/**/*' diff --git a/.travis.yml b/.travis.yml index 60eb4fa..3bc91f9 100644 --- a/.travis.yml +++ b/.travis.yml @@ -7,6 +7,8 @@ services: env: global: + - RAILS_WEB_CONCURRENCY=1 + - RAILS_MIN_THREADS=1 - RAILS_MAX_THREADS=5 - SIDEKIQ_CONCURRENCY=5 diff --git a/Gemfile b/Gemfile index a30f20e..fce927f 100644 --- a/Gemfile +++ b/Gemfile @@ -4,7 +4,7 @@ ruby '2.7.0' source 'https://rubygems.org' -git_source(:github) { |s| "https://github.com/#{s}.git" } +git_source(:github) { |repo| "https://github.com/#{repo}.git" } gem 'aws-sdk-s3', require: false gem 'bcrypt', '~> 3.1' @@ -28,7 +28,7 @@ gem 'puma', '~> 4.2' gem 'pundit', '~> 2.1' gem 'rack', '= 2.2.0', github: 'rack/rack' gem 'rack-attack', '~> 6.1' -gem 'rails', '~> 6.0.0' +gem 'rails', '~> 6.0.2', '~> 6.0.2.1' gem 'rails-i18n', '~> 6.0.0' gem 'recaptcha', '~> 5.1' gem 'redis', '~> 4.1' diff --git a/Gemfile.lock b/Gemfile.lock index a126f26..ff24f32 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -530,7 +530,7 @@ DEPENDENCIES pundit-matchers (~> 1.6) rack (= 2.2.0)! rack-attack (~> 6.1) - rails (~> 6.0.0) + rails (~> 6.0.2.1, ~> 6.0.2) rails-erd (~> 1.5) rails-i18n (~> 6.0.0) recaptcha (~> 5.1) diff --git a/LICENSE b/LICENSE index 86621c1..85510c9 100644 --- a/LICENSE +++ b/LICENSE @@ -1,6 +1,6 @@ MIT License -Copyright (c) 2018-2019 Alex Kotov +Copyright (c) 2018-2020 Alex Kotov Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/config/application.rb b/config/application.rb index 1da228a..192580d 100644 --- a/config/application.rb +++ b/config/application.rb @@ -4,13 +4,13 @@ require_relative 'boot' require 'rails' # Pick the frameworks you want: -require 'active_model/railtie' -require 'active_job/railtie' -require 'active_record/railtie' -require 'active_storage/engine' require 'action_controller/railtie' require 'action_mailer/railtie' require 'action_view/railtie' +require 'active_job/railtie' +require 'active_model/railtie' +require 'active_record/railtie' +require 'active_storage/engine' require 'sprockets/railtie' # Require the gems listed in Gemfile, including any gems @@ -57,7 +57,8 @@ module Partynest config_for("settings/#{name}").deep_symbolize_keys.freeze end - # Initialize configuration defaults for originally generated Rails version. + # Initialize configuration defaults + # for originally generated Rails version. config.load_defaults 5.2 # Custom directories with classes and modules you want to be autoloadable. diff --git a/config/puma/development.rb b/config/puma/development.rb index 7da0e5b..ecc8a2c 100644 --- a/config/puma/development.rb +++ b/config/puma/development.rb @@ -2,8 +2,10 @@ root_dir = File.expand_path '../..', __dir__ -workers_count = ENV.fetch('WEB_CONCURRENCY') { 1 } -threads_count = ENV.fetch('RAILS_MAX_THREADS') { 5 } +workers_count = ENV.fetch('RAILS_WEB_CONCURRENCY') { 1 } +max_threads_count = ENV.fetch('RAILS_MAX_THREADS') { 5 } +min_threads_count = ENV.fetch('RAILS_MIN_THREADS') { max_threads_count } +port_number = ENV.fetch('PORT') { 3000 } # Specifies the number of `workers` to boot in clustered mode. # Workers are forked webserver processes. If using threads and workers together @@ -19,7 +21,7 @@ workers workers_count # the maximum value specified for Puma. Default is set to 5 threads for minimum # and maximum; this matches the default thread size of Active Record. # -threads threads_count, threads_count +threads min_threads_count, max_threads_count # Use the `preload_app!` method when specifying a `workers` number. # This directive tells Puma to first boot the application and load code @@ -31,7 +33,7 @@ threads threads_count, threads_count # Specifies the `port` that Puma will listen on to receive requests; # default is 3000. # -port ENV.fetch('PORT') { 3000 } +port port_number # Allow puma to be restarted by `rails restart` command. plugin :tmp_restart diff --git a/config/puma/production.rb b/config/puma/production.rb index 32c02be..be1ddc2 100644 --- a/config/puma/production.rb +++ b/config/puma/production.rb @@ -2,8 +2,9 @@ root_dir = File.expand_path '../..', __dir__ -workers_count = ENV.fetch('WEB_CONCURRENCY') { 1 } -threads_count = ENV.fetch('RAILS_MAX_THREADS') { 5 } +workers_count = ENV.fetch('RAILS_WEB_CONCURRENCY') { 1 } +max_threads_count = ENV.fetch('RAILS_MAX_THREADS') { 5 } +min_threads_count = ENV.fetch('RAILS_MIN_THREADS') { max_threads_count } # Specifies the number of `workers` to boot in clustered mode. # Workers are forked webserver processes. If using threads and workers together @@ -19,7 +20,7 @@ workers workers_count # the maximum value specified for Puma. Default is set to 5 threads for minimum # and maximum; this matches the default thread size of Active Record. # -threads threads_count, threads_count +threads min_threads_count, max_threads_count # Use the `preload_app!` method when specifying a `workers` number. # This directive tells Puma to first boot the application and load code @@ -33,9 +34,6 @@ threads threads_count, threads_count # bind "unix://#{File.join(root_dir, 'tmp', 'sockets', 'puma.sock')}" -# Allow puma to be restarted by `rails restart` command. -# plugin :tmp_restart - # Use "path" as the file to store the server info state. This is # used by "pumactl" to query and control the server. # diff --git a/config/puma/staging.rb b/config/puma/staging.rb index 32c02be..be1ddc2 100644 --- a/config/puma/staging.rb +++ b/config/puma/staging.rb @@ -2,8 +2,9 @@ root_dir = File.expand_path '../..', __dir__ -workers_count = ENV.fetch('WEB_CONCURRENCY') { 1 } -threads_count = ENV.fetch('RAILS_MAX_THREADS') { 5 } +workers_count = ENV.fetch('RAILS_WEB_CONCURRENCY') { 1 } +max_threads_count = ENV.fetch('RAILS_MAX_THREADS') { 5 } +min_threads_count = ENV.fetch('RAILS_MIN_THREADS') { max_threads_count } # Specifies the number of `workers` to boot in clustered mode. # Workers are forked webserver processes. If using threads and workers together @@ -19,7 +20,7 @@ workers workers_count # the maximum value specified for Puma. Default is set to 5 threads for minimum # and maximum; this matches the default thread size of Active Record. # -threads threads_count, threads_count +threads min_threads_count, max_threads_count # Use the `preload_app!` method when specifying a `workers` number. # This directive tells Puma to first boot the application and load code @@ -33,9 +34,6 @@ threads threads_count, threads_count # bind "unix://#{File.join(root_dir, 'tmp', 'sockets', 'puma.sock')}" -# Allow puma to be restarted by `rails restart` command. -# plugin :tmp_restart - # Use "path" as the file to store the server info state. This is # used by "pumactl" to query and control the server. # diff --git a/config/spring.rb b/config/spring.rb index c5933e4..c31fc59 100644 --- a/config/spring.rb +++ b/config/spring.rb @@ -1,8 +1,9 @@ # frozen_string_literal: true -%w[ - .ruby-version - .rbenv-vars - tmp/restart.txt - tmp/caching-dev.txt -].each { |path| Spring.watch(path) } +Spring.watch( + '.ruby-version', + '.ruby-gemset', + '.rbenv-vars', + 'tmp/restart.txt', + 'tmp/caching-dev.txt', +) diff --git a/config/storage.yml b/config/storage.yml index 5ccd70d..de3a961 100644 --- a/config/storage.yml +++ b/config/storage.yml @@ -1,6 +1,6 @@ test: service: Disk - root: <%= Rails.root.join 'tmp', 'storage' %> + root: <%= Rails.root.join 'tmp/storage' %> local: service: Disk diff --git a/db/seeds.rb b/db/seeds.rb index 8622cd9..57e14a8 100644 --- a/db/seeds.rb +++ b/db/seeds.rb @@ -4,7 +4,7 @@ require 'csv' def csv_foreach(filename, &block) CSV.foreach( - Rails.root.join('db', 'data', "#{filename}.csv"), + Rails.root.join("db/data/#{filename}.csv"), col_sep: '|', &block )