From db35f49aa9babf0bd5fda6762a8a75cce08f5526 Mon Sep 17 00:00:00 2001 From: Owaru Ryudo Date: Tue, 28 May 2024 19:20:00 +0800 Subject: [PATCH] Use JRuby --- .rubocop.yml | 10 + .ruby-version | 2 +- Gemfile | 38 +- Gemfile.lock | 432 +++++++++--------- ...{application.css.scss => application.scss} | 3 +- .../{custom.css.scss => custom.scss} | 0 ...contributor.css.scss => _contributor.scss} | 0 ...{_navigation.css.scss => _navigation.scss} | 0 ...y_proposals.css.scss => my_proposals.scss} | 0 app/helpers/application_helper.rb | 5 +- app/mailers/application_mailer.rb | 2 +- app/models/application_record.rb | 5 +- app/models/notification.rb | 7 +- config/database.yml | 1 - config/initializers/redcarpet.rb | 9 - config/puma.rb | 1 - config/settings.yml | 3 +- db/schema.rb | 3 +- spec/mailers/notification_spec.rb | 2 +- spec/models/notification_spec.rb | 4 +- 20 files changed, 251 insertions(+), 276 deletions(-) create mode 100644 .rubocop.yml rename app/assets/stylesheets/{application.css.scss => application.scss} (96%) rename app/assets/stylesheets/{custom.css.scss => custom.scss} (100%) rename app/assets/stylesheets/module/{_contributor.css.scss => _contributor.scss} (100%) rename app/assets/stylesheets/module/{_navigation.css.scss => _navigation.scss} (100%) rename app/assets/stylesheets/{my_proposals.css.scss => my_proposals.scss} (100%) delete mode 100644 config/initializers/redcarpet.rb diff --git a/.rubocop.yml b/.rubocop.yml new file mode 100644 index 0000000..cc4712a --- /dev/null +++ b/.rubocop.yml @@ -0,0 +1,10 @@ +# The behavior of RuboCop can be controlled via the .rubocop.yml +# configuration file. It makes it possible to enable/disable +# certain cops (checks) and to alter their behavior if they accept +# any parameters. The file can be placed either in your home +# directory or in some project directory. +# +# RuboCop will start looking for the configuration file in the directory +# where the inspected file is and continue its way up to the root directory. +# +# See https://docs.rubocop.org/rubocop/configuration diff --git a/.ruby-version b/.ruby-version index 6a81b4c..d414abc 100644 --- a/.ruby-version +++ b/.ruby-version @@ -1 +1 @@ -2.7.8 +jruby-9.3.14.0 diff --git a/Gemfile b/Gemfile index 374f62e..996a192 100644 --- a/Gemfile +++ b/Gemfile @@ -1,16 +1,18 @@ source 'https://rubygems.org' -gem 'airbrake', '~> 13.0' -gem 'bigdecimal', '~> 1.4' +gem 'bigdecimal' +# gem 'sassc-embedded' +gem 'bootstrap-sass', '3.4.1' +gem 'airbrake-ruby','6.2.2', github: 'airbrake/airbrake-ruby' +gem 'airbrake' gem 'redis-namespace' gem 'aasm', '~> 5' gem 'default_value_for', '~> 3.4.0' gem 'rails', '5.2.8.1' -gem 'pg', '~> 1.0' -gem 'bootstrap-sass', '~> 3.4.1' -gem 'font-awesome-rails' +gem 'jdbc-postgres', '~> 42.6' +gem 'activerecord-jdbcpostgresql-adapter' +gem 'font-awesome-rails', '4.7.0.8' gem 'pagedown-bootstrap-rails' -gem 'sassc-rails' gem 'uglifier', '>= 1.3.0' gem 'coffee-rails' gem 'jquery-rails' @@ -22,28 +24,26 @@ gem 'devise','~> 4.7.0' gem 'ratyrate' gem 'cancancan', '~> 1.10' gem 'carrierwave', '~> 1' -gem 'omniauth' +gem 'omniauth', '< 2.0' gem 'omniauth-github' -gem 'redcarpet' +gem 'kramdown' gem 'rouge', '~> 2.0.6' gem 'acts-as-taggable-on', '6.5.0' gem 'unicode_utils' gem 'scenic' gem 'slack-notifier' gem 'puma' -# gem 'json', '2.6.3' group :development, :test do - gem 'byebug' + gem 'ruby-debug' gem 'rspec-rails' gem 'shoulda-matchers', '~> 2.8.0' gem 'capybara' gem 'fuubar' - gem 'factory_bot_rails' - gem 'guard' - gem 'guard-rspec' + gem 'factory_bot_rails', '~> 5' gem 'rails-controller-testing' - gem 'faker' + gem 'faker', '~> 1.8.0' + gem 'listen' end group :test do @@ -52,11 +52,13 @@ group :test do end group :development do - gem 'next_rails', '1.0.5' gem 'letter_opener' gem 'web-console', '~> 3.0' gem 'awesome_print' gem 'boxing' + gem 'rubocop-rails' + gem 'rubocop-capybara' + gem 'rubocop-rspec' end group :test do @@ -68,9 +70,7 @@ gem 'liveness' gem 'config' gem 'country_select' -gem 'slim' -gem 'nokogiri', '~> 1' -gem "ffi", ">= 1.9.24" +gem 'slim', '~> 3.0' gem 'write_xlsx' gem "omniauth-twitter", "~> 1.4" @@ -82,3 +82,5 @@ gem "postal-rails", "~> 1.0" gem "dotenv-rails", "~> 2.8" gem "good_job", "~> 2.99" + +gem "kramdown-parser-gfm", "~> 1.1" diff --git a/Gemfile.lock b/Gemfile.lock index fc77592..54f528f 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,3 +1,10 @@ +GIT + remote: https://github.com/airbrake/airbrake-ruby.git + revision: 7c9f1885717141ffe39f8a7900cea47b941be19b + specs: + airbrake-ruby (6.2.2) + rbtree-jruby (~> 0.2) + GEM remote: https://rubygems.org/ specs: @@ -35,6 +42,11 @@ GEM activemodel (= 5.2.8.1) activesupport (= 5.2.8.1) arel (>= 9.0) + activerecord-jdbc-adapter (52.8-java) + activerecord (~> 5.2.0) + activerecord-jdbcpostgresql-adapter (52.8-java) + activerecord-jdbc-adapter (= 52.8) + jdbc-postgres (>= 9.4, < 43) activestorage (5.2.8.1) actionpack (= 5.2.8.1) activerecord (= 5.2.8.1) @@ -46,18 +58,18 @@ GEM tzinfo (~> 1.1) acts-as-taggable-on (6.5.0) activerecord (>= 5.0, < 6.1) - addressable (2.5.2) - public_suffix (>= 2.0.2, < 4.0) + addressable (2.8.6) + public_suffix (>= 2.0.2, < 6.0) airbrake (13.0.4) airbrake-ruby (~> 6.0) - airbrake-ruby (6.2.2) - rbtree3 (~> 0.6) arel (9.0.0) - autoprefixer-rails (9.4.9) - execjs - awesome_print (1.8.0) - bcrypt (3.1.20) - bigdecimal (1.4.4) + ast (2.4.2) + autoprefixer-rails (10.4.16.0) + execjs (~> 2) + awesome_print (1.9.2) + base64 (0.2.0) + bcrypt (3.1.20-java) + bigdecimal (3.1.7-java) bindex (0.8.1) bootsnap (1.18.3) msgpack (~> 1.2) @@ -68,43 +80,43 @@ GEM bundler (~> 2.0) zeitwerk (~> 2.6) builder (3.2.4) - byebug (11.1.3) cancancan (1.17.0) - capybara (2.17.0) + capybara (3.36.0) addressable + matrix mini_mime (>= 0.1.3) - nokogiri (>= 1.3.3) - rack (>= 1.0.0) - rack-test (>= 0.5.4) - xpath (>= 2.0, < 4.0) - carrierwave (1.2.2) + nokogiri (~> 1.8) + rack (>= 1.6.0) + rack-test (>= 0.6.3) + regexp_parser (>= 1.5, < 3.0) + xpath (~> 3.2) + carrierwave (1.3.4) activemodel (>= 4.0.0) activesupport (>= 4.0.0) mime-types (>= 1.16) - coderay (1.1.2) - coffee-rails (4.2.2) + ssrf_filter (~> 1.0, < 1.1.0) + childprocess (5.0.0) + coffee-rails (5.0.0) coffee-script (>= 2.2.0) - railties (>= 4.0.0) + railties (>= 5.2.0) coffee-script (2.4.1) coffee-script-source execjs coffee-script-source (1.12.2) - colorize (1.1.0) + columnize (0.9.0) concurrent-ruby (1.2.3) - config (5.1.0) + config (5.4.0) deep_merge (~> 1.2, >= 1.2.1) - dry-validation (~> 1.0, >= 1.0.0) - countries (2.1.3) - i18n_data (~> 0.8.0) - money (~> 6.9) + connection_pool (2.4.1) + countries (4.2.3) + i18n_data (~> 0.16.0) sixarm_ruby_unaccent (~> 1.1) - unicode_utils (~> 1.4) - country_select (3.1.1) - countries (~> 2.0) - sort_alphabetical (~> 1.0) + country_select (6.1.1) + countries (~> 4.2) + sort_alphabetical (~> 1.1) crass (1.0.6) - database_rewinder (0.8.2) - date (3.3.4) + database_rewinder (1.0.1) + date (3.3.4-java) deep_merge (1.2.2) default_value_for (3.4.0) activerecord (>= 3.2.0, < 7.0) @@ -114,67 +126,35 @@ GEM railties (>= 4.1.0) responders warden (~> 1.2.3) - diff-lcs (1.3) - docile (1.1.5) + diff-lcs (1.5.1) + docile (1.4.0) dotenv (2.8.1) dotenv-rails (2.8.1) dotenv (= 2.8.1) railties (>= 3.2) - dry-configurable (1.0.1) - dry-core (~> 1.0, < 2) - zeitwerk (~> 2.6) - dry-core (1.0.0) - concurrent-ruby (~> 1.0) - zeitwerk (~> 2.6) - dry-inflector (1.0.0) - dry-initializer (3.1.1) - dry-logic (1.5.0) - concurrent-ruby (~> 1.0) - dry-core (~> 1.0, < 2) - zeitwerk (~> 2.6) - dry-schema (1.13.3) - concurrent-ruby (~> 1.0) - dry-configurable (~> 1.0, >= 1.0.1) - dry-core (~> 1.0, < 2) - dry-initializer (~> 3.0) - dry-logic (>= 1.4, < 2) - dry-types (>= 1.7, < 2) - zeitwerk (~> 2.6) - dry-types (1.7.1) - concurrent-ruby (~> 1.0) - dry-core (~> 1.0) - dry-inflector (~> 1.0) - dry-logic (~> 1.4) - zeitwerk (~> 2.6) - dry-validation (1.10.0) - concurrent-ruby (~> 1.0) - dry-core (~> 1.0, < 2) - dry-initializer (~> 3.0) - dry-schema (>= 1.12, < 2) - zeitwerk (~> 2.6) erubi (1.12.0) - et-orbi (1.2.7) + et-orbi (1.2.11) tzinfo execjs (2.9.1) - factory_bot (5.0.2) + factory_bot (5.2.0) activesupport (>= 4.2.0) - factory_bot_rails (5.0.1) - factory_bot (~> 5.0.0) + factory_bot_rails (5.2.0) + factory_bot (~> 5.2.0) railties (>= 4.2.0) faker (1.8.7) i18n (>= 0.7) - faraday (2.7.10) + faraday (2.8.1) + base64 faraday-net_http (>= 2.0, < 3.1) ruby2_keywords (>= 0.0.4) faraday-net_http (3.0.2) - ffi (1.16.3) + ffi (1.16.3-java) font-awesome-rails (4.7.0.8) railties (>= 3.2, < 8.0) - formatador (0.2.5) - fugit (1.9.0) - et-orbi (~> 1, >= 1.2.7) + fugit (1.11.0) + et-orbi (~> 1, >= 1.2.11) raabro (~> 1.4) - fuubar (2.3.1) + fuubar (2.5.1) rspec-core (~> 3.0) ruby-progressbar (~> 1.4) globalid (1.1.0) @@ -188,95 +168,76 @@ GEM thor (>= 0.14.1) webrick (>= 1.3) zeitwerk (>= 2.0) - guard (2.14.2) - formatador (>= 0.2.4) - listen (>= 2.7, < 4.0) - lumberjack (>= 1.0.12, < 2.0) - nenv (~> 0.1) - notiffany (~> 0.0) - pry (>= 0.9.12) - shellany (~> 0.0) - thor (>= 0.18.1) - guard-compat (1.2.1) - guard-rspec (4.7.3) - guard (~> 2.1) - guard-compat (~> 1.1) - rspec (>= 2.99.0, < 4.0) hashie (5.0.0) - i18n (0.9.5) + i18n (1.14.4) concurrent-ruby (~> 1.0) - i18n_data (0.8.0) - jbuilder (2.7.0) - activesupport (>= 4.2.0) - multi_json (>= 1.2) + i18n_data (0.16.0) + simple_po_parser (~> 1.1) + jbuilder (2.11.5) + actionview (>= 5.0.0) + activesupport (>= 5.0.0) + jdbc-postgres (42.6.0) jquery-rails (4.6.0) rails-dom-testing (>= 1, < 3) railties (>= 4.2.0) thor (>= 0.14, < 2.0) - jquery-ui-rails (6.0.1) + jquery-ui-rails (7.0.0) railties (>= 3.2.16) - json (2.7.1) - jwt (2.7.1) - launchy (2.4.3) - addressable (~> 2.3) - letter_opener (1.5.0) - launchy (~> 2.2) - listen (3.1.5) - rb-fsevent (~> 0.9, >= 0.9.4) - rb-inotify (~> 0.9, >= 0.9.7) - ruby_dep (~> 1.2) + json (2.7.2-java) + jwt (2.8.1) + base64 + kramdown (2.4.0) + rexml + kramdown-parser-gfm (1.1.0) + kramdown (~> 2.0) + launchy (3.0.0) + addressable (~> 2.8) + childprocess (~> 5.0) + letter_opener (1.10.0) + launchy (>= 2.2, < 4) + linecache (1.3.1-java) + listen (3.9.0) + rb-fsevent (~> 0.10, >= 0.10.3) + rb-inotify (~> 0.9, >= 0.9.10) liveness (0.3.2) rack (>= 1.0) loofah (2.22.0) crass (~> 1.0.2) nokogiri (>= 1.12.0) - lumberjack (1.0.12) mail (2.8.1) mini_mime (>= 0.1.1) net-imap net-pop net-smtp - marcel (1.0.2) - method_source (0.9.2) - mime-types (3.4.1) + marcel (1.0.4) + matrix (0.4.2) + method_source (1.1.0) + mime-types (3.5.2) mime-types-data (~> 3.2015) - mime-types-data (3.2023.0218.1) - mini_magick (4.9.4) + mime-types-data (3.2024.0305) + mini_magick (4.12.0) mini_mime (1.1.5) - mini_portile2 (2.8.5) - minitest (5.22.2) - money (6.10.1) - i18n (>= 0.6.4, < 1.0) + minitest (5.22.3) moonrope-client (1.0.5) json - msgpack (1.7.2) - multi_json (1.15.0) + msgpack (1.7.2-java) multi_xml (0.6.0) - nenv (0.3.0) - net-imap (0.4.10) + net-imap (0.3.7) date net-protocol net-pop (0.1.2) net-protocol net-protocol (0.2.2) timeout - net-smtp (0.4.0.1) + net-smtp (0.5.0) net-protocol - next_rails (1.0.5) - colorize (>= 0.8.1) - nio4r (2.7.0) - nokogiri (1.15.5) - mini_portile2 (~> 2.8.2) + nio4r (2.7.1-java) + nkf (0.2.0-java) + nokogiri (1.13.10-java) racc (~> 1.4) - notiffany (0.1.1) - nenv (~> 0.1) - shellany (~> 0.0) - oauth (1.1.0) - oauth-tty (~> 1.0, >= 1.0.1) + oauth (0.6.2) snaky_hash (~> 2.0) version_gem (~> 1.1) - oauth-tty (1.0.5) - version_gem (~> 1.1, >= 1.1.1) oauth2 (2.0.9) faraday (>= 0.17.3, < 3.0) jwt (>= 1.0, < 3.0) @@ -305,20 +266,20 @@ GEM orm_adapter (0.5.0) pagedown-bootstrap-rails (2.1.4) railties (> 3.1) - pg (1.5.4) + parallel (1.24.0) + parser (3.3.1.0) + ast (~> 2.4.1) + racc postal-rails (1.0.1) postal-ruby (>= 0.0.2, < 2.0) postal-ruby (1.0.1) moonrope-client (>= 1.0.2, < 1.1) - pry (0.11.3) - coderay (~> 1.1.0) - method_source (~> 0.9.0) - public_suffix (3.0.1) - puma (6.4.2) + public_suffix (5.0.5) + puma (6.4.2-java) nio4r (~> 2.0) raabro (1.4.0) - racc (1.7.3) - rack (2.2.8) + racc (1.7.3-java) + rack (2.2.9) rack-test (2.1.0) rack (>= 1.3) rails (5.2.8.1) @@ -334,86 +295,105 @@ GEM bundler (>= 1.3.0) railties (= 5.2.8.1) sprockets-rails (>= 2.0.0) - rails-controller-testing (1.0.2) - actionpack (~> 5.x, >= 5.0.1) - actionview (~> 5.x, >= 5.0.1) - activesupport (~> 5.x) + rails-controller-testing (1.0.5) + actionpack (>= 5.0.1.rc1) + actionview (>= 5.0.1.rc1) + activesupport (>= 5.0.1.rc1) rails-dom-testing (2.2.0) activesupport (>= 5.0.0) minitest nokogiri (>= 1.6) - rails-html-sanitizer (1.6.0) - loofah (~> 2.21) - nokogiri (~> 1.14) + rails-html-sanitizer (1.5.0) + loofah (~> 2.19, >= 2.19.1) railties (5.2.8.1) actionpack (= 5.2.8.1) activesupport (= 5.2.8.1) method_source rake (>= 0.8.7) thor (>= 0.19.0, < 2.0) - rake (13.1.0) + rainbow (3.1.1) + rake (13.2.1) ratyrate (1.2.2.alpha) - rb-fsevent (0.10.3) - rb-inotify (0.10.0) + rb-fsevent (0.11.2) + rb-inotify (0.10.1) ffi (~> 1.0) - rbtree3 (0.7.1) - redcarpet (3.4.0) - redis (4.5.1) - redis-namespace (1.6.0) - redis (>= 3.0.4) + rbtree-jruby (0.2.1) + redis (5.2.0) + redis-client (>= 0.22.0) + redis-client (0.22.1) + connection_pool + redis-namespace (1.11.0) + redis (>= 4) + regexp_parser (2.9.0) responders (3.1.1) actionpack (>= 5.2) railties (>= 5.2) + rexml (3.2.6) rouge (2.0.7) - rspec (3.7.0) - rspec-core (~> 3.7.0) - rspec-expectations (~> 3.7.0) - rspec-mocks (~> 3.7.0) - rspec-core (3.7.1) - rspec-support (~> 3.7.0) - rspec-expectations (3.7.0) + rspec-core (3.13.0) + rspec-support (~> 3.13.0) + rspec-expectations (3.13.0) diff-lcs (>= 1.2.0, < 2.0) - rspec-support (~> 3.7.0) - rspec-mocks (3.7.0) + rspec-support (~> 3.13.0) + rspec-mocks (3.13.0) diff-lcs (>= 1.2.0, < 2.0) - rspec-support (~> 3.7.0) - rspec-rails (3.7.2) - actionpack (>= 3.0) - activesupport (>= 3.0) - railties (>= 3.0) - rspec-core (~> 3.7.0) - rspec-expectations (~> 3.7.0) - rspec-mocks (~> 3.7.0) - rspec-support (~> 3.7.0) - rspec-support (3.7.0) - ruby-progressbar (1.9.0) + rspec-support (~> 3.13.0) + rspec-rails (5.1.2) + actionpack (>= 5.2) + activesupport (>= 5.2) + railties (>= 5.2) + rspec-core (~> 3.10) + rspec-expectations (~> 3.10) + rspec-mocks (~> 3.10) + rspec-support (~> 3.10) + rspec-support (3.13.1) + rubocop (1.50.2) + json (~> 2.3) + parallel (~> 1.10) + parser (>= 3.2.0.0) + rainbow (>= 2.2.2, < 4.0) + regexp_parser (>= 1.8, < 3.0) + rexml (>= 3.2.5, < 4.0) + rubocop-ast (>= 1.28.0, < 2.0) + ruby-progressbar (~> 1.7) + unicode-display_width (>= 2.4.0, < 3.0) + rubocop-ast (1.30.0) + parser (>= 3.2.1.0) + rubocop-capybara (2.18.0) + rubocop (~> 1.41) + rubocop-rails (2.19.1) + activesupport (>= 4.2.0) + rack (>= 1.1) + rubocop (>= 1.33.0, < 2.0) + rubocop-rspec (2.20.0) + rubocop (~> 1.33) + rubocop-capybara (~> 2.17) + ruby-debug (0.11.0) + columnize (>= 0.1) + linecache (~> 1.3.1) + ruby-debug-base (~> 0.11.0.0) + ruby-debug-base (0.11.0-java) + ruby-progressbar (1.13.0) ruby2_keywords (0.0.5) - ruby_dep (1.5.0) - rubyzip (1.2.2) + rubyzip (2.3.2) sassc (2.4.0) - ffi (~> 1.9) - sassc-rails (2.1.0) - railties (>= 4.0.0) - sassc (>= 2.0) - sprockets (> 3.0) - sprockets-rails - tilt - scenic (1.4.1) + scenic (1.8.0) activerecord (>= 4.0.0) railties (>= 4.0.0) - shellany (0.0.1) shoulda-matchers (2.8.0) activesupport (>= 3.0.0) simple_form (4.1.0) actionpack (>= 5.0) activemodel (>= 5.0) - simplecov (0.15.1) - docile (~> 1.1.0) - json (>= 1.8, < 3) - simplecov-html (~> 0.10.0) - simplecov-html (0.10.2) - sixarm_ruby_unaccent (1.2.0) - slack-notifier (2.3.1) + simple_po_parser (1.1.6) + simplecov (0.22.0) + docile (~> 1.1) + simplecov-html (~> 0.11) + simplecov_json_formatter (~> 0.1) + simplecov-html (0.12.3) + simplecov_json_formatter (0.1.4) + sixarm_ruby_unaccent (1.2.2) + slack-notifier (2.4.0) slim (3.0.9) temple (>= 0.7.6, < 0.9) tilt (>= 1.3.3, < 2.1) @@ -422,8 +402,7 @@ GEM version_gem (~> 1.1, >= 1.1.1) sort_alphabetical (1.1.0) unicode_utils (>= 1.2.2) - spring (2.0.2) - activesupport (>= 4.2) + spring (3.1.1) sprockets (4.2.1) concurrent-ruby (~> 1.0) rack (>= 2.2.4, < 4) @@ -431,17 +410,19 @@ GEM actionpack (>= 5.2) activesupport (>= 5.2) sprockets (>= 3.0.0) - temple (0.8.0) - thor (1.3.0) - thread_safe (0.3.6) - tilt (2.0.9) + ssrf_filter (1.0.8) + temple (0.8.2) + thor (1.3.1) + thread_safe (0.3.6-java) + tilt (2.0.11) timeout (0.4.1) tzinfo (1.2.11) thread_safe (~> 0.1) - uglifier (4.1.3) + uglifier (4.2.0) execjs (>= 0.3.0, < 3) + unicode-display_width (2.5.0) unicode_utils (1.4.0) - version_gem (1.1.3) + version_gem (1.1.4) warden (1.2.9) rack (>= 2.0.9) web-console (3.7.0) @@ -450,31 +431,30 @@ GEM bindex (>= 0.4.0) railties (>= 5.0) webrick (1.8.1) - websocket-driver (0.7.6) + websocket-driver (0.7.6-java) websocket-extensions (>= 0.1.0) websocket-extensions (0.1.5) - write_xlsx (0.85.6) + write_xlsx (1.12.1) + nkf rubyzip (>= 1.0.0) - zip-zip - xpath (3.0.0) + xpath (3.2.0) nokogiri (~> 1.8) zeitwerk (2.6.13) - zip-zip (0.3) - rubyzip (>= 1.0.0) PLATFORMS - ruby + universal-java-21 DEPENDENCIES aasm (~> 5) + activerecord-jdbcpostgresql-adapter acts-as-taggable-on (= 6.5.0) - airbrake (~> 13.0) + airbrake + airbrake-ruby (= 6.2.2)! awesome_print - bigdecimal (~> 1.4) + bigdecimal bootsnap (~> 1.18) - bootstrap-sass (~> 3.4.1) + bootstrap-sass (= 3.4.1) boxing - byebug cancancan (~> 1.10) capybara carrierwave (~> 1) @@ -485,44 +465,44 @@ DEPENDENCIES default_value_for (~> 3.4.0) devise (~> 4.7.0) dotenv-rails (~> 2.8) - factory_bot_rails - faker - ffi (>= 1.9.24) - font-awesome-rails + factory_bot_rails (~> 5) + faker (~> 1.8.0) + font-awesome-rails (= 4.7.0.8) fuubar good_job (~> 2.99) - guard - guard-rspec jbuilder (~> 2.0) + jdbc-postgres (~> 42.6) jquery-rails jquery-ui-rails + kramdown + kramdown-parser-gfm (~> 1.1) letter_opener + listen liveness mini_magick - next_rails (= 1.0.5) - nokogiri (~> 1) - omniauth + omniauth (< 2.0) omniauth-github omniauth-twitter (~> 1.4) openbox pagedown-bootstrap-rails - pg (~> 1.0) postal-rails (~> 1.0) puma rails (= 5.2.8.1) rails-controller-testing ratyrate - redcarpet redis-namespace rouge (~> 2.0.6) rspec-rails - sassc-rails + rubocop-capybara + rubocop-rails + rubocop-rspec + ruby-debug scenic shoulda-matchers (~> 2.8.0) simple_form (~> 4.1.0) simplecov slack-notifier - slim + slim (~> 3.0) spring uglifier (>= 1.3.0) unicode_utils @@ -530,4 +510,4 @@ DEPENDENCIES write_xlsx BUNDLED WITH - 2.2.33 + 2.4.22 diff --git a/app/assets/stylesheets/application.css.scss b/app/assets/stylesheets/application.scss similarity index 96% rename from app/assets/stylesheets/application.css.scss rename to app/assets/stylesheets/application.scss index 9c22fa3..209813e 100644 --- a/app/assets/stylesheets/application.css.scss +++ b/app/assets/stylesheets/application.scss @@ -10,6 +10,7 @@ * defined in the other CSS/SCSS files in this directory. It is generally better to create a new * file per style scope. * + *= require font-awesome *= require jquery-ui *= require_tree . *= require_self @@ -17,7 +18,7 @@ @import "bootstrap-sprockets"; @import "bootstrap"; -@import "font-awesome"; +//@import "font-awesome"; @import "pagedown_bootstrap"; @import "bootstrap-datetimepicker-build"; @import "rouge_github"; diff --git a/app/assets/stylesheets/custom.css.scss b/app/assets/stylesheets/custom.scss similarity index 100% rename from app/assets/stylesheets/custom.css.scss rename to app/assets/stylesheets/custom.scss diff --git a/app/assets/stylesheets/module/_contributor.css.scss b/app/assets/stylesheets/module/_contributor.scss similarity index 100% rename from app/assets/stylesheets/module/_contributor.css.scss rename to app/assets/stylesheets/module/_contributor.scss diff --git a/app/assets/stylesheets/module/_navigation.css.scss b/app/assets/stylesheets/module/_navigation.scss similarity index 100% rename from app/assets/stylesheets/module/_navigation.css.scss rename to app/assets/stylesheets/module/_navigation.scss diff --git a/app/assets/stylesheets/my_proposals.css.scss b/app/assets/stylesheets/my_proposals.scss similarity index 100% rename from app/assets/stylesheets/my_proposals.css.scss rename to app/assets/stylesheets/my_proposals.scss diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index 79c34dc..76eed8f 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -2,9 +2,8 @@ module ApplicationHelper SELECTED_PARAMS = %i(search_field search_type search_key commit) def markdown(content) - @markdown_renderer ||= ::RougeHTML.new(filter_html: true) - @markdown ||= Redcarpet::Markdown.new(@markdown_renderer, autolink: true, fenced_code_blocks: true) - @markdown.render(content|| "") + return '' if content.blank? + Kramdown::Document.new(content, auto_ids: false, syntax_highlighter: :rouge, input: 'GFM').to_html end def flash_message diff --git a/app/mailers/application_mailer.rb b/app/mailers/application_mailer.rb index 11c6e42..f945244 100644 --- a/app/mailers/application_mailer.rb +++ b/app/mailers/application_mailer.rb @@ -1,5 +1,5 @@ class ApplicationMailer < ActionMailer::Base - default reply_to: Settings.mailer.default_reply_to, from: Settings.mailer.default_from, bcc: Settings.mailer&.bcc_emails.to_s.split(',') + default reply_to: Settings.mailer.default_reply_to, from: Settings.mailer.default_from, bcc: Settings.mailer.bcc_emails.to_s.split(',') layout 'mailer' end diff --git a/app/models/application_record.rb b/app/models/application_record.rb index f2af975..9c33add 100644 --- a/app/models/application_record.rb +++ b/app/models/application_record.rb @@ -1,9 +1,6 @@ class ApplicationRecord < ActiveRecord::Base self.abstract_class = true def self.markdown(content) - @@markdown_renderer ||= ::RougeHTML.new(filter_html: true) - @@markdown ||= Redcarpet::Markdown.new(@@markdown_renderer, autolink: true, fenced_code_blocks: true) - - @@markdown.render(content || "") + Kramdown::Document.new(content, syntax_highlighter: :rouge, input: 'GFM').to_html end end diff --git a/app/models/notification.rb b/app/models/notification.rb index 0bc7408..066f9b6 100644 --- a/app/models/notification.rb +++ b/app/models/notification.rb @@ -22,10 +22,9 @@ def html_content end protected - def markdown(content) - renderer = Redcarpet::Render::HTML.new(filter_html: true) - markdown = Redcarpet::Markdown.new(renderer, autolink: true) - markdown.render(content) + def markdown(content) + return '' if content.blank? + Kramdown::Document.new(content, input: 'markdown', auto_ids: false).to_html end end diff --git a/config/database.yml b/config/database.yml index 3982ff7..3984e62 100644 --- a/config/database.yml +++ b/config/database.yml @@ -7,7 +7,6 @@ development: test: <<: *default - host: postgres database: cfp-test production: diff --git a/config/initializers/redcarpet.rb b/config/initializers/redcarpet.rb deleted file mode 100644 index 969f22f..0000000 --- a/config/initializers/redcarpet.rb +++ /dev/null @@ -1,9 +0,0 @@ -require 'rouge/plugins/redcarpet' - -class RougeHTML < Redcarpet::Render::HTML - include Rouge::Plugins::Redcarpet - - def rouge_formatter(lexer) - Rouge::Formatters::HTMLLegacy.new(:css_class => "highlight #{lexer.tag}") - end -end diff --git a/config/puma.rb b/config/puma.rb index c6dcc87..879c630 100644 --- a/config/puma.rb +++ b/config/puma.rb @@ -24,7 +24,6 @@ # Workers do not work on JRuby or Windows (both of which do not support # processes). # -workers ENV.fetch("WEB_CONCURRENCY") { 2 } # Use the `preload_app!` method when specifying a `workers` number. # This directive tells Puma to first boot the application and load code diff --git a/config/settings.yml b/config/settings.yml index 0442515..56af592 100644 --- a/config/settings.yml +++ b/config/settings.yml @@ -19,8 +19,7 @@ mailer: delivery_method: default_reply_to: contact@rubyconf.test default_from: "noreply@rubyconf.test" - bcc_email: - - contact@rubyconf.test + bcc_emails: contact@rubyconf.test paper: title: limit_word: true diff --git a/db/schema.rb b/db/schema.rb index 89719ad..ea3a8b7 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -203,7 +203,7 @@ add_foreign_key "papers", "activities" - create_view "custom_field_answers", sql_definition: <<-SQL + create_view "custom_field_answers", sql_definition: <<-SQL SELECT p.id, c.id AS custom_field_id, c.name, @@ -218,5 +218,4 @@ papers.answer_of_custom_fields AS ans FROM papers) p ON ((c.id = (p.key)::integer))); SQL - end diff --git a/spec/mailers/notification_spec.rb b/spec/mailers/notification_spec.rb index b616828..9ab543a 100644 --- a/spec/mailers/notification_spec.rb +++ b/spec/mailers/notification_spec.rb @@ -24,7 +24,7 @@ end it "renders the bcc email" do - expect(mail.bcc).to eq(["contact@rubyconf.dev"]) + expect(mail.bcc).to eq(["contact@rubyconf.test"]) end it "assigns @activity.name" do diff --git a/spec/models/notification_spec.rb b/spec/models/notification_spec.rb index 4a5b98c..90ee936 100644 --- a/spec/models/notification_spec.rb +++ b/spec/models/notification_spec.rb @@ -31,14 +31,14 @@ context "generate html content" do it "should able to convert markdown into html" do - notification = Notification.new(content: "#heading") + notification = Notification.new(content: "# heading") # TODO: Using capybara matcher expect(notification.html_content).to match(/

heading<\/h1>/) end it "should able to modify content before convert to html" do notification = Notification.new - expect(notification.html_content { "#heading" }).to match(/

heading<\/h1>/) + expect(notification.html_content { "# heading" }).to match(/

heading<\/h1>/) end end