mirror of
https://github.com/projekteuler/projekteuler.git
synced 2026-01-27 18:48:49 +01:00
Compare commits
153 Commits
use-github
...
f5266836a0
| Author | SHA1 | Date | |
|---|---|---|---|
| f5266836a0 | |||
| d6a4c41b6f | |||
|
|
11b3fb1410 | ||
|
|
79698c60ff | ||
| a01d14997c | |||
| 8b19a1b8d7 | |||
| 0e97b943f8 | |||
| 546cebc65a | |||
| b37303fd72 | |||
| 1818c766bb | |||
| 42514c633e | |||
| a73a9b4a9b | |||
| a926be0f48 | |||
| d3cd187aa7 | |||
| ba8573d611 | |||
|
|
06a13271e6 | ||
| a21f963601 | |||
|
|
5fb0a14292 | ||
|
|
4a76c81d32 | ||
| cf8fe399b5 | |||
| 548b47640c | |||
| 8387832ab7 | |||
|
|
0c9da40226 | ||
|
|
aac0e0d337 | ||
|
|
2bb32f3702 | ||
|
|
73fc676286 | ||
| ab25a617d1 | |||
|
|
aa63654a4f | ||
|
|
bb2f0024f1 | ||
| 946d848737 | |||
| af7199560f | |||
| 858d62d467 | |||
| b1e01886ff | |||
| bfe8ce7b59 | |||
| eab04b9404 | |||
|
|
f2703ca850 | ||
| 25e6fd2052 | |||
|
|
90c8aaf172 | ||
| 58fec99824 | |||
| 10259ef7c5 | |||
| 52e5ffee22 | |||
|
|
ee88d9efa9 | ||
|
|
169b1a44d2 | ||
|
|
c2cfb6e25f | ||
| 5b46db5485 | |||
|
|
4031ca0cbf | ||
| b4c621b5fa | |||
|
|
7b9725b273 | ||
| c77f0494e8 | |||
|
|
4f65ca4e64 | ||
| 4191abbccd | |||
|
|
028dcb2616 | ||
| ecef051a3b | |||
| 37deaa5535 | |||
| 0f44c84fd9 | |||
| 58bfe3183d | |||
|
|
457df5438e | ||
|
|
d09f32ccf0 | ||
|
|
3a9287df53 | ||
|
|
d16ca761d9 | ||
| 4f7fa8ea47 | |||
|
|
683552a78f | ||
| 0d3440c80f | |||
| afb3b0d1ee | |||
|
|
9255e84154 | ||
|
|
2e714944c5 | ||
| 89a5b83bf3 | |||
|
|
b2b2759713 | ||
| 952c2fedd3 | |||
|
|
ddac1e3d89 | ||
| 0e75ebffcf | |||
| 8e02a171cc | |||
| 1af8a98968 | |||
|
|
9f84df87ed | ||
|
|
8825088a62 | ||
|
|
c0c0e4701a | ||
| 9ddf16ccf0 | |||
| 2c468610a4 | |||
| a47889e38f | |||
| e09a408d34 | |||
| 87cdfccc6c | |||
| 309c90820c | |||
| 66a6fc6499 | |||
| 74446fb139 | |||
|
|
a358b829cb | ||
| c81a3c17ad | |||
| c81a590adb | |||
|
|
a57eca5737 | ||
| e6986b85a9 | |||
| 1af75a7f5d | |||
| 469ef622ab | |||
| 487faace6e | |||
| a49487c3b7 | |||
|
|
6f10301192 | ||
| 393669bbde | |||
| 4339ded7d3 | |||
|
|
6ef8b772a9 | ||
| 9cff35ff64 | |||
|
|
3de48f0952 | ||
| e5b5eace95 | |||
| 0683e5657c | |||
| 552bd7287a | |||
|
|
467363aadc | ||
|
|
d3470f7679 | ||
|
|
6bd5d1d740 | ||
|
|
787f6ed7f0 | ||
|
|
ac41164417 | ||
|
|
8f6a7afd29 | ||
|
|
a52a25a21e | ||
| d2c2273500 | |||
|
|
6b60d32314 | ||
| dfd86af95e | |||
| 21c018ddce | |||
|
|
1ad6a3ecc5 | ||
|
|
d2940d667d | ||
| 12a633bc54 | |||
|
|
5780c64643 | ||
| a6d74cd0da | |||
| e7d739c212 | |||
| 2f734d851e | |||
|
|
49fc0ea601 | ||
|
|
a0a010e53b | ||
| 8f72d768f1 | |||
| 2e2e419938 | |||
|
|
62616d1865 | ||
| 686e8d9f46 | |||
|
|
067a7ba907 | ||
| a18efbf70c | |||
| feb7a3955d | |||
|
|
f313957284 | ||
|
|
e59e9da896 | ||
| 2b659a62ca | |||
|
|
923d4ce9f6 | ||
| 6a7094667e | |||
| 48a6a31cd1 | |||
|
|
46d14c843e | ||
|
|
4b04234c71 | ||
| 54c4b24880 | |||
|
|
9316b89430 | ||
| f26ed021eb | |||
|
|
e97cf8eafa | ||
| bb6a68417a | |||
|
|
c7dbaea090 | ||
| 7c95126a96 | |||
| cb3c05b9a6 | |||
|
|
047515d288 | ||
| de47c81f5c | |||
| 2cda24dcdb | |||
| 7db0dfe75c | |||
|
|
555e11e7b7 | ||
|
|
94c4ec9657 | ||
|
|
a17827e1ec | ||
| 2f8dd8d489 |
7
.github/dependabot.yml
vendored
Normal file
7
.github/dependabot.yml
vendored
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
version: 2
|
||||||
|
updates:
|
||||||
|
- package-ecosystem: bundler
|
||||||
|
directory: "/"
|
||||||
|
schedule:
|
||||||
|
interval: weekly
|
||||||
|
open-pull-requests-limit: 10
|
||||||
4
.github/workflows/ci.yml
vendored
4
.github/workflows/ci.yml
vendored
@@ -8,7 +8,7 @@ jobs:
|
|||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
ruby: ['2.5', '2.6', '2.7']
|
ruby: ['2.7', '3.0', '3.1']
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v2
|
||||||
- name: Set up Ruby ${{ matrix.ruby }}
|
- name: Set up Ruby ${{ matrix.ruby }}
|
||||||
@@ -17,7 +17,7 @@ jobs:
|
|||||||
ruby-version: ${{ matrix.ruby }}
|
ruby-version: ${{ matrix.ruby }}
|
||||||
bundler-cache: true
|
bundler-cache: true
|
||||||
- name: Set up Node
|
- name: Set up Node
|
||||||
uses: actions/setup-node@v2-beta
|
uses: actions/setup-node@v2
|
||||||
with:
|
with:
|
||||||
node-version: '14'
|
node-version: '14'
|
||||||
- name: Install dependencies
|
- name: Install dependencies
|
||||||
|
|||||||
36
Gemfile
36
Gemfile
@@ -2,9 +2,11 @@ source 'https://rubygems.org'
|
|||||||
|
|
||||||
|
|
||||||
# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
|
# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
|
||||||
gem 'rails', '6.0.3.4'
|
gem 'rails', '7.0.4'
|
||||||
|
# Use Puma as the app server
|
||||||
|
gem 'puma', '~> 6.0'
|
||||||
# Use sqlite3 as the database for Active Record
|
# Use sqlite3 as the database for Active Record
|
||||||
gem 'sqlite3', '~> 1.4.1'
|
gem 'sqlite3', '~> 1.5.3'
|
||||||
|
|
||||||
gem 'mysql2', '~> 0.5.2', group: :production
|
gem 'mysql2', '~> 0.5.2', group: :production
|
||||||
|
|
||||||
@@ -19,7 +21,7 @@ gem 'coffee-rails', '~> 5.0.0'
|
|||||||
# See https://github.com/sstephenson/execjs#readme for more supported runtimes
|
# See https://github.com/sstephenson/execjs#readme for more supported runtimes
|
||||||
# gem 'therubyracer', platforms: :ruby
|
# gem 'therubyracer', platforms: :ruby
|
||||||
|
|
||||||
gem 'rails-i18n', '~> 6.0.0'
|
gem 'rails-i18n', '~> 7.0.6'
|
||||||
|
|
||||||
gem 'rails-controller-testing'
|
gem 'rails-controller-testing'
|
||||||
|
|
||||||
@@ -30,28 +32,27 @@ gem 'jquery-rails', '~> 4.4.0'
|
|||||||
# Turbolinks makes following links in your web application faster. Read more: https://github.com/rails/turbolinks
|
# Turbolinks makes following links in your web application faster. Read more: https://github.com/rails/turbolinks
|
||||||
gem 'turbolinks', '~> 5.2.1'
|
gem 'turbolinks', '~> 5.2.1'
|
||||||
# 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.10.1'
|
gem 'jbuilder', '~> 2.11.3'
|
||||||
# bundle exec rake doc:rails generates the API under doc/api.
|
# bundle exec rake doc:rails generates the API under doc/api.
|
||||||
gem 'sdoc', '~> 2.0.2', group: :doc
|
gem 'sdoc', '~> 2.4.0', group: :doc
|
||||||
|
|
||||||
gem 'web-console', '~> 4.1.0', group: :development
|
gem 'web-console', '~> 4.2.0', group: :development
|
||||||
|
gem 'listen', '~> 3.7.0', group: :development
|
||||||
|
|
||||||
# Use Codacy for coverage
|
gem 'bootstrap', '~> 5.1.3'
|
||||||
gem 'codacy-coverage', :require => false
|
gem "bootstrap_form", "~> 5.0"
|
||||||
|
gem 'font-awesome-sass', '~> 6.2.1'
|
||||||
gem 'bootstrap', '~> 4.5.3'
|
|
||||||
gem "bootstrap_form", "~> 4.5"
|
|
||||||
gem 'font-awesome-sass', '~> 5.15.1'
|
|
||||||
|
|
||||||
# Use Diffy for showing translation diffs
|
# Use Diffy for showing translation diffs
|
||||||
gem 'diffy'
|
gem 'diffy'
|
||||||
gem 'diff-lcs'
|
gem 'diff-lcs'
|
||||||
|
|
||||||
gem 'will_paginate', '~> 3.3.0'
|
gem 'will_paginate', '~> 3.3.1'
|
||||||
gem 'will_paginate-bootstrap4', '~> 0.2.2'
|
gem 'will_paginate-bootstrap4', '~> 0.2.2'
|
||||||
|
|
||||||
gem 'devise', '~> 4.7.3'
|
gem 'devise', '~> 4.8.0'
|
||||||
gem 'omniauth'
|
gem 'omniauth'
|
||||||
|
gem 'omniauth-rails_csrf_protection'
|
||||||
gem 'omniauth-github'
|
gem 'omniauth-github'
|
||||||
|
|
||||||
# Use ActiveModel has_secure_password
|
# Use ActiveModel has_secure_password
|
||||||
@@ -68,3 +69,10 @@ gem 'omniauth-github'
|
|||||||
|
|
||||||
# Windows does not include zoneinfo files, so bundle the tzinfo-data gem
|
# Windows does not include zoneinfo files, so bundle the tzinfo-data gem
|
||||||
gem 'tzinfo-data', platforms: [:mingw, :mswin, :x64_mingw]
|
gem 'tzinfo-data', platforms: [:mingw, :mswin, :x64_mingw]
|
||||||
|
|
||||||
|
# Silence net protocol warnings
|
||||||
|
# See https://github.com/rails/rails/pull/44175
|
||||||
|
gem 'net-http'
|
||||||
|
gem 'uri', '0.10.0'
|
||||||
|
gem 'strscan', '3.0.1'
|
||||||
|
gem 'stringio', '3.0.1'
|
||||||
|
|||||||
373
Gemfile.lock
373
Gemfile.lock
@@ -1,79 +1,87 @@
|
|||||||
GEM
|
GEM
|
||||||
remote: https://rubygems.org/
|
remote: https://rubygems.org/
|
||||||
specs:
|
specs:
|
||||||
actioncable (6.0.3.4)
|
actioncable (7.0.4)
|
||||||
actionpack (= 6.0.3.4)
|
actionpack (= 7.0.4)
|
||||||
|
activesupport (= 7.0.4)
|
||||||
nio4r (~> 2.0)
|
nio4r (~> 2.0)
|
||||||
websocket-driver (>= 0.6.1)
|
websocket-driver (>= 0.6.1)
|
||||||
actionmailbox (6.0.3.4)
|
actionmailbox (7.0.4)
|
||||||
actionpack (= 6.0.3.4)
|
actionpack (= 7.0.4)
|
||||||
activejob (= 6.0.3.4)
|
activejob (= 7.0.4)
|
||||||
activerecord (= 6.0.3.4)
|
activerecord (= 7.0.4)
|
||||||
activestorage (= 6.0.3.4)
|
activestorage (= 7.0.4)
|
||||||
activesupport (= 6.0.3.4)
|
activesupport (= 7.0.4)
|
||||||
mail (>= 2.7.1)
|
mail (>= 2.7.1)
|
||||||
actionmailer (6.0.3.4)
|
net-imap
|
||||||
actionpack (= 6.0.3.4)
|
net-pop
|
||||||
actionview (= 6.0.3.4)
|
net-smtp
|
||||||
activejob (= 6.0.3.4)
|
actionmailer (7.0.4)
|
||||||
|
actionpack (= 7.0.4)
|
||||||
|
actionview (= 7.0.4)
|
||||||
|
activejob (= 7.0.4)
|
||||||
|
activesupport (= 7.0.4)
|
||||||
mail (~> 2.5, >= 2.5.4)
|
mail (~> 2.5, >= 2.5.4)
|
||||||
|
net-imap
|
||||||
|
net-pop
|
||||||
|
net-smtp
|
||||||
rails-dom-testing (~> 2.0)
|
rails-dom-testing (~> 2.0)
|
||||||
actionpack (6.0.3.4)
|
actionpack (7.0.4)
|
||||||
actionview (= 6.0.3.4)
|
actionview (= 7.0.4)
|
||||||
activesupport (= 6.0.3.4)
|
activesupport (= 7.0.4)
|
||||||
rack (~> 2.0, >= 2.0.8)
|
rack (~> 2.0, >= 2.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.2.0)
|
rails-html-sanitizer (~> 1.0, >= 1.2.0)
|
||||||
actiontext (6.0.3.4)
|
actiontext (7.0.4)
|
||||||
actionpack (= 6.0.3.4)
|
actionpack (= 7.0.4)
|
||||||
activerecord (= 6.0.3.4)
|
activerecord (= 7.0.4)
|
||||||
activestorage (= 6.0.3.4)
|
activestorage (= 7.0.4)
|
||||||
activesupport (= 6.0.3.4)
|
activesupport (= 7.0.4)
|
||||||
|
globalid (>= 0.6.0)
|
||||||
nokogiri (>= 1.8.5)
|
nokogiri (>= 1.8.5)
|
||||||
actionview (6.0.3.4)
|
actionview (7.0.4)
|
||||||
activesupport (= 6.0.3.4)
|
activesupport (= 7.0.4)
|
||||||
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.1, >= 1.2.0)
|
rails-html-sanitizer (~> 1.1, >= 1.2.0)
|
||||||
activejob (6.0.3.4)
|
activejob (7.0.4)
|
||||||
activesupport (= 6.0.3.4)
|
activesupport (= 7.0.4)
|
||||||
globalid (>= 0.3.6)
|
globalid (>= 0.3.6)
|
||||||
activemodel (6.0.3.4)
|
activemodel (7.0.4)
|
||||||
activesupport (= 6.0.3.4)
|
activesupport (= 7.0.4)
|
||||||
activerecord (6.0.3.4)
|
activerecord (7.0.4)
|
||||||
activemodel (= 6.0.3.4)
|
activemodel (= 7.0.4)
|
||||||
activesupport (= 6.0.3.4)
|
activesupport (= 7.0.4)
|
||||||
activestorage (6.0.3.4)
|
activestorage (7.0.4)
|
||||||
actionpack (= 6.0.3.4)
|
actionpack (= 7.0.4)
|
||||||
activejob (= 6.0.3.4)
|
activejob (= 7.0.4)
|
||||||
activerecord (= 6.0.3.4)
|
activerecord (= 7.0.4)
|
||||||
marcel (~> 0.3.1)
|
activesupport (= 7.0.4)
|
||||||
activesupport (6.0.3.4)
|
marcel (~> 1.0)
|
||||||
|
mini_mime (>= 1.1.0)
|
||||||
|
activesupport (7.0.4)
|
||||||
concurrent-ruby (~> 1.0, >= 1.0.2)
|
concurrent-ruby (~> 1.0, >= 1.0.2)
|
||||||
i18n (>= 0.7, < 2)
|
i18n (>= 1.6, < 2)
|
||||||
minitest (~> 5.1)
|
minitest (>= 5.1)
|
||||||
tzinfo (~> 1.1)
|
tzinfo (~> 2.0)
|
||||||
zeitwerk (~> 2.2, >= 2.2.2)
|
addressable (2.8.0)
|
||||||
addressable (2.7.0)
|
|
||||||
public_suffix (>= 2.0.2, < 5.0)
|
public_suffix (>= 2.0.2, < 5.0)
|
||||||
autoprefixer-rails (10.0.2.0)
|
autoprefixer-rails (10.4.2.0)
|
||||||
execjs
|
execjs (~> 2)
|
||||||
bcrypt (3.1.16)
|
bcrypt (3.1.16)
|
||||||
bindex (0.8.1)
|
bindex (0.8.1)
|
||||||
bootsnap (1.5.1)
|
bootsnap (1.13.0)
|
||||||
msgpack (~> 1.0)
|
msgpack (~> 1.2)
|
||||||
bootstrap (4.5.3)
|
bootstrap (5.1.3)
|
||||||
autoprefixer-rails (>= 9.1.0)
|
autoprefixer-rails (>= 9.1.0)
|
||||||
popper_js (>= 1.14.3, < 2)
|
popper_js (>= 2.9.3, < 3)
|
||||||
sassc-rails (>= 2.0.0)
|
sassc-rails (>= 2.0.0)
|
||||||
bootstrap_form (4.5.0)
|
bootstrap_form (5.0.0)
|
||||||
actionpack (>= 5.2)
|
actionpack (>= 5.2)
|
||||||
activemodel (>= 5.2)
|
activemodel (>= 5.2)
|
||||||
builder (3.2.4)
|
builder (3.2.4)
|
||||||
codacy-coverage (2.2.1)
|
|
||||||
simplecov
|
|
||||||
coffee-rails (5.0.0)
|
coffee-rails (5.0.0)
|
||||||
coffee-script (>= 2.2.0)
|
coffee-script (>= 2.2.0)
|
||||||
railties (>= 5.2.0)
|
railties (>= 5.2.0)
|
||||||
@@ -81,94 +89,146 @@ GEM
|
|||||||
coffee-script-source
|
coffee-script-source
|
||||||
execjs
|
execjs
|
||||||
coffee-script-source (1.12.2)
|
coffee-script-source (1.12.2)
|
||||||
concurrent-ruby (1.1.7)
|
concurrent-ruby (1.1.10)
|
||||||
crack (0.4.4)
|
crack (0.4.5)
|
||||||
|
rexml
|
||||||
crass (1.0.6)
|
crass (1.0.6)
|
||||||
devise (4.7.3)
|
devise (4.8.1)
|
||||||
bcrypt (~> 3.0)
|
bcrypt (~> 3.0)
|
||||||
orm_adapter (~> 0.1)
|
orm_adapter (~> 0.1)
|
||||||
railties (>= 4.1.0)
|
railties (>= 4.1.0)
|
||||||
responders
|
responders
|
||||||
warden (~> 1.2.3)
|
warden (~> 1.2.3)
|
||||||
diff-lcs (1.4.4)
|
diff-lcs (1.5.0)
|
||||||
diffy (3.4.0)
|
diffy (3.4.2)
|
||||||
docile (1.3.2)
|
digest (3.1.0)
|
||||||
erubi (1.9.0)
|
erubi (1.11.0)
|
||||||
execjs (2.7.0)
|
execjs (2.8.1)
|
||||||
faraday (1.0.0)
|
faraday (1.9.3)
|
||||||
|
faraday-em_http (~> 1.0)
|
||||||
|
faraday-em_synchrony (~> 1.0)
|
||||||
|
faraday-excon (~> 1.1)
|
||||||
|
faraday-httpclient (~> 1.0)
|
||||||
|
faraday-multipart (~> 1.0)
|
||||||
|
faraday-net_http (~> 1.0)
|
||||||
|
faraday-net_http_persistent (~> 1.0)
|
||||||
|
faraday-patron (~> 1.0)
|
||||||
|
faraday-rack (~> 1.0)
|
||||||
|
faraday-retry (~> 1.0)
|
||||||
|
ruby2_keywords (>= 0.0.4)
|
||||||
|
faraday-em_http (1.0.0)
|
||||||
|
faraday-em_synchrony (1.0.0)
|
||||||
|
faraday-excon (1.1.0)
|
||||||
|
faraday-httpclient (1.0.1)
|
||||||
|
faraday-multipart (1.0.3)
|
||||||
multipart-post (>= 1.2, < 3)
|
multipart-post (>= 1.2, < 3)
|
||||||
ffi (1.13.1)
|
faraday-net_http (1.0.1)
|
||||||
font-awesome-sass (5.15.1)
|
faraday-net_http_persistent (1.2.0)
|
||||||
sassc (>= 1.11)
|
faraday-patron (1.0.0)
|
||||||
globalid (0.4.2)
|
faraday-rack (1.0.0)
|
||||||
activesupport (>= 4.2.0)
|
faraday-retry (1.0.3)
|
||||||
|
ffi (1.15.5)
|
||||||
|
font-awesome-sass (6.2.1)
|
||||||
|
sassc (~> 2.0)
|
||||||
|
globalid (1.0.1)
|
||||||
|
activesupport (>= 5.0)
|
||||||
hashdiff (1.0.1)
|
hashdiff (1.0.1)
|
||||||
hashie (4.1.0)
|
hashie (5.0.0)
|
||||||
i18n (1.8.5)
|
i18n (1.12.0)
|
||||||
concurrent-ruby (~> 1.0)
|
concurrent-ruby (~> 1.0)
|
||||||
jbuilder (2.10.1)
|
jbuilder (2.11.5)
|
||||||
|
actionview (>= 5.0.0)
|
||||||
activesupport (>= 5.0.0)
|
activesupport (>= 5.0.0)
|
||||||
jquery-rails (4.4.0)
|
jquery-rails (4.4.0)
|
||||||
rails-dom-testing (>= 1, < 3)
|
rails-dom-testing (>= 1, < 3)
|
||||||
railties (>= 4.2.0)
|
railties (>= 4.2.0)
|
||||||
thor (>= 0.14, < 2.0)
|
thor (>= 0.14, < 2.0)
|
||||||
jwt (2.2.1)
|
jwt (2.3.0)
|
||||||
loofah (2.7.0)
|
listen (3.7.1)
|
||||||
|
rb-fsevent (~> 0.10, >= 0.10.3)
|
||||||
|
rb-inotify (~> 0.9, >= 0.9.10)
|
||||||
|
loofah (2.19.0)
|
||||||
crass (~> 1.0.2)
|
crass (~> 1.0.2)
|
||||||
nokogiri (>= 1.5.9)
|
nokogiri (>= 1.5.9)
|
||||||
mail (2.7.1)
|
mail (2.7.1)
|
||||||
mini_mime (>= 0.1.1)
|
mini_mime (>= 0.1.1)
|
||||||
marcel (0.3.3)
|
marcel (1.0.2)
|
||||||
mimemagic (~> 0.3.2)
|
|
||||||
method_source (1.0.0)
|
method_source (1.0.0)
|
||||||
mimemagic (0.3.5)
|
mini_mime (1.1.2)
|
||||||
mini_mime (1.0.2)
|
mini_portile2 (2.8.0)
|
||||||
mini_portile2 (2.4.0)
|
minitest (5.17.0)
|
||||||
minitest (5.14.2)
|
msgpack (1.6.0)
|
||||||
msgpack (1.3.3)
|
multi_json (1.15.0)
|
||||||
multi_json (1.14.1)
|
|
||||||
multi_xml (0.6.0)
|
multi_xml (0.6.0)
|
||||||
multipart-post (2.1.1)
|
multipart-post (2.1.1)
|
||||||
mysql2 (0.5.3)
|
mysql2 (0.5.3)
|
||||||
nio4r (2.5.4)
|
net-http (0.2.0)
|
||||||
nokogiri (1.10.10)
|
net-protocol
|
||||||
mini_portile2 (~> 2.4.0)
|
uri
|
||||||
oauth2 (1.4.3)
|
net-imap (0.2.3)
|
||||||
|
digest
|
||||||
|
net-protocol
|
||||||
|
strscan
|
||||||
|
net-pop (0.1.1)
|
||||||
|
digest
|
||||||
|
net-protocol
|
||||||
|
timeout
|
||||||
|
net-protocol (0.1.3)
|
||||||
|
timeout
|
||||||
|
net-smtp (0.3.1)
|
||||||
|
digest
|
||||||
|
net-protocol
|
||||||
|
timeout
|
||||||
|
nio4r (2.5.8)
|
||||||
|
nokogiri (1.13.9)
|
||||||
|
mini_portile2 (~> 2.8.0)
|
||||||
|
racc (~> 1.4)
|
||||||
|
oauth2 (1.4.7)
|
||||||
faraday (>= 0.8, < 2.0)
|
faraday (>= 0.8, < 2.0)
|
||||||
jwt (>= 1.0, < 3.0)
|
jwt (>= 1.0, < 3.0)
|
||||||
multi_json (~> 1.3)
|
multi_json (~> 1.3)
|
||||||
multi_xml (~> 0.5)
|
multi_xml (~> 0.5)
|
||||||
rack (>= 1.2, < 3)
|
rack (>= 1.2, < 3)
|
||||||
omniauth (1.9.1)
|
omniauth (2.1.0)
|
||||||
hashie (>= 3.4.6)
|
hashie (>= 3.4.6)
|
||||||
rack (>= 1.6.2, < 3)
|
rack (>= 2.2.3)
|
||||||
omniauth-github (1.4.0)
|
rack-protection
|
||||||
omniauth (~> 1.5)
|
omniauth-github (2.0.0)
|
||||||
omniauth-oauth2 (>= 1.4.0, < 2.0)
|
omniauth (~> 2.0)
|
||||||
omniauth-oauth2 (1.6.0)
|
omniauth-oauth2 (~> 1.7.1)
|
||||||
oauth2 (~> 1.1)
|
omniauth-oauth2 (1.7.2)
|
||||||
omniauth (~> 1.9)
|
oauth2 (~> 1.4)
|
||||||
|
omniauth (>= 1.9, < 3)
|
||||||
|
omniauth-rails_csrf_protection (1.0.1)
|
||||||
|
actionpack (>= 4.2)
|
||||||
|
omniauth (~> 2.0)
|
||||||
orm_adapter (0.5.0)
|
orm_adapter (0.5.0)
|
||||||
popper_js (1.16.0)
|
popper_js (2.9.3)
|
||||||
|
psych (4.0.6)
|
||||||
|
stringio
|
||||||
public_suffix (4.0.6)
|
public_suffix (4.0.6)
|
||||||
rack (2.2.3)
|
puma (6.0.0)
|
||||||
rack-test (1.1.0)
|
nio4r (~> 2.0)
|
||||||
rack (>= 1.0, < 3)
|
racc (1.6.0)
|
||||||
rails (6.0.3.4)
|
rack (2.2.4)
|
||||||
actioncable (= 6.0.3.4)
|
rack-protection (3.0.3)
|
||||||
actionmailbox (= 6.0.3.4)
|
rack
|
||||||
actionmailer (= 6.0.3.4)
|
rack-test (2.0.2)
|
||||||
actionpack (= 6.0.3.4)
|
rack (>= 1.3)
|
||||||
actiontext (= 6.0.3.4)
|
rails (7.0.4)
|
||||||
actionview (= 6.0.3.4)
|
actioncable (= 7.0.4)
|
||||||
activejob (= 6.0.3.4)
|
actionmailbox (= 7.0.4)
|
||||||
activemodel (= 6.0.3.4)
|
actionmailer (= 7.0.4)
|
||||||
activerecord (= 6.0.3.4)
|
actionpack (= 7.0.4)
|
||||||
activestorage (= 6.0.3.4)
|
actiontext (= 7.0.4)
|
||||||
activesupport (= 6.0.3.4)
|
actionview (= 7.0.4)
|
||||||
bundler (>= 1.3.0)
|
activejob (= 7.0.4)
|
||||||
railties (= 6.0.3.4)
|
activemodel (= 7.0.4)
|
||||||
sprockets-rails (>= 2.0.0)
|
activerecord (= 7.0.4)
|
||||||
|
activestorage (= 7.0.4)
|
||||||
|
activesupport (= 7.0.4)
|
||||||
|
bundler (>= 1.15.0)
|
||||||
|
railties (= 7.0.4)
|
||||||
rails-controller-testing (1.0.5)
|
rails-controller-testing (1.0.5)
|
||||||
actionpack (>= 5.0.1.rc1)
|
actionpack (>= 5.0.1.rc1)
|
||||||
actionview (>= 5.0.1.rc1)
|
actionview (>= 5.0.1.rc1)
|
||||||
@@ -176,22 +236,29 @@ GEM
|
|||||||
rails-dom-testing (2.0.3)
|
rails-dom-testing (2.0.3)
|
||||||
activesupport (>= 4.2.0)
|
activesupport (>= 4.2.0)
|
||||||
nokogiri (>= 1.6)
|
nokogiri (>= 1.6)
|
||||||
rails-html-sanitizer (1.3.0)
|
rails-html-sanitizer (1.4.3)
|
||||||
loofah (~> 2.3)
|
loofah (~> 2.3)
|
||||||
rails-i18n (6.0.0)
|
rails-i18n (7.0.6)
|
||||||
i18n (>= 0.7, < 2)
|
i18n (>= 0.7, < 2)
|
||||||
railties (>= 6.0.0, < 7)
|
railties (>= 6.0.0, < 8)
|
||||||
railties (6.0.3.4)
|
railties (7.0.4)
|
||||||
actionpack (= 6.0.3.4)
|
actionpack (= 7.0.4)
|
||||||
activesupport (= 6.0.3.4)
|
activesupport (= 7.0.4)
|
||||||
method_source
|
method_source
|
||||||
rake (>= 0.8.7)
|
rake (>= 12.2)
|
||||||
thor (>= 0.20.3, < 2.0)
|
thor (~> 1.0)
|
||||||
rake (13.0.1)
|
zeitwerk (~> 2.5)
|
||||||
rdoc (6.2.1)
|
rake (13.0.6)
|
||||||
|
rb-fsevent (0.11.0)
|
||||||
|
rb-inotify (0.10.1)
|
||||||
|
ffi (~> 1.0)
|
||||||
|
rdoc (6.4.0)
|
||||||
|
psych (>= 4.0.0)
|
||||||
responders (3.0.1)
|
responders (3.0.1)
|
||||||
actionpack (>= 5.0)
|
actionpack (>= 5.0)
|
||||||
railties (>= 5.0)
|
railties (>= 5.0)
|
||||||
|
rexml (3.2.5)
|
||||||
|
ruby2_keywords (0.0.5)
|
||||||
sassc (2.4.0)
|
sassc (2.4.0)
|
||||||
ffi (~> 1.9)
|
ffi (~> 1.9)
|
||||||
sassc-rails (2.1.2)
|
sassc-rails (2.1.2)
|
||||||
@@ -200,80 +267,86 @@ GEM
|
|||||||
sprockets (> 3.0)
|
sprockets (> 3.0)
|
||||||
sprockets-rails
|
sprockets-rails
|
||||||
tilt
|
tilt
|
||||||
sdoc (2.0.2)
|
sdoc (2.4.0)
|
||||||
rdoc (>= 5.0)
|
rdoc (>= 5.0)
|
||||||
simplecov (0.18.1)
|
|
||||||
docile (~> 1.1)
|
|
||||||
simplecov-html (~> 0.11.0)
|
|
||||||
simplecov-html (0.11.0)
|
|
||||||
sprockets (4.0.2)
|
sprockets (4.0.2)
|
||||||
concurrent-ruby (~> 1.0)
|
concurrent-ruby (~> 1.0)
|
||||||
rack (> 1, < 3)
|
rack (> 1, < 3)
|
||||||
sprockets-rails (3.2.2)
|
sprockets-rails (3.4.2)
|
||||||
actionpack (>= 4.0)
|
actionpack (>= 5.2)
|
||||||
activesupport (>= 4.0)
|
activesupport (>= 5.2)
|
||||||
sprockets (>= 3.0.0)
|
sprockets (>= 3.0.0)
|
||||||
sqlite3 (1.4.2)
|
sqlite3 (1.5.3)
|
||||||
thor (1.0.1)
|
mini_portile2 (~> 2.8.0)
|
||||||
thread_safe (0.3.6)
|
stringio (3.0.1)
|
||||||
|
strscan (3.0.1)
|
||||||
|
thor (1.2.1)
|
||||||
tilt (2.0.10)
|
tilt (2.0.10)
|
||||||
|
timeout (0.3.0)
|
||||||
turbolinks (5.2.1)
|
turbolinks (5.2.1)
|
||||||
turbolinks-source (~> 5.2)
|
turbolinks-source (~> 5.2)
|
||||||
turbolinks-source (5.2.0)
|
turbolinks-source (5.2.0)
|
||||||
tzinfo (1.2.8)
|
tzinfo (2.0.5)
|
||||||
thread_safe (~> 0.1)
|
concurrent-ruby (~> 1.0)
|
||||||
uglifier (4.2.0)
|
uglifier (4.2.0)
|
||||||
execjs (>= 0.3.0, < 3)
|
execjs (>= 0.3.0, < 3)
|
||||||
|
uri (0.10.0)
|
||||||
warden (1.2.9)
|
warden (1.2.9)
|
||||||
rack (>= 2.0.9)
|
rack (>= 2.0.9)
|
||||||
web-console (4.1.0)
|
web-console (4.2.0)
|
||||||
actionview (>= 6.0.0)
|
actionview (>= 6.0.0)
|
||||||
activemodel (>= 6.0.0)
|
activemodel (>= 6.0.0)
|
||||||
bindex (>= 0.4.0)
|
bindex (>= 0.4.0)
|
||||||
railties (>= 6.0.0)
|
railties (>= 6.0.0)
|
||||||
webmock (3.10.0)
|
webmock (3.14.0)
|
||||||
addressable (>= 2.3.6)
|
addressable (>= 2.8.0)
|
||||||
crack (>= 0.3.2)
|
crack (>= 0.3.2)
|
||||||
hashdiff (>= 0.4.0, < 2.0.0)
|
hashdiff (>= 0.4.0, < 2.0.0)
|
||||||
websocket-driver (0.7.3)
|
websocket-driver (0.7.5)
|
||||||
websocket-extensions (>= 0.1.0)
|
websocket-extensions (>= 0.1.0)
|
||||||
websocket-extensions (0.1.5)
|
websocket-extensions (0.1.5)
|
||||||
will_paginate (3.3.0)
|
will_paginate (3.3.1)
|
||||||
will_paginate-bootstrap4 (0.2.2)
|
will_paginate-bootstrap4 (0.2.2)
|
||||||
will_paginate (~> 3.0, >= 3.0.0)
|
will_paginate (~> 3.0, >= 3.0.0)
|
||||||
zeitwerk (2.4.1)
|
zeitwerk (2.6.6)
|
||||||
|
|
||||||
PLATFORMS
|
PLATFORMS
|
||||||
ruby
|
ruby
|
||||||
|
|
||||||
DEPENDENCIES
|
DEPENDENCIES
|
||||||
bootsnap
|
bootsnap
|
||||||
bootstrap (~> 4.5.3)
|
bootstrap (~> 5.1.3)
|
||||||
bootstrap_form (~> 4.5)
|
bootstrap_form (~> 5.0)
|
||||||
codacy-coverage
|
|
||||||
coffee-rails (~> 5.0.0)
|
coffee-rails (~> 5.0.0)
|
||||||
devise (~> 4.7.3)
|
devise (~> 4.8.0)
|
||||||
diff-lcs
|
diff-lcs
|
||||||
diffy
|
diffy
|
||||||
font-awesome-sass (~> 5.15.1)
|
font-awesome-sass (~> 6.2.1)
|
||||||
jbuilder (~> 2.10.1)
|
jbuilder (~> 2.11.3)
|
||||||
jquery-rails (~> 4.4.0)
|
jquery-rails (~> 4.4.0)
|
||||||
|
listen (~> 3.7.0)
|
||||||
mysql2 (~> 0.5.2)
|
mysql2 (~> 0.5.2)
|
||||||
|
net-http
|
||||||
omniauth
|
omniauth
|
||||||
omniauth-github
|
omniauth-github
|
||||||
rails (= 6.0.3.4)
|
omniauth-rails_csrf_protection
|
||||||
|
puma (~> 6.0)
|
||||||
|
rails (= 7.0.4)
|
||||||
rails-controller-testing
|
rails-controller-testing
|
||||||
rails-i18n (~> 6.0.0)
|
rails-i18n (~> 7.0.6)
|
||||||
sassc-rails (~> 2.1.2)
|
sassc-rails (~> 2.1.2)
|
||||||
sdoc (~> 2.0.2)
|
sdoc (~> 2.4.0)
|
||||||
sqlite3 (~> 1.4.1)
|
sqlite3 (~> 1.5.3)
|
||||||
|
stringio (= 3.0.1)
|
||||||
|
strscan (= 3.0.1)
|
||||||
turbolinks (~> 5.2.1)
|
turbolinks (~> 5.2.1)
|
||||||
tzinfo-data
|
tzinfo-data
|
||||||
uglifier (~> 4.2.0)
|
uglifier (~> 4.2.0)
|
||||||
web-console (~> 4.1.0)
|
uri (= 0.10.0)
|
||||||
|
web-console (~> 4.2.0)
|
||||||
webmock
|
webmock
|
||||||
will_paginate (~> 3.3.0)
|
will_paginate (~> 3.3.1)
|
||||||
will_paginate-bootstrap4 (~> 0.2.2)
|
will_paginate-bootstrap4 (~> 0.2.2)
|
||||||
|
|
||||||
BUNDLED WITH
|
BUNDLED WITH
|
||||||
2.1.4
|
2.3.25
|
||||||
|
|||||||
@@ -2,7 +2,6 @@ Projekt Euler
|
|||||||
=============
|
=============
|
||||||
|
|
||||||

