Description:
upgrade to rails 5.2
Commit status:
[Not Reviewed]
References:
Diff options:
Comments:
0 Commit comments
0 Inline Comments
Unresolved TODOs:
There are no unresolved TODOs
r750:d729ef9d227c - - 18 files changed: 306 inserted, 107 deleted
@@ -0,0 +1,11 | |||
|
1 | + #!/usr/bin/env ruby | |
|
2 | + APP_ROOT = File.expand_path('..', __dir__) | |
|
3 | + Dir.chdir(APP_ROOT) do | |
|
4 | + begin | |
|
5 | + exec "yarnpkg", *ARGV | |
|
6 | + rescue Errno::ENOENT | |
|
7 | + $stderr.puts "Yarn executable was not detected in the system." | |
|
8 | + $stderr.puts "Download Yarn at https://yarnpkg.com/en/docs/install" | |
|
9 | + exit 1 | |
|
10 | + end | |
|
11 | + end |
@@ -0,0 +1,25 | |||
|
1 | + # Be sure to restart your server when you modify this file. | |
|
2 | + | |
|
3 | + # Define an application-wide content security policy | |
|
4 | + # For further information see the following documentation | |
|
5 | + # https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Security-Policy | |
|
6 | + | |
|
7 | + # Rails.application.config.content_security_policy do |policy| | |
|
8 | + # policy.default_src :self, :https | |
|
9 | + # policy.font_src :self, :https, :data | |
|
10 | + # policy.img_src :self, :https, :data | |
|
11 | + # policy.object_src :none | |
|
12 | + # policy.script_src :self, :https | |
|
13 | + # policy.style_src :self, :https | |
|
14 | + | |
|
15 | + # # Specify URI for violation reports | |
|
16 | + # # policy.report_uri "/csp-violation-report-endpoint" | |
|
17 | + # end | |
|
18 | + | |
|
19 | + # If you are using UJS then enable automatic nonce generation | |
|
20 | + # Rails.application.config.content_security_policy_nonce_generator = -> request { SecureRandom.base64(16) } | |
|
21 | + | |
|
22 | + # Report CSP violations to a specified URI | |
|
23 | + # For further information see the following documentation: | |
|
24 | + # https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Security-Policy-Report-Only | |
|
25 | + # Rails.application.config.content_security_policy_report_only = true |
@@ -0,0 +1,38 | |||
|
1 | + # Be sure to restart your server when you modify this file. | |
|
2 | + # | |
|
3 | + # This file contains migration options to ease your Rails 5.2 upgrade. | |
|
4 | + # | |
|
5 | + # Once upgraded flip defaults one by one to migrate to the new default. | |
|
6 | + # | |
|
7 | + # Read the Guide for Upgrading Ruby on Rails for more info on each option. | |
|
8 | + | |
|
9 | + # Make Active Record use stable #cache_key alongside new #cache_version method. | |
|
10 | + # This is needed for recyclable cache keys. | |
|
11 | + # Rails.application.config.active_record.cache_versioning = true | |
|
12 | + | |
|
13 | + # Use AES-256-GCM authenticated encryption for encrypted cookies. | |
|
14 | + # Also, embed cookie expiry in signed or encrypted cookies for increased security. | |
|
15 | + # | |
|
16 | + # This option is not backwards compatible with earlier Rails versions. | |
|
17 | + # It's best enabled when your entire app is migrated and stable on 5.2. | |
|
18 | + # | |
|
19 | + # Existing cookies will be converted on read then written with the new scheme. | |
|
20 | + # Rails.application.config.action_dispatch.use_authenticated_cookie_encryption = true | |
|
21 | + | |
|
22 | + # Use AES-256-GCM authenticated encryption as default cipher for encrypting messages | |
|
23 | + # instead of AES-256-CBC, when use_authenticated_message_encryption is set to true. | |
|
24 | + # Rails.application.config.active_support.use_authenticated_message_encryption = true | |
|
25 | + | |
|
26 | + # Add default protection from forgery to ActionController::Base instead of in | |
|
27 | + # ApplicationController. | |
|
28 | + # Rails.application.config.action_controller.default_protect_from_forgery = true | |
|
29 | + | |
|
30 | + # Store boolean values are in sqlite3 databases as 1 and 0 instead of 't' and | |
|
31 | + # 'f' after migrating old data. | |
|
32 | + # Rails.application.config.active_record.sqlite3.represent_boolean_as_integer = true | |
|
33 | + | |
|
34 | + # Use SHA-1 instead of MD5 to generate non-sensitive digests, such as the ETag header. | |
|
35 | + # Rails.application.config.active_support.use_sha1_digests = true | |
|
36 | + | |
|
37 | + # Make `form_with` generate id attributes for any generated HTML tags. | |
|
38 | + # Rails.application.config.action_view.form_with_generates_ids = true |
@@ -0,0 +1,34 | |||
|
1 | + test: | |
|
2 | + service: Disk | |
|
3 | + root: <%= Rails.root.join("tmp/storage") %> | |
|
4 | + | |
|
5 | + local: | |
|
6 | + service: Disk | |
|
7 | + root: <%= Rails.root.join("storage") %> | |
|
8 | + | |
|
9 | + # Use rails credentials:edit to set the AWS secrets (as aws:access_key_id|secret_access_key) | |
|
10 | + # amazon: | |
|
11 | + # service: S3 | |
|
12 | + # access_key_id: <%= Rails.application.credentials.dig(:aws, :access_key_id) %> | |
|
13 | + # secret_access_key: <%= Rails.application.credentials.dig(:aws, :secret_access_key) %> | |
|
14 | + # region: us-east-1 | |
|
15 | + # bucket: your_own_bucket | |
|
16 | + | |
|
17 | + # Remember not to checkin your GCS keyfile to a repository | |
|
18 | + # google: | |
|
19 | + # service: GCS | |
|
20 | + # project: your_project | |
|
21 | + # credentials: <%= Rails.root.join("path/to/gcs.keyfile") %> | |
|
22 | + # bucket: your_own_bucket | |
|
23 | + | |
|
24 | + # Use rails credentials:edit to set the Azure Storage secret (as azure_storage:storage_access_key) | |
|
25 | + # microsoft: | |
|
26 | + # service: AzureStorage | |
|
27 | + # storage_account_name: your_account_name | |
|
28 | + # storage_access_key: <%= Rails.application.credentials.dig(:azure_storage, :storage_access_key) %> | |
|
29 | + # container: your_container_name | |
|
30 | + | |
|
31 | + # mirror: | |
|
32 | + # service: Mirror | |
|
33 | + # primary: local | |
|
34 | + # mirrors: [ amazon, google, microsoft ] |
@@ -1,9 +1,13 | |||
|
1 | 1 | source 'https://rubygems.org' |
|
2 | + git_source(:github) { |repo| "https://github.com/#{repo}.git" } | |
|
2 | 3 | |
|
3 | 4 | #rails |
|
4 |
- gem 'rails', '~>5. |
|
|
5 | + gem 'rails', '~>5.2' | |
|
5 | 6 | gem 'activerecord-session_store' |
|
7 | + gem 'puma' | |
|
6 | 8 | |
|
9 | + # Reduces boot times through caching; required in config/boot.rb | |
|
10 | + gem 'bootsnap', '>= 1.1.0', require: false | |
|
7 | 11 | |
|
8 | 12 | # Bundle edge Rails instead: |
|
9 | 13 | # gem 'rails', :git => 'git://github.com/rails/rails.git' |
@@ -17,9 +21,13 | |||
|
17 | 21 | #for dumping database into yaml |
|
18 | 22 | gem 'yaml_db' |
|
19 | 23 | |
|
24 | + | |
|
25 | + #------------- assset pipeline ----------------- | |
|
20 | 26 | # Gems used only for assets and not required |
|
21 | 27 | # in production environments by default. |
|
22 | - gem 'sass-rails' | |
|
28 | + #sass-rails is depricated | |
|
29 | + #gem 'sass-rails' | |
|
30 | + gem 'sassc-rails' | |
|
23 | 31 | gem 'coffee-rails' |
|
24 | 32 | |
|
25 | 33 | # See https://github.com/sstephenson/execjs#readme for more supported runtimes |
@@ -29,23 +37,12 | |||
|
29 | 37 | |
|
30 | 38 | gem 'haml' |
|
31 | 39 | gem 'haml-rails' |
|
32 | - # gem 'prototype-rails' | |
|
33 | - | |
|
34 | - # To use ActiveModel has_secure_password | |
|
35 | - # gem 'bcrypt-ruby', '~> 3.0.0' | |
|
36 | - | |
|
37 | - # To use Jbuilder templates for JSON | |
|
38 | - # gem 'jbuilder' | |
|
39 | 40 | |
|
40 | - # Use unicorn as the app server | |
|
41 | - # gem 'unicorn' | |
|
41 | + # Turbolinks makes navigating your web application faster. Read more: https://github.com/turbolinks/turbolinks | |
|
42 | + #gem 'turbolinks', '~> 5' | |
|
43 | + # Build JSON APIs with ease. Read more: https://github.com/rails/jbuilder | |
|
44 | + gem 'jbuilder', '~> 2.5' | |
|
42 | 45 | |
|
43 | - # Deploy with Capistrano | |
|
44 | - # gem 'capistrano' | |
|
45 | - | |
|
46 | - # To use debugger | |
|
47 | - # gem 'debugger' | |
|
48 | - # | |
|
49 | 46 | |
|
50 | 47 | #in-place editor |
|
51 | 48 | gem 'best_in_place', '~> 3.0.1' |
@@ -62,7 +59,6 | |||
|
62 | 59 | |
|
63 | 60 | #bootstrap add-ons |
|
64 | 61 | gem 'bootstrap-sass', '~> 3.4.1' |
|
65 | - gem 'sassc-rails', '>= 2.1.0' | |
|
66 | 62 | gem 'bootstrap-switch-rails' |
|
67 | 63 | gem 'bootstrap-toggle-rails' |
|
68 | 64 | gem 'autoprefixer-rails' |
@@ -84,7 +80,7 | |||
|
84 | 80 | gem 'rdiscount' |
|
85 | 81 | gem 'dynamic_form' |
|
86 | 82 | gem 'in_place_editing' |
|
87 | - gem 'verification', :git => 'https://github.com/sikachu/verification.git' | |
|
83 | + #gem 'verification', :git => 'https://github.com/sikachu/verification.git' | |
|
88 | 84 | |
|
89 | 85 | |
|
90 | 86 | #---------------- testiing ----------------------- |
@@ -92,3 +88,28 | |||
|
92 | 88 | |
|
93 | 89 | #---------------- for console -------------------- |
|
94 | 90 | gem 'fuzzy-string-match' |
|
91 | + | |
|
92 | + | |
|
93 | + group :development, :test do | |
|
94 | + # Call 'byebug' anywhere in the code to stop execution and get a debugger console | |
|
95 | + gem 'byebug', platforms: [:mri, :mingw, :x64_mingw] | |
|
96 | + end | |
|
97 | + | |
|
98 | + group :development do | |
|
99 | + # Access an interactive console on exception pages or by calling 'console' anywhere in the code. | |
|
100 | + gem 'web-console', '>= 3.3.0' | |
|
101 | + gem 'listen', '>= 3.0.5', '< 3.2' | |
|
102 | + # Spring speeds up development by keeping your application running in the background. Read more: https://github.com/rails/spring | |
|
103 | + gem 'spring' | |
|
104 | + gem 'spring-watcher-listen', '~> 2.0.0' | |
|
105 | + end | |
|
106 | + | |
|
107 | + group :test do | |
|
108 | + # Adds support for Capybara system testing and selenium driver | |
|
109 | + gem 'capybara', '>= 2.15' | |
|
110 | + gem 'selenium-webdriver' | |
|
111 | + # Easy installation and use of chromedriver to run system tests with Chrome | |
|
112 | + #gem 'chromedriver-helper' | |
|
113 | + gem 'webdriver' | |
|
114 | + end | |
|
115 | + |
@@ -1,11 +1,3 | |||
|
1 | - GIT | |
|
2 | - remote: https://github.com/sikachu/verification.git | |
|
3 | - revision: ff31697b940d7b0e2ec65f08764215c96104e76d | |
|
4 | - specs: | |
|
5 | - verification (1.0.3) | |
|
6 | - actionpack (>= 3.0.0, < 5.1) | |
|
7 | - activesupport (>= 3.0.0, < 5.1) | |
|
8 | - | |
|
9 | 1 | GEM |
|
10 | 2 | remote: https://rubygems.org/ |
|
11 | 3 | specs: |
@@ -13,56 +5,65 | |||
|
13 | 5 | ZenTest (~> 4.3) |
|
14 | 6 | ZenTest (4.11.2) |
|
15 | 7 | ace-rails-ap (4.2) |
|
16 |
- actioncable (5. |
|
|
17 |
- actionpack (= 5. |
|
|
18 |
- nio4r (> |
|
|
19 |
- websocket-driver ( |
|
|
20 |
- actionmailer (5. |
|
|
21 |
- actionpack (= 5. |
|
|
22 |
- actionview (= 5. |
|
|
23 |
- activejob (= 5. |
|
|
8 | + actioncable (5.2.3) | |
|
9 | + actionpack (= 5.2.3) | |
|
10 | + nio4r (~> 2.0) | |
|
11 | + websocket-driver (>= 0.6.1) | |
|
12 | + actionmailer (5.2.3) | |
|
13 | + actionpack (= 5.2.3) | |
|
14 | + actionview (= 5.2.3) | |
|
15 | + activejob (= 5.2.3) | |
|
24 | 16 | mail (~> 2.5, >= 2.5.4) |
|
25 | 17 | rails-dom-testing (~> 2.0) |
|
26 |
- actionpack (5. |
|
|
27 |
- actionview (= 5. |
|
|
28 |
- activesupport (= 5. |
|
|
18 | + actionpack (5.2.3) | |
|
19 | + actionview (= 5.2.3) | |
|
20 | + activesupport (= 5.2.3) | |
|
29 | 21 | rack (~> 2.0) |
|
30 |
- rack-test ( |
|
|
22 | + rack-test (>= 0.6.3) | |
|
31 | 23 | rails-dom-testing (~> 2.0) |
|
32 | 24 | rails-html-sanitizer (~> 1.0, >= 1.0.2) |
|
33 |
- actionview (5. |
|
|
34 |
- activesupport (= 5. |
|
|
25 | + actionview (5.2.3) | |
|
26 | + activesupport (= 5.2.3) | |
|
35 | 27 | builder (~> 3.1) |
|
36 |
- erubi |
|
|
28 | + erubi (~> 1.4) | |
|
37 | 29 | rails-dom-testing (~> 2.0) |
|
38 | 30 | rails-html-sanitizer (~> 1.0, >= 1.0.3) |
|
39 |
- activejob (5. |
|
|
40 |
- activesupport (= 5. |
|
|
31 | + activejob (5.2.3) | |
|
32 | + activesupport (= 5.2.3) | |
|
41 | 33 | globalid (>= 0.3.6) |
|
42 |
- activemodel (5. |
|
|
43 |
- activesupport (= 5. |
|
|
44 |
- activerecord (5. |
|
|
45 |
- activemodel (= 5. |
|
|
46 |
- activesupport (= 5. |
|
|
47 |
- arel ( |
|
|
34 | + activemodel (5.2.3) | |
|
35 | + activesupport (= 5.2.3) | |
|
36 | + activerecord (5.2.3) | |
|
37 | + activemodel (= 5.2.3) | |
|
38 | + activesupport (= 5.2.3) | |
|
39 | + arel (>= 9.0) | |
|
48 | 40 | activerecord-session_store (1.1.3) |
|
49 | 41 | actionpack (>= 4.0) |
|
50 | 42 | activerecord (>= 4.0) |
|
51 | 43 | multi_json (~> 1.11, >= 1.11.2) |
|
52 | 44 | rack (>= 1.5.2, < 3) |
|
53 | 45 | railties (>= 4.0) |
|
54 |
- actives |
|
|
46 | + activestorage (5.2.3) | |
|
47 | + actionpack (= 5.2.3) | |
|
48 | + activerecord (= 5.2.3) | |
|
49 | + marcel (~> 0.3.1) | |
|
50 | + activesupport (5.2.3) | |
|
55 | 51 | concurrent-ruby (~> 1.0, >= 1.0.2) |
|
56 | 52 | i18n (>= 0.7, < 2) |
|
57 | 53 | minitest (~> 5.1) |
|
58 | 54 | tzinfo (~> 1.1) |
|
55 | + addressable (2.6.0) | |
|
56 | + public_suffix (>= 2.0.2, < 4.0) | |
|
59 | 57 | ansi (1.5.0) |
|
60 |
- arel ( |
|
|
58 | + arel (9.0.0) | |
|
61 | 59 | autoprefixer-rails (9.5.1.1) |
|
62 | 60 | execjs |
|
63 | 61 | best_in_place (3.0.3) |
|
64 | 62 | actionpack (>= 3.2) |
|
65 | 63 | railties (>= 3.2) |
|
64 | + bindex (0.7.0) | |
|
65 | + bootsnap (1.4.4) | |
|
66 | + msgpack (~> 1.0) | |
|
66 | 67 | bootstrap-datepicker-rails (1.8.0.1) |
|
67 | 68 | railties (>= 3.0) |
|
68 | 69 | bootstrap-sass (3.4.1) |
@@ -73,6 +74,17 | |||
|
73 | 74 | bootstrap3-datetimepicker-rails (4.17.47) |
|
74 | 75 | momentjs-rails (>= 2.8.1) |
|
75 | 76 | builder (3.2.3) |
|
77 | + byebug (11.0.1) | |
|
78 | + capybara (3.25.0) | |
|
79 | + addressable | |
|
80 | + mini_mime (>= 0.1.3) | |
|
81 | + nokogiri (~> 1.8) | |
|
82 | + rack (>= 1.6.0) | |
|
83 | + rack-test (>= 0.6.3) | |
|
84 | + regexp_parser (~> 1.5) | |
|
85 | + xpath (~> 3.2) | |
|
86 | + childprocess (1.0.1) | |
|
87 | + rake (< 13.0) | |
|
76 | 88 | coffee-rails (4.2.2) |
|
77 | 89 | coffee-script (>= 2.2.0) |
|
78 | 90 | railties (>= 4.0.0) |
@@ -83,6 +95,7 | |||
|
83 | 95 | concurrent-ruby (1.1.5) |
|
84 | 96 | crass (1.0.4) |
|
85 | 97 | dynamic_form (1.1.4) |
|
98 | + erubi (1.8.0) | |
|
86 | 99 | erubis (2.7.0) |
|
87 | 100 | execjs (2.7.0) |
|
88 | 101 | ffi (1.11.1) |
@@ -107,6 +120,8 | |||
|
107 | 120 | i18n (1.6.0) |
|
108 | 121 | concurrent-ruby (~> 1.0) |
|
109 | 122 | in_place_editing (1.2.0) |
|
123 | + jbuilder (2.9.1) | |
|
124 | + activesupport (>= 4.2.0) | |
|
110 | 125 | jquery-countdown-rails (2.0.2) |
|
111 | 126 | jquery-datatables-rails (3.4.0) |
|
112 | 127 | actionpack (>= 3.1) |
@@ -123,12 +138,19 | |||
|
123 | 138 | railties (>= 3.1) |
|
124 | 139 | jquery-ui-rails (6.0.1) |
|
125 | 140 | railties (>= 3.2.16) |
|
141 | + listen (3.1.5) | |
|
142 | + rb-fsevent (~> 0.9, >= 0.9.4) | |
|
143 | + rb-inotify (~> 0.9, >= 0.9.7) | |
|
144 | + ruby_dep (~> 1.2) | |
|
126 | 145 | loofah (2.2.3) |
|
127 | 146 | crass (~> 1.0.2) |
|
128 | 147 | nokogiri (>= 1.5.9) |
|
129 | 148 | mail (2.7.1) |
|
130 | 149 | mini_mime (>= 0.1.1) |
|
150 | + marcel (0.3.3) | |
|
151 | + mimemagic (~> 0.3.2) | |
|
131 | 152 | method_source (0.9.2) |
|
153 | + mimemagic (0.3.3) | |
|
132 | 154 | mini_mime (1.0.1) |
|
133 | 155 | mini_portile2 (2.4.0) |
|
134 | 156 | minitest (5.11.3) |
@@ -139,25 +161,30 | |||
|
139 | 161 | ruby-progressbar |
|
140 | 162 | momentjs-rails (2.20.1) |
|
141 | 163 | railties (>= 3.1) |
|
164 | + msgpack (1.3.0) | |
|
142 | 165 | multi_json (1.13.1) |
|
143 | 166 | mysql2 (0.5.2) |
|
144 | 167 | nio4r (2.3.1) |
|
145 | 168 | nokogiri (1.10.3) |
|
146 | 169 | mini_portile2 (~> 2.4.0) |
|
170 | + public_suffix (3.1.1) | |
|
171 | + puma (4.0.0) | |
|
172 | + nio4r (~> 2.0) | |
|
147 | 173 | rack (2.0.7) |
|
148 |
- rack-test ( |
|
|
149 | - rack (>= 1.0) | |
|
150 |
- rails (5. |
|
|
151 |
- actioncable (= 5. |
|
|
152 |
- actionmailer (= 5. |
|
|
153 |
- actionpack (= 5. |
|
|
154 |
- actionview (= 5. |
|
|
155 |
- activejob (= 5. |
|
|
156 |
- activemodel (= 5. |
|
|
157 |
- activerecord (= 5. |
|
|
158 |
- actives |
|
|
174 | + rack-test (1.1.0) | |
|
175 | + rack (>= 1.0, < 3) | |
|
176 | + rails (5.2.3) | |
|
177 | + actioncable (= 5.2.3) | |
|
178 | + actionmailer (= 5.2.3) | |
|
179 | + actionpack (= 5.2.3) | |
|
180 | + actionview (= 5.2.3) | |
|
181 | + activejob (= 5.2.3) | |
|
182 | + activemodel (= 5.2.3) | |
|
183 | + activerecord (= 5.2.3) | |
|
184 | + activestorage (= 5.2.3) | |
|
185 | + activesupport (= 5.2.3) | |
|
159 | 186 | bundler (>= 1.3.0) |
|
160 |
- railties (= 5. |
|
|
187 | + railties (= 5.2.3) | |
|
161 | 188 | sprockets-rails (>= 2.0.0) |
|
162 | 189 | rails-controller-testing (1.0.4) |
|
163 | 190 | actionpack (>= 5.0.1.x) |
@@ -170,21 +197,24 | |||
|
170 | 197 | loofah (~> 2.2, >= 2.2.2) |
|
171 | 198 | rails_bootstrap_sortable (2.0.6) |
|
172 | 199 | momentjs-rails (>= 2.8.3) |
|
173 |
- railties (5. |
|
|
174 |
- actionpack (= 5. |
|
|
175 |
- activesupport (= 5. |
|
|
200 | + railties (5.2.3) | |
|
201 | + actionpack (= 5.2.3) | |
|
202 | + activesupport (= 5.2.3) | |
|
176 | 203 | method_source |
|
177 | 204 | rake (>= 0.8.7) |
|
178 |
- thor (>= 0.1 |
|
|
205 | + thor (>= 0.19.0, < 2.0) | |
|
179 | 206 | rake (12.3.2) |
|
180 | 207 | rb-fsevent (0.10.3) |
|
181 | 208 | rb-inotify (0.10.0) |
|
182 | 209 | ffi (~> 1.0) |
|
183 | 210 | rdiscount (2.2.0.1) |
|
211 | + regexp_parser (1.5.1) | |
|
184 | 212 | rouge (3.3.0) |
|
185 | 213 | ruby-progressbar (1.10.0) |
|
214 | + ruby_dep (1.5.0) | |
|
186 | 215 | ruby_parser (3.13.1) |
|
187 | 216 | sexp_processor (~> 4.9) |
|
217 | + rubyzip (1.2.3) | |
|
188 | 218 | sass (3.7.4) |
|
189 | 219 | sass-listen (~> 4.0.0) |
|
190 | 220 | sass-listen (4.0.0) |
@@ -207,7 +237,14 | |||
|
207 | 237 | tilt |
|
208 | 238 | select2-rails (4.0.3) |
|
209 | 239 | thor (~> 0.14) |
|
240 | + selenium-webdriver (3.142.3) | |
|
241 | + childprocess (>= 0.5, < 2.0) | |
|
242 | + rubyzip (~> 1.2, >= 1.2.2) | |
|
210 | 243 | sexp_processor (4.12.0) |
|
244 | + spring (2.1.0) | |
|
245 | + spring-watcher-listen (2.0.1) | |
|
246 | + listen (>= 2.7, < 4.0) | |
|
247 | + spring (>= 1.2, < 3.0) | |
|
211 | 248 | sprockets (3.7.2) |
|
212 | 249 | concurrent-ruby (~> 1.0) |
|
213 | 250 | rack (> 1, < 3) |
@@ -224,10 +261,18 | |||
|
224 | 261 | thread_safe (~> 0.1) |
|
225 | 262 | uglifier (4.1.20) |
|
226 | 263 | execjs (>= 0.3.0, < 3) |
|
227 | - websocket-driver (0.6.5) | |
|
264 | + web-console (3.7.0) | |
|
265 | + actionview (>= 5.0) | |
|
266 | + activemodel (>= 5.0) | |
|
267 | + bindex (>= 0.4.0) | |
|
268 | + railties (>= 5.0) | |
|
269 | + webdriver (0.1.0) | |
|
270 | + websocket-driver (0.7.1) | |
|
228 | 271 | websocket-extensions (>= 0.1.0) |
|
229 | 272 | websocket-extensions (0.1.4) |
|
230 | 273 | will_paginate (3.0.12) |
|
274 | + xpath (3.2.0) | |
|
275 | + nokogiri (~> 1.8) | |
|
231 | 276 | yaml_db (0.7.0) |
|
232 | 277 | rails (>= 3.0) |
|
233 | 278 | rake (>= 0.8.7) |
@@ -240,38 +285,47 | |||
|
240 | 285 | activerecord-session_store |
|
241 | 286 | autoprefixer-rails |
|
242 | 287 | best_in_place (~> 3.0.1) |
|
288 | + bootsnap (>= 1.1.0) | |
|
243 | 289 | bootstrap-datepicker-rails |
|
244 | 290 | bootstrap-sass (~> 3.4.1) |
|
245 | 291 | bootstrap-switch-rails |
|
246 | 292 | bootstrap-toggle-rails |
|
247 | 293 | bootstrap3-datetimepicker-rails |
|
294 | + byebug | |
|
295 | + capybara (>= 2.15) | |
|
248 | 296 | coffee-rails |
|
249 | 297 | dynamic_form |
|
250 | 298 | fuzzy-string-match |
|
251 | 299 | haml |
|
252 | 300 | haml-rails |
|
253 | 301 | in_place_editing |
|
302 | + jbuilder (~> 2.5) | |
|
254 | 303 | jquery-countdown-rails |
|
255 | 304 | jquery-datatables-rails |
|
256 | 305 | jquery-rails |
|
257 | 306 | jquery-tablesorter |
|
258 | 307 | jquery-timepicker-addon-rails |
|
259 | 308 | jquery-ui-rails |
|
309 | + listen (>= 3.0.5, < 3.2) | |
|
260 | 310 | |
|
261 | 311 | minitest-reporters |
|
262 | 312 | momentjs-rails |
|
263 | 313 | mysql2 |
|
264 | - rails (~> 5.0) | |
|
314 | + puma | |
|
315 | + rails (~> 5.2) | |
|
265 | 316 | rails-controller-testing |
|
266 | 317 | rails_bootstrap_sortable |
|
267 | 318 | rdiscount |
|
268 | 319 | rouge |
|
269 | - sass-rails | |
|
270 | - sassc-rails (>= 2.1.0) | |
|
320 | + sassc-rails | |
|
271 | 321 | select2-rails |
|
322 | + selenium-webdriver | |
|
323 | + spring | |
|
324 | + spring-watcher-listen (~> 2.0.0) | |
|
272 | 325 | sqlite3 |
|
273 | 326 | uglifier |
|
274 | - verification! | |
|
327 | + web-console (>= 3.3.0) | |
|
328 | + webdriver | |
|
275 | 329 | will_paginate (~> 3.0.7) |
|
276 | 330 | yaml_db |
|
277 | 331 |
@@ -1,3 +1,3 | |||
|
1 | 1 | #!/usr/bin/env ruby |
|
2 |
- ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../ |
|
|
2 | + ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../Gemfile', __dir__) | |
|
3 | 3 | load Gem.bin_path('bundler', 'bundle') |
@@ -1,10 +1,9 | |||
|
1 | 1 | #!/usr/bin/env ruby |
|
2 | - require 'pathname' | |
|
3 | 2 | require 'fileutils' |
|
4 | 3 | include FileUtils |
|
5 | 4 | |
|
6 | 5 | # path to your application root. |
|
7 |
- APP_ROOT = |
|
|
6 | + APP_ROOT = File.expand_path('..', __dir__) | |
|
8 | 7 | |
|
9 | 8 | def system!(*args) |
|
10 | 9 | system(*args) || abort("\n== Command #{args} failed ==") |
@@ -18,6 +17,9 | |||
|
18 | 17 | system! 'gem install bundler --conservative' |
|
19 | 18 | system('bundle check') || system!('bundle install') |
|
20 | 19 | |
|
20 | + # Install JavaScript dependencies if using Yarn | |
|
21 | + # system('bin/yarn') | |
|
22 | + | |
|
21 | 23 | # puts "\n== Copying sample files ==" |
|
22 | 24 | # unless File.exist?('config/database.yml') |
|
23 | 25 | # cp 'config/database.yml.sample', 'config/database.yml' |
@@ -1,10 +1,9 | |||
|
1 | 1 | #!/usr/bin/env ruby |
|
2 | - require 'pathname' | |
|
3 | 2 | require 'fileutils' |
|
4 | 3 | include FileUtils |
|
5 | 4 | |
|
6 | 5 | # path to your application root. |
|
7 |
- APP_ROOT = |
|
|
6 | + APP_ROOT = File.expand_path('..', __dir__) | |
|
8 | 7 | |
|
9 | 8 | def system!(*args) |
|
10 | 9 | system(*args) || abort("\n== Command #{args} failed ==") |
@@ -18,6 +17,9 | |||
|
18 | 17 | system! 'gem install bundler --conservative' |
|
19 | 18 | system('bundle check') || system!('bundle install') |
|
20 | 19 | |
|
20 | + # Install JavaScript dependencies if using Yarn | |
|
21 | + # system('bin/yarn') | |
|
22 | + | |
|
21 | 23 | puts "\n== Updating database ==" |
|
22 | 24 | system! 'bin/rails db:migrate' |
|
23 | 25 |
@@ -1,3 +1,4 | |||
|
1 | 1 | ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../Gemfile', __dir__) |
|
2 | 2 | |
|
3 | 3 | require 'bundler/setup' # Set up gems listed in the Gemfile. |
|
4 | + require 'bootsnap/setup' # Speed up boot time by caching expensive operations. |
@@ -6,4 +6,5 | |||
|
6 | 6 | |
|
7 | 7 | production: |
|
8 | 8 | adapter: redis |
|
9 | - url: redis://localhost:6379/1 | |
|
9 | + url: <%= ENV.fetch("REDIS_URL") { "redis://localhost:6379/1" } %> | |
|
10 | + channel_prefix: cafe_grader_production |
@@ -13,12 +13,13 | |||
|
13 | 13 | config.consider_all_requests_local = true |
|
14 | 14 | |
|
15 | 15 | # Enable/disable caching. By default caching is disabled. |
|
16 | - if Rails.root.join('tmp/caching-dev.txt').exist? | |
|
16 | + # Run rails dev:cache to toggle caching. | |
|
17 | + if Rails.root.join('tmp', 'caching-dev.txt').exist? | |
|
17 | 18 | config.action_controller.perform_caching = true |
|
18 | 19 | |
|
19 | 20 | config.cache_store = :memory_store |
|
20 | 21 | config.public_file_server.headers = { |
|
21 |
- 'Cache-Control' => |
|
|
22 | + 'Cache-Control' => "public, max-age=#{2.days.to_i}" | |
|
22 | 23 | } |
|
23 | 24 | else |
|
24 | 25 | config.action_controller.perform_caching = false |
@@ -26,6 +27,9 | |||
|
26 | 27 | config.cache_store = :null_store |
|
27 | 28 | end |
|
28 | 29 | |
|
30 | + # Store uploaded files on the local file system (see config/storage.yml for options) | |
|
31 | + config.active_storage.service = :local | |
|
32 | + | |
|
29 | 33 | # Don't care if the mailer can't send. |
|
30 | 34 | config.action_mailer.raise_delivery_errors = false |
|
31 | 35 | |
@@ -37,6 +41,9 | |||
|
37 | 41 | # Raise an error on page load if there are pending migrations. |
|
38 | 42 | config.active_record.migration_error = :page_load |
|
39 | 43 | |
|
44 | + # Highlight code that triggered database queries in logs. | |
|
45 | + config.active_record.verbose_query_logs = true | |
|
46 | + | |
|
40 | 47 | # Debug mode disables concatenation and preprocessing of assets. |
|
41 | 48 | # This option may cause significant delays in view rendering with a large |
|
42 | 49 | # number of complex assets. |
@@ -50,5 +57,5 | |||
|
50 | 57 | |
|
51 | 58 | # Use an evented file watcher to asynchronously detect changes in source code, |
|
52 | 59 | # routes, locales, etc. This feature depends on the listen gem. |
|
53 |
- |
|
|
60 | + config.file_watcher = ActiveSupport::EventedFileUpdateChecker | |
|
54 | 61 | end |
@@ -14,6 +14,10 | |||
|
14 | 14 | config.consider_all_requests_local = false |
|
15 | 15 | config.action_controller.perform_caching = true |
|
16 | 16 | |
|
17 | + # Ensures that a master key has been made available in either ENV["RAILS_MASTER_KEY"] | |
|
18 | + # or in config/master.key. This key is used to decrypt credentials (and other encrypted files). | |
|
19 | + # config.require_master_key = true | |
|
20 | + | |
|
17 | 21 | # Disable serving static files from the `/public` folder by default since |
|
18 | 22 | # Apache or NGINX already handles this. |
|
19 | 23 | config.public_file_server.enabled = ENV['RAILS_SERVE_STATIC_FILES'].present? |
@@ -34,6 +38,9 | |||
|
34 | 38 | # config.action_dispatch.x_sendfile_header = 'X-Sendfile' # for Apache |
|
35 | 39 | # config.action_dispatch.x_sendfile_header = 'X-Accel-Redirect' # for NGINX |
|
36 | 40 | |
|
41 | + # Store uploaded files on the local file system (see config/storage.yml for options) | |
|
42 | + config.active_storage.service = :local | |
|
43 | + | |
|
37 | 44 | # Mount Action Cable outside main process or domain |
|
38 | 45 | # config.action_cable.mount_path = nil |
|
39 | 46 | # config.action_cable.url = 'wss://example.com/cable' |
@@ -55,6 +62,7 | |||
|
55 | 62 | # Use a real queuing backend for Active Job (and separate queues per environment) |
|
56 | 63 | # config.active_job.queue_adapter = :resque |
|
57 | 64 | # config.active_job.queue_name_prefix = "cafe_grader_#{Rails.env}" |
|
65 | + | |
|
58 | 66 | config.action_mailer.perform_caching = false |
|
59 | 67 | |
|
60 | 68 | # Ignore bad email addresses and do not raise email delivery errors. |
@@ -78,7 +86,7 | |||
|
78 | 86 | if ENV["RAILS_LOG_TO_STDOUT"].present? |
|
79 | 87 | logger = ActiveSupport::Logger.new(STDOUT) |
|
80 | 88 | logger.formatter = config.log_formatter |
|
81 | - config.logger = ActiveSupport::TaggedLogging.new(logger) | |
|
89 | + config.logger = ActiveSupport::TaggedLogging.new(logger) | |
|
82 | 90 | end |
|
83 | 91 | |
|
84 | 92 | # Do not dump schema after migrations. |
@@ -15,7 +15,7 | |||
|
15 | 15 | # Configure public file server for tests with Cache-Control for performance. |
|
16 | 16 | config.public_file_server.enabled = true |
|
17 | 17 | config.public_file_server.headers = { |
|
18 |
- 'Cache-Control' => |
|
|
18 | + 'Cache-Control' => "public, max-age=#{1.hour.to_i}" | |
|
19 | 19 | } |
|
20 | 20 | |
|
21 | 21 | # Show full error reports and disable caching. |
@@ -27,6 +27,10 | |||
|
27 | 27 | |
|
28 | 28 | # Disable request forgery protection in test environment. |
|
29 | 29 | config.action_controller.allow_forgery_protection = false |
|
30 | + | |
|
31 | + # Store uploaded files on the local file system in a temporary directory | |
|
32 | + config.active_storage.service = :test | |
|
33 | + | |
|
30 | 34 | config.action_mailer.perform_caching = false |
|
31 | 35 | |
|
32 | 36 | # Tell Action Mailer not to deliver emails to the real world. |
@@ -3,12 +3,15 | |||
|
3 | 3 | # Version of your assets, change this if you want to expire all your assets. |
|
4 | 4 | Rails.application.config.assets.version = '1.0' |
|
5 | 5 | |
|
6 | - # Add additional assets to the asset load path | |
|
6 | + # Add additional assets to the asset load path. | |
|
7 | 7 | # Rails.application.config.assets.paths << Emoji.images_path |
|
8 | + # Add Yarn node_modules folder to the asset load path. | |
|
9 | + Rails.application.config.assets.paths << Rails.root.join('node_modules') | |
|
8 | 10 | |
|
9 | 11 | # Precompile additional assets. |
|
10 |
- # application.js, application.css, and all non-JS/CSS in app/assets |
|
|
11 | - # Rails.application.config.assets.precompile += %w( search.js ) | |
|
12 | + # application.js, application.css, and all non-JS/CSS in the app/assets | |
|
13 | + # folder are already added. | |
|
14 | + # Rails.application.config.assets.precompile += %w( admin.js admin.css ) | |
|
12 | 15 | Rails.application.config.assets.precompile += ['announcement_refresh.js','effects.js','site_update.js'] |
|
13 | 16 | Rails.application.config.assets.precompile += ['local_jquery.js','tablesorter-theme.cafe.css'] |
|
14 | 17 | %w( announcements submissions configurations contests contest_management graders heartbeat |
@@ -16,3 +19,4 | |||
|
16 | 19 | test user_admin users tags testcases).each do |controller| |
|
17 | 20 | Rails.application.config.assets.precompile += ["#{controller}.js", "#{controller}.css"] |
|
18 | 21 | end |
|
22 | + |
@@ -2,4 +2,4 | |||
|
2 | 2 | |
|
3 | 3 | # Specify a serializer for the signed and encrypted cookie jars. |
|
4 | 4 | # Valid options are :json, :marshal, and :hybrid. |
|
5 |
- Rails.application.config.action_dispatch.cookies_serializer = : |
|
|
5 | + Rails.application.config.action_dispatch.cookies_serializer = :json |
@@ -1,13 +1,13 | |||
|
1 | 1 | # Puma can serve each request in a thread from an internal thread pool. |
|
2 | - # The `threads` method setting takes two numbers a minimum and maximum. | |
|
2 | + # The `threads` method setting takes two numbers: a minimum and maximum. | |
|
3 | 3 | # Any libraries that use thread pools should be configured to match |
|
4 | 4 | # the maximum value specified for Puma. Default is set to 5 threads for minimum |
|
5 |
- # and maximum |
|
|
5 | + # and maximum; this matches the default thread size of Active Record. | |
|
6 | 6 | # |
|
7 |
- threads_count = ENV.fetch("RAILS_MAX_THREADS") { 5 } |
|
|
7 | + threads_count = ENV.fetch("RAILS_MAX_THREADS") { 5 } | |
|
8 | 8 | threads threads_count, threads_count |
|
9 | 9 | |
|
10 |
- # Specifies the `port` that Puma will listen on to receive requests |
|
|
10 | + # Specifies the `port` that Puma will listen on to receive requests; default is 3000. | |
|
11 | 11 | # |
|
12 | 12 | port ENV.fetch("PORT") { 3000 } |
|
13 | 13 | |
@@ -26,22 +26,9 | |||
|
26 | 26 | # Use the `preload_app!` method when specifying a `workers` number. |
|
27 | 27 | # This directive tells Puma to first boot the application and load code |
|
28 | 28 | # before forking the application. This takes advantage of Copy On Write |
|
29 |
- # process behavior so workers use less memory. |
|
|
30 | - # you need to make sure to reconnect any threads in the `on_worker_boot` | |
|
31 | - # block. | |
|
29 | + # process behavior so workers use less memory. | |
|
32 | 30 | # |
|
33 | 31 | # preload_app! |
|
34 | 32 | |
|
35 | - # The code in the `on_worker_boot` will be called if you are using | |
|
36 | - # clustered mode by specifying a number of `workers`. After each worker | |
|
37 | - # process is booted this block will be run, if you are using `preload_app!` | |
|
38 | - # option you will want to use this block to reconnect to any threads | |
|
39 | - # or connections that may have been created at application boot, Ruby | |
|
40 | - # cannot share connections between processes. | |
|
41 | - # | |
|
42 | - # on_worker_boot do | |
|
43 | - # ActiveRecord::Base.establish_connection if defined?(ActiveRecord) | |
|
44 | - # end | |
|
45 | - | |
|
46 | 33 | # Allow puma to be restarted by `rails restart` command. |
|
47 | 34 | plugin :tmp_restart |
You need to be logged in to leave comments.
Login now