diff --git a/Gemfile b/Gemfile index 607d2c0..d2c5e0a 100644 --- a/Gemfile +++ b/Gemfile @@ -1,59 +1,85 @@ source 'https://rubygems.org' +git_source(:github) { |repo| "https://github.com/#{repo}.git" } +ruby '2.4.3' # Bundle edge Rails instead: gem 'rails', github: 'rails/rails' -gem 'rails', '~> 5.0.0' +gem 'rails', '~> 5.2.4', '>= 5.2.4.4' # Use sqlite3 as the database for Active Record -gem 'sqlite3', '~> 1.3.0' +gem 'sqlite3' +# Use Puma as the app server +gem 'puma', '~> 3.11' # Use SCSS for stylesheets gem 'sass-rails', '~> 5.0' # Use Uglifier as compressor for JavaScript assets gem 'uglifier', '>= 1.3.0' -# Use CoffeeScript for .coffee assets and views -gem 'coffee-rails', '~> 4.1.0' # See https://github.com/rails/execjs#readme for more supported runtimes -# gem 'therubyracer', platforms: :ruby +# gem 'mini_racer', platforms: :ruby -# Use jquery as the JavaScript library -gem 'jquery-rails' -# Turbolinks makes following links in your web application faster. Read more: https://github.com/rails/turbolinks -# gem 'turbolinks' +# Use CoffeeScript for .coffee assets and views +gem 'coffee-rails', '~> 4.2' +# Turbolinks makes navigating your web application faster. Read more: https://github.com/turbolinks/turbolinks +gem 'turbolinks', '~> 5' # Build JSON APIs with ease. Read more: https://github.com/rails/jbuilder -gem 'jbuilder', '~> 2.0' -# bundle exec rake doc:rails generates the API under doc/api. -gem 'sdoc', '~> 0.4.0', group: :doc - +gem 'jbuilder', '~> 2.5' +# Use Redis adapter to run Action Cable in production +# gem 'redis', '~> 4.0' # Use ActiveModel has_secure_password # gem 'bcrypt', '~> 3.1.7' -# Use Unicorn as the app server -# gem 'unicorn' +# Use ActiveStorage variant +# gem 'mini_magick', '~> 4.8' # Use Capistrano for deployment # gem 'capistrano-rails', group: :development +# Reduces boot times through caching; required in config/boot.rb +gem 'bootsnap', '>= 1.1.0', require: false -## Markdown to HTML converter -# gem 'github-markup' +group :development, :test do + # Call 'byebug' anywhere in the code to stop execution and get a debugger console + gem 'byebug', platforms: [:mri, :mingw, :x64_mingw] +end -# pure-ruby markdown to HTML converter -gem "kramdown", "~> 1.12.0" +group :development do + # Access an interactive console on exception pages or by calling 'console' anywhere in the code. + gem 'web-console', '>= 3.3.0' + gem 'listen', '>= 3.0.5', '< 3.2' + # Spring speeds up development by keeping your application running in the background. Read more: https://github.com/rails/spring + gem 'spring' + gem 'spring-watcher-listen', '~> 2.0.0' +end -# html-pipeline filter -gem 'html-pipeline', '~> 2.4.0' +group :test do + # Adds support for Capybara system testing and selenium driver + gem 'capybara', '>= 2.15' + gem 'selenium-webdriver' + # Easy installation and use of chromedriver to run system tests with Chrome + gem 'chromedriver-helper' +end -## for EmojiFilter -gem 'gemoji' +# Windows does not include zoneinfo files, so bundle the tzinfo-data gem +gem 'tzinfo-data', platforms: [:mingw, :mswin, :x64_mingw, :jruby] -## for SanitizationFilter -gem 'sanitize' +################################################################ +## User settings -## for AutolinkFilter -gem 'rinku' +gem 'jquery-rails' + +# pure-ruby markdown to HTML converter +gem "kramdown", "~> 2.0" +gem 'kramdown-parser-gfm' -## for SyntaxHighlightFilter -gem 'github-linguist', '~> 7.11.0' -gem 'pygments.rb', '~> 0.6.0' +################ +# html-pipeline filter +# https://github.com/jch/html-pipeline#dependencies +# See html-pipeline's Gemfile :test block for version requirements. +# +gem 'html-pipeline', '~> 2.14.0' +gem 'rinku' ## for AutolinkFilter +gem 'gemoji' ## for EmojiFilter +gem 'sanitize' ## for SanitizationFilter +gem 'rouge' ## for SyntaxHighlightFilter # OmniAuth + github gem 'omniauth' @@ -69,17 +95,6 @@ gem "octokit", "~> 3.0" # for Emoji completion gem 'jquery-textcomplete-rails' -group :development, :test do - # Call 'byebug' anywhere in the code to stop execution and get a debugger console - gem 'byebug' - - # Access an IRB console on exception pages or by using <%= console %> in views - gem 'web-console', '~> 2.0' - - # Spring speeds up development by keeping your application running in the background. Read more: https://github.com/rails/spring - gem 'spring' -end - # https://github.com/twbs/bootstrap-sass gem 'bootstrap-sass', '~> 3.3.4' diff --git a/Gemfile.lock b/Gemfile.lock index cef6184..0f3ef8f 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,67 +1,84 @@ GEM remote: https://rubygems.org/ specs: - actioncable (5.0.7.2) - actionpack (= 5.0.7.2) - nio4r (>= 1.2, < 3.0) - websocket-driver (~> 0.6.1) - actionmailer (5.0.7.2) - actionpack (= 5.0.7.2) - actionview (= 5.0.7.2) - activejob (= 5.0.7.2) + actioncable (5.2.4.4) + actionpack (= 5.2.4.4) + nio4r (~> 2.0) + websocket-driver (>= 0.6.1) + actionmailer (5.2.4.4) + actionpack (= 5.2.4.4) + actionview (= 5.2.4.4) + activejob (= 5.2.4.4) mail (~> 2.5, >= 2.5.4) rails-dom-testing (~> 2.0) - actionpack (5.0.7.2) - actionview (= 5.0.7.2) - activesupport (= 5.0.7.2) - rack (~> 2.0) - rack-test (~> 0.6.3) + actionpack (5.2.4.4) + actionview (= 5.2.4.4) + activesupport (= 5.2.4.4) + rack (~> 2.0, >= 2.0.8) + rack-test (>= 0.6.3) rails-dom-testing (~> 2.0) rails-html-sanitizer (~> 1.0, >= 1.0.2) - actionview (5.0.7.2) - activesupport (= 5.0.7.2) + actionview (5.2.4.4) + activesupport (= 5.2.4.4) builder (~> 3.1) - erubis (~> 2.7.0) + erubi (~> 1.4) rails-dom-testing (~> 2.0) rails-html-sanitizer (~> 1.0, >= 1.0.3) - activejob (5.0.7.2) - activesupport (= 5.0.7.2) + activejob (5.2.4.4) + activesupport (= 5.2.4.4) globalid (>= 0.3.6) - activemodel (5.0.7.2) - activesupport (= 5.0.7.2) - activerecord (5.0.7.2) - activemodel (= 5.0.7.2) - activesupport (= 5.0.7.2) - arel (~> 7.0) - activesupport (5.0.7.2) + activemodel (5.2.4.4) + activesupport (= 5.2.4.4) + activerecord (5.2.4.4) + activemodel (= 5.2.4.4) + activesupport (= 5.2.4.4) + arel (>= 9.0) + activestorage (5.2.4.4) + actionpack (= 5.2.4.4) + activerecord (= 5.2.4.4) + marcel (~> 0.3.1) + activesupport (5.2.4.4) concurrent-ruby (~> 1.0, >= 1.0.2) i18n (>= 0.7, < 2) minitest (~> 5.1) tzinfo (~> 1.1) addressable (2.3.8) - arel (7.1.4) - autoprefixer-rails (9.8.6.3) + archive-zip (0.12.0) + io-like (~> 0.3.0) + arel (9.0.0) + autoprefixer-rails (9.8.6.5) execjs - binding_of_caller (0.8.0) - debug_inspector (>= 0.0.1) + bindex (0.8.1) + bootsnap (1.4.8) + msgpack (~> 1.0) bootstrap-sass (3.3.7) autoprefixer-rails (>= 5.2.1) sass (>= 3.3.4) builder (3.2.4) byebug (11.1.3) - charlock_holmes (0.7.7) - coffee-rails (4.1.1) + capybara (3.32.2) + addressable + mini_mime (>= 0.1.3) + nokogiri (~> 1.8) + rack (>= 1.6.0) + rack-test (>= 0.6.3) + regexp_parser (~> 1.5) + xpath (~> 3.2) + childprocess (3.0.0) + chromedriver-helper (2.1.1) + archive-zip (~> 0.10) + nokogiri (~> 1.8) + coffee-rails (4.2.2) coffee-script (>= 2.2.0) - railties (>= 4.0.0, < 5.1.x) + railties (>= 4.0.0) coffee-script (2.4.1) coffee-script-source execjs coffee-script-source (1.12.2) concurrent-ruby (1.1.7) crass (1.0.6) - debug_inspector (0.0.3) + erubi (1.9.0) erubis (2.7.0) - escape_utils (1.2.1) execjs (2.7.0) faraday (0.9.2) multipart-post (>= 1.2, < 3) @@ -69,24 +86,19 @@ GEM font-awesome-sass (4.7.0) sass (>= 3.2) gemoji (3.0.1) - github-linguist (7.11.0) - charlock_holmes (~> 0.7.7) - escape_utils (~> 1.2.0) - mini_mime (~> 1.0) - rugged (>= 0.25.1) globalid (0.4.2) activesupport (>= 4.2.0) haml (5.1.2) temple (>= 0.8.0) tilt - haml-rails (1.0.0) - actionpack (>= 4.0.1) - activesupport (>= 4.0.1) + haml-rails (2.0.1) + actionpack (>= 5.1) + activesupport (>= 5.1) haml (>= 4.0.6, < 6.0) html2haml (>= 1.0.1) - railties (>= 4.0.1) + railties (>= 5.1) hashie (4.1.0) - html-pipeline (2.4.2) + html-pipeline (2.14.0) activesupport (>= 2) nokogiri (>= 1.4) html2haml (2.2.0) @@ -96,6 +108,7 @@ GEM ruby_parser (~> 3.5) i18n (1.8.5) concurrent-ruby (~> 1.0) + io-like (0.3.1) jbuilder (2.10.1) activesupport (>= 5.0.0) jquery-rails (4.4.0) @@ -106,7 +119,6 @@ GEM coffee-rails (>= 3.2.0) railties (>= 3.2.0) sass-rails (>= 3.2.0) - json (1.8.6) jwt (2.2.2) kaminari (1.2.1) activesupport (>= 4.1.0) @@ -123,20 +135,31 @@ GEM kaminari (>= 0.13.0) rails kaminari-core (1.2.1) - kramdown (1.12.0) + kramdown (2.3.0) + rexml + kramdown-parser-gfm (1.1.0) + kramdown (~> 2.0) + listen (3.1.5) + rb-fsevent (~> 0.9, >= 0.9.4) + rb-inotify (~> 0.9, >= 0.9.7) + ruby_dep (~> 1.2) loofah (2.7.0) crass (~> 1.0.2) nokogiri (>= 1.5.9) mail (2.7.1) mini_mime (>= 0.1.1) + marcel (0.3.3) + mimemagic (~> 0.3.2) method_source (1.0.0) + mimemagic (0.3.5) mini_mime (1.0.2) mini_portile2 (2.4.0) minitest (5.14.2) + msgpack (1.3.3) multi_json (1.15.0) multi_xml (0.6.0) multipart-post (2.1.1) - nio4r (2.5.3) + nio4r (2.5.4) nokogiri (1.10.10) mini_portile2 (~> 2.4.0) nokogumbo (2.0.2) @@ -160,45 +183,46 @@ GEM omniauth-oauth2 (1.7.0) oauth2 (~> 1.4) omniauth (~> 1.9) - posix-spawn (0.3.15) - pygments.rb (0.6.3) - posix-spawn (~> 0.3.6) - yajl-ruby (~> 1.2.0) + puma (3.12.6) rack (2.2.3) - rack-test (0.6.3) - rack (>= 1.0) - rails (5.0.7.2) - actioncable (= 5.0.7.2) - actionmailer (= 5.0.7.2) - actionpack (= 5.0.7.2) - actionview (= 5.0.7.2) - activejob (= 5.0.7.2) - activemodel (= 5.0.7.2) - activerecord (= 5.0.7.2) - activesupport (= 5.0.7.2) + rack-test (1.1.0) + rack (>= 1.0, < 3) + rails (5.2.4.4) + actioncable (= 5.2.4.4) + actionmailer (= 5.2.4.4) + actionpack (= 5.2.4.4) + actionview (= 5.2.4.4) + activejob (= 5.2.4.4) + activemodel (= 5.2.4.4) + activerecord (= 5.2.4.4) + activestorage (= 5.2.4.4) + activesupport (= 5.2.4.4) bundler (>= 1.3.0) - railties (= 5.0.7.2) + railties (= 5.2.4.4) sprockets-rails (>= 2.0.0) rails-dom-testing (2.0.3) activesupport (>= 4.2.0) nokogiri (>= 1.6) rails-html-sanitizer (1.3.0) loofah (~> 2.3) - railties (5.0.7.2) - actionpack (= 5.0.7.2) - activesupport (= 5.0.7.2) + railties (5.2.4.4) + actionpack (= 5.2.4.4) + activesupport (= 5.2.4.4) method_source rake (>= 0.8.7) - thor (>= 0.18.1, < 2.0) + thor (>= 0.19.0, < 2.0) rake (13.0.1) rb-fsevent (0.10.4) rb-inotify (0.10.1) ffi (~> 1.0) - rdoc (4.3.0) + regexp_parser (1.7.1) + rexml (3.2.4) rinku (2.0.6) + rouge (3.23.0) + ruby_dep (1.5.0) ruby_parser (3.15.0) sexp_processor (~> 4.9) - rugged (1.0.1) + rubyzip (2.3.0) sanitize (5.2.1) crass (~> 1.0.2) nokogiri (>= 1.8.0) @@ -208,8 +232,8 @@ GEM sass-listen (4.0.0) rb-fsevent (~> 0.9, >= 0.9.4) rb-inotify (~> 0.9, >= 0.9.7) - sass-rails (5.0.7) - railties (>= 4.0.0, < 6) + sass-rails (5.1.0) + railties (>= 5.2.0) sass (~> 3.1) sprockets (>= 2.8, < 4.0) sprockets-rails (>= 2.0, < 4.0) @@ -217,12 +241,15 @@ GEM sawyer (0.6.0) addressable (~> 2.3.5) faraday (~> 0.8, < 0.10) - sdoc (0.4.2) - json (~> 1.7, >= 1.7.7) - rdoc (~> 4.0) + selenium-webdriver (3.142.7) + childprocess (>= 0.5, < 4.0) + rubyzip (>= 1.2.2) settingslogic (2.0.9) sexp_processor (4.15.1) spring (2.1.1) + spring-watcher-listen (2.0.1) + listen (>= 2.7, < 4.0) + spring (>= 1.2, < 3.0) sprockets (3.7.2) concurrent-ruby (~> 1.0) rack (> 1, < 3) @@ -230,58 +257,73 @@ GEM actionpack (>= 4.0) activesupport (>= 4.0) sprockets (>= 3.0.0) - sqlite3 (1.3.13) + sqlite3 (1.4.2) temple (0.8.2) thor (1.0.1) thread_safe (0.3.6) tilt (2.0.10) + turbolinks (5.2.1) + turbolinks-source (~> 5.2) + turbolinks-source (5.2.0) tzinfo (1.2.7) thread_safe (~> 0.1) uglifier (4.2.0) execjs (>= 0.3.0, < 3) - web-console (2.3.0) - activemodel (>= 4.0) - binding_of_caller (>= 0.7.2) - railties (>= 4.0) - sprockets-rails (>= 2.0, < 4.0) - websocket-driver (0.6.5) + web-console (3.7.0) + actionview (>= 5.0) + activemodel (>= 5.0) + bindex (>= 0.4.0) + railties (>= 5.0) + websocket-driver (0.7.3) websocket-extensions (>= 0.1.0) websocket-extensions (0.1.5) - yajl-ruby (1.2.3) + xpath (3.2.0) + nokogiri (~> 1.8) PLATFORMS ruby DEPENDENCIES + bootsnap (>= 1.1.0) bootstrap-sass (~> 3.3.4) byebug - coffee-rails (~> 4.1.0) + capybara (>= 2.15) + chromedriver-helper + coffee-rails (~> 4.2) font-awesome-sass (~> 4.0) gemoji - github-linguist (~> 7.11.0) haml-rails - html-pipeline (~> 2.4.0) - jbuilder (~> 2.0) + html-pipeline (~> 2.14.0) + jbuilder (~> 2.5) jquery-rails jquery-textcomplete-rails kaminari kaminari-bootstrap - kramdown (~> 1.12.0) + kramdown (~> 2.0) + kramdown-parser-gfm + listen (>= 3.0.5, < 3.2) octokit (~> 3.0) omniauth omniauth-github omniauth-github-team-member - pygments.rb (~> 0.6.0) - rails (~> 5.0.0) + puma (~> 3.11) + rails (~> 5.2.4, >= 5.2.4.4) rinku + rouge sanitize sass-rails (~> 5.0) - sdoc (~> 0.4.0) + selenium-webdriver settingslogic spring - sqlite3 (~> 1.3.0) + spring-watcher-listen (~> 2.0.0) + sqlite3 + turbolinks (~> 5) + tzinfo-data uglifier (>= 1.3.0) - web-console (~> 2.0) + web-console (>= 3.3.0) + +RUBY VERSION + ruby 2.4.3p205 BUNDLED WITH - 1.16.2 + 2.1.4 diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index 6949a68..31a5c4a 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -2,8 +2,8 @@ class ApplicationController < ActionController::Base # Prevent CSRF attacks by raising an exception. # For APIs, you may want to use :null_session instead. protect_from_forgery with: :exception - prepend_before_filter :login_state_setup - before_filter :authenticate + prepend_before_action :login_state_setup + before_action :authenticate # after_action :outgoing_webhook_action private diff --git a/app/controllers/incoming_webhook_controller.rb b/app/controllers/incoming_webhook_controller.rb index 45ff000..cae606f 100644 --- a/app/controllers/incoming_webhook_controller.rb +++ b/app/controllers/incoming_webhook_controller.rb @@ -1,8 +1,8 @@ class IncomingWebhookController < ApplicationController protect_from_forgery with: :exception - skip_before_filter :verify_authenticity_token - skip_before_filter :authenticate + skip_before_action :verify_authenticity_token + skip_before_action :authenticate def github payload_body = request.body.read diff --git a/app/controllers/sessions_controller.rb b/app/controllers/sessions_controller.rb index 864a4ee..3b7883d 100644 --- a/app/controllers/sessions_controller.rb +++ b/app/controllers/sessions_controller.rb @@ -1,5 +1,5 @@ class SessionsController < ApplicationController - skip_before_filter :authenticate + skip_before_action :authenticate def logout session[:user_id] = nil diff --git a/app/controllers/welcome_controller.rb b/app/controllers/welcome_controller.rb index 172a45b..1ca5ea5 100644 --- a/app/controllers/welcome_controller.rb +++ b/app/controllers/welcome_controller.rb @@ -1,5 +1,5 @@ class WelcomeController < ApplicationController - skip_before_filter :authenticate + skip_before_action :authenticate def index end diff --git a/app/views/minutes/_content.html.haml b/app/views/minutes/_content.html.haml index dfb6b97..60d5ab4 100644 --- a/app/views/minutes/_content.html.haml +++ b/app/views/minutes/_content.html.haml @@ -3,4 +3,4 @@ = render :partial => "minutes/create_comment_modal.html.haml" .markdown-body = raw ::JayFlavoredMarkdownConverter.new(text, :organization => organization).content - %button.action-item New Issue + -# %button.action-item New Issue diff --git a/config/application.rb b/config/application.rb index a6140ba..52e3ffc 100644 --- a/config/application.rb +++ b/config/application.rb @@ -21,7 +21,7 @@ class Application < Rails::Application # config.i18n.default_locale = :de # Do not swallow errors in after_commit/after_rollback callbacks. - config.active_record.raise_in_transactional_callbacks = true + # config.active_record.raise_in_transactional_callbacks = true config.autoload_paths += %W(#{config.root}/lib) end end diff --git a/config/initializers/new_framework_defaults.rb b/config/initializers/new_framework_defaults.rb index f6e7233..dbf8263 100644 --- a/config/initializers/new_framework_defaults.rb +++ b/config/initializers/new_framework_defaults.rb @@ -20,4 +20,4 @@ Rails.application.config.active_record.belongs_to_required_by_default = false # Do not halt callback chains when a callback returns false. Previous versions had true. -ActiveSupport.halt_callback_chains_on_return_false = true +# ActiveSupport.halt_callback_chains_on_return_false = true diff --git a/lib/markdown_converter.rb b/lib/markdown_converter.rb index 75bb99b..6d021f5 100644 --- a/lib/markdown_converter.rb +++ b/lib/markdown_converter.rb @@ -1051,11 +1051,11 @@ def content private def context - whitelist = HTML::Pipeline::SanitizationFilter::WHITELIST.dup + whitelist = HTML::Pipeline::SanitizationFilter::WHITELIST.deep_dup whitelist[:attributes][:all] << "data-linenum" { input: "GFM", - asset_root: 'https://assets-cdn.github.com/images/icons/', + asset_root: 'https://github.githubassets.com/images/icons/', whitelist: whitelist, syntax_highlighter: :rouge, syntax_highlighter_opts: {inline_theme: true, line_numbers: true, code_class: 'codehilite'} @@ -1094,7 +1094,7 @@ def content private def context - whitelist = HTML::Pipeline::SanitizationFilter::WHITELIST.dup + whitelist = HTML::Pipeline::SanitizationFilter::WHITELIST.deep_dup whitelist[:attributes][:all] << "data-linenum" { input: "GFM", diff --git a/scripts/launch.sh b/scripts/launch.sh index f8da923..c7cd929 100755 --- a/scripts/launch.sh +++ b/scripts/launch.sh @@ -1,4 +1,31 @@ #!/bin/sh -export RAILS_SERVE_STATIC_FILES=true -bundle exec rake assets:precompile RAILS_ENV=production -bundle exec rails s -e production -p 12321 -d -b 0.0.0.0 + +# export RAILS_RELATIVE_URL_ROOT='/lab/nom' + +# Rails 4 requires bundler < 2.0 +# You may need to: +# gem install bundler -v "< 2.0" +# bundle _1.17.3_ install +# +# BUNDLER_VER="_1.17.3_" + +BUNDLER_VER="" + +case "$1" in + dev*) + export RAILS_ENV="development" + export SERVER_PORT=3000 + ;; + pro*) + export RAILS_ENV="production" + export SERVER_PORT=12321 + bundle $BUNDLER_VER exec rake assets:precompile RAILS_ENV="$RAILS_ENV" + export RAILS_SERVE_STATIC_FILES=true + ;; + *) + echo "usage: launch.sh (production|development)" >&2 + exit 1 + ;; +esac + +bundle $BUNDLER_VER exec rails server -b 0.0.0.0 -p "$SERVER_PORT" -d -e "$RAILS_ENV"