diff --git a/Gemfile b/Gemfile index 5d4cd57a1..f973ee9ab 100644 --- a/Gemfile +++ b/Gemfile @@ -39,6 +39,9 @@ group :dependencies do # compiling markdown to html gem 'rdiscount', '2.2.0.1' + # Process manager for applications with multiple components + gem 'foreman', '~> 0.85.0' + # asset pipelining gem 'bootstrap-sass' gem 'sassc-rails' @@ -77,6 +80,7 @@ group :development, :test do end group :development do + gem 'brakeman' gem 'jshintrb', '~> 0.3.0' gem 'mini_racer', platforms: :ruby gem 'listen', '~> 3.2.1' diff --git a/Gemfile.lock b/Gemfile.lock index e80b9ef7d..921110379 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -6,43 +6,43 @@ GEM ZenTest (4.12.0) action-cable-testing (0.6.0) actioncable (>= 5.0) - actioncable (5.2.4) - actionpack (= 5.2.4) + actioncable (5.2.4.1) + actionpack (= 5.2.4.1) nio4r (~> 2.0) websocket-driver (>= 0.6.1) - actionmailer (5.2.4) - actionpack (= 5.2.4) - actionview (= 5.2.4) - activejob (= 5.2.4) + actionmailer (5.2.4.1) + actionpack (= 5.2.4.1) + actionview (= 5.2.4.1) + activejob (= 5.2.4.1) mail (~> 2.5, >= 2.5.4) rails-dom-testing (~> 2.0) - actionpack (5.2.4) - actionview (= 5.2.4) - activesupport (= 5.2.4) - rack (~> 2.0) + actionpack (5.2.4.1) + actionview (= 5.2.4.1) + activesupport (= 5.2.4.1) + 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.2.4) - activesupport (= 5.2.4) + actionview (5.2.4.1) + activesupport (= 5.2.4.1) builder (~> 3.1) erubi (~> 1.4) rails-dom-testing (~> 2.0) rails-html-sanitizer (~> 1.0, >= 1.0.3) - activejob (5.2.4) - activesupport (= 5.2.4) + activejob (5.2.4.1) + activesupport (= 5.2.4.1) globalid (>= 0.3.6) - activemodel (5.2.4) - activesupport (= 5.2.4) - activerecord (5.2.4) - activemodel (= 5.2.4) - activesupport (= 5.2.4) + activemodel (5.2.4.1) + activesupport (= 5.2.4.1) + activerecord (5.2.4.1) + activemodel (= 5.2.4.1) + activesupport (= 5.2.4.1) arel (>= 9.0) - activestorage (5.2.4) - actionpack (= 5.2.4) - activerecord (= 5.2.4) + activestorage (5.2.4.1) + actionpack (= 5.2.4.1) + activerecord (= 5.2.4.1) marcel (~> 0.3.1) - activesupport (5.2.4) + activesupport (5.2.4.1) concurrent-ruby (~> 1.0, >= 1.0.2) i18n (>= 0.7, < 2) minitest (~> 5.1) @@ -52,16 +52,16 @@ GEM ansi (1.5.0) arel (9.0.0) ast (2.4.0) - autoprefixer-rails (9.7.3) + autoprefixer-rails (9.7.4) execjs aws-eventstream (1.0.3) - aws-partitions (1.258.0) - aws-sdk-core (3.86.0) + aws-partitions (1.269.0) + aws-sdk-core (3.89.1) aws-eventstream (~> 1.0, >= 1.0.2) aws-partitions (~> 1, >= 1.239.0) aws-sigv4 (~> 1.1) jmespath (~> 1.0) - aws-sdk-kms (1.27.0) + aws-sdk-kms (1.28.0) aws-sdk-core (~> 3, >= 3.71.0) aws-sigv4 (~> 1.1) aws-sdk-s3 (1.60.1) @@ -76,9 +76,10 @@ GEM bootstrap-sass (3.4.1) autoprefixer-rails (>= 5.2.1) sassc (>= 2.0.0) + brakeman (4.7.2) builder (3.2.4) byebug (11.0.1) - capybara (3.29.0) + capybara (3.31.0) addressable mini_mime (>= 0.1.3) nokogiri (~> 1.8) @@ -94,15 +95,17 @@ GEM url coderay (1.1.2) concurrent-ruby (1.1.5) - crass (1.0.5) + crass (1.0.6) docile (1.3.2) erubi (1.9.0) execjs (2.7.0) faker (2.6.0) i18n (>= 1.6, < 1.8) - faraday (0.15.4) + faraday (0.17.3) multipart-post (>= 1.2, < 3) - ffi (1.11.3) + ffi (1.12.2) + foreman (0.85.0) + thor (~> 0.19.1) friendly_id (5.3.0) activerecord (>= 4.0.0) geokit (1.13.1) @@ -113,11 +116,11 @@ GEM httparty (0.17.3) mime-types (~> 3.0) multi_xml (>= 0.5.2) - i18n (1.7.0) + i18n (1.7.1) concurrent-ruby (~> 1.0) image_science (1.3.0) RubyInline (~> 3.9) - jaro_winkler (1.5.3) + jaro_winkler (1.5.4) jmespath (1.4.0) jquery-rails (4.3.5) rails-dom-testing (>= 1, < 3) @@ -127,7 +130,7 @@ GEM execjs multi_json (>= 1.3) rake - json (2.2.0) + json (2.3.0) libv8 (7.3.492.27.1) libxml-ruby (3.1.0) listen (3.2.1) @@ -141,14 +144,14 @@ GEM marcel (0.3.3) mimemagic (~> 0.3.2) method_source (0.9.2) - mime-types (3.3) + mime-types (3.3.1) mime-types-data (~> 3.2015) mime-types-data (3.2019.1009) - mimemagic (0.3.3) - mini_magick (4.9.5) + mimemagic (0.3.4) + mini_magick (4.10.1) mini_mime (1.0.2) mini_portile2 (2.4.0) - mini_racer (0.2.8) + mini_racer (0.2.9) libv8 (>= 6.9.411) minitest (5.14.0) minitest-reporters (1.4.2) @@ -157,7 +160,7 @@ GEM minitest (>= 5.0) ruby-progressbar msgpack (1.3.1) - multi_json (1.13.1) + multi_json (1.14.1) multi_xml (0.6.0) multipart-post (2.1.1) mysql2 (0.5.3) @@ -181,22 +184,22 @@ GEM mime-types mimemagic (~> 0.3.0) terrapin (~> 0.6.0) - parallel (1.17.0) - parser (2.6.4.0) + parallel (1.19.1) + parser (2.7.0.2) ast (~> 2.4.0) passenger (6.0.4) rack rake (>= 0.8.1) - popper_js (1.14.5) + popper_js (1.16.0) pry (0.12.2) coderay (~> 1.1.0) method_source (~> 0.9.0) pry-rails (0.3.9) pry (>= 0.10.4) - public_suffix (4.0.1) + public_suffix (4.0.3) puma (4.3.1) nio4r (~> 2.0) - rack (2.1.1) + rack (2.1.2) rack-openid (1.3.1) rack (>= 1.1.0) ruby-openid (>= 2.1.8) @@ -205,18 +208,18 @@ GEM rack_session_access (0.2.0) builder (>= 2.0.0) rack (>= 1.0.0) - rails (5.2.4) - actioncable (= 5.2.4) - actionmailer (= 5.2.4) - actionpack (= 5.2.4) - actionview (= 5.2.4) - activejob (= 5.2.4) - activemodel (= 5.2.4) - activerecord (= 5.2.4) - activestorage (= 5.2.4) - activesupport (= 5.2.4) + rails (5.2.4.1) + actioncable (= 5.2.4.1) + actionmailer (= 5.2.4.1) + actionpack (= 5.2.4.1) + actionview (= 5.2.4.1) + activejob (= 5.2.4.1) + activemodel (= 5.2.4.1) + activerecord (= 5.2.4.1) + activestorage (= 5.2.4.1) + activesupport (= 5.2.4.1) bundler (>= 1.3.0) - railties (= 5.2.4) + railties (= 5.2.4.1) sprockets-rails (>= 2.0.0) rails-controller-testing (1.0.4) actionpack (>= 5.0.1.x) @@ -228,23 +231,23 @@ GEM rails-html-sanitizer (1.3.0) loofah (~> 2.3) rails-perftest (0.0.7) - railties (5.2.4) - actionpack (= 5.2.4) - activesupport (= 5.2.4) + railties (5.2.4.1) + actionpack (= 5.2.4.1) + activesupport (= 5.2.4.1) method_source rake (>= 0.8.7) thor (>= 0.19.0, < 2.0) rainbow (3.0.0) rake (12.3.3) rb-fsevent (0.10.3) - rb-inotify (0.10.0) + rb-inotify (0.10.1) ffi (~> 1.0) rdiscount (2.2.0.1) recaptcha (5.0.0) json redcarpet (3.5.0) regexp_parser (1.6.0) - request_store (1.4.1) + request_store (1.5.0) rack (>= 1.4) right_aws_api (0.3.5) right_cloud_api_base (>= 0.2.6) @@ -264,18 +267,18 @@ GEM rubocop-performance (1.3.0) rubocop (>= 0.68.0) ruby-hmac (0.4.0) - ruby-openid (2.9.1) + ruby-openid (2.9.2) ruby-openid-apps-discovery (1.2.0) ruby-openid (>= 2.1.7) ruby-prof (1.2.0) ruby-progressbar (1.10.1) - rubyzip (2.0.0) + rubyzip (2.2.0) sass (3.7.4) sass-listen (~> 4.0.0) sass-listen (4.0.0) rb-fsevent (~> 0.9, >= 0.9.4) rb-inotify (~> 0.9, >= 0.9.7) - sassc (2.2.0) + sassc (2.2.1) ffi (~> 1.9) sassc-rails (2.1.2) railties (>= 4.0.0) @@ -283,19 +286,18 @@ GEM sprockets (> 3.0) sprockets-rails tilt - selenium-webdriver (3.142.6) + selenium-webdriver (3.142.7) childprocess (>= 0.5, < 4.0) rubyzip (>= 1.2.2) - sentry-raven (2.11.1) + sentry-raven (2.13.0) faraday (>= 0.7.6, < 1.0) - simplecov (0.17.1) + simplecov (0.18.1) docile (~> 1.1) - json (>= 1.8, < 3) - simplecov-html (~> 0.10.0) - simplecov-html (0.10.2) - skylight (4.2.0) - skylight-core (= 4.2.0) - skylight-core (4.2.0) + simplecov-html (~> 0.11.0) + simplecov-html (0.11.0) + skylight (4.2.1) + skylight-core (= 4.2.1) + skylight-core (4.2.1) activesupport (>= 4.2.0) spring (2.1.0) spring-watcher-listen (2.0.1) @@ -311,19 +313,19 @@ GEM sqlite3 (1.4.2) terrapin (0.6.0) climate_control (>= 0.0.3, < 1.0) - thor (0.20.3) + thor (0.19.4) thread_safe (0.3.6) - tilt (2.0.9) + tilt (2.0.10) turbolinks (5.2.1) turbolinks-source (~> 5.2) turbolinks-source (5.2.0) - tzinfo (1.2.5) + tzinfo (1.2.6) thread_safe (~> 0.1) - tzinfo-data (1.2019.2) + tzinfo-data (1.2019.3) tzinfo (>= 1.0.0) uglifier (4.1.20) execjs (>= 0.3.0, < 3) - unicode-display_width (1.6.0) + unicode-display_width (1.6.1) url (0.3.2) web-console (3.7.0) actionview (>= 5.0) @@ -349,10 +351,12 @@ DEPENDENCIES aws-sdk-s3 (~> 1) bootsnap (~> 1.4.5) bootstrap-sass + brakeman byebug (~> 11.0.1) capybara codecov faker (~> 2.6.0) + foreman (~> 0.85.0) friendly_id geokit-rails (= 1.1.4) httparty diff --git a/app/assets/javascripts/application.js b/app/assets/javascripts/application.js index 0d1323116..2617c95e0 100644 --- a/app/assets/javascripts/application.js +++ b/app/assets/javascripts/application.js @@ -12,7 +12,7 @@ // -//= require leaflet/dist/leaflet-src.js +// = require leaflet/dist/leaflet-src.js //= require jquery //= require jquery-ujs @@ -49,4 +49,4 @@ //= require mapknitter/Map.js //= require cable.js -//= require_tree . +// = require_tree . diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb index 5dc4f187f..2d1dc6e3b 100644 --- a/app/controllers/users_controller.rb +++ b/app/controllers/users_controller.rb @@ -13,7 +13,7 @@ def index @users = User.joins(:maps) .select('users.*, count(users.id) as maps_count') .group('maps.user_id') - .order(sort_column + ' ' + sort_direction) + .order(sort_column: sort_direction) .paginate(page: params[:page], per_page: 24) render 'users/index' end diff --git a/config/puma.rb b/config/puma.rb index 7ac412907..9c495cf96 100644 --- a/config/puma.rb +++ b/config/puma.rb @@ -1,10 +1,12 @@ +#!/usr/bin/env puma + # Specifies the `port` that Puma will listen on to receive requests; default is 3000. port ENV.fetch("PORT") { 3000 } # Specifies the `environment` that Puma will run in. environment ENV.fetch("RAILS_ENV") { "production" } -pidfile 'tmp/pids/puma.pid' +pidfile '/app/tmp/pids/puma.pid' # Allow puma to be restarted by `rails restart` command. plugin :tmp_restart diff --git a/test/controllers/images_controller_test.rb b/test/controllers/images_controller_test.rb index db4e5154d..1e5f1ae85 100644 --- a/test/controllers/images_controller_test.rb +++ b/test/controllers/images_controller_test.rb @@ -62,7 +62,7 @@ def fetch_in_production points = "-71.39,41.83:-71.39,41.83:-71.39,41.83:-71.39,41.83" patch :update, params: { id: @map.id, warpable_id: @warp.id, locked: false, points: points } assert_not_nil @warp.nodes - assert_equal "text/html", response.content_type + assert_equal "application/json", response.content_type assert_response :success end