|

|
||||||
[](https://www.codacy.com/app/projekteuler/projekteuler)
|
|
||||||
|
|
||||||
This is the Ruby on Rails web-app powering [projekteuler.de](https://projekteuler.de).
|
This is the Ruby on Rails web-app powering [projekteuler.de](https://projekteuler.de).
|
||||||
It allows visitors to view and suggest German translations of the maths puzzles found on [projecteuler.net](https://projecteuler.net).
|
It allows visitors to view and suggest German translations of the maths puzzles found on [projecteuler.net](https://projecteuler.net).
|
||||||
|
|||||||
@@ -18,6 +18,6 @@ App.init = ->
|
|||||||
$(document).on "turbolinks:load", ->
|
$(document).on "turbolinks:load", ->
|
||||||
App.init()
|
App.init()
|
||||||
|
|
||||||
$(document).on "click", '#translationTab a[href="#preview"]', ->
|
$(document).on "click", '#translationTab button[data-bs-target="#preview"]', ->
|
||||||
$('#preview .problem-content').html(cm.getValue())
|
$('#preview .problem-content').html(cm.getValue())
|
||||||
MathJax.Hub.Queue(["Typeset",MathJax.Hub]);
|
MathJax.Hub.Queue(["Typeset",MathJax.Hub]);
|
||||||
@@ -17,7 +17,6 @@
|
|||||||
|
|
||||||
@import "bootstrap";
|
@import "bootstrap";
|
||||||
@import "rails_bootstrap_forms";
|
@import "rails_bootstrap_forms";
|
||||||
@import "font-awesome-sprockets";
|
|
||||||
@import "font-awesome";
|
@import "font-awesome";
|
||||||
|
|
||||||
.turbolinks-progress-bar {
|
.turbolinks-progress-bar {
|
||||||
|
|||||||
@@ -7,11 +7,8 @@ module ApplicationHelper
|
|||||||
capture do
|
capture do
|
||||||
flash.each do |msg_type, message|
|
flash.each do |msg_type, message|
|
||||||
concat(content_tag(:div, message, class: "alert #{bootstrap_class_for(msg_type)} alert-dismissible", role: 'alert') do
|
concat(content_tag(:div, message, class: "alert #{bootstrap_class_for(msg_type)} alert-dismissible", role: 'alert') do
|
||||||
concat(content_tag(:button, class: 'close', data: { dismiss: 'alert' }) do
|
|
||||||
concat content_tag(:span, '×'.html_safe, 'aria-hidden' => true)
|
|
||||||
concat content_tag(:span, 'Close', class: 'sr-only')
|
|
||||||
end)
|
|
||||||
concat message
|
concat message
|
||||||
|
concat content_tag(:button, "", class: 'btn-close', data: { 'bs-dismiss': 'alert' }, 'aria-label': 'Close')
|
||||||
end)
|
end)
|
||||||
end
|
end
|
||||||
nil
|
nil
|
||||||
@@ -29,9 +26,8 @@ module ApplicationHelper
|
|||||||
end
|
end
|
||||||
|
|
||||||
def nav_link_to(body, url)
|
def nav_link_to(body, url)
|
||||||
nav_options = { class: current_page?(url) ? 'nav-item active': 'nav-item' }
|
content_tag(:li, class: 'nav-item') do
|
||||||
content_tag(:li, nav_options) do
|
link_to body, url, class: current_page?(url) ? 'nav-link active': 'nav-link'
|
||||||
link_to body, url, class: 'nav-link'
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ class TranslationContentScrubber < Rails::Html::PermitScrubber
|
|||||||
super
|
super
|
||||||
self.tags = %w( strong em b i p code pre tt samp kbd var sub
|
self.tags = %w( strong em b i p code pre tt samp kbd var sub
|
||||||
sup dfn cite big small address hr br div span h1 h2 h3 h4 h5 h6 ul ol li dl dt dd abbr
|
sup dfn cite big small address hr br div span h1 h2 h3 h4 h5 h6 ul ol li dl dt dd abbr
|
||||||
acronym a img blockquote del ins table th tr td thead tbody tfoot )
|
acronym a img blockquote del ins table th tr td thead tbody tfoot u )
|
||||||
self.attributes = %w( href src width height alt cite datetime title class name xml:lang abbr style
|
self.attributes = %w( href src width height alt cite datetime title class name xml:lang abbr style
|
||||||
align border cellpadding cellspacing colspan )
|
align border cellpadding cellspacing colspan )
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
<div class="jumbotron">
|
<div class="bg-light p-5 rounded">
|
||||||
<h1 class="display-4">Willkommen auf Projekt Euler!</h1>
|
<h1 class="display-4">Willkommen auf Projekt Euler!</h1>
|
||||||
<p>Diese Seite ist eine Übersetzung der englischen Rätsel-Webseite <a href="https://projecteuler.net/">projecteuler.net</a>.</p>
|
<p>Diese Seite ist eine Übersetzung der englischen Rätsel-Webseite <a href="https://projecteuler.net/">projecteuler.net</a>.</p>
|
||||||
<p class="lead">
|
<p class="lead">
|
||||||
@@ -7,26 +7,27 @@
|
|||||||
<% end %>
|
<% end %>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="container">
|
<div class="row g-4 py-5 row-cols-1 row-cols-lg-3">
|
||||||
<!-- Example row of columns -->
|
<div class="col d-flex align-items-start">
|
||||||
<div class="row">
|
<div>
|
||||||
<div class="col-md-4">
|
|
||||||
<h2>Ansehen</h2>
|
<h2>Ansehen</h2>
|
||||||
<p>Sehen Sie sich die mathematischen Probleme in deutscher Sprache an.</p>
|
<p>Sehen Sie sich die mathematischen Probleme in deutscher Sprache an.</p>
|
||||||
<p>
|
<%= link_to problems_path, class: 'btn btn-primary' do %>
|
||||||
<%= link_to problems_path, class: 'btn btn-primary' do %>
|
Zu den Problemen »
|
||||||
Zu den Problemen »
|
<% end %>
|
||||||
<% end %>
|
|
||||||
</p>
|
|
||||||
</div>
|
</div>
|
||||||
<div class="col-md-4">
|
</div>
|
||||||
|
<div class="col d-flex align-items-start">
|
||||||
|
<div>
|
||||||
<h2>Übersetzen</h2>
|
<h2>Übersetzen</h2>
|
||||||
<p>Bisher wurden erst <%= Problem.translated_count %> der <%= Problem.count %> Probleme übersetzt. Helfen Sie mit, Übersetzungen zu erstellen und anzupassen!</p>
|
<p>Bisher wurden erst <%= Problem.translated_count %> der <%= Problem.count %> Probleme übersetzt. Helfen Sie mit, Übersetzungen zu erstellen und anzupassen!</p>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-md-4">
|
</div>
|
||||||
|
<div class="col d-flex align-items-start">
|
||||||
|
<div>
|
||||||
<h2>Verbessern</h2>
|
<h2>Verbessern</h2>
|
||||||
<p>Vermissen Sie eine Funktion auf der Webseite, oder ist Ihnen ein Fehler aufgefallen? Dann helfen Sie beim Entwickeln der Webseite in Ruby on Rails!</p>
|
<p>Vermissen Sie eine Funktion auf der Webseite, oder ist Ihnen ein Fehler aufgefallen? Dann helfen Sie beim Entwickeln der Webseite in Ruby on Rails!</p>
|
||||||
<p><a class="btn btn-primary" href="https://github.com/projekteuler/projekteuler" target="_blank">Projekt Euler auf GitHub »</a></p>
|
<a class="btn btn-primary" href="https://github.com/projekteuler/projekteuler" target="_blank">Projekt Euler auf GitHub »</a>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -1,44 +1,46 @@
|
|||||||
<nav class="navbar navbar-expand-lg navbar-light bg-light">
|
<nav class="navbar navbar-expand-lg navbar-light bg-light">
|
||||||
<div class="container">
|
<div class="container">
|
||||||
<%= link_to t('application.site_title'), root_path, class: 'navbar-brand' %>
|
<%= link_to root_path, class: 'navbar-brand' do %>
|
||||||
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarSupportedContent" aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
|
<%= image_tag "favicon.ico", alt: "", width: 24, height: 24, class: "d-inline-block align-text-top" %> <%= t('application.site_title') %>
|
||||||
|
<% end %>
|
||||||
|
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarSupportedContent" aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
|
||||||
<span class="navbar-toggler-icon">
|
<span class="navbar-toggler-icon">
|
||||||
<%= icon('fas', 'bars') %>
|
<%= icon('fas', 'bars') %>
|
||||||
</span>
|
</span>
|
||||||
</button>
|
</button>
|
||||||
<div class="collapse navbar-collapse" id="navbarSupportedContent">
|
<div class="collapse navbar-collapse" id="navbarSupportedContent">
|
||||||
<ul class="navbar-nav mr-auto">
|
<ul class="navbar-nav me-auto">
|
||||||
<%= nav_link_to t('application.info'), about_info_path %>
|
<%= nav_link_to t('application.info'), about_info_path %>
|
||||||
<%= nav_link_to Problem.model_name.human(count: 2), problems_path %>
|
<%= nav_link_to Problem.model_name.human(count: 2), problems_path %>
|
||||||
<% if user_signed_in? and current_user.admin? %>
|
<% if user_signed_in? and current_user.admin? %>
|
||||||
<%= nav_link_to t('admin.dashboard.index.administration'), admin_dashboard_index_path %>
|
<%= nav_link_to t('admin.dashboard.index.administration'), admin_dashboard_index_path %>
|
||||||
<%= link_to admin_translations_path, class: 'nav-link' do %>
|
<%= link_to admin_translations_path, class: 'nav-link' do %>
|
||||||
<%= t('admin.dashboard.index.translations') %> <span class="badge badge-secondary"><%= Translation.pending.count %></span>
|
<%= t('admin.dashboard.index.translations') %> <span class="badge bg-secondary"><%= Translation.pending.count %></span>
|
||||||
<% end %>
|
|
||||||
<% end %>
|
|
||||||
</ul>
|
|
||||||
<ul class="navbar-nav">
|
|
||||||
<% if user_signed_in? %>
|
|
||||||
<li class="nav-item">
|
|
||||||
<span class="navbar-text"><%= t 'application.logged_in_as_html', name: current_user.name %>
|
|
||||||
<% if current_user.admin? %>
|
|
||||||
<b><%= icon('fas', 'star') %></b>
|
|
||||||
<% end %>
|
|
||||||
</span>
|
|
||||||
</li>
|
|
||||||
<li class="nav-item">
|
|
||||||
<%= link_to t('application.sign_out'), destroy_user_session_path, method: :delete, class: 'nav-link' %>
|
|
||||||
</li>
|
|
||||||
<% else %>
|
|
||||||
<li class="nav-item">
|
|
||||||
<% if Rails.env.development? %>
|
|
||||||
<%= link_to t('application.sign_in_with_github'), user_developer_omniauth_authorize_path, class: 'nav-link' %>
|
|
||||||
<% else %>
|
|
||||||
<%= link_to t('application.sign_in_with_github'), user_github_omniauth_authorize_path, class: 'nav-link' %>
|
|
||||||
<% end %>
|
<% end %>
|
||||||
</li>
|
|
||||||
<% end %>
|
<% end %>
|
||||||
|
</ul>
|
||||||
|
<% if user_signed_in? %>
|
||||||
|
<span class="navbar-text"><%= t 'application.logged_in_as_html', name: current_user.name %>
|
||||||
|
<% if current_user.admin? %>
|
||||||
|
<b><%= icon('fas', 'star') %></b>
|
||||||
|
<% end %>
|
||||||
|
</span>
|
||||||
|
<ul class="navbar-nav">
|
||||||
|
<li class="nav-item">
|
||||||
|
<%= link_to t('application.sign_out'), destroy_user_session_path, method: :delete, class: 'nav-link' %>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
<% else %>
|
||||||
|
<ul class="navbar-nav">
|
||||||
|
<li class="nav-item">
|
||||||
|
<% if Rails.env.development? %>
|
||||||
|
<%= link_to t('application.sign_in_with_github'), user_developer_omniauth_authorize_path, method: :post, class: 'nav-link' %>
|
||||||
|
<% else %>
|
||||||
|
<%= link_to t('application.sign_in_with_github'), user_github_omniauth_authorize_path, method: :post, class: 'nav-link' %>
|
||||||
|
<% end %>
|
||||||
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
|
<% end %>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</nav>
|
</nav>
|
||||||
@@ -2,10 +2,10 @@
|
|||||||
<%= f.text_field :title %>
|
<%= f.text_field :title %>
|
||||||
<ul class="nav nav-tabs" id="translationTab" role="tablist">
|
<ul class="nav nav-tabs" id="translationTab" role="tablist">
|
||||||
<li class="nav-item">
|
<li class="nav-item">
|
||||||
<%= link_to t('.source_code'), '#source', data: {toggle: 'tab'}, class:'nav-link active', id:'source-tab', role:'tab', 'aria-controls':'source', 'aria-selected':'true' %>
|
<button class="nav-link active" id="source-tab" data-bs-toggle="tab" data-bs-target="#source" type="button" role="tab" aria-controls="source" aria-selected="true"><%= t('.source_code') %></button>
|
||||||
</li>
|
</li>
|
||||||
<li class="nav-item">
|
<li class="nav-item">
|
||||||
<%= link_to t('.preview'), '#preview', data: {toggle: 'tab'}, class:'nav-link', id:'preview-tab', role:'tab', 'aria-controls':'preview', 'aria-selected':'false' %>
|
<button class="nav-link" id="preview-tab" data-bs-toggle="tab" data-bs-target="#preview" type="button" role="tab" aria-controls="preview" aria-selected="false"><%= t('.preview') %></button>
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
<div class="tab-content" id="translationTabContent">
|
<div class="tab-content" id="translationTabContent">
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
#!/usr/bin/env ruby
|
#!/usr/bin/env ruby
|
||||||
APP_PATH = File.expand_path('../config/application', __dir__)
|
APP_PATH = File.expand_path("../config/application", __dir__)
|
||||||
require_relative '../config/boot'
|
require_relative "../config/boot"
|
||||||
require 'rails/commands'
|
require "rails/commands"
|
||||||
|
|||||||
4
bin/rake
4
bin/rake
@@ -1,4 +1,4 @@
|
|||||||
#!/usr/bin/env ruby
|
#!/usr/bin/env ruby
|
||||||
require_relative '../config/boot'
|
require_relative "../config/boot"
|
||||||
require 'rake'
|
require "rake"
|
||||||
Rake.application.run
|
Rake.application.run
|
||||||
|
|||||||
27
bin/setup
27
bin/setup
@@ -1,36 +1,33 @@
|
|||||||
#!/usr/bin/env ruby
|
#!/usr/bin/env ruby
|
||||||
require 'fileutils'
|
require "fileutils"
|
||||||
|
|
||||||
# path to your application root.
|
# path to your application root.
|
||||||
APP_ROOT = File.expand_path('..', __dir__)
|
APP_ROOT = File.expand_path("..", __dir__)
|
||||||
|
|
||||||
def system!(*args)
|
def system!(*args)
|
||||||
system(*args) || abort("\n== Command #{args} failed ==")
|
system(*args) || abort("\n== Command #{args} failed ==")
|
||||||
end
|
end
|
||||||
|
|
||||||
FileUtils.chdir APP_ROOT do
|
FileUtils.chdir APP_ROOT do
|
||||||
# This script is a way to setup or update your development environment automatically.
|
# This script is a way to set up or update your development environment automatically.
|
||||||
# This script is idempotent, so that you can run it at anytime and get an expectable outcome.
|
# This script is idempotent, so that you can run it at any time and get an expectable outcome.
|
||||||
# Add necessary setup steps to this file.
|
# Add necessary setup steps to this file.
|
||||||
|
|
||||||
puts '== Installing dependencies =='
|
puts "== Installing dependencies =="
|
||||||
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
|
|
||||||
# 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")
|
||||||
# FileUtils.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 =="
|
||||||
system! 'bin/rails db:prepare'
|
system! "bin/rails db:prepare"
|
||||||
|
|
||||||
puts "\n== Removing old logs and tempfiles =="
|
puts "\n== Removing old logs and tempfiles =="
|
||||||
system! 'bin/rails log:clear tmp:clear'
|
system! "bin/rails log:clear tmp:clear"
|
||||||
|
|
||||||
puts "\n== Restarting application server =="
|
puts "\n== Restarting application server =="
|
||||||
system! 'bin/rails restart'
|
system! "bin/rails restart"
|
||||||
end
|
end
|
||||||
|
|||||||
12
bin/yarn
12
bin/yarn
@@ -1,9 +1,15 @@
|
|||||||
#!/usr/bin/env ruby
|
#!/usr/bin/env ruby
|
||||||
APP_ROOT = File.expand_path('..', __dir__)
|
APP_ROOT = File.expand_path('..', __dir__)
|
||||||
Dir.chdir(APP_ROOT) do
|
Dir.chdir(APP_ROOT) do
|
||||||
begin
|
yarn = ENV["PATH"].split(File::PATH_SEPARATOR).
|
||||||
exec "yarnpkg", *ARGV
|
select { |dir| File.expand_path(dir) != __dir__ }.
|
||||||
rescue Errno::ENOENT
|
product(["yarn", "yarn.exe"]).
|
||||||
|
map { |dir, file| File.expand_path(file, dir) }.
|
||||||
|
find { |file| File.executable?(file) }
|
||||||
|
|
||||||
|
if yarn
|
||||||
|
exec yarn, *ARGV
|
||||||
|
else
|
||||||
$stderr.puts "Yarn executable was not detected in the system."
|
$stderr.puts "Yarn executable was not detected in the system."
|
||||||
$stderr.puts "Download Yarn at https://yarnpkg.com/en/docs/install"
|
$stderr.puts "Download Yarn at https://yarnpkg.com/en/docs/install"
|
||||||
exit 1
|
exit 1
|
||||||
|
|||||||
@@ -1,4 +1,6 @@
|
|||||||
# This file is used by Rack-based servers to start the application.
|
# This file is used by Rack-based servers to start the application.
|
||||||
|
|
||||||
require ::File.expand_path('../config/environment', __FILE__)
|
require_relative "config/environment"
|
||||||
|
|
||||||
run Rails.application
|
run Rails.application
|
||||||
|
Rails.application.load_server
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
require_relative 'boot'
|
require_relative "boot"
|
||||||
|
|
||||||
require 'rails/all'
|
require "rails/all"
|
||||||
|
|
||||||
# Require the gems listed in Gemfile, including any gems
|
# Require the gems listed in Gemfile, including any gems
|
||||||
# you've limited to :test, :development, or :production.
|
# you've limited to :test, :development, or :production.
|
||||||
@@ -9,12 +9,12 @@ Bundler.require(*Rails.groups)
|
|||||||
module Projekteuler
|
module Projekteuler
|
||||||
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 6.0
|
config.load_defaults 7.0
|
||||||
|
|
||||||
# Settings in config/environments/* take precedence over those specified here.
|
# Configuration for the application, engines, and railties goes here.
|
||||||
# Application configuration can go into files in config/initializers
|
#
|
||||||
# -- all .rb files in that directory are automatically loaded after loading
|
# These settings can be overridden in specific environments using the files
|
||||||
# the framework and any gems in your application.
|
# in config/environments, which are processed later.
|
||||||
|
|
||||||
config.action_dispatch.default_headers = {
|
config.action_dispatch.default_headers = {
|
||||||
'X-Frame-Options' => 'DENY',
|
'X-Frame-Options' => 'DENY',
|
||||||
@@ -27,7 +27,8 @@ module Projekteuler
|
|||||||
|
|
||||||
# Set Time.zone default to the specified zone and make Active Record auto-convert to this zone.
|
# Set Time.zone default to the specified zone and make Active Record auto-convert to this zone.
|
||||||
# Run "rake -D time" for a list of tasks for finding time zone names. Default is UTC.
|
# Run "rake -D time" for a list of tasks for finding time zone names. Default is UTC.
|
||||||
config.time_zone = 'Berlin'
|
config.time_zone = "Berlin"
|
||||||
|
# config.eager_load_paths << Rails.root.join("extras")
|
||||||
|
|
||||||
# The default locale is :en and all translations from config/locales/*.rb,yml are auto loaded.
|
# The default locale is :en and all translations from config/locales/*.rb,yml are auto loaded.
|
||||||
config.i18n.load_path += Dir[Rails.root.join('config', 'locales', '**', '*.{rb,yml}').to_s]
|
config.i18n.load_path += Dir[Rails.root.join('config', 'locales', '**', '*.{rb,yml}').to_s]
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../Gemfile', __dir__)
|
ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../Gemfile", __dir__)
|
||||||
|
|
||||||
require 'bundler/setup' # Set up gems listed in the Gemfile.
|
require "bundler/setup" # Set up gems listed in the Gemfile.
|
||||||
require 'bootsnap/setup' # Speed up boot time by caching expensive operations.
|
require "bootsnap/setup" # Speed up boot time by caching expensive operations.
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
# Load the Rails application.
|
# Load the Rails application.
|
||||||
require_relative 'application'
|
require_relative "application"
|
||||||
|
|
||||||
# Initialize the Rails application.
|
# Initialize the Rails application.
|
||||||
Rails.application.initialize!
|
Rails.application.initialize!
|
||||||
|
|||||||
@@ -1,8 +1,10 @@
|
|||||||
|
require "active_support/core_ext/integer/time"
|
||||||
|
|
||||||
Rails.application.configure do
|
Rails.application.configure do
|
||||||
# Settings specified here will take precedence over those in config/application.rb.
|
# Settings specified here will take precedence over those in config/application.rb.
|
||||||
|
|
||||||
# In the development environment your application's code is reloaded on
|
# In the development environment your application's code is reloaded any time
|
||||||
# every request. This slows down response time but is perfect for development
|
# it changes. This slows down response time but is perfect for development
|
||||||
# since you don't have to restart the web server when you make code changes.
|
# since you don't have to restart the web server when you make code changes.
|
||||||
config.cache_classes = false
|
config.cache_classes = false
|
||||||
|
|
||||||
@@ -12,15 +14,18 @@ Rails.application.configure do
|
|||||||
# Show full error reports.
|
# Show full error reports.
|
||||||
config.consider_all_requests_local = true
|
config.consider_all_requests_local = true
|
||||||
|
|
||||||
|
# Enable server timing
|
||||||
|
config.server_timing = true
|
||||||
|
|
||||||
# Enable/disable caching. By default caching is disabled.
|
# Enable/disable caching. By default caching is disabled.
|
||||||
# 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.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 = {
|
||||||
'Cache-Control' => "public, max-age=#{2.days.to_i}"
|
"Cache-Control" => "public, max-age=#{2.days.to_i}"
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
config.action_controller.perform_caching = false
|
config.action_controller.perform_caching = false
|
||||||
@@ -39,24 +44,27 @@ Rails.application.configure do
|
|||||||
# Print deprecation notices to the Rails logger.
|
# Print deprecation notices to the Rails logger.
|
||||||
config.active_support.deprecation = :log
|
config.active_support.deprecation = :log
|
||||||
|
|
||||||
|
# Raise exceptions for disallowed deprecations.
|
||||||
|
config.active_support.disallowed_deprecation = :raise
|
||||||
|
|
||||||
|
# Tell Active Support which deprecation messages to disallow.
|
||||||
|
config.active_support.disallowed_deprecation_warnings = []
|
||||||
|
|
||||||
# Raise an error on page load if there are pending migrations.
|
# Raise an error on page load if there are pending migrations.
|
||||||
config.active_record.migration_error = :page_load
|
config.active_record.migration_error = :page_load
|
||||||
|
|
||||||
# Highlight code that triggered database queries in logs.
|
# Highlight code that triggered database queries in logs.
|
||||||
config.active_record.verbose_query_logs = true
|
config.active_record.verbose_query_logs = true
|
||||||
|
|
||||||
# Debug mode disables concatenation and preprocessing of assets.
|
|
||||||
# This option may cause significant delays in view rendering with a large
|
|
||||||
# number of complex assets.
|
|
||||||
config.assets.debug = true
|
|
||||||
|
|
||||||
# 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.i18n.raise_on_missing_translations = true
|
||||||
|
|
||||||
# Use an evented file watcher to asynchronously detect changes in source code,
|
# Annotate rendered view with file names.
|
||||||
# routes, locales, etc. This feature depends on the listen gem.
|
# config.action_view.annotate_rendered_view_with_filenames = true
|
||||||
# config.file_watcher = ActiveSupport::EventedFileUpdateChecker
|
|
||||||
|
# Uncomment if you wish to allow Action Cable access from any origin.
|
||||||
|
# config.action_cable.disable_request_forgery_protection = true
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -1,3 +1,5 @@
|
|||||||
|
require "active_support/core_ext/integer/time"
|
||||||
|
|
||||||
Rails.application.configure do
|
Rails.application.configure do
|
||||||
# Settings specified here will take precedence over those in config/application.rb.
|
# Settings specified here will take precedence over those in config/application.rb.
|
||||||
|
|
||||||
@@ -20,10 +22,7 @@ Rails.application.configure do
|
|||||||
|
|
||||||
# Disable serving static files from the `/public` folder by default since
|
# Disable serving static files from the `/public` folder by default since
|
||||||
# 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 JS using a preprocessor.
|
|
||||||
config.assets.js_compressor = :uglifier
|
|
||||||
|
|
||||||
# Compress CSS using a preprocessor.
|
# Compress CSS using a preprocessor.
|
||||||
# config.assets.css_compressor = :sass
|
# config.assets.css_compressor = :sass
|
||||||
@@ -32,26 +31,26 @@ Rails.application.configure do
|
|||||||
config.assets.compile = false
|
config.assets.compile = false
|
||||||
|
|
||||||
# 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.asset_host = "http://assets.example.com"
|
||||||
|
|
||||||
# Specifies the header that your server uses for sending files.
|
# Specifies the header that your server uses for sending files.
|
||||||
# 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
|
||||||
|
|
||||||
# Mount Action Cable outside main process or domain.
|
# Mount Action Cable outside main process or domain.
|
||||||
# config.action_cable.mount_path = nil
|
# config.action_cable.mount_path = nil
|
||||||
# config.action_cable.url = 'wss://example.com/cable'
|
# config.action_cable.url = "wss://example.com/cable"
|
||||||
# config.action_cable.allowed_request_origins = [ 'http://example.com', /http:\/\/example.*/ ]
|
# config.action_cable.allowed_request_origins = [ "http://example.com", /http:\/\/example.*/ ]
|
||||||
|
|
||||||
# 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.
|
||||||
config.force_ssl = true
|
config.force_ssl = true
|
||||||
|
|
||||||
# Use the lowest log level to ensure availability of diagnostic information
|
# Include generic and useful information about system operation, but avoid logging too much
|
||||||
# when problems arise.
|
# information to avoid inadvertent exposure of personally identifiable information (PII).
|
||||||
config.log_level = :debug
|
config.log_level = :info
|
||||||
|
|
||||||
# Prepend all log lines with the following tags.
|
# Prepend all log lines with the following tags.
|
||||||
config.log_tags = [ :request_id ]
|
config.log_tags = [ :request_id ]
|
||||||
@@ -71,17 +70,17 @@ Rails.application.configure do
|
|||||||
|
|
||||||
# Enable locale fallbacks for I18n (makes lookups for any locale fall back to
|
# Enable locale fallbacks for I18n (makes lookups for any locale fall back to
|
||||||
# the I18n.default_locale when a translation cannot be found).
|
# the I18n.default_locale when a translation cannot be found).
|
||||||
config.i18n.fallbacks = [I18n.default_locale]
|
config.i18n.fallbacks = true
|
||||||
|
|
||||||
# Send deprecation notices to registered listeners.
|
# Log deprecations.
|
||||||
config.active_support.deprecation = :notify
|
config.active_support.report_deprecations = true
|
||||||
|
|
||||||
# Use default logging formatter so that PID and timestamp are not suppressed.
|
# Use default logging formatter so that PID and timestamp are not suppressed.
|
||||||
config.log_formatter = ::Logger::Formatter.new
|
config.log_formatter = ::Logger::Formatter.new
|
||||||
|
|
||||||
# Use a different logger for distributed setups.
|
# Use a different logger for distributed setups.
|
||||||
# require 'syslog/logger'
|
# require "syslog/logger"
|
||||||
# config.logger = ActiveSupport::TaggedLogging.new(Syslog::Logger.new 'app-name')
|
# config.logger = ActiveSupport::TaggedLogging.new(Syslog::Logger.new "app-name")
|
||||||
|
|
||||||
if ENV["RAILS_LOG_TO_STDOUT"].present?
|
if ENV["RAILS_LOG_TO_STDOUT"].present?
|
||||||
logger = ActiveSupport::Logger.new(STDOUT)
|
logger = ActiveSupport::Logger.new(STDOUT)
|
||||||
@@ -91,25 +90,4 @@ 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
|
||||||
|
|||||||
@@ -1,3 +1,5 @@
|
|||||||
|
require "active_support/core_ext/integer/time"
|
||||||
|
|
||||||
# The test environment is used exclusively to run your application's
|
# The test environment is used exclusively to run your application's
|
||||||
# test suite. You never need to work with it otherwise. Remember that
|
# test suite. You never need to work with it otherwise. Remember that
|
||||||
# your test database is "scratch space" for the test suite and is wiped
|
# your test database is "scratch space" for the test suite and is wiped
|
||||||
@@ -6,17 +8,18 @@
|
|||||||
Rails.application.configure do
|
Rails.application.configure do
|
||||||
# Settings specified here will take precedence over those in config/application.rb.
|
# Settings specified here will take precedence over those in config/application.rb.
|
||||||
|
|
||||||
|
# Turn false under Spring and add config.action_view.cache_template_loading = true.
|
||||||
config.cache_classes = true
|
config.cache_classes = true
|
||||||
|
|
||||||
# Do not eager load code on boot. This avoids loading your whole application
|
# Eager loading loads your whole application. When running a single test locally,
|
||||||
# just for the purpose of running a single test. If you are using a tool that
|
# this probably isn't necessary. It's a good idea to do in a continuous integration
|
||||||
# preloads Rails for running tests, you may have to set it to true.
|
# system, or in some way before deploying your code.
|
||||||
config.eager_load = false
|
config.eager_load = ENV["CI"].present?
|
||||||
|
|
||||||
# Configure public file server for tests with Cache-Control for performance.
|
# Configure public file server for tests with Cache-Control for performance.
|
||||||
config.public_file_server.enabled = true
|
config.public_file_server.enabled = true
|
||||||
config.public_file_server.headers = {
|
config.public_file_server.headers = {
|
||||||
'Cache-Control' => "public, max-age=#{1.hour.to_i}"
|
"Cache-Control" => "public, max-age=#{1.hour.to_i}"
|
||||||
}
|
}
|
||||||
|
|
||||||
# Show full error reports and disable caching.
|
# Show full error reports and disable caching.
|
||||||
@@ -43,6 +46,15 @@ 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
|
||||||
|
|
||||||
|
# Raise exceptions for disallowed deprecations.
|
||||||
|
config.active_support.disallowed_deprecation = :raise
|
||||||
|
|
||||||
|
# Tell Active Support which deprecation messages to disallow.
|
||||||
|
config.active_support.disallowed_deprecation_warnings = []
|
||||||
|
|
||||||
# Raises error for missing translations.
|
# Raises error for missing translations.
|
||||||
config.action_view.raise_on_missing_translations = true
|
config.i18n.raise_on_missing_translations = true
|
||||||
|
|
||||||
|
# Annotate rendered view with file names.
|
||||||
|
# config.action_view.annotate_rendered_view_with_filenames = true
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -1,9 +1,12 @@
|
|||||||
# Be sure to restart your server when you modify this file.
|
# Be sure to restart your server when you modify this file.
|
||||||
|
|
||||||
# Version of your assets, change this if you want to expire all your assets.
|
# Version of your assets, change this if you want to expire all your assets.
|
||||||
Rails.application.config.assets.version = '1.0'
|
Rails.application.config.assets.version = "1.0"
|
||||||
|
|
||||||
# Add additional assets to the asset load path.
|
# Add additional assets to the asset load path.
|
||||||
# Rails.application.config.assets.paths << Emoji.images_path
|
# Rails.application.config.assets.paths << Emoji.images_path
|
||||||
# Add Yarn node_modules folder to the asset load path.
|
|
||||||
Rails.application.config.assets.paths << Rails.root.join('node_modules')
|
# Precompile additional assets.
|
||||||
|
# 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 )
|
||||||
|
|||||||
@@ -1,7 +1,8 @@
|
|||||||
# Be sure to restart your server when you modify this file.
|
# Be sure to restart your server when you modify this file.
|
||||||
|
|
||||||
# You can add backtrace silencers for libraries that you're using but don't wish to see in your backtraces.
|
# You can add backtrace silencers for libraries that you're using but don't wish to see in your backtraces.
|
||||||
# Rails.backtrace_cleaner.add_silencer { |line| line =~ /my_noisy_library/ }
|
# Rails.backtrace_cleaner.add_silencer { |line| /my_noisy_library/.match?(line) }
|
||||||
|
|
||||||
# You can also remove all the silencers if you're trying to debug a problem that might stem from framework code.
|
# You can also remove all the silencers if you're trying to debug a problem that might stem from framework code
|
||||||
# Rails.backtrace_cleaner.remove_silencers!
|
# by setting BACKTRACE=1 before calling your invocation, like "BACKTRACE=1 ./bin/rails runner 'MyClass.perform'".
|
||||||
|
Rails.backtrace_cleaner.remove_silencers! if ENV["BACKTRACE"]
|
||||||
|
|||||||
@@ -4,26 +4,24 @@
|
|||||||
# For further information see the following documentation
|
# For further information see the following documentation
|
||||||
# https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Security-Policy
|
# https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Security-Policy
|
||||||
|
|
||||||
Rails.application.config.content_security_policy do |policy|
|
Rails.application.configure do
|
||||||
policy.default_src :none
|
config.content_security_policy do |policy|
|
||||||
policy.font_src :self, 'https://cdnjs.cloudflare.com'
|
policy.default_src :none
|
||||||
policy.img_src :self, 'https://cdnjs.cloudflare.com', 'https://projecteuler.net'
|
policy.font_src :self, "https://cdnjs.cloudflare.com"
|
||||||
policy.object_src :none
|
policy.img_src :self, "https://cdnjs.cloudflare.com", "https://projecteuler.net"
|
||||||
policy.script_src :self, 'https://cdnjs.cloudflare.com'
|
policy.object_src :none
|
||||||
policy.style_src :self, :unsafe_inline
|
policy.script_src :self, "https://cdnjs.cloudflare.com"
|
||||||
policy.connect_src :self
|
policy.style_src :self, :unsafe_inline
|
||||||
|
policy.connect_src :self
|
||||||
|
# Specify URI for violation reports
|
||||||
|
# policy.report_uri "/csp-violation-report-endpoint"
|
||||||
|
end
|
||||||
|
|
||||||
# Specify URI for violation reports
|
# Generate session nonces for permitted importmap and inline scripts
|
||||||
# policy.report_uri "/csp-violation-report-endpoint"
|
config.content_security_policy_nonce_generator = ->(request) { request.session.id.to_s }
|
||||||
|
config.content_security_policy_nonce_directives = %w(script-src)
|
||||||
|
|
||||||
|
# Report CSP violations to a specified URI. See:
|
||||||
|
# https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Security-Policy-Report-Only
|
||||||
|
# config.content_security_policy_report_only = true
|
||||||
end
|
end
|
||||||
|
|
||||||
# If you are using UJS then enable automatic nonce generation
|
|
||||||
# Rails.application.config.content_security_policy_nonce_generator = -> request { SecureRandom.base64(16) }
|
|
||||||
|
|
||||||
# Set the nonce only to specific directives
|
|
||||||
# Rails.application.config.content_security_policy_nonce_directives = %w(script-src)
|
|
||||||
|
|
||||||
# Report CSP violations to a specified URI
|
|
||||||
# For further information see the following documentation:
|
|
||||||
# https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Security-Policy-Report-Only
|
|
||||||
# Rails.application.config.content_security_policy_report_only = true
|
|
||||||
|
|||||||
@@ -1,4 +1,6 @@
|
|||||||
# Be sure to restart your server when you modify this file.
|
# Be sure to restart your server when you modify this file.
|
||||||
|
|
||||||
# Configure sensitive parameters which will be filtered from the log file.
|
# Configure sensitive parameters which will be filtered from the log file.
|
||||||
Rails.application.config.filter_parameters += [:password]
|
Rails.application.config.filter_parameters += [
|
||||||
|
:passw, :secret, :token, :_key, :crypt, :salt, :certificate, :otp, :ssn
|
||||||
|
]
|
||||||
|
|||||||
@@ -4,13 +4,13 @@
|
|||||||
# are locale specific, and you may define rules for as many different
|
# are locale specific, and you may define rules for as many different
|
||||||
# locales as you wish. All of these examples are active by default:
|
# locales as you wish. All of these examples are active by default:
|
||||||
# ActiveSupport::Inflector.inflections(:en) do |inflect|
|
# ActiveSupport::Inflector.inflections(:en) do |inflect|
|
||||||
# inflect.plural /^(ox)$/i, '\1en'
|
# inflect.plural /^(ox)$/i, "\\1en"
|
||||||
# inflect.singular /^(ox)en/i, '\1'
|
# inflect.singular /^(ox)en/i, "\\1"
|
||||||
# inflect.irregular 'person', 'people'
|
# inflect.irregular "person", "people"
|
||||||
# inflect.uncountable %w( fish sheep )
|
# inflect.uncountable %w( fish sheep )
|
||||||
# end
|
# end
|
||||||
|
|
||||||
# These inflection rules are supported but not enabled by default:
|
# These inflection rules are supported but not enabled by default:
|
||||||
# ActiveSupport::Inflector.inflections(:en) do |inflect|
|
# ActiveSupport::Inflector.inflections(:en) do |inflect|
|
||||||
# inflect.acronym 'RESTful'
|
# inflect.acronym "RESTful"
|
||||||
# end
|
# end
|
||||||
|
|||||||
11
config/initializers/permissions_policy.rb
Normal file
11
config/initializers/permissions_policy.rb
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
# Define an application-wide HTTP permissions policy. For further
|
||||||
|
# information see https://developers.google.com/web/updates/2018/06/feature-policy
|
||||||
|
#
|
||||||
|
Rails.application.config.permissions_policy do |f|
|
||||||
|
f.camera :none
|
||||||
|
f.gyroscope :none
|
||||||
|
f.microphone :none
|
||||||
|
f.usb :none
|
||||||
|
f.fullscreen :self
|
||||||
|
f.payment :none
|
||||||
|
end
|
||||||
@@ -8,6 +8,6 @@ class ApplicationHelperTest < ActionView::TestCase
|
|||||||
|
|
||||||
test "bootstrap flash messages should work" do
|
test "bootstrap flash messages should work" do
|
||||||
flash[:error] = "Error"
|
flash[:error] = "Error"
|
||||||
assert_equal "<div class=\"alert alert-danger alert-dismissible\" role=\"alert\"><button class=\"close\" data-dismiss=\"alert\"><span aria-hidden=\"true\">×</span><span class=\"sr-only\">Close</span></button>Error</div>", flash_messages
|
assert_equal "<div class=\"alert alert-danger alert-dismissible\" role=\"alert\">Error<button class=\"btn-close\" data-bs-dismiss=\"alert\" aria-label=\"Close\"></button></div>", flash_messages
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ class TranslatorFlowTest < ActionDispatch::IntegrationTest
|
|||||||
end
|
end
|
||||||
|
|
||||||
test "can login via github" do
|
test "can login via github" do
|
||||||
get '/users/auth/github'
|
post '/users/auth/github'
|
||||||
assert_response :redirect
|
assert_response :redirect
|
||||||
follow_redirect!
|
follow_redirect!
|
||||||
follow_redirect!
|
follow_redirect!
|
||||||
|
|||||||
@@ -1,8 +1,5 @@
|
|||||||
require 'codacy-coverage'
|
|
||||||
require 'webmock/minitest'
|
require 'webmock/minitest'
|
||||||
|
|
||||||
Codacy::Reporter.start
|
|
||||||
|
|
||||||
ENV['RAILS_ENV'] ||= 'test'
|
ENV['RAILS_ENV'] ||= 'test'
|
||||||
require File.expand_path('../../config/environment', __FILE__)
|
require File.expand_path('../../config/environment', __FILE__)
|
||||||
require 'rails/test_help'
|
require 'rails/test_help'
|
||||||
|
|||||||
Reference in New Issue
Block a user