mirror of
https://github.com/Evolix/chexpire.git
synced 2024-05-06 18:48:38 +02:00
trying to upgrade to Rails 6.0.0.beta2
This commit is contained in:
parent
3b6ceae25c
commit
50507f2d3b
3
.gitignore
vendored
3
.gitignore
vendored
|
@ -19,9 +19,6 @@
|
||||||
# Ignore uploaded files in development
|
# Ignore uploaded files in development
|
||||||
/storage/*
|
/storage/*
|
||||||
|
|
||||||
/node_modules
|
|
||||||
/yarn-error.log
|
|
||||||
|
|
||||||
/public/assets
|
/public/assets
|
||||||
.byebug_history
|
.byebug_history
|
||||||
|
|
||||||
|
|
17
Gemfile
17
Gemfile
|
@ -4,7 +4,7 @@ git_source(:github) { |repo| "https://github.com/#{repo}.git" }
|
||||||
ruby '>= 2.3.3'
|
ruby '>= 2.3.3'
|
||||||
|
|
||||||
# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
|
# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
|
||||||
gem 'rails', '~> 5.2.0'
|
gem 'rails', '6.0.0.beta2'
|
||||||
gem 'rails-i18n', '~> 5.1'
|
gem 'rails-i18n', '~> 5.1'
|
||||||
# Use mysql as the database for Active Record
|
# Use mysql as the database for Active Record
|
||||||
gem 'mysql2', '>= 0.4.4', '< 0.6.0'
|
gem 'mysql2', '>= 0.4.4', '< 0.6.0'
|
||||||
|
@ -18,23 +18,20 @@ gem 'pundit', '~> 1.1'
|
||||||
|
|
||||||
# Use SCSS for stylesheets
|
# Use SCSS for stylesheets
|
||||||
gem 'sass-rails', '~> 5.0'
|
gem 'sass-rails', '~> 5.0'
|
||||||
# Use Uglifier as compressor for JavaScript assets
|
# Transpile app-like JavaScript. Read more: https://github.com/rails/webpacker
|
||||||
gem 'uglifier', '>= 1.3.0'
|
gem 'webpacker', '>= 4.0.0.rc.3'
|
||||||
gem 'webpacker', '~> 3.5'
|
|
||||||
# See https://github.com/rails/execjs#readme for more supported runtimes
|
# See https://github.com/rails/execjs#readme for more supported runtimes
|
||||||
# gem 'mini_racer', platforms: :ruby
|
# gem 'mini_racer', platforms: :ruby
|
||||||
|
|
||||||
# Use CoffeeScript for .coffee assets and views
|
|
||||||
# gem 'coffee-rails', '~> 4.2'
|
|
||||||
# Turbolinks makes navigating your web application faster. Read more: https://github.com/turbolinks/turbolinks
|
# Turbolinks makes navigating your web application faster. Read more: https://github.com/turbolinks/turbolinks
|
||||||
gem 'turbolinks', '~> 5'
|
gem 'turbolinks', '~> 5'
|
||||||
# Build JSON APIs with ease. Read more: https://github.com/rails/jbuilder
|
# Build JSON APIs with ease. Read more: https://github.com/rails/jbuilder
|
||||||
gem 'jbuilder', '~> 2.5'
|
gem 'jbuilder', '~> 2.5'
|
||||||
# Use ActiveModel has_secure_password
|
# Use Active Model has_secure_password
|
||||||
gem 'bcrypt', '~> 3.1.7'
|
gem 'bcrypt', '~> 3.1.7'
|
||||||
|
|
||||||
# Use ActiveStorage variant
|
# Use Active Storage variant
|
||||||
# gem 'mini_magick', '~> 4.8'
|
# gem 'image_processing', '~> 1.2'
|
||||||
|
|
||||||
gem 'rack-contrib'
|
gem 'rack-contrib'
|
||||||
|
|
||||||
|
@ -51,7 +48,7 @@ gem 'has_scope'
|
||||||
gem 'logging'
|
gem 'logging'
|
||||||
|
|
||||||
# Reduces boot times through caching; required in config/boot.rb
|
# Reduces boot times through caching; required in config/boot.rb
|
||||||
gem 'bootsnap', '>= 1.1.0', require: false
|
gem 'bootsnap', '>= 1.4.1', require: false
|
||||||
|
|
||||||
group :development, :test do
|
group :development, :test do
|
||||||
# Call 'byebug' anywhere in the code to stop execution and get a debugger console
|
# Call 'byebug' anywhere in the code to stop execution and get a debugger console
|
||||||
|
|
105
Gemfile.lock
105
Gemfile.lock
|
@ -1,47 +1,60 @@
|
||||||
GEM
|
GEM
|
||||||
remote: https://rubygems.org/
|
remote: https://rubygems.org/
|
||||||
specs:
|
specs:
|
||||||
actioncable (5.2.2)
|
actioncable (6.0.0.beta2)
|
||||||
actionpack (= 5.2.2)
|
actionpack (= 6.0.0.beta2)
|
||||||
nio4r (~> 2.0)
|
nio4r (~> 2.0)
|
||||||
websocket-driver (>= 0.6.1)
|
websocket-driver (>= 0.6.1)
|
||||||
actionmailer (5.2.2)
|
actionmailbox (6.0.0.beta2)
|
||||||
actionpack (= 5.2.2)
|
actionpack (= 6.0.0.beta2)
|
||||||
actionview (= 5.2.2)
|
activejob (= 6.0.0.beta2)
|
||||||
activejob (= 5.2.2)
|
activerecord (= 6.0.0.beta2)
|
||||||
|
activestorage (= 6.0.0.beta2)
|
||||||
|
activesupport (= 6.0.0.beta2)
|
||||||
|
mail (>= 2.7.1)
|
||||||
|
actionmailer (6.0.0.beta2)
|
||||||
|
actionpack (= 6.0.0.beta2)
|
||||||
|
actionview (= 6.0.0.beta2)
|
||||||
|
activejob (= 6.0.0.beta2)
|
||||||
mail (~> 2.5, >= 2.5.4)
|
mail (~> 2.5, >= 2.5.4)
|
||||||
rails-dom-testing (~> 2.0)
|
rails-dom-testing (~> 2.0)
|
||||||
actionpack (5.2.2)
|
actionpack (6.0.0.beta2)
|
||||||
actionview (= 5.2.2)
|
actionview (= 6.0.0.beta2)
|
||||||
activesupport (= 5.2.2)
|
activesupport (= 6.0.0.beta2)
|
||||||
rack (~> 2.0)
|
rack (~> 2.0)
|
||||||
rack-test (>= 0.6.3)
|
rack-test (>= 0.6.3)
|
||||||
rails-dom-testing (~> 2.0)
|
rails-dom-testing (~> 2.0)
|
||||||
rails-html-sanitizer (~> 1.0, >= 1.0.2)
|
rails-html-sanitizer (~> 1.0, >= 1.0.2)
|
||||||
actionview (5.2.2)
|
actiontext (6.0.0.beta2)
|
||||||
activesupport (= 5.2.2)
|
actionpack (= 6.0.0.beta2)
|
||||||
|
activerecord (= 6.0.0.beta2)
|
||||||
|
activestorage (= 6.0.0.beta2)
|
||||||
|
activesupport (= 6.0.0.beta2)
|
||||||
|
nokogiri (>= 1.8.5)
|
||||||
|
actionview (6.0.0.beta2)
|
||||||
|
activesupport (= 6.0.0.beta2)
|
||||||
builder (~> 3.1)
|
builder (~> 3.1)
|
||||||
erubi (~> 1.4)
|
erubi (~> 1.4)
|
||||||
rails-dom-testing (~> 2.0)
|
rails-dom-testing (~> 2.0)
|
||||||
rails-html-sanitizer (~> 1.0, >= 1.0.3)
|
rails-html-sanitizer (~> 1.0, >= 1.0.3)
|
||||||
activejob (5.2.2)
|
activejob (6.0.0.beta2)
|
||||||
activesupport (= 5.2.2)
|
activesupport (= 6.0.0.beta2)
|
||||||
globalid (>= 0.3.6)
|
globalid (>= 0.3.6)
|
||||||
activemodel (5.2.2)
|
activemodel (6.0.0.beta2)
|
||||||
activesupport (= 5.2.2)
|
activesupport (= 6.0.0.beta2)
|
||||||
activerecord (5.2.2)
|
activerecord (6.0.0.beta2)
|
||||||
activemodel (= 5.2.2)
|
activemodel (= 6.0.0.beta2)
|
||||||
activesupport (= 5.2.2)
|
activesupport (= 6.0.0.beta2)
|
||||||
arel (>= 9.0)
|
activestorage (6.0.0.beta2)
|
||||||
activestorage (5.2.2)
|
actionpack (= 6.0.0.beta2)
|
||||||
actionpack (= 5.2.2)
|
activerecord (= 6.0.0.beta2)
|
||||||
activerecord (= 5.2.2)
|
|
||||||
marcel (~> 0.3.1)
|
marcel (~> 0.3.1)
|
||||||
activesupport (5.2.2)
|
activesupport (6.0.0.beta2)
|
||||||
concurrent-ruby (~> 1.0, >= 1.0.2)
|
concurrent-ruby (~> 1.0, >= 1.0.2)
|
||||||
i18n (>= 0.7, < 2)
|
i18n (>= 0.7, < 2)
|
||||||
minitest (~> 5.1)
|
minitest (~> 5.1)
|
||||||
tzinfo (~> 1.1)
|
tzinfo (~> 1.1)
|
||||||
|
zeitwerk (~> 1.3, >= 1.3.1)
|
||||||
addressable (2.6.0)
|
addressable (2.6.0)
|
||||||
public_suffix (>= 2.0.2, < 4.0)
|
public_suffix (>= 2.0.2, < 4.0)
|
||||||
airbrussh (1.3.1)
|
airbrussh (1.3.1)
|
||||||
|
@ -51,7 +64,6 @@ GEM
|
||||||
rake (>= 10.4, < 13.0)
|
rake (>= 10.4, < 13.0)
|
||||||
archive-zip (0.12.0)
|
archive-zip (0.12.0)
|
||||||
io-like (~> 0.3.0)
|
io-like (~> 0.3.0)
|
||||||
arel (9.0.0)
|
|
||||||
ast (2.4.0)
|
ast (2.4.0)
|
||||||
bcrypt (3.1.12)
|
bcrypt (3.1.12)
|
||||||
bcrypt_pbkdf (1.0.0)
|
bcrypt_pbkdf (1.0.0)
|
||||||
|
@ -108,7 +120,6 @@ GEM
|
||||||
devise (>= 4.6)
|
devise (>= 4.6)
|
||||||
docile (1.3.1)
|
docile (1.3.1)
|
||||||
erubi (1.8.0)
|
erubi (1.8.0)
|
||||||
execjs (2.7.0)
|
|
||||||
factory_bot (5.0.2)
|
factory_bot (5.0.2)
|
||||||
activesupport (>= 4.2.0)
|
activesupport (>= 4.2.0)
|
||||||
factory_bot_rails (5.0.1)
|
factory_bot_rails (5.0.1)
|
||||||
|
@ -224,18 +235,20 @@ GEM
|
||||||
rack
|
rack
|
||||||
rack-test (1.1.0)
|
rack-test (1.1.0)
|
||||||
rack (>= 1.0, < 3)
|
rack (>= 1.0, < 3)
|
||||||
rails (5.2.2)
|
rails (6.0.0.beta2)
|
||||||
actioncable (= 5.2.2)
|
actioncable (= 6.0.0.beta2)
|
||||||
actionmailer (= 5.2.2)
|
actionmailbox (= 6.0.0.beta2)
|
||||||
actionpack (= 5.2.2)
|
actionmailer (= 6.0.0.beta2)
|
||||||
actionview (= 5.2.2)
|
actionpack (= 6.0.0.beta2)
|
||||||
activejob (= 5.2.2)
|
actiontext (= 6.0.0.beta2)
|
||||||
activemodel (= 5.2.2)
|
actionview (= 6.0.0.beta2)
|
||||||
activerecord (= 5.2.2)
|
activejob (= 6.0.0.beta2)
|
||||||
activestorage (= 5.2.2)
|
activemodel (= 6.0.0.beta2)
|
||||||
activesupport (= 5.2.2)
|
activerecord (= 6.0.0.beta2)
|
||||||
|
activestorage (= 6.0.0.beta2)
|
||||||
|
activesupport (= 6.0.0.beta2)
|
||||||
bundler (>= 1.3.0)
|
bundler (>= 1.3.0)
|
||||||
railties (= 5.2.2)
|
railties (= 6.0.0.beta2)
|
||||||
sprockets-rails (>= 2.0.0)
|
sprockets-rails (>= 2.0.0)
|
||||||
rails-dom-testing (2.0.3)
|
rails-dom-testing (2.0.3)
|
||||||
activesupport (>= 4.2.0)
|
activesupport (>= 4.2.0)
|
||||||
|
@ -245,12 +258,12 @@ GEM
|
||||||
rails-i18n (5.1.3)
|
rails-i18n (5.1.3)
|
||||||
i18n (>= 0.7, < 2)
|
i18n (>= 0.7, < 2)
|
||||||
railties (>= 5.0, < 6)
|
railties (>= 5.0, < 6)
|
||||||
railties (5.2.2)
|
railties (6.0.0.beta2)
|
||||||
actionpack (= 5.2.2)
|
actionpack (= 6.0.0.beta2)
|
||||||
activesupport (= 5.2.2)
|
activesupport (= 6.0.0.beta2)
|
||||||
method_source
|
method_source
|
||||||
rake (>= 0.8.7)
|
rake (>= 0.8.7)
|
||||||
thor (>= 0.19.0, < 2.0)
|
thor (>= 0.20.3, < 2.0)
|
||||||
rainbow (3.0.0)
|
rainbow (3.0.0)
|
||||||
rake (12.3.2)
|
rake (12.3.2)
|
||||||
rb-fsevent (0.10.3)
|
rb-fsevent (0.10.3)
|
||||||
|
@ -318,8 +331,6 @@ GEM
|
||||||
turbolinks-source (5.2.0)
|
turbolinks-source (5.2.0)
|
||||||
tzinfo (1.2.5)
|
tzinfo (1.2.5)
|
||||||
thread_safe (~> 0.1)
|
thread_safe (~> 0.1)
|
||||||
uglifier (4.1.20)
|
|
||||||
execjs (>= 0.3.0, < 3)
|
|
||||||
unicode-display_width (1.4.1)
|
unicode-display_width (1.4.1)
|
||||||
warden (1.2.8)
|
warden (1.2.8)
|
||||||
rack (>= 2.0.6)
|
rack (>= 2.0.6)
|
||||||
|
@ -328,7 +339,7 @@ GEM
|
||||||
activemodel (>= 5.0)
|
activemodel (>= 5.0)
|
||||||
bindex (>= 0.4.0)
|
bindex (>= 0.4.0)
|
||||||
railties (>= 5.0)
|
railties (>= 5.0)
|
||||||
webpacker (3.5.5)
|
webpacker (4.0.0.rc.7)
|
||||||
activesupport (>= 4.2)
|
activesupport (>= 4.2)
|
||||||
rack-proxy (>= 0.6.1)
|
rack-proxy (>= 0.6.1)
|
||||||
railties (>= 4.2)
|
railties (>= 4.2)
|
||||||
|
@ -339,6 +350,7 @@ GEM
|
||||||
chronic (>= 0.6.3)
|
chronic (>= 0.6.3)
|
||||||
xpath (3.2.0)
|
xpath (3.2.0)
|
||||||
nokogiri (~> 1.8)
|
nokogiri (~> 1.8)
|
||||||
|
zeitwerk (1.3.1)
|
||||||
|
|
||||||
PLATFORMS
|
PLATFORMS
|
||||||
ruby
|
ruby
|
||||||
|
@ -348,7 +360,7 @@ DEPENDENCIES
|
||||||
bcrypt (~> 3.1.7)
|
bcrypt (~> 3.1.7)
|
||||||
bcrypt_pbkdf (>= 1.0, < 2.0)
|
bcrypt_pbkdf (>= 1.0, < 2.0)
|
||||||
binding_of_caller
|
binding_of_caller
|
||||||
bootsnap (>= 1.1.0)
|
bootsnap (>= 1.4.1)
|
||||||
capistrano (~> 3.10)
|
capistrano (~> 3.10)
|
||||||
capistrano-rails (~> 1.4)
|
capistrano-rails (~> 1.4)
|
||||||
capistrano-rbenv
|
capistrano-rbenv
|
||||||
|
@ -378,7 +390,7 @@ DEPENDENCIES
|
||||||
puma (~> 3.11)
|
puma (~> 3.11)
|
||||||
pundit (~> 1.1)
|
pundit (~> 1.1)
|
||||||
rack-contrib
|
rack-contrib
|
||||||
rails (~> 5.2.0)
|
rails (= 6.0.0.beta2)
|
||||||
rails-i18n (~> 5.1)
|
rails-i18n (~> 5.1)
|
||||||
rbnacl (>= 3.2, < 5.0)
|
rbnacl (>= 3.2, < 5.0)
|
||||||
rubocop (~> 0.56.0)
|
rubocop (~> 0.56.0)
|
||||||
|
@ -390,9 +402,8 @@ DEPENDENCIES
|
||||||
spring-watcher-listen (~> 2.0.0)
|
spring-watcher-listen (~> 2.0.0)
|
||||||
turbolinks (~> 5)
|
turbolinks (~> 5)
|
||||||
tzinfo-data
|
tzinfo-data
|
||||||
uglifier (>= 1.3.0)
|
|
||||||
web-console (>= 3.3.0)
|
web-console (>= 3.3.0)
|
||||||
webpacker (~> 3.5)
|
webpacker (>= 4.0.0.rc.3)
|
||||||
whenever
|
whenever
|
||||||
|
|
||||||
RUBY VERSION
|
RUBY VERSION
|
||||||
|
|
|
@ -1 +1,2 @@
|
||||||
//= link_tree ../images
|
//= link_tree ../images
|
||||||
|
//= link_directory ../stylesheets .css
|
||||||
|
|
9
app/javascript/channels/application.js
Normal file
9
app/javascript/channels/application.js
Normal file
|
@ -0,0 +1,9 @@
|
||||||
|
// This file is automatically compiled by Webpack, along with any other files
|
||||||
|
// present in this directory. You're encouraged to place your actual application logic in
|
||||||
|
// a relevant structure within app/javascript and only use these pack files to reference
|
||||||
|
// that code so it'll be compiled.
|
||||||
|
|
||||||
|
require("@rails/ujs").start()
|
||||||
|
require("turbolinks").start()
|
||||||
|
require("@rails/activestorage").start()
|
||||||
|
require("channels")
|
6
app/javascript/channels/consummer.js
Normal file
6
app/javascript/channels/consummer.js
Normal file
|
@ -0,0 +1,6 @@
|
||||||
|
// Action Cable provides the framework to deal with WebSockets in Rails.
|
||||||
|
// You can generate new channels where WebSocket features live using the `rails generate channel` command.
|
||||||
|
|
||||||
|
import { createConsumer } from "@rails/actioncable"
|
||||||
|
|
||||||
|
export default createConsumer()
|
5
app/javascript/channels/index.js
Normal file
5
app/javascript/channels/index.js
Normal file
|
@ -0,0 +1,5 @@
|
||||||
|
// Load all the channels within this directory and all subdirectories.
|
||||||
|
// Channel files must be named *_channel.js.
|
||||||
|
|
||||||
|
const channels = require.context('.', true, /_channel\.js$/)
|
||||||
|
channels.keys().forEach(channels)
|
|
@ -1,4 +1,10 @@
|
||||||
class ApplicationJob < ActiveJob::Base
|
class ApplicationJob < ActiveJob::Base
|
||||||
|
# Automatically retry jobs that encountered a deadlock
|
||||||
|
# retry_on ActiveRecord::Deadlocked
|
||||||
|
|
||||||
|
# Most jobs are safe to ignore if the underlying records are no longer available
|
||||||
|
# discard_on ActiveJob::DeserializationError
|
||||||
|
|
||||||
# from http://api.rubyonrails.org/classes/ActiveJob/Core.html
|
# from http://api.rubyonrails.org/classes/ActiveJob/Core.html
|
||||||
attr_writer :attempt_number
|
attr_writer :attempt_number
|
||||||
|
|
||||||
|
|
106
bin/bundle
Executable file → Normal file
106
bin/bundle
Executable file → Normal file
|
@ -1,3 +1,105 @@
|
||||||
#!/usr/bin/env ruby
|
#!/usr/bin/env ruby
|
||||||
ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../Gemfile', __dir__)
|
# frozen_string_literal: true
|
||||||
load Gem.bin_path('bundler', 'bundle')
|
|
||||||
|
#
|
||||||
|
# This file was generated by Bundler.
|
||||||
|
#
|
||||||
|
# The application 'bundle' is installed as part of a gem, and
|
||||||
|
# this file is here to facilitate running it.
|
||||||
|
#
|
||||||
|
|
||||||
|
require "rubygems"
|
||||||
|
|
||||||
|
m = Module.new do
|
||||||
|
module_function
|
||||||
|
|
||||||
|
def invoked_as_script?
|
||||||
|
File.expand_path($0) == File.expand_path(__FILE__)
|
||||||
|
end
|
||||||
|
|
||||||
|
def env_var_version
|
||||||
|
ENV["BUNDLER_VERSION"]
|
||||||
|
end
|
||||||
|
|
||||||
|
def cli_arg_version
|
||||||
|
return unless invoked_as_script? # don't want to hijack other binstubs
|
||||||
|
return unless "update".start_with?(ARGV.first || " ") # must be running `bundle update`
|
||||||
|
bundler_version = nil
|
||||||
|
update_index = nil
|
||||||
|
ARGV.each_with_index do |a, i|
|
||||||
|
if update_index && update_index.succ == i && a =~ Gem::Version::ANCHORED_VERSION_PATTERN
|
||||||
|
bundler_version = a
|
||||||
|
end
|
||||||
|
next unless a =~ /\A--bundler(?:[= ](#{Gem::Version::VERSION_PATTERN}))?\z/
|
||||||
|
bundler_version = $1 || ">= 0.a"
|
||||||
|
update_index = i
|
||||||
|
end
|
||||||
|
bundler_version
|
||||||
|
end
|
||||||
|
|
||||||
|
def gemfile
|
||||||
|
gemfile = ENV["BUNDLE_GEMFILE"]
|
||||||
|
return gemfile if gemfile && !gemfile.empty?
|
||||||
|
|
||||||
|
File.expand_path("../../Gemfile", __FILE__)
|
||||||
|
end
|
||||||
|
|
||||||
|
def lockfile
|
||||||
|
lockfile =
|
||||||
|
case File.basename(gemfile)
|
||||||
|
when "gems.rb" then gemfile.sub(/\.rb$/, gemfile)
|
||||||
|
else "#{gemfile}.lock"
|
||||||
|
end
|
||||||
|
File.expand_path(lockfile)
|
||||||
|
end
|
||||||
|
|
||||||
|
def lockfile_version
|
||||||
|
return unless File.file?(lockfile)
|
||||||
|
lockfile_contents = File.read(lockfile)
|
||||||
|
return unless lockfile_contents =~ /\n\nBUNDLED WITH\n\s{2,}(#{Gem::Version::VERSION_PATTERN})\n/
|
||||||
|
Regexp.last_match(1)
|
||||||
|
end
|
||||||
|
|
||||||
|
def bundler_version
|
||||||
|
@bundler_version ||= begin
|
||||||
|
env_var_version || cli_arg_version ||
|
||||||
|
lockfile_version || "#{Gem::Requirement.default}.a"
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
def load_bundler!
|
||||||
|
ENV["BUNDLE_GEMFILE"] ||= gemfile
|
||||||
|
|
||||||
|
# must dup string for RG < 1.8 compatibility
|
||||||
|
activate_bundler(bundler_version.dup)
|
||||||
|
end
|
||||||
|
|
||||||
|
def activate_bundler(bundler_version)
|
||||||
|
if Gem::Version.correct?(bundler_version) && Gem::Version.new(bundler_version).release < Gem::Version.new("2.0")
|
||||||
|
bundler_version = "< 2"
|
||||||
|
end
|
||||||
|
gem_error = activation_error_handling do
|
||||||
|
gem "bundler", bundler_version
|
||||||
|
end
|
||||||
|
return if gem_error.nil?
|
||||||
|
require_error = activation_error_handling do
|
||||||
|
require "bundler/version"
|
||||||
|
end
|
||||||
|
return if require_error.nil? && Gem::Requirement.new(bundler_version).satisfied_by?(Gem::Version.new(Bundler::VERSION))
|
||||||
|
warn "Activating bundler (#{bundler_version}) failed:\n#{gem_error.message}\n\nTo install the version of bundler this project requires, run `gem install bundler -v '#{bundler_version}'`"
|
||||||
|
exit 42
|
||||||
|
end
|
||||||
|
|
||||||
|
def activation_error_handling
|
||||||
|
yield
|
||||||
|
nil
|
||||||
|
rescue StandardError, LoadError => e
|
||||||
|
e
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
m.load_bundler!
|
||||||
|
|
||||||
|
if m.invoked_as_script?
|
||||||
|
load Gem.bin_path("bundler", "bundle")
|
||||||
|
end
|
||||||
|
|
|
@ -1,6 +1,5 @@
|
||||||
#!/usr/bin/env ruby
|
#!/usr/bin/env ruby
|
||||||
require 'fileutils'
|
require 'fileutils'
|
||||||
include FileUtils
|
|
||||||
|
|
||||||
# path to your application root.
|
# path to your application root.
|
||||||
APP_ROOT = File.expand_path('..', __dir__)
|
APP_ROOT = File.expand_path('..', __dir__)
|
||||||
|
@ -9,7 +8,7 @@ def system!(*args)
|
||||||
system(*args) || abort("\n== Command #{args} failed ==")
|
system(*args) || abort("\n== Command #{args} failed ==")
|
||||||
end
|
end
|
||||||
|
|
||||||
chdir APP_ROOT do
|
FileUtils.chdir APP_ROOT do
|
||||||
# This script is a starting point to setup your application.
|
# This script is a starting point to setup your application.
|
||||||
# Add necessary setup steps to this file.
|
# Add necessary setup steps to this file.
|
||||||
|
|
||||||
|
@ -17,12 +16,12 @@ chdir APP_ROOT do
|
||||||
system! 'gem install bundler --conservative'
|
system! 'gem install bundler --conservative'
|
||||||
system('bundle check') || system!('bundle install')
|
system('bundle check') || system!('bundle install')
|
||||||
|
|
||||||
# Install JavaScript dependencies if using Yarn
|
# Install JavaScript dependencies
|
||||||
# system('bin/yarn')
|
# system('bin/yarn')
|
||||||
|
|
||||||
# puts "\n== Copying sample files =="
|
# puts "\n== Copying sample files =="
|
||||||
# unless File.exist?('config/database.yml')
|
# unless File.exist?('config/database.yml')
|
||||||
# cp 'config/database.yml.sample', 'config/database.yml'
|
# FileUtils.cp 'config/database.yml.sample', 'config/database.yml'
|
||||||
# end
|
# end
|
||||||
|
|
||||||
puts "\n== Preparing database =="
|
puts "\n== Preparing database =="
|
||||||
|
|
11
bin/update
11
bin/update
|
@ -1,6 +1,5 @@
|
||||||
#!/usr/bin/env ruby
|
#!/usr/bin/env ruby
|
||||||
require 'fileutils'
|
require 'fileutils'
|
||||||
include FileUtils
|
|
||||||
|
|
||||||
# path to your application root.
|
# path to your application root.
|
||||||
APP_ROOT = File.expand_path('..', __dir__)
|
APP_ROOT = File.expand_path('..', __dir__)
|
||||||
|
@ -9,7 +8,7 @@ def system!(*args)
|
||||||
system(*args) || abort("\n== Command #{args} failed ==")
|
system(*args) || abort("\n== Command #{args} failed ==")
|
||||||
end
|
end
|
||||||
|
|
||||||
chdir APP_ROOT do
|
FileUtils.chdir APP_ROOT do
|
||||||
# This script is a way to update your development environment automatically.
|
# This script is a way to update your development environment automatically.
|
||||||
# Add necessary update steps to this file.
|
# Add necessary update steps to this file.
|
||||||
|
|
||||||
|
@ -17,15 +16,15 @@ chdir APP_ROOT do
|
||||||
system! 'gem install bundler --conservative'
|
system! 'gem install bundler --conservative'
|
||||||
system('bundle check') || system!('bundle install')
|
system('bundle check') || system!('bundle install')
|
||||||
|
|
||||||
# Install JavaScript dependencies if using Yarn
|
# Install JavaScript dependencies
|
||||||
# system('bin/yarn')
|
# system('bin/yarn')
|
||||||
|
|
||||||
puts "\n== Updating database =="
|
puts "\n== Updating database =="
|
||||||
system! 'bin/rails db:migrate'
|
system! 'rails db:migrate'
|
||||||
|
|
||||||
puts "\n== Removing old logs and tempfiles =="
|
puts "\n== Removing old logs and tempfiles =="
|
||||||
system! 'bin/rails log:clear tmp:clear'
|
system! 'rails log:clear tmp:clear'
|
||||||
|
|
||||||
puts "\n== Restarting application server =="
|
puts "\n== Restarting application server =="
|
||||||
system! 'bin/rails restart'
|
system! 'rails restart'
|
||||||
end
|
end
|
||||||
|
|
|
@ -12,4 +12,8 @@ require "bundler/setup"
|
||||||
|
|
||||||
require "webpacker"
|
require "webpacker"
|
||||||
require "webpacker/webpack_runner"
|
require "webpacker/webpack_runner"
|
||||||
Webpacker::WebpackRunner.run(ARGV)
|
|
||||||
|
APP_ROOT = File.expand_path("..", __dir__)
|
||||||
|
Dir.chdir(APP_ROOT) do
|
||||||
|
Webpacker::WebpackRunner.run(ARGV)
|
||||||
|
end
|
||||||
|
|
|
@ -12,4 +12,8 @@ require "bundler/setup"
|
||||||
|
|
||||||
require "webpacker"
|
require "webpacker"
|
||||||
require "webpacker/dev_server_runner"
|
require "webpacker/dev_server_runner"
|
||||||
Webpacker::DevServerRunner.run(ARGV)
|
|
||||||
|
APP_ROOT = File.expand_path("..", __dir__)
|
||||||
|
Dir.chdir(APP_ROOT) do
|
||||||
|
Webpacker::DevServerRunner.run(ARGV)
|
||||||
|
end
|
||||||
|
|
|
@ -20,7 +20,7 @@ Bundler.require(*Rails.groups)
|
||||||
module Chexpire
|
module Chexpire
|
||||||
class Application < Rails::Application
|
class Application < Rails::Application
|
||||||
# Initialize configuration defaults for originally generated Rails version.
|
# Initialize configuration defaults for originally generated Rails version.
|
||||||
config.load_defaults 5.2
|
config.load_defaults 6.0
|
||||||
|
|
||||||
# Settings in config/environments/* take precedence over those specified here.
|
# Settings in config/environments/* take precedence over those specified here.
|
||||||
# Application configuration can go into files in config/initializers
|
# Application configuration can go into files in config/initializers
|
||||||
|
|
|
@ -20,6 +20,7 @@ Rails.application.configure do
|
||||||
# Run rails dev:cache to toggle caching.
|
# Run rails dev:cache to toggle caching.
|
||||||
if Rails.root.join('tmp', 'caching-dev.txt').exist?
|
if Rails.root.join('tmp', 'caching-dev.txt').exist?
|
||||||
config.action_controller.perform_caching = true
|
config.action_controller.perform_caching = true
|
||||||
|
config.action_controller.enable_fragment_cache_logging = true
|
||||||
|
|
||||||
config.cache_store = :memory_store
|
config.cache_store = :memory_store
|
||||||
config.public_file_server.headers = {
|
config.public_file_server.headers = {
|
||||||
|
@ -31,7 +32,7 @@ Rails.application.configure do
|
||||||
config.cache_store = :null_store
|
config.cache_store = :null_store
|
||||||
end
|
end
|
||||||
|
|
||||||
# Store uploaded files on the local file system (see config/storage.yml for options)
|
# Store uploaded files on the local file system (see config/storage.yml for options).
|
||||||
config.active_storage.service = :local
|
config.active_storage.service = :local
|
||||||
|
|
||||||
config.action_mailer.delivery_method = :letter_opener_web
|
config.action_mailer.delivery_method = :letter_opener_web
|
||||||
|
@ -65,7 +66,7 @@ Rails.application.configure do
|
||||||
# Suppress logger output for asset requests.
|
# Suppress logger output for asset requests.
|
||||||
config.assets.quiet = true
|
config.assets.quiet = true
|
||||||
|
|
||||||
# Raises error for missing translations
|
# Raises error for missing translations.
|
||||||
# config.action_view.raise_on_missing_translations = true
|
# config.action_view.raise_on_missing_translations = true
|
||||||
|
|
||||||
# Use an evented file watcher to asynchronously detect changes in source code,
|
# Use an evented file watcher to asynchronously detect changes in source code,
|
||||||
|
|
|
@ -24,15 +24,12 @@ Rails.application.configure do
|
||||||
# Apache or NGINX already handles this.
|
# Apache or NGINX already handles this.
|
||||||
config.public_file_server.enabled = ENV['RAILS_SERVE_STATIC_FILES'].present?
|
config.public_file_server.enabled = ENV['RAILS_SERVE_STATIC_FILES'].present?
|
||||||
|
|
||||||
# Compress JavaScripts and CSS.
|
# Compress CSS using a preprocessor.
|
||||||
config.assets.js_compressor = :uglifier
|
|
||||||
# config.assets.css_compressor = :sass
|
# config.assets.css_compressor = :sass
|
||||||
|
|
||||||
# Do not fallback to assets pipeline if a precompiled asset is missed.
|
# Do not fallback to assets pipeline if a precompiled asset is missed.
|
||||||
config.assets.compile = false
|
config.assets.compile = false
|
||||||
|
|
||||||
# `config.assets.precompile` and `config.assets.version` have moved to config/initializers/assets.rb
|
|
||||||
|
|
||||||
# Enable serving of images, stylesheets, and JavaScripts from an asset server.
|
# Enable serving of images, stylesheets, and JavaScripts from an asset server.
|
||||||
# config.action_controller.asset_host = 'http://assets.example.com'
|
# config.action_controller.asset_host = 'http://assets.example.com'
|
||||||
|
|
||||||
|
@ -40,7 +37,7 @@ Rails.application.configure do
|
||||||
# config.action_dispatch.x_sendfile_header = 'X-Sendfile' # for Apache
|
# config.action_dispatch.x_sendfile_header = 'X-Sendfile' # for Apache
|
||||||
# config.action_dispatch.x_sendfile_header = 'X-Accel-Redirect' # for NGINX
|
# config.action_dispatch.x_sendfile_header = 'X-Accel-Redirect' # for NGINX
|
||||||
|
|
||||||
# Store uploaded files on the local file system (see config/storage.yml for options)
|
# Store uploaded files on the local file system (see config/storage.yml for options).
|
||||||
config.active_storage.service = :local
|
config.active_storage.service = :local
|
||||||
|
|
||||||
# Force all access to the app over SSL, use Strict-Transport-Security, and use secure cookies.
|
# Force all access to the app over SSL, use Strict-Transport-Security, and use secure cookies.
|
||||||
|
@ -56,7 +53,7 @@ Rails.application.configure do
|
||||||
# Use a different cache store in production.
|
# Use a different cache store in production.
|
||||||
# config.cache_store = :mem_cache_store
|
# config.cache_store = :mem_cache_store
|
||||||
|
|
||||||
# Use a real queuing backend for Active Job (and separate queues per environment)
|
# Use a real queuing backend for Active Job (and separate queues per environment).
|
||||||
# config.active_job.queue_adapter = :resque
|
# config.active_job.queue_adapter = :resque
|
||||||
# config.active_job.queue_name_prefix = "chexpire_#{Rails.env}"
|
# config.active_job.queue_name_prefix = "chexpire_#{Rails.env}"
|
||||||
|
|
||||||
|
@ -93,4 +90,25 @@ Rails.application.configure do
|
||||||
|
|
||||||
# Do not dump schema after migrations.
|
# Do not dump schema after migrations.
|
||||||
config.active_record.dump_schema_after_migration = false
|
config.active_record.dump_schema_after_migration = false
|
||||||
|
|
||||||
|
# Inserts middleware to perform automatic connection switching.
|
||||||
|
# The `database_selector` hash is used to pass options to the DatabaseSelector
|
||||||
|
# middleware. The `delay` is used to determine how long to wait after a write
|
||||||
|
# to send a subsequent read to the primary.
|
||||||
|
#
|
||||||
|
# The `database_resolver` class is used by the middleware to determine which
|
||||||
|
# database is appropriate to use based on the time delay.
|
||||||
|
#
|
||||||
|
# The `database_resolver_context` class is used by the middleware to set
|
||||||
|
# timestamps for the last write to the primary. The resolver uses the context
|
||||||
|
# class timestamps to determine how long to wait before reading from the
|
||||||
|
# replica.
|
||||||
|
#
|
||||||
|
# By default Rails will store a last write timestamp in the session. The
|
||||||
|
# DatabaseSelector middleware is designed as such you can define your own
|
||||||
|
# strategy for connection switching and pass that into the middleware through
|
||||||
|
# these configuration options.
|
||||||
|
# config.active_record.database_selector = { delay: 2.seconds }
|
||||||
|
# config.active_record.database_resolver = ActiveRecord::Middleware::DatabaseSelector::Resolver
|
||||||
|
# config.active_record.database_resolver_context = ActiveRecord::Middleware::DatabaseSelector::Resolver::Session
|
||||||
end
|
end
|
||||||
|
|
|
@ -23,6 +23,7 @@ Rails.application.configure do
|
||||||
# Show full error reports and disable caching.
|
# Show full error reports and disable caching.
|
||||||
config.consider_all_requests_local = true
|
config.consider_all_requests_local = true
|
||||||
config.action_controller.perform_caching = false
|
config.action_controller.perform_caching = false
|
||||||
|
config.cache_store = :null_store
|
||||||
|
|
||||||
# Raise exceptions instead of rendering exception templates.
|
# Raise exceptions instead of rendering exception templates.
|
||||||
config.action_dispatch.show_exceptions = false
|
config.action_dispatch.show_exceptions = false
|
||||||
|
@ -30,7 +31,7 @@ Rails.application.configure do
|
||||||
# Disable request forgery protection in test environment.
|
# Disable request forgery protection in test environment.
|
||||||
config.action_controller.allow_forgery_protection = false
|
config.action_controller.allow_forgery_protection = false
|
||||||
|
|
||||||
# Store uploaded files on the local file system in a temporary directory
|
# Store uploaded files on the local file system in a temporary directory.
|
||||||
config.active_storage.service = :test
|
config.active_storage.service = :test
|
||||||
|
|
||||||
config.action_mailer.perform_caching = false
|
config.action_mailer.perform_caching = false
|
||||||
|
@ -45,6 +46,6 @@ Rails.application.configure do
|
||||||
# Print deprecation notices to the stderr.
|
# Print deprecation notices to the stderr.
|
||||||
config.active_support.deprecation = :stderr
|
config.active_support.deprecation = :stderr
|
||||||
|
|
||||||
# Raises error for missing translations
|
# Raises error for missing translations.
|
||||||
# config.action_view.raise_on_missing_translations = true
|
# config.action_view.raise_on_missing_translations = true
|
||||||
end
|
end
|
||||||
|
|
|
@ -11,6 +11,8 @@ Rails.application.config.content_security_policy do |policy|
|
||||||
policy.object_src :none
|
policy.object_src :none
|
||||||
policy.script_src :self, :https
|
policy.script_src :self, :https
|
||||||
policy.style_src :self, :https
|
policy.style_src :self, :https
|
||||||
|
# # If you are using webpack-dev-server then specify webpack-dev-server host
|
||||||
|
# policy.connect_src :self, :https, "http://localhost:3035", "ws://localhost:3035" if Rails.env.development?
|
||||||
|
|
||||||
# Specify URI for violation reports
|
# Specify URI for violation reports
|
||||||
# policy.report_uri "/csp-violation-report-endpoint"
|
# policy.report_uri "/csp-violation-report-endpoint"
|
||||||
|
|
|
@ -4,8 +4,9 @@
|
||||||
# the maximum value specified for Puma. Default is set to 5 threads for minimum
|
# 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.
|
# and maximum; this matches the default thread size of Active Record.
|
||||||
#
|
#
|
||||||
threads_count = ENV.fetch("RAILS_MAX_THREADS") { 5 }
|
max_threads_count = ENV.fetch("RAILS_MAX_THREADS") { 5 }
|
||||||
threads threads_count, threads_count
|
min_threads_count = ENV.fetch("RAILS_MIN_THREADS") { max_threads_count }
|
||||||
|
threads min_threads_count, max_threads_count
|
||||||
|
|
||||||
# Specifies the `port` that Puma will listen on to receive requests; default is 3000.
|
# Specifies the `port` that Puma will listen on to receive requests; default is 3000.
|
||||||
#
|
#
|
||||||
|
@ -16,7 +17,7 @@ port ENV.fetch("PORT") { 3000 }
|
||||||
environment ENV.fetch("RAILS_ENV") { "development" }
|
environment ENV.fetch("RAILS_ENV") { "development" }
|
||||||
|
|
||||||
# Specifies the number of `workers` to boot in clustered mode.
|
# Specifies the number of `workers` to boot in clustered mode.
|
||||||
# Workers are forked webserver processes. If using threads and workers together
|
# Workers are forked web server processes. If using threads and workers together
|
||||||
# the concurrency of the application would be max `threads` * `workers`.
|
# the concurrency of the application would be max `threads` * `workers`.
|
||||||
# Workers do not work on JRuby or Windows (both of which do not support
|
# Workers do not work on JRuby or Windows (both of which do not support
|
||||||
# processes).
|
# processes).
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
# In order to update the route map below,
|
# In order to update the route map below,
|
||||||
# run `bundle exec annotate -r` after modifying this file
|
# run `bundle exec annotate -r` after modifying this file
|
||||||
Rails.application.routes.draw do
|
Rails.application.routes.draw do
|
||||||
# For details on the DSL available within this file, see http://guides.rubyonrails.org/routing.html
|
# For details on the DSL available within this file, see https://guides.rubyonrails.org/routing.html
|
||||||
|
|
||||||
resources :checks, except: [:show] do
|
resources :checks, except: [:show] do
|
||||||
collection do
|
collection do
|
||||||
|
@ -63,7 +63,7 @@ end
|
||||||
# rails_disk_service GET /rails/active_storage/disk/:encoded_key/*filename(.:format) active_storage/disk#show
|
# rails_disk_service GET /rails/active_storage/disk/:encoded_key/*filename(.:format) active_storage/disk#show
|
||||||
# update_rails_disk_service PUT /rails/active_storage/disk/:encoded_token(.:format) active_storage/disk#update
|
# update_rails_disk_service PUT /rails/active_storage/disk/:encoded_token(.:format) active_storage/disk#update
|
||||||
# rails_direct_uploads POST /rails/active_storage/direct_uploads(.:format) active_storage/direct_uploads#create
|
# rails_direct_uploads POST /rails/active_storage/direct_uploads(.:format) active_storage/direct_uploads#create
|
||||||
#
|
#
|
||||||
# Routes for LetterOpenerWeb::Engine:
|
# Routes for LetterOpenerWeb::Engine:
|
||||||
# clear_letters DELETE /clear(.:format) letter_opener_web/letters#clear
|
# clear_letters DELETE /clear(.:format) letter_opener_web/letters#clear
|
||||||
# delete_letter DELETE /:id(.:format) letter_opener_web/letters#destroy
|
# delete_letter DELETE /:id(.:format) letter_opener_web/letters#destroy
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
%w[
|
Spring.watch(
|
||||||
.ruby-version
|
".ruby-version",
|
||||||
.rbenv-vars
|
".rbenv-vars",
|
||||||
tmp/restart.txt
|
"tmp/restart.txt",
|
||||||
tmp/caching-dev.txt
|
"tmp/caching-dev.txt"
|
||||||
].each { |path| Spring.watch(path) }
|
)
|
||||||
|
|
|
@ -7,8 +7,8 @@
|
||||||
"exports-loader": "^0.7.0",
|
"exports-loader": "^0.7.0",
|
||||||
"jquery": "^3.3.1",
|
"jquery": "^3.3.1",
|
||||||
"popper.js": "^1.14.3",
|
"popper.js": "^1.14.3",
|
||||||
"rails-ujs": "^5.2.0",
|
"@rails/ujs": "^6.0.0-alpha",
|
||||||
"turbolinks": "^5.1.1"
|
"turbolinks": "^5.2.0"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"webpack-dev-server": "2.11.2"
|
"webpack-dev-server": "2.11.2"
|
||||||
|
|
Loading…
Reference in a new issue