From 587698a6d514cb4ee11e6325e8b452360f0535d1 Mon Sep 17 00:00:00 2001 From: dtaniwaki Date: Sun, 29 Jan 2017 20:51:41 +0900 Subject: [PATCH 01/10] Update gems for Rails 5.0.1 --- Gemfile | 35 ++--- Gemfile.lock | 387 ++++++++++++++++++++------------------------------- 2 files changed, 163 insertions(+), 259 deletions(-) diff --git a/Gemfile b/Gemfile index b95ba13..76eeb25 100644 --- a/Gemfile +++ b/Gemfile @@ -3,7 +3,7 @@ source 'https://rubygems.org' ruby '2.3.0' # Bundle edge Rails instead: gem 'rails', github: 'rails/rails' -gem 'rails', '>= 5.0.0.rc1', '< 5.1' +gem 'rails', '~> 5.0.1' # Use mysql2 as the database for Active Record gem 'mysql2', '~> 0.4.4' # Use Puma as the app server @@ -39,20 +39,20 @@ gem 'mini_magick', '~> 4.5.1' gem 'pry-rails', '~> 0.3.4' gem 'config', '~> 1.1.0' gem 'bootstrap-sass', '~> 3.3.6' -gem 'devise', '~> 4.0.0.rc1' +gem 'devise', '~> 4.2.0' gem 'devise_invitable', '~> 1.6.0' gem 'sidekiq', '~> 4.1.0' gem 'sidekiq-unique-jobs', '~> 4.0.13' gem 'sidekiq-failures', '~> 0.4.5' gem 'yajl-ruby', '~> 1.2.1' -gem 'sinatra', github: 'sinatra/sinatra', require: nil +gem 'sinatra', '~> 1.0', require: nil gem 'redis-namespace', '~> 1.5.2' -gem 'omniauth', '~> 1.3.1' -gem 'omniauth-google-oauth2', '~> 0.3.1' -gem 'sprockets-es6', '~> 0.9.0' +gem 'omniauth', '~> 1.3.2' +gem 'omniauth-google-oauth2', '~> 0.4.1' +gem 'sprockets-es6', '~> 0.9.2' gem 'acts_as_list', '~> 0.7.2' gem 'paranoia', github: 'rubysherpas/paranoia', branch: 'core' -gem 'slim-rails', '~> 3.0.1' +gem 'slim-rails', '~> 3.1.1' gem 'pundit', '~> 1.1.0' gem 'bugsnag', '~> 4.0.0' gem 'redcarpet', '~> 3.2.3' @@ -67,27 +67,14 @@ gem 'enum_help', '~> 0.0.15' gem 'validates_timeliness', '~> 4.0.2' gem 'swagger-blocks', '~> 1.3.3' gem 'rack-cors', '~> 0.4.0', require: 'rack/cors' +gem 'activeadmin', '~> 1.0.0.pre4' +gem 'redis-rails', '~> 5.0.1' ################################ -# redis-rails Rails 5 support -# gem 'redis-rack', github: "schuylr/redis-rack", ref: "a01bfe5a8ee1df4af6c3a886e005896fe711aab7" -gem 'redis-rack', github: 'redis-store/redis-rack', ref: '83a7b7b895bb528c1ae88329e4bca09a97d9fbbf' -gem 'redis-activesupport', github: 'claudiob/redis-activesupport', ref: 'd83917b3a852a98cd0bee8709ab52e5437f7ca11' -# gem 'redis-actionpack', github: "schuylr/redis-actionpack", ref: "b4b37571e3db63cf10713995e7d1ef85e3183b42" -gem 'redis-actionpack', github: 'marcroberts/redis-actionpack', ref: '4e23b49c814ee49ed216bbcaa7811f55c84b5cd2' -gem 'redis-rails', github: 'redis-store/redis-rails', branch: :master +# activeadmin Rails 5 support +gem 'inherited_resources', git: 'https://github.com/activeadmin/inherited_resources' ################################ -################################ -# ActiveAdmin Rails 5 support -gem 'activeadmin', github: 'activeadmin/activeadmin', branch: 'master' -gem 'ransack', github: 'activerecord-hackery/ransack' -gem 'kaminari', github: 'amatsuda/kaminari', branch: '0-17-stable' -gem 'formtastic', github: 'justinfrench/formtastic' -gem 'draper', github: 'audionerd/draper', branch: 'rails5', ref: 'e816e0e587' -# To fix a Draper deprecation error -gem 'activemodel-serializers-xml', github: 'rails/activemodel-serializers-xml' -################################ group :development, :test do # Call 'byebug' anywhere in the code to stop execution and get a debugger console diff --git a/Gemfile.lock b/Gemfile.lock index 4793ab8..9d2c432 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,91 +1,3 @@ -GIT - remote: git://github.com/activeadmin/activeadmin.git - revision: 2f7703600953b05e629e101a2b4d5a4c8844740c - branch: master - specs: - activeadmin (1.0.0.pre2) - arbre (~> 1.0, >= 1.0.2) - bourbon - coffee-rails - formtastic (~> 3.1) - formtastic_i18n - inherited_resources (~> 1.6) - jquery-rails - jquery-ui-rails - kaminari (~> 0.15) - rails (>= 3.2, < 5.0) - ransack (~> 1.3) - sass-rails - sprockets (< 4) - -GIT - remote: git://github.com/activerecord-hackery/ransack.git - revision: 50af43e3a75e0c8a57b315deb035114d11c50c6b - specs: - ransack (1.7.0) - actionpack (>= 3.0) - activerecord (>= 3.0) - activesupport (>= 3.0) - i18n - polyamorous (~> 1.3) - -GIT - remote: git://github.com/amatsuda/kaminari.git - revision: 1002b14aee62d4360c383ae1f14f5b5b72e76e2a - branch: 0-17-stable - specs: - kaminari (0.17.0.alpha) - actionpack (>= 3.0.0) - activesupport (>= 3.0.0) - -GIT - remote: git://github.com/audionerd/draper.git - revision: e816e0e5876b76c648c0928f1c3f2aa2c7a3d1f2 - ref: e816e0e587 - branch: rails5 - specs: - draper (2.1.0) - actionpack (>= 3.0) - activemodel (>= 3.0) - activesupport (>= 3.0) - request_store (~> 1.0) - -GIT - remote: git://github.com/claudiob/redis-activesupport.git - revision: d83917b3a852a98cd0bee8709ab52e5437f7ca11 - ref: d83917b3a852a98cd0bee8709ab52e5437f7ca11 - specs: - redis-activesupport (4.1.5) - activesupport (>= 3, < 6) - redis-store (~> 1.1.0) - -GIT - remote: git://github.com/justinfrench/formtastic.git - revision: dcca532c5a52d8d04397ae7daf59f5b445fc8e58 - specs: - formtastic (3.2.0.pre) - actionpack (>= 4.1.0) - -GIT - remote: git://github.com/marcroberts/redis-actionpack.git - revision: 4e23b49c814ee49ed216bbcaa7811f55c84b5cd2 - ref: 4e23b49c814ee49ed216bbcaa7811f55c84b5cd2 - specs: - redis-actionpack (4.0.1) - actionpack (>= 4.0.0, < 6) - redis-rack (~> 1.5.0) - redis-store (~> 1.1.0) - -GIT - remote: git://github.com/rails/activemodel-serializers-xml.git - revision: ad5ff3a9262576362792196a991de1d1778c5f48 - specs: - activemodel-serializers-xml (1.0.0) - activemodel (> 5.x) - activerecord (> 5.x) - activesupport (> 5.x) - builder (~> 3.1) - GIT remote: git://github.com/rails/jbuilder.git revision: 64c510ec69d9e63b73ffd5942e802d21a7d14701 @@ -95,25 +7,6 @@ GIT activesupport (>= 3.0.0, < 5.1) multi_json (~> 1.2) -GIT - remote: git://github.com/redis-store/redis-rack.git - revision: 83a7b7b895bb528c1ae88329e4bca09a97d9fbbf - ref: 83a7b7b895bb528c1ae88329e4bca09a97d9fbbf - specs: - redis-rack (1.5.0) - rack (> 1.5, < 3) - redis-store (~> 1.1.0) - -GIT - remote: git://github.com/redis-store/redis-rails.git - revision: bb9e202da4c9d9d4d927e4531f98e2db4e2dc657 - branch: master - specs: - redis-rails (5.0.0) - redis-actionpack (>= 4, < 5.1) - redis-activesupport (>= 4, < 5.1) - redis-store (~> 1.1.0) - GIT remote: git://github.com/rubysherpas/paranoia.git revision: 9e0ec38e5f4d08d25c1bf1b63c1fe78208abe625 @@ -123,50 +16,65 @@ GIT activerecord (>= 4.0, < 5.1) GIT - remote: git://github.com/sinatra/sinatra.git - revision: 4c7d38eb1b2cc02ce51029f28e0c3c34ca12ccfd + remote: https://github.com/activeadmin/inherited_resources + revision: e48c1bd28e98d02a0d0cf4765f6ba531c6f5d1bc specs: - sinatra (2.0.0.pre.alpha) - rack (= 2.0.0.alpha) - rack-protection (~> 1.5) - tilt (~> 2.0) + inherited_resources (1.6.0) + actionpack (>= 3.2, < 5.1) + has_scope (~> 0.6) + railties (>= 3.2, < 5.1) + responders GEM remote: https://rubygems.org/ specs: - actioncable (5.0.0.rc1) - actionpack (= 5.0.0.rc1) + actioncable (5.0.1) + actionpack (= 5.0.1) nio4r (~> 1.2) websocket-driver (~> 0.6.1) - actionmailer (5.0.0.rc1) - actionpack (= 5.0.0.rc1) - actionview (= 5.0.0.rc1) - activejob (= 5.0.0.rc1) + actionmailer (5.0.1) + actionpack (= 5.0.1) + actionview (= 5.0.1) + activejob (= 5.0.1) mail (~> 2.5, >= 2.5.4) - rails-dom-testing (~> 1.0, >= 1.0.5) - actionpack (5.0.0.rc1) - actionview (= 5.0.0.rc1) - activesupport (= 5.0.0.rc1) - rack (~> 2.x) + rails-dom-testing (~> 2.0) + actionpack (5.0.1) + actionview (= 5.0.1) + activesupport (= 5.0.1) + rack (~> 2.0) rack-test (~> 0.6.3) - rails-dom-testing (~> 1.0, >= 1.0.5) + rails-dom-testing (~> 2.0) rails-html-sanitizer (~> 1.0, >= 1.0.2) - actionview (5.0.0.rc1) - activesupport (= 5.0.0.rc1) + actionview (5.0.1) + activesupport (= 5.0.1) builder (~> 3.1) erubis (~> 2.7.0) - rails-dom-testing (~> 1.0, >= 1.0.5) + rails-dom-testing (~> 2.0) rails-html-sanitizer (~> 1.0, >= 1.0.2) - activejob (5.0.0.rc1) - activesupport (= 5.0.0.rc1) + activeadmin (1.0.0.pre4) + arbre (~> 1.0, >= 1.0.2) + bourbon + coffee-rails + formtastic (~> 3.1) + formtastic_i18n + inherited_resources (~> 1.6) + jquery-rails + jquery-ui-rails + kaminari (~> 0.15) + rails (>= 3.2, < 5.1) + ransack (~> 1.3) + sass-rails + sprockets (< 4) + activejob (5.0.1) + activesupport (= 5.0.1) globalid (>= 0.3.6) - activemodel (5.0.0.rc1) - activesupport (= 5.0.0.rc1) - activerecord (5.0.0.rc1) - activemodel (= 5.0.0.rc1) - activesupport (= 5.0.0.rc1) + activemodel (5.0.1) + activesupport (= 5.0.1) + activerecord (5.0.1) + activemodel (= 5.0.1) + activesupport (= 5.0.1) arel (~> 7.0) - activesupport (5.0.0.rc1) + activesupport (5.0.1) concurrent-ruby (~> 1.0, >= 1.0.2) i18n (~> 0.7) minitest (~> 5.1) @@ -177,9 +85,9 @@ GEM acts_as_list (0.7.2) activerecord (>= 3.0) addressable (2.4.0) - arbre (1.0.3) + arbre (1.1.1) activesupport (>= 3.0.0) - arel (7.0.0) + arel (7.1.4) ast (2.2.0) autoprefixer-rails (6.3.6) execjs @@ -194,7 +102,7 @@ GEM bootstrap-sass (3.3.6) autoprefixer-rails (>= 5.2.1) sass (>= 3.3.4) - bourbon (4.2.6) + bourbon (4.2.7) sass (~> 3.4) thor (~> 0.19) bower-rails (0.10.0) @@ -209,7 +117,7 @@ GEM slim (>= 1.3.6, < 4.0) terminal-table (~> 1.4) bugsnag (4.0.0) - builder (3.2.2) + builder (3.2.3) byebug (8.2.2) childprocess (0.5.9) ffi (~> 1.0, >= 1.0.11) @@ -221,14 +129,14 @@ GEM codeclimate-test-reporter (0.5.0) simplecov (>= 0.7.1, < 1.0.0) coderay (1.1.1) - coffee-rails (4.1.1) + coffee-rails (4.2.1) coffee-script (>= 2.2.0) - railties (>= 4.0.0, < 5.1.x) + railties (>= 4.0.0, < 5.2.x) coffee-script (2.4.1) coffee-script-source execjs - coffee-script-source (1.10.0) - concurrent-ruby (1.0.2) + coffee-script-source (1.12.2) + concurrent-ruby (1.0.4) config (1.1.0) activesupport (>= 3.0) deep_merge (~> 1.0.1) @@ -244,7 +152,7 @@ GEM database_rewinder (0.5.3) debug_inspector (0.0.2) deep_merge (1.0.1) - devise (4.0.0.rc2) + devise (4.2.0) bcrypt (~> 3.0) orm_adapter (~> 0.1) railties (>= 4.1.0, < 5.1) @@ -262,7 +170,7 @@ GEM enum_help (0.0.15) erubis (2.7.0) excon (0.49.0) - execjs (2.6.0) + execjs (2.7.0) factory_girl (4.5.0) activesupport (>= 3.0.0) factory_girl_rails (4.6.0) @@ -293,18 +201,20 @@ GEM fog-core nokogiri (~> 1.5, >= 1.5.11) formatador (0.2.5) + formtastic (3.1.4) + actionpack (>= 3.2.13) formtastic_i18n (0.6.0) - globalid (0.3.6) + globalid (0.3.7) activesupport (>= 4.1.0) gravatar_image_tag (1.2.0) haml (4.0.7) tilt - has_scope (0.6.0) - actionpack (>= 3.2, < 5) - activesupport (>= 3.2, < 5) + has_scope (0.7.0) + actionpack (>= 4.1, < 5.1) + activesupport (>= 4.1, < 5.1) hashdiff (0.3.0) hashids (1.0.2) - hashie (3.4.3) + hashie (3.4.6) highline (1.7.8) i18n (0.7.0) i18n-tasks (0.9.5) @@ -319,11 +229,6 @@ GEM terminal-table (>= 1.5.1) i18n_generators (2.1.1) rails (>= 3.0.0) - inherited_resources (1.6.0) - actionpack (>= 3.2, < 5) - has_scope (~> 0.6.0.rc) - railties (>= 3.2, < 5) - responders ipaddress (0.8.3) jquery-rails (4.1.1) rails-dom-testing (>= 1, < 3) @@ -331,8 +236,11 @@ GEM thor (>= 0.14, < 2.0) jquery-ui-rails (5.0.5) railties (>= 3.2.16) - json (1.8.3) - jwt (1.5.1) + json (1.8.6) + jwt (1.5.6) + kaminari (0.17.0) + actionpack (>= 3.0.0) + activesupport (>= 3.0.0) launchy (2.4.3) addressable (~> 2.3) letter_opener (1.4.1) @@ -349,34 +257,34 @@ GEM mail (2.6.4) mime-types (>= 1.16, < 4) method_source (0.8.2) - mime-types (3.0) + mime-types (3.1) mime-types-data (~> 3.2015) - mime-types-data (3.2016.0221) + mime-types-data (3.2016.0521) mimemagic (0.3.1) mini_magick (4.5.1) - mini_portile2 (2.0.0) - minitest (5.9.0) + mini_portile2 (2.1.0) + minitest (5.10.1) multi_json (1.12.1) - multi_xml (0.5.5) + multi_xml (0.6.0) multipart-post (2.0.0) mysql2 (0.4.4) nilify_blanks (1.2.1) activerecord (>= 3.0.0) activesupport (>= 3.0.0) nio4r (1.2.1) - nokogiri (1.6.7.2) - mini_portile2 (~> 2.0.0.rc2) - oauth2 (1.1.0) - faraday (>= 0.8, < 0.10) - jwt (~> 1.0, < 1.5.2) + nokogiri (1.7.0.1) + mini_portile2 (~> 2.1.0) + oauth2 (1.3.0) + faraday (>= 0.8, < 0.11) + jwt (~> 1.0) multi_json (~> 1.3) multi_xml (~> 0.5) rack (>= 1.2, < 3) - omniauth (1.3.1) + omniauth (1.3.2) hashie (>= 1.2, < 4) rack (>= 1.0, < 3) - omniauth-google-oauth2 (0.3.1) - jwt (~> 1.0) + omniauth-google-oauth2 (0.4.1) + jwt (~> 1.5.2) multi_json (~> 1.3) omniauth (>= 1.1.1) omniauth-oauth2 (>= 1.3.1) @@ -392,7 +300,7 @@ GEM mimemagic (~> 0.3.0) parser (2.3.0.7) ast (~> 2.2) - polyamorous (1.3.0) + polyamorous (1.3.1) activerecord (>= 3.0) powerpack (0.1.1) pry (0.10.3) @@ -407,56 +315,69 @@ GEM puma (3.2.0) pundit (1.1.0) activesupport (>= 3.0.0) - rack (2.0.0.alpha) - json + rack (2.0.1) rack-cors (0.4.0) - rack-protection (1.5.3) - rack rack-test (0.6.3) rack (>= 1.0) - rails (5.0.0.rc1) - actioncable (= 5.0.0.rc1) - actionmailer (= 5.0.0.rc1) - actionpack (= 5.0.0.rc1) - actionview (= 5.0.0.rc1) - activejob (= 5.0.0.rc1) - activemodel (= 5.0.0.rc1) - activerecord (= 5.0.0.rc1) - activesupport (= 5.0.0.rc1) + rails (5.0.1) + actioncable (= 5.0.1) + actionmailer (= 5.0.1) + actionpack (= 5.0.1) + actionview (= 5.0.1) + activejob (= 5.0.1) + activemodel (= 5.0.1) + activerecord (= 5.0.1) + activesupport (= 5.0.1) bundler (>= 1.3.0, < 2.0) - railties (= 5.0.0.rc1) + railties (= 5.0.1) sprockets-rails (>= 2.0.0) rails-controller-testing (0.1.1) actionpack (~> 5.x) actionview (~> 5.x) activesupport (~> 5.x) - rails-deprecated_sanitizer (1.0.3) - activesupport (>= 4.2.0.alpha) - rails-dom-testing (1.0.7) - activesupport (>= 4.2.0.beta, < 5.0) - nokogiri (~> 1.6.0) - rails-deprecated_sanitizer (>= 1.0.1) + rails-dom-testing (2.0.2) + activesupport (>= 4.2.0, < 6.0) + nokogiri (~> 1.6) rails-html-sanitizer (1.0.3) loofah (~> 2.0) - railties (5.0.0.rc1) - actionpack (= 5.0.0.rc1) - activesupport (= 5.0.0.rc1) + railties (5.0.1) + actionpack (= 5.0.1) + activesupport (= 5.0.1) method_source rake (>= 0.8.7) thor (>= 0.18.1, < 2.0) rainbow (2.1.0) - rake (11.1.2) + rake (12.0.0) + ransack (1.8.2) + actionpack (>= 3.0) + activerecord (>= 3.0) + activesupport (>= 3.0) + i18n + polyamorous (~> 1.3) rb-fsevent (0.9.7) rb-inotify (0.9.7) ffi (>= 0.5.0) redcarpet (3.2.3) redis (3.2.2) + redis-actionpack (5.0.1) + actionpack (>= 4.0, < 6) + redis-rack (>= 1, < 3) + redis-store (>= 1.1.0, < 1.4.0) + redis-activesupport (5.0.1) + activesupport (>= 3, < 6) + redis-store (~> 1.2.0) redis-namespace (1.5.2) redis (~> 3.0, >= 3.0.4) - redis-store (1.1.7) + redis-rack (2.0.0) + rack (~> 2.0) + redis-store (~> 1.2.0) + redis-rails (5.0.1) + redis-actionpack (~> 5.0.0) + redis-activesupport (~> 5.0.0) + redis-store (~> 1.2.0) + redis-store (1.2.0) redis (>= 2.2) - request_store (1.3.1) - responders (2.1.2) + responders (2.3.0) railties (>= 4.2.0, < 5.1) rspec-core (3.5.0.beta3) rspec-support (= 3.5.0.beta3) @@ -490,9 +411,9 @@ GEM sexp_processor (~> 4.1) rubyzip (1.2.0) safe_yaml (1.0.4) - sass (3.4.22) - sass-rails (5.0.4) - railties (>= 4.0.0, < 5.0) + sass (3.4.23) + sass-rails (5.0.6) + railties (>= 4.0.0, < 6) sass (~> 3.1) sprockets (>= 2.8, < 4.0) sprockets-rails (>= 2.0, < 4.0) @@ -519,40 +440,40 @@ GEM json (~> 1.8) simplecov-html (~> 0.10.0) simplecov-html (0.10.0) - slim (3.0.6) - temple (~> 0.7.3) + sinatra (1.0) + rack (>= 1.0) + slim (3.0.7) + temple (~> 0.7.6) tilt (>= 1.3.3, < 2.1) - slim-rails (3.0.1) - actionmailer (>= 3.1, < 5.0) - actionpack (>= 3.1, < 5.0) - activesupport (>= 3.1, < 5.0) - railties (>= 3.1, < 5.0) + slim-rails (3.1.1) + actionpack (>= 3.1) + railties (>= 3.1) slim (~> 3.0) slop (3.6.0) spring (1.6.4) spring-watcher-listen (2.0.0) listen (>= 2.7, < 4.0) spring (~> 1.2) - sprockets (3.6.0) + sprockets (3.7.1) concurrent-ruby (~> 1.0) rack (> 1, < 3) - sprockets-es6 (0.9.0) + sprockets-es6 (0.9.2) babel-source (>= 5.8.11) babel-transpiler sprockets (>= 3.0.0) - sprockets-rails (3.0.4) + sprockets-rails (3.2.0) actionpack (>= 4.0) activesupport (>= 4.0) sprockets (>= 3.0.0) swagger-blocks (1.3.3) - temple (0.7.6) + temple (0.7.7) term-ansicolor (1.3.2) tins (~> 1.0) terminal-table (1.5.2) - thor (0.19.1) + thor (0.19.4) thread (0.2.2) thread_safe (0.3.5) - tilt (2.0.2) + tilt (2.0.6) timecop (0.8.1) timeliness (0.3.8) tins (1.6.0) @@ -567,7 +488,7 @@ GEM validates_timeliness (4.0.2) timeliness (~> 0.3.7) vcr (3.0.1) - warden (1.2.6) + warden (1.2.7) rack (>= 1.0) web-console (3.1.1) activemodel (>= 4.2) @@ -578,7 +499,7 @@ GEM crack (>= 0.3.2) hashdiff websocket (1.2.2) - websocket-driver (0.6.3) + websocket-driver (0.6.5) websocket-extensions (>= 0.1.0) websocket-extensions (0.1.2) yajl-ruby (1.2.1) @@ -587,8 +508,7 @@ PLATFORMS ruby DEPENDENCIES - activeadmin! - activemodel-serializers-xml! + activeadmin (~> 1.0.0.pre4) acts_as_hashids (~> 0.1.2) acts_as_list (~> 0.7.2) bootstrap-kaminari-views (~> 0.0.5) @@ -602,9 +522,8 @@ DEPENDENCIES config (~> 1.1.0) coveralls (~> 0.8.13) database_rewinder (~> 0.5.3) - devise (~> 4.0.0.rc1) + devise (~> 4.2.0) devise_invitable (~> 1.6.0) - draper! enum_help (~> 0.0.15) factory_girl_rails (~> 4.6.0) fakeredis (~> 0.5.0) @@ -612,21 +531,20 @@ DEPENDENCIES faraday_middleware (~> 0.10.0) fog-aws (~> 0.9.0) fog-local (~> 0.3.0) - formtastic! gravatar_image_tag (~> 1.2.0) i18n-tasks (~> 0.9.5) i18n_generators (~> 2.1.1) + inherited_resources! jbuilder! jquery-rails (~> 4.1.0) jquery-ui-rails (~> 5.0.5) - kaminari! letter_opener_web (~> 1.3.0) listen (~> 3.0.5) mini_magick (~> 4.5.1) mysql2 (~> 0.4.4) nilify_blanks (~> 1.2.1) - omniauth (~> 1.3.1) - omniauth-google-oauth2 (~> 0.3.1) + omniauth (~> 1.3.2) + omniauth-google-oauth2 (~> 0.4.1) paperclip (~> 5.0.0.beta1) paranoia! pry-byebug (~> 3.3.0) @@ -634,15 +552,11 @@ DEPENDENCIES puma (~> 3.2.0) pundit (~> 1.1.0) rack-cors (~> 0.4.0) - rails (>= 5.0.0.rc1, < 5.1) + rails (~> 5.0.1) rails-controller-testing (~> 0.1.1) - ransack! redcarpet (~> 3.2.3) - redis-actionpack! - redis-activesupport! redis-namespace (~> 1.5.2) - redis-rack! - redis-rails! + redis-rails (~> 5.0.1) rspec-rails (~> 3.5.0.beta2) rubocop (~> 0.37.2) rubocop-rspec (~> 1.4.0) @@ -653,11 +567,11 @@ DEPENDENCIES sidekiq-unique-jobs (~> 4.0.13) simple_form (~> 3.2.1) simplecov (~> 0.11.2) - sinatra! - slim-rails (~> 3.0.1) + sinatra (~> 1.0) + slim-rails (~> 3.1.1) spring (~> 1.6.4) spring-watcher-listen (~> 2.0.0) - sprockets-es6 (~> 0.9.0) + sprockets-es6 (~> 0.9.2) swagger-blocks (~> 1.3.3) timecop (~> 0.8.0) turbolinks (~> 5.x) @@ -669,5 +583,8 @@ DEPENDENCIES webmock (~> 1.24.2) yajl-ruby (~> 1.2.1) +RUBY VERSION + ruby 2.3.0p0 + BUNDLED WITH - 1.11.2 + 1.12.5 From b3739cb551b386b3d29d1901e8e1365f714f422c Mon Sep 17 00:00:00 2001 From: dtaniwaki Date: Sun, 29 Jan 2017 20:52:53 +0900 Subject: [PATCH 02/10] Update paperclip gem 5.1.0 --- Gemfile | 2 +- Gemfile.lock | 9 ++++----- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/Gemfile b/Gemfile index 76eeb25..4ef7d0d 100644 --- a/Gemfile +++ b/Gemfile @@ -28,7 +28,7 @@ gem 'jbuilder', github: 'rails/jbuilder', branch: :master # To use with rails-ap # Use ActiveModel has_secure_password # gem 'bcrypt', '~> 3.1.7' -gem 'paperclip', '~> 5.0.0.beta1' +gem 'paperclip', '~> 5.1.0' gem 'fog-aws', '~> 0.9.0' gem 'fog-local', '~> 0.3.0' # gem 'poltergeist' diff --git a/Gemfile.lock b/Gemfile.lock index 9d2c432..204b057 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -121,8 +121,7 @@ GEM byebug (8.2.2) childprocess (0.5.9) ffi (~> 1.0, >= 1.0.11) - climate_control (0.0.3) - activesupport (>= 3.0) + climate_control (0.1.0) cocaine (0.5.8) climate_control (>= 0.0.3, < 1.0) cocoon (1.2.9) @@ -260,7 +259,7 @@ GEM mime-types (3.1) mime-types-data (~> 3.2015) mime-types-data (3.2016.0521) - mimemagic (0.3.1) + mimemagic (0.3.2) mini_magick (4.5.1) mini_portile2 (2.1.0) minitest (5.10.1) @@ -292,7 +291,7 @@ GEM oauth2 (~> 1.0) omniauth (~> 1.2) orm_adapter (0.5.0) - paperclip (5.0.0.beta1) + paperclip (5.1.0) activemodel (>= 4.2.0) activesupport (>= 4.2.0) cocaine (~> 0.5.5) @@ -545,7 +544,7 @@ DEPENDENCIES nilify_blanks (~> 1.2.1) omniauth (~> 1.3.2) omniauth-google-oauth2 (~> 0.4.1) - paperclip (~> 5.0.0.beta1) + paperclip (~> 5.1.0) paranoia! pry-byebug (~> 3.3.0) pry-rails (~> 0.3.4) From 5283fba95916c0d5d076f5f0e663d7890af7ce29 Mon Sep 17 00:00:00 2001 From: dtaniwaki Date: Sun, 29 Jan 2017 20:57:44 +0900 Subject: [PATCH 03/10] Update rubocop gem to 0.47.1 --- Gemfile | 4 ++-- Gemfile.lock | 23 ++++++++++++----------- 2 files changed, 14 insertions(+), 13 deletions(-) diff --git a/Gemfile b/Gemfile index 4ef7d0d..914398a 100644 --- a/Gemfile +++ b/Gemfile @@ -94,8 +94,8 @@ group :development do gem 'spring', '~> 1.6.4' gem 'spring-watcher-listen', '~> 2.0.0' # Code regulation - gem 'rubocop', '~> 0.37.2', require: false - gem 'rubocop-rspec', '~> 1.4.0', require: false + gem 'rubocop', '~> 0.47.1', require: false + gem 'rubocop-rspec', '~> 1.10.0', require: false # Vulnerability scan gem 'brakeman', '~> 3.2.1', require: false # Debug Email diff --git a/Gemfile.lock b/Gemfile.lock index 204b057..b6f7b21 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -88,7 +88,7 @@ GEM arbre (1.1.1) activesupport (>= 3.0.0) arel (7.1.4) - ast (2.2.0) + ast (2.3.0) autoprefixer-rails (6.3.6) execjs babel-source (5.8.35) @@ -297,7 +297,7 @@ GEM cocaine (~> 0.5.5) mime-types mimemagic (~> 0.3.0) - parser (2.3.0.7) + parser (2.3.3.1) ast (~> 2.2) polyamorous (1.3.1) activerecord (>= 3.0) @@ -345,7 +345,7 @@ GEM method_source rake (>= 0.8.7) thor (>= 0.18.1, < 2.0) - rainbow (2.1.0) + rainbow (2.2.1) rake (12.0.0) ransack (1.8.2) actionpack (>= 3.0) @@ -395,14 +395,15 @@ GEM rspec-mocks (= 3.5.0.beta3) rspec-support (= 3.5.0.beta3) rspec-support (3.5.0.beta3) - rubocop (0.37.2) - parser (>= 2.3.0.4, < 3.0) + rubocop (0.47.1) + parser (>= 2.3.3.1, < 3.0) powerpack (~> 0.1) rainbow (>= 1.99.1, < 3.0) ruby-progressbar (~> 1.7) - unicode-display_width (~> 0.3) - rubocop-rspec (1.4.0) - ruby-progressbar (1.7.5) + unicode-display_width (~> 1.0, >= 1.0.1) + rubocop-rspec (1.10.0) + rubocop (>= 0.42.0) + ruby-progressbar (1.8.1) ruby2ruby (2.3.0) ruby_parser (~> 3.1) sexp_processor (~> 4.0) @@ -483,7 +484,7 @@ GEM thread_safe (~> 0.1) uglifier (3.0.0) execjs (>= 0.3.0, < 3) - unicode-display_width (0.3.1) + unicode-display_width (1.1.3) validates_timeliness (4.0.2) timeliness (~> 0.3.7) vcr (3.0.1) @@ -557,8 +558,8 @@ DEPENDENCIES redis-namespace (~> 1.5.2) redis-rails (~> 5.0.1) rspec-rails (~> 3.5.0.beta2) - rubocop (~> 0.37.2) - rubocop-rspec (~> 1.4.0) + rubocop (~> 0.47.1) + rubocop-rspec (~> 1.10.0) sass-rails (~> 5.0) selenium-webdriver (~> 2.53.0) sidekiq (~> 4.1.0) From 58a0838b1ce7f6d6fc205b60babe4a56280fe9eb Mon Sep 17 00:00:00 2001 From: dtaniwaki Date: Sun, 29 Jan 2017 21:08:50 +0900 Subject: [PATCH 04/10] Use startbootstrap-sb-admin instead of startbootstrap-sb-admin-2 --- Bowerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Bowerfile b/Bowerfile index 420b4e5..649fff1 100644 --- a/Bowerfile +++ b/Bowerfile @@ -1,4 +1,4 @@ -asset 'startbootstrap-sb-admin-2', '1.0.8' +asset 'startbootstrap-sb-admin', '1.0.7' asset 'pwstrength-bootstrap', '2.0.0' asset 'jquery-timeago', '1.5.2' asset 'zeroclipboard', '2.2.0' From 395c8833f10cd42a910b0d43cf5c537a0872f8bc Mon Sep 17 00:00:00 2001 From: dtaniwaki Date: Sun, 29 Jan 2017 21:21:32 +0900 Subject: [PATCH 05/10] Update sidekiq gem to 4.2.9 --- Gemfile | 2 +- Gemfile.lock | 11 +++++++---- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/Gemfile b/Gemfile index 914398a..51ce7cd 100644 --- a/Gemfile +++ b/Gemfile @@ -41,7 +41,7 @@ gem 'config', '~> 1.1.0' gem 'bootstrap-sass', '~> 3.3.6' gem 'devise', '~> 4.2.0' gem 'devise_invitable', '~> 1.6.0' -gem 'sidekiq', '~> 4.1.0' +gem 'sidekiq', '~> 4.2.9' gem 'sidekiq-unique-jobs', '~> 4.0.13' gem 'sidekiq-failures', '~> 0.4.5' gem 'yajl-ruby', '~> 1.2.1' diff --git a/Gemfile.lock b/Gemfile.lock index b6f7b21..827cd98 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -139,7 +139,7 @@ GEM config (1.1.0) activesupport (>= 3.0) deep_merge (~> 1.0.1) - connection_pool (2.2.0) + connection_pool (2.2.1) coveralls (0.8.13) json (~> 1.8) simplecov (~> 0.11.0) @@ -316,6 +316,8 @@ GEM activesupport (>= 3.0.0) rack (2.0.1) rack-cors (0.4.0) + rack-protection (1.5.3) + rack rack-test (0.6.3) rack (>= 1.0) rails (5.0.1) @@ -357,7 +359,7 @@ GEM rb-inotify (0.9.7) ffi (>= 0.5.0) redcarpet (3.2.3) - redis (3.2.2) + redis (3.3.3) redis-actionpack (5.0.1) actionpack (>= 4.0, < 6) redis-rack (>= 1, < 3) @@ -423,9 +425,10 @@ GEM rubyzip (~> 1.0) websocket (~> 1.0) sexp_processor (4.7.0) - sidekiq (4.1.1) + sidekiq (4.2.9) concurrent-ruby (~> 1.0) connection_pool (~> 2.2, >= 2.2.0) + rack-protection (>= 1.5.0) redis (~> 3.2, >= 3.2.1) sidekiq-failures (0.4.5) sidekiq (>= 2.16.0) @@ -562,7 +565,7 @@ DEPENDENCIES rubocop-rspec (~> 1.10.0) sass-rails (~> 5.0) selenium-webdriver (~> 2.53.0) - sidekiq (~> 4.1.0) + sidekiq (~> 4.2.9) sidekiq-failures (~> 0.4.5) sidekiq-unique-jobs (~> 4.0.13) simple_form (~> 3.2.1) From 3ac755ebf12c6fd88011593472dd8238f0a0e9c9 Mon Sep 17 00:00:00 2001 From: dtaniwaki Date: Sun, 29 Jan 2017 21:42:06 +0900 Subject: [PATCH 06/10] Use BlackrockDigital/startbootstrap-sb-admin-2 instead of IronSummitMedia/startbootstrap-sb-admin-2 --- Bowerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Bowerfile b/Bowerfile index 649fff1..5a53ff8 100644 --- a/Bowerfile +++ b/Bowerfile @@ -1,4 +1,4 @@ -asset 'startbootstrap-sb-admin', '1.0.7' +asset 'startbootstrap-sb-admin-2', '1.0.7', github: 'BlackrockDigital/startbootstrap-sb-admin-2' asset 'pwstrength-bootstrap', '2.0.0' asset 'jquery-timeago', '1.5.2' asset 'zeroclipboard', '2.2.0' From 616275d93eeb216ef10e1480a9ed22e1da27782d Mon Sep 17 00:00:00 2001 From: dtaniwaki Date: Sun, 29 Jan 2017 22:31:10 +0900 Subject: [PATCH 07/10] Add accidentally removed necessary gems --- Gemfile | 2 ++ Gemfile.lock | 25 +++++++++++++++++++++++++ 2 files changed, 27 insertions(+) diff --git a/Gemfile b/Gemfile index 51ce7cd..748ced0 100644 --- a/Gemfile +++ b/Gemfile @@ -69,6 +69,8 @@ gem 'swagger-blocks', '~> 1.3.3' gem 'rack-cors', '~> 0.4.0', require: 'rack/cors' gem 'activeadmin', '~> 1.0.0.pre4' gem 'redis-rails', '~> 5.0.1' +gem 'draper', github: 'audionerd/draper', branch: 'rails5', ref: 'e816e0e5876b76c648c0928f1c3f2aa2c7a3d1f2' +gem 'activemodel-serializers-xml', github: 'rails/activemodel-serializers-xml', ref: 'dd9c0acf26aab111ebc647cd8deb99ebc6946531' ################################ # activeadmin Rails 5 support diff --git a/Gemfile.lock b/Gemfile.lock index 827cd98..e00523b 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,3 +1,25 @@ +GIT + remote: git://github.com/audionerd/draper.git + revision: e816e0e5876b76c648c0928f1c3f2aa2c7a3d1f2 + ref: e816e0e5876b76c648c0928f1c3f2aa2c7a3d1f2 + branch: rails5 + specs: + draper (2.1.0) + actionpack (>= 3.0) + activemodel (>= 3.0) + activesupport (>= 3.0) + request_store (~> 1.0) + +GIT + remote: git://github.com/rails/activemodel-serializers-xml.git + revision: dd9c0acf26aab111ebc647cd8deb99ebc6946531 + ref: dd9c0acf26aab111ebc647cd8deb99ebc6946531 + specs: + activemodel-serializers-xml (1.0.1) + activemodel (> 5.x) + activesupport (> 5.x) + builder (~> 3.1) + GIT remote: git://github.com/rails/jbuilder.git revision: 64c510ec69d9e63b73ffd5942e802d21a7d14701 @@ -378,6 +400,7 @@ GEM redis-store (~> 1.2.0) redis-store (1.2.0) redis (>= 2.2) + request_store (1.3.2) responders (2.3.0) railties (>= 4.2.0, < 5.1) rspec-core (3.5.0.beta3) @@ -512,6 +535,7 @@ PLATFORMS DEPENDENCIES activeadmin (~> 1.0.0.pre4) + activemodel-serializers-xml! acts_as_hashids (~> 0.1.2) acts_as_list (~> 0.7.2) bootstrap-kaminari-views (~> 0.0.5) @@ -527,6 +551,7 @@ DEPENDENCIES database_rewinder (~> 0.5.3) devise (~> 4.2.0) devise_invitable (~> 1.6.0) + draper! enum_help (~> 0.0.15) factory_girl_rails (~> 4.6.0) fakeredis (~> 0.5.0) From 747d7e6c2a1d1f90def14afe375e167c8b8ea601 Mon Sep 17 00:00:00 2001 From: dtaniwaki Date: Sun, 29 Jan 2017 22:34:59 +0900 Subject: [PATCH 08/10] Use EnforcedStyleAlignWith instead of obsolete AlignWith --- .rubocop.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.rubocop.yml b/.rubocop.yml index 99921d0..f29f9fe 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -39,7 +39,7 @@ Style/IndentArray: Style/DoubleNegation: Enabled: false Lint/EndAlignment: - AlignWith: variable + EnforcedStyleAlignWith: variable Style/FrozenStringLiteralComment: Enabled: false RSpec/AnyInstance: From c4c418d43d91b72d6443cebff8d222b9b04b7c70 Mon Sep 17 00:00:00 2001 From: dtaniwaki Date: Sun, 29 Jan 2017 22:40:17 +0900 Subject: [PATCH 09/10] Correct correctable rubocop lint --- Gemfile | 71 +++++++++---------- app/controllers/api/v1/base_controller.rb | 2 +- .../api/v1/test_executions_controller.rb | 4 +- app/controllers/docs_controller.rb | 3 +- app/controllers/test_executions_controller.rb | 4 +- app/controllers/test_versions_controller.rb | 4 +- app/jobs/async_record_job.rb | 2 +- app/jobs/test_execution_job.rb | 4 +- app/models/browser/browserstack.rb | 12 ++-- app/models/browser/local.rb | 12 ++-- app/models/test_execution_browser.rb | 2 +- app/models/test_step/navigation.rb | 2 +- app/models/test_step/step_set.rb | 2 +- app/models/test_step_execution.rb | 4 +- app/models/user.rb | 4 +- app/models/user_test.rb | 2 +- app/models/user_test_version.rb | 2 +- lib/e2e_tester/exceptions.rb | 8 +-- lib/web_driver_ext/full_screenshot.rb | 4 +- spec/models/concerns/async_concern_spec.rb | 10 ++- spec/models/test_execution_browser_spec.rb | 2 +- spec/models/test_execution_spec.rb | 2 +- spec/support/api.rb | 4 +- spec/support/devise.rb | 12 ++-- 24 files changed, 89 insertions(+), 89 deletions(-) diff --git a/Gemfile b/Gemfile index 748ced0..47c5708 100644 --- a/Gemfile +++ b/Gemfile @@ -28,61 +28,60 @@ gem 'jbuilder', github: 'rails/jbuilder', branch: :master # To use with rails-ap # Use ActiveModel has_secure_password # gem 'bcrypt', '~> 3.1.7' -gem 'paperclip', '~> 5.1.0' gem 'fog-aws', '~> 0.9.0' gem 'fog-local', '~> 0.3.0' +gem 'paperclip', '~> 5.1.0' # gem 'poltergeist' -gem 'selenium-webdriver', '~> 2.53.0' -gem 'faraday', '~> 0.9.2' -gem 'faraday_middleware', '~> 0.10.0' -gem 'mini_magick', '~> 4.5.1' -gem 'pry-rails', '~> 0.3.4' -gem 'config', '~> 1.1.0' +gem 'activeadmin', '~> 1.0.0.pre4' +gem 'activemodel-serializers-xml', github: 'rails/activemodel-serializers-xml', ref: 'dd9c0acf26aab111ebc647cd8deb99ebc6946531' +gem 'acts_as_hashids', '~> 0.1.2' +gem 'acts_as_list', '~> 0.7.2' +gem 'bootstrap-kaminari-views', '~> 0.0.5' gem 'bootstrap-sass', '~> 3.3.6' +gem 'bower-rails', '~> 0.10.0' +gem 'bugsnag', '~> 4.0.0' +gem 'cocoon', '~> 1.2.9' +gem 'config', '~> 1.1.0' gem 'devise', '~> 4.2.0' gem 'devise_invitable', '~> 1.6.0' -gem 'sidekiq', '~> 4.2.9' -gem 'sidekiq-unique-jobs', '~> 4.0.13' -gem 'sidekiq-failures', '~> 0.4.5' -gem 'yajl-ruby', '~> 1.2.1' -gem 'sinatra', '~> 1.0', require: nil -gem 'redis-namespace', '~> 1.5.2' +gem 'draper', github: 'audionerd/draper', branch: 'rails5', ref: 'e816e0e5876b76c648c0928f1c3f2aa2c7a3d1f2' +gem 'enum_help', '~> 0.0.15' +gem 'faraday', '~> 0.9.2' +gem 'faraday_middleware', '~> 0.10.0' +gem 'gravatar_image_tag', '~> 1.2.0' +gem 'mini_magick', '~> 4.5.1' +gem 'nilify_blanks', '~> 1.2.1' gem 'omniauth', '~> 1.3.2' gem 'omniauth-google-oauth2', '~> 0.4.1' -gem 'sprockets-es6', '~> 0.9.2' -gem 'acts_as_list', '~> 0.7.2' gem 'paranoia', github: 'rubysherpas/paranoia', branch: 'core' -gem 'slim-rails', '~> 3.1.1' +gem 'pry-rails', '~> 0.3.4' gem 'pundit', '~> 1.1.0' -gem 'bugsnag', '~> 4.0.0' +gem 'rack-cors', '~> 0.4.0', require: 'rack/cors' gem 'redcarpet', '~> 3.2.3' -gem 'gravatar_image_tag', '~> 1.2.0' +gem 'redis-namespace', '~> 1.5.2' +gem 'redis-rails', '~> 5.0.1' +gem 'selenium-webdriver', '~> 2.53.0' +gem 'sidekiq', '~> 4.2.9' +gem 'sidekiq-failures', '~> 0.4.5' +gem 'sidekiq-unique-jobs', '~> 4.0.13' gem 'simple_form', '~> 3.2.1' -gem 'cocoon', '~> 1.2.9' -gem 'nilify_blanks', '~> 1.2.1' -gem 'bootstrap-kaminari-views', '~> 0.0.5' -gem 'bower-rails', '~> 0.10.0' -gem 'acts_as_hashids', '~> 0.1.2' -gem 'enum_help', '~> 0.0.15' -gem 'validates_timeliness', '~> 4.0.2' +gem 'sinatra', '~> 1.0', require: nil +gem 'slim-rails', '~> 3.1.1' +gem 'sprockets-es6', '~> 0.9.2' gem 'swagger-blocks', '~> 1.3.3' -gem 'rack-cors', '~> 0.4.0', require: 'rack/cors' -gem 'activeadmin', '~> 1.0.0.pre4' -gem 'redis-rails', '~> 5.0.1' -gem 'draper', github: 'audionerd/draper', branch: 'rails5', ref: 'e816e0e5876b76c648c0928f1c3f2aa2c7a3d1f2' -gem 'activemodel-serializers-xml', github: 'rails/activemodel-serializers-xml', ref: 'dd9c0acf26aab111ebc647cd8deb99ebc6946531' +gem 'validates_timeliness', '~> 4.0.2' +gem 'yajl-ruby', '~> 1.2.1' ################################ # activeadmin Rails 5 support gem 'inherited_resources', git: 'https://github.com/activeadmin/inherited_resources' ################################ - group :development, :test do # Call 'byebug' anywhere in the code to stop execution and get a debugger console gem 'byebug', '~> 8.2.2' - gem 'pry-byebug', '~> 3.3.0' gem 'factory_girl_rails', '~> 4.6.0' + gem 'pry-byebug', '~> 3.3.0' # i18n generators gem 'i18n-tasks', '~> 0.9.5' gem 'i18n_generators', '~> 2.1.1' @@ -90,8 +89,8 @@ end group :development do # Access an IRB console on exception pages or by using <%= console %> in views - gem 'web-console', '~> 3.0' gem 'listen', '~> 3.0.5' + gem 'web-console', '~> 3.0' # Spring speeds up development by keeping your application running in the background. Read more: https://github.com/rails/spring gem 'spring', '~> 1.6.4' gem 'spring-watcher-listen', '~> 2.0.0' @@ -105,13 +104,13 @@ group :development do end group :test do - gem 'rspec-rails', '~> 3.5.0.beta2' gem 'rails-controller-testing', '~> 0.1.1' + gem 'rspec-rails', '~> 3.5.0.beta2' # Test Coverage - gem 'simplecov', '~> 0.11.2', require: false - gem 'coveralls', '~> 0.8.13', require: false gem 'codeclimate-test-reporter', '~> 0.5.0', require: false + gem 'coveralls', '~> 0.8.13', require: false gem 'database_rewinder', '~> 0.5.3' + gem 'simplecov', '~> 0.11.2', require: false # gem 'fuubar' gem 'timecop', '~> 0.8.0' gem 'webmock', '~> 1.24.2', require: false diff --git a/app/controllers/api/v1/base_controller.rb b/app/controllers/api/v1/base_controller.rb index c7257ff..04ccb84 100644 --- a/app/controllers/api/v1/base_controller.rb +++ b/app/controllers/api/v1/base_controller.rb @@ -24,7 +24,7 @@ def set_pagination_header(records, params = request.params) def current_user return unless request.headers['Authorization'] =~ /\ABearer\s+(.*)\Z/ - token = UserApiToken.eager_load(:user).find_by_token(Regexp.last_match(1)) + token = UserApiToken.eager_load(:user).find_by(token: Regexp.last_match(1)) token&.user end diff --git a/app/controllers/api/v1/test_executions_controller.rb b/app/controllers/api/v1/test_executions_controller.rb index fe2ae45..c6acee7 100644 --- a/app/controllers/api/v1/test_executions_controller.rb +++ b/app/controllers/api/v1/test_executions_controller.rb @@ -49,7 +49,7 @@ class TestExecutionsController < Api::V1::BaseController end def index - @test_version = Test.find(params[:test_id]).test_versions.find_by_position!(params[:number]) + @test_version = Test.find(params[:test_id]).test_versions.find_by!(position: params[:number]) authorize @test_version, :show? @test_executions = policy_scope(@test_version.test_executions, @test_version) @@ -59,7 +59,7 @@ def index end def create - @test_version = Test.find(params[:test_id]).test_versions.find_by_position!(params[:number]) + @test_version = Test.find(params[:test_id]).test_versions.find_by!(position: params[:number]) authorize @test_version, :show? @test_execution = @test_version.test_executions.with_user(current_user).build authorize @test_execution diff --git a/app/controllers/docs_controller.rb b/app/controllers/docs_controller.rb index 110e445..563c9b7 100644 --- a/app/controllers/docs_controller.rb +++ b/app/controllers/docs_controller.rb @@ -1,6 +1,5 @@ class DocsController < ApplicationController layout 'docs' - def api - end + def api; end end diff --git a/app/controllers/test_executions_controller.rb b/app/controllers/test_executions_controller.rb index db4fd2d..4168ea7 100644 --- a/app/controllers/test_executions_controller.rb +++ b/app/controllers/test_executions_controller.rb @@ -3,7 +3,7 @@ class TestExecutionsController < BaseController skip_before_action :authenticate_user!, only: [:show] def index - @test_version = Test.find(params[:test_id]).test_versions.find_by_position!(params[:number]) + @test_version = Test.find(params[:test_id]).test_versions.find_by!(position: params[:number]) authorize @test_version, :show? @test_executions = policy_scope(@test_version.test_executions, @test_version).eager_load(:user).latest.page(params[:page]).per(20) @@ -24,7 +24,7 @@ def show end def create - @test_version = Test.find(params[:test_id]).test_versions.find_by_position!(params[:number]) + @test_version = Test.find(params[:test_id]).test_versions.find_by!(position: params[:number]) authorize @test_version, :show? @test_execution = @test_version.test_executions.with_user(current_user).build authorize @test_execution diff --git a/app/controllers/test_versions_controller.rb b/app/controllers/test_versions_controller.rb index 3710cde..1772029 100644 --- a/app/controllers/test_versions_controller.rb +++ b/app/controllers/test_versions_controller.rb @@ -9,7 +9,7 @@ def index end def show - @test_version = Test.find(params[:test_id]).test_versions.includes(:test, test_browsers: :browser).find_by_position!(params[:number]) + @test_version = Test.find(params[:test_id]).test_versions.includes(:test, test_browsers: :browser).find_by!(position: params[:number]) authorize @test_version @test = @test_version.test @@ -21,7 +21,7 @@ def show end def destroy - @test_version = Test.find(params[:test_id]).test_versions.find_by_position!(params[:number]) + @test_version = Test.find(params[:test_id]).test_versions.find_by!(position: params[:number]) authorize @test_version if @test_version.destroy diff --git a/app/jobs/async_record_job.rb b/app/jobs/async_record_job.rb index cf72af6..ff4f4f1 100644 --- a/app/jobs/async_record_job.rb +++ b/app/jobs/async_record_job.rb @@ -4,7 +4,7 @@ class AsyncRecordJob < ApplicationJob sidekiq_options queue: :default, retry: true, backtrace: true, unique: :while_executing def perform(klass, id, method_name) - record = klass.constantize.find_by_id!(id) + record = klass.constantize.find_by!(id: id) record.public_send(method_name) end end diff --git a/app/jobs/test_execution_job.rb b/app/jobs/test_execution_job.rb index 8df93c2..f937837 100644 --- a/app/jobs/test_execution_job.rb +++ b/app/jobs/test_execution_job.rb @@ -4,8 +4,8 @@ class TestExecutionJob < ApplicationJob sidekiq_options queue: :test_execution, retry: false, backtrace: true, unique: :while_executing def perform(user_id, execution_id) - user = User.find_by_id!(user_id) - execution_browser = user.test_execution_browsers.find_by_id!(execution_id) + user = User.find_by!(id: user_id) + execution_browser = user.test_execution_browsers.find_by!(id: execution_id) execution_browser.execute!(user) end end diff --git a/app/models/browser/browserstack.rb b/app/models/browser/browserstack.rb index cbb9eed..4327002 100644 --- a/app/models/browser/browserstack.rb +++ b/app/models/browser/browserstack.rb @@ -50,11 +50,13 @@ def driver(credential = nil) driver = Selenium::WebDriver.for :remote, url: url, desired_capabilities: caps at_exit do - begin - driver.quit - rescue - nil - end if driver + if driver + begin + driver.quit + rescue + nil + end + end end driver diff --git a/app/models/browser/local.rb b/app/models/browser/local.rb index 15f440f..e673249 100644 --- a/app/models/browser/local.rb +++ b/app/models/browser/local.rb @@ -66,11 +66,13 @@ def driver(_credential = nil) end at_exit do - begin - driver.quit - rescue - nil - end if driver + if driver + begin + driver.quit + rescue + nil + end + end end driver diff --git a/app/models/test_execution_browser.rb b/app/models/test_execution_browser.rb index 9354183..aa3a5e9 100644 --- a/app/models/test_execution_browser.rb +++ b/app/models/test_execution_browser.rb @@ -25,7 +25,7 @@ def execute!(user) failed! ensure test_execution.check_completion! - driver.quit if driver + driver&.quit end def execute_async!(user) diff --git a/app/models/test_step/navigation.rb b/app/models/test_step/navigation.rb index f3129ac..15b8c90 100644 --- a/app/models/test_step/navigation.rb +++ b/app/models/test_step/navigation.rb @@ -3,7 +3,7 @@ class Navigation < Base using Refinements::ReplaceVariables validates :url, length: { minimum: 1, maximum: 2_048 }, presence: true - validates :url, url: true, unless: -> (ts) { ts.url =~ /{[^}]+}/ } + validates :url, url: true, unless: ->(ts) { ts.url =~ /{[^}]+}/ } serialized_attribute :url diff --git a/app/models/test_step/step_set.rb b/app/models/test_step/step_set.rb index 26aaecd..98d2810 100644 --- a/app/models/test_step/step_set.rb +++ b/app/models/test_step/step_set.rb @@ -3,7 +3,7 @@ class StepSet < Base belongs_to :shared_test_step_set, inverse_of: :test_step_sets has_many :test_steps, through: :shared_test_step_set - scope :with_test_step_set, -> (test_step_set) { where(shared_test_step_set_id: test_step_set.is_a?(ActiveRecord::Base) ? test_step_set.id : test_step_set) } + scope :with_test_step_set, ->(test_step_set) { where(shared_test_step_set_id: test_step_set.is_a?(ActiveRecord::Base) ? test_step_set.id : test_step_set) } validate :validate_accessibility validates :shared_test_step_set, presence: true diff --git a/app/models/test_step_execution.rb b/app/models/test_step_execution.rb index 9d866fe..77b568b 100644 --- a/app/models/test_step_execution.rb +++ b/app/models/test_step_execution.rb @@ -7,8 +7,8 @@ class TestStepExecution < ApplicationRecord has_one :browser, through: :test_execution_browser has_one :test_execution, through: :test_execution_browser - scope :with_user, -> (user) { joins(:test_execution).merge(TestExecution.where(user_id: user.is_a?(ActiveRecord::Base) ? user.id : user)) } - scope :with_test_execution, -> (te) { joins(:test_execution_browser).merge(TestExecutionBrowser.where(test_execution_id: te.is_a?(ActiveRecord::Base) ? te.id : te)) } + scope :with_user, ->(user) { joins(:test_execution).merge(TestExecution.where(user_id: user.is_a?(ActiveRecord::Base) ? user.id : user)) } + scope :with_test_execution, ->(te) { joins(:test_execution_browser).merge(TestExecutionBrowser.where(test_execution_id: te.is_a?(ActiveRecord::Base) ? te.id : te)) } scope :with_test_step, ->(test_step) { where(test_step_id: test_step.is_a?(ActiveRecord::Base) ? test_step.id : test_step) } scope :with_browser, ->(browser) { joins(:test_browser).merge(TestBrowser.where(browser_id: browser.is_a?(ActiveRecord::Base) ? browser.id : browser)) } diff --git a/app/models/user.rb b/app/models/user.rb index 2090dd3..3bfa340 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -33,7 +33,7 @@ class User < ApplicationRecord validates :email, :confirmation_token, :reset_password_token, :unlock_token, uniqueness: true, allow_blank: true validates :email, :encrypted_password, presence: true - validates :name, :username, presence: true, if: -> (u) { u.accepted_or_not_invited? || u.accepting_invitation? } + validates :name, :username, presence: true, if: ->(u) { u.accepted_or_not_invited? || u.accepting_invitation? } validates :name, length: { minimum: 1, maximum: 100 }, allow_blank: true validates :username, format: { with: /\A([a-zA-Z0-9_][a-zA-Z0-9_\-\.]*[a-zA-Z0-9_]|[a-zA-Z0-9_])\Z/ }, @@ -41,7 +41,7 @@ class User < ApplicationRecord uniqueness: { case_sensitive: false }, allow_blank: true - accepts_nested_attributes_for :user_variables, allow_destroy: true, reject_if: -> (attributes) { attributes[:name].blank? && attributes[:value].blank? } + accepts_nested_attributes_for :user_variables, allow_destroy: true, reject_if: ->(attributes) { attributes[:name].blank? && attributes[:value].blank? } def self.find_or_invite_by(params, user) user = User.find_by(params) diff --git a/app/models/user_test.rb b/app/models/user_test.rb index fe9cc87..85673e5 100644 --- a/app/models/user_test.rb +++ b/app/models/user_test.rb @@ -9,7 +9,7 @@ class UserTest < ApplicationRecord after_commit :send_notification!, on: :create, if: ->(up) { up.assigned_by.present? } - accepts_nested_attributes_for :user_test_variables, allow_destroy: true, reject_if: -> (attributes) { attributes[:name].blank? && attributes[:value].blank? } + accepts_nested_attributes_for :user_test_variables, allow_destroy: true, reject_if: ->(attributes) { attributes[:name].blank? && attributes[:value].blank? } alias_attribute :assigned_at, :created_at diff --git a/app/models/user_test_version.rb b/app/models/user_test_version.rb index 8840a79..9d4dfa8 100644 --- a/app/models/user_test_version.rb +++ b/app/models/user_test_version.rb @@ -10,7 +10,7 @@ class UserTestVersion < ApplicationRecord after_commit :send_notification!, on: :create, if: ->(ut) { ut.assigned_by.present? } - accepts_nested_attributes_for :user_test_version_variables, allow_destroy: true, reject_if: -> (attributes) { attributes[:name].blank? && attributes[:value].blank? } + accepts_nested_attributes_for :user_test_version_variables, allow_destroy: true, reject_if: ->(attributes) { attributes[:name].blank? && attributes[:value].blank? } alias_attribute :assigned_at, :created_at diff --git a/lib/e2e_tester/exceptions.rb b/lib/e2e_tester/exceptions.rb index 98a59c6..3c8198a 100644 --- a/lib/e2e_tester/exceptions.rb +++ b/lib/e2e_tester/exceptions.rb @@ -2,15 +2,15 @@ module E2eTester class Exception < ::StandardError end - class NotAuthenticated < Exception + class NotAuthenticated < RuntimeError end - class NotFound < Exception + class NotFound < RuntimeError end - class GenerateTokenFailure < Exception + class GenerateTokenFailure < RuntimeError end - class JavaScriptError < Exception + class JavaScriptError < RuntimeError end end diff --git a/lib/web_driver_ext/full_screenshot.rb b/lib/web_driver_ext/full_screenshot.rb index fa98c6b..4067cd4 100644 --- a/lib/web_driver_ext/full_screenshot.rb +++ b/lib/web_driver_ext/full_screenshot.rb @@ -30,8 +30,8 @@ def take_full_screenshot(driver) end image = MiniMagick::Image.new(tempfile.path) (image_width, image_height) = image.dimensions - @logger.info "n: #{n}, screen: (#{screen_width}, #{screen_height}), total (#{total_width}, #{total_height}), inner (#{inner_width}, #{inner_height}),\ - image (#{image_width}, #{image_height}), scroll (#{scroll_top}, 0)" if @logger + @logger&.info "n: #{n}, screen: (#{screen_width}, #{screen_height}), total (#{total_width}, #{total_height}), inner (#{inner_width}, #{inner_height}),\ + image (#{image_width}, #{image_height}), scroll (#{scroll_top}, 0)" # Resize to actual pixel size if total_height <= image_height append_file_paths << image.path diff --git a/spec/models/concerns/async_concern_spec.rb b/spec/models/concerns/async_concern_spec.rb index 20966e0..569b7f4 100644 --- a/spec/models/concerns/async_concern_spec.rb +++ b/spec/models/concerns/async_concern_spec.rb @@ -3,24 +3,22 @@ RSpec.describe AsyncConcern, type: :model do subject do Class.new(ActiveRecord::Base) do - include AsyncConcern # rubocop:disable RSpec/DescribedClass + include AsyncConcern def id 1 end - def foo - end + def foo; end - def foo! - end + def foo!; end def self.name 'Foo' end end end - before :example do + before do allow(subject).to receive_message_chain(:connection, :schema_cache, :columns_hash).and_return({}) AsyncRecordJob.jobs.clear end diff --git a/spec/models/test_execution_browser_spec.rb b/spec/models/test_execution_browser_spec.rb index aaa522a..f1aeaed 100644 --- a/spec/models/test_execution_browser_spec.rb +++ b/spec/models/test_execution_browser_spec.rb @@ -8,7 +8,7 @@ subject(:test_execution_browser) { create :test_execution_browser, test_execution: test_execution } describe '#execute!' do let!(:user_variable) { create :user_variable, user: user, name: 'foo', value: 'bar' } - before :example do + before do subject.initialize_test_step_executions! allow(subject.browser).to receive(:driver).and_return(driver) end diff --git a/spec/models/test_execution_spec.rb b/spec/models/test_execution_spec.rb index 2961d4b..377e6e8 100644 --- a/spec/models/test_execution_spec.rb +++ b/spec/models/test_execution_spec.rb @@ -45,7 +45,7 @@ let(:owner) { test.user } subject!(:test_execution) { create :test_execution, test_version: test_version, user: executer } let(:sent_users) { [] } - before :example do + before do allow(UserMailer).to receive(:test_execution_result) do |user, _test_execution| sent_users << user double deliver_now: nil diff --git a/spec/support/api.rb b/spec/support/api.rb index 872186b..7291ce7 100644 --- a/spec/support/api.rb +++ b/spec/support/api.rb @@ -2,7 +2,7 @@ let(:current_user) { create :user } let(:api_token) { create :user_api_token, user: current_user } - before :example do + before do sign_out :user request.headers['Authorization'] = "Bearer #{api_token.token}" end @@ -11,7 +11,7 @@ RSpec.shared_context 'without authorized token' do let(:current_user) { create :user } - before :example do + before do sign_out :user request.headers['Authorization'] = '' end diff --git a/spec/support/devise.rb b/spec/support/devise.rb index 84ebfeb..c33b6d9 100644 --- a/spec/support/devise.rb +++ b/spec/support/devise.rb @@ -5,12 +5,12 @@ RSpec.shared_context 'with signed in user' do let(:current_user) { create :user } - before :example do + before do sign_in :user, current_user expect(controller.current_user).not_to be_nil end - after :example do + after do sign_out :user end end @@ -18,7 +18,7 @@ RSpec.shared_context 'without signed in user' do let(:current_user) { create :user } - before :example do + before do sign_out :user expect(controller.current_user).to be_nil end @@ -27,12 +27,12 @@ RSpec.shared_context 'with signed in admin user' do let(:current_admin_user) { create :admin_user } - before :example do + before do sign_in :admin_user, current_admin_user expect(controller.current_admin_user).not_to be_nil end - after :example do + after do sign_out :admin_user end end @@ -40,7 +40,7 @@ RSpec.shared_context 'without signed in admin user' do let(:current_admin_user) { create :admin_user } - before :example do + before do sign_out :admin_user expect(controller.current_admin_user).to be_nil end From 39bdecfb21c274411cc3223294d8525372cfbbdc Mon Sep 17 00:00:00 2001 From: dtaniwaki Date: Sun, 29 Jan 2017 22:46:08 +0900 Subject: [PATCH 10/10] Generate rubocop_todo.yml to temporarily remove rubocop lint errors --- .rubocop.yml | 1 + .rubocop_todo.yml | 124 ++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 125 insertions(+) create mode 100644 .rubocop_todo.yml diff --git a/.rubocop.yml b/.rubocop.yml index f29f9fe..abb20b9 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -1,3 +1,4 @@ +inherit_from: .rubocop_todo.yml require: rubocop-rspec Rails: Enabled: true diff --git a/.rubocop_todo.yml b/.rubocop_todo.yml new file mode 100644 index 0000000..40e182a --- /dev/null +++ b/.rubocop_todo.yml @@ -0,0 +1,124 @@ +# This configuration was generated by +# `rubocop --auto-gen-config` +# on 2017-01-29 22:43:39 +0900 using RuboCop version 0.47.1. +# The point is for the user to remove these configuration records +# one by one as the offenses are removed from the code base. +# Note that changes in the inspected code, or installation of new +# versions of RuboCop, may require this file to be generated again. + +# Offense count: 89 +# Configuration parameters: CountComments, ExcludedMethods. +Metrics/BlockLength: + Max: 219 + +# Offense count: 1 +# Configuration parameters: CustomIncludeMethods. +RSpec/EmptyExampleGroup: + Exclude: + - 'spec/controllers/user_api_tokens_controller_spec.rb' + +# Offense count: 7 +# Configuration parameters: Max. +RSpec/ExampleLength: + Exclude: + - 'spec/controllers/browserstack_credentials_controller_spec.rb' + - 'spec/controllers/test_step_sets_controller_spec.rb' + - 'spec/models/concerns/async_concern_spec.rb' + - 'spec/models/test_execution_browser_spec.rb' + - 'spec/models/test_execution_spec.rb' + +# Offense count: 8 +RSpec/LeadingSubject: + Exclude: + - 'spec/mailers/user_mailer_spec.rb' + - 'spec/models/test_execution_browser_spec.rb' + - 'spec/models/test_step/step_set_spec.rb' + - 'spec/models/test_step_set_spec.rb' + - 'spec/models/test_version_spec.rb' + +# Offense count: 51 +RSpec/LetSetup: + Enabled: false + +# Offense count: 3 +RSpec/MessageChain: + Exclude: + - 'spec/models/concerns/async_concern_spec.rb' + - 'spec/models/user_test_spec.rb' + - 'spec/models/user_test_version_spec.rb' + +# Offense count: 15 +# Configuration parameters: SupportedStyles. +# SupportedStyles: have_received, receive +RSpec/MessageSpies: + EnforcedStyle: receive + +# Offense count: 154 +RSpec/MultipleExpectations: + Max: 5 + +# Offense count: 120 +RSpec/NamedSubject: + Enabled: false + +# Offense count: 97 +# Configuration parameters: Max. +RSpec/NestedGroups: + Enabled: false + +# Offense count: 3 +RSpec/SubjectStub: + Exclude: + - 'spec/models/concerns/async_concern_spec.rb' + - 'spec/models/test_step_set_spec.rb' + +# Offense count: 2 +# Configuration parameters: IgnoreSymbolicNames. +RSpec/VerifiedDoubles: + Exclude: + - 'spec/models/test_execution_browser_spec.rb' + - 'spec/models/test_execution_spec.rb' + +# Offense count: 5 +Rails/FilePath: + Exclude: + - 'config/environments/development.rb' + - 'config/initializers/i18n.rb' + - 'spec/rails_helper.rb' + +# Offense count: 3 +Rails/OutputSafety: + Exclude: + - 'app/admin/browser.rb' + - 'app/helpers/devise_helper.rb' + - 'app/helpers/render_helper.rb' + +# Offense count: 2 +# Configuration parameters: Blacklist. +# Blacklist: decrement!, decrement_counter, increment!, increment_counter, toggle!, touch, update_all, update_attribute, update_column, update_columns, update_counters +Rails/SkipsModelValidations: + Exclude: + - 'app/admin/browser.rb' + +# Offense count: 3 +# Configuration parameters: MinBodyLength. +Style/GuardClause: + Exclude: + - 'app/models/concerns/async_concern.rb' + - 'app/models/test_execution.rb' + - 'lib/patch/i18n_tasks.rb' + +# Offense count: 1 +Style/MethodMissing: + Exclude: + - 'app/models/concerns/async_concern.rb' + +# Offense count: 3 +# Cop supports --auto-correct. +# Configuration parameters: AutoCorrect, EnforcedStyle, SupportedStyles. +# SupportedStyles: predicate, comparison +Style/NumericPredicate: + Exclude: + - 'spec/**/*' + - 'config/application.rb' + - 'lib/web_driver_ext/full_screenshot.rb'