From 281bd89d2796c163923828a3a2688b1cc2249e7b Mon Sep 17 00:00:00 2001 From: Kenji Okimoto Date: Tue, 17 Apr 2018 14:22:31 +0900 Subject: [PATCH 01/31] Update Capybara TODO: I will update Capybara to 3.x after I update Rails 5.2.x Signed-off-by: Kenji Okimoto --- Gemfile | 2 +- Gemfile.lock | 13 +++++++------ 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/Gemfile b/Gemfile index c64d093..f5d69d0 100644 --- a/Gemfile +++ b/Gemfile @@ -19,7 +19,7 @@ end group :test do gem "factory_girl_rails" - gem "capybara", "~> 2.4.0" + gem "capybara", "~> 2.18.0" gem "capybara-screenshot" gem "simplecov", "~> 0.16.1", require: false gem "webmock", "~> 1.18.0" diff --git a/Gemfile.lock b/Gemfile.lock index b93c4c8..c5fc88a 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -69,12 +69,13 @@ GEM binding_of_caller (0.7.2) debug_inspector (>= 0.0.1) builder (3.2.3) - capybara (2.4.4) - mime-types (>= 1.16) + capybara (2.18.0) + addressable + mini_mime (>= 0.1.3) nokogiri (>= 1.3.3) rack (>= 1.0.0) rack-test (>= 0.5.4) - xpath (~> 2.0) + xpath (>= 2.0, < 4.0) capybara-screenshot (1.0.14) capybara (>= 1.0, < 3) launchy @@ -314,8 +315,8 @@ GEM websocket-driver (0.6.5) websocket-extensions (>= 0.1.0) websocket-extensions (0.1.2) - xpath (2.0.0) - nokogiri (~> 1.3) + xpath (3.0.0) + nokogiri (~> 1.8) yajl-ruby (1.3.1) PLATFORMS @@ -323,7 +324,7 @@ PLATFORMS DEPENDENCIES better_errors - capybara (~> 2.4.0) + capybara (~> 2.18.0) capybara-screenshot factory_girl_rails fluentd-ui! From 2f1820d04f8ca94404d8486e6e797c1db70b4126 Mon Sep 17 00:00:00 2001 From: Kenji Okimoto Date: Tue, 17 Apr 2018 15:59:27 +0900 Subject: [PATCH 02/31] Use ActiveJob::Base to ride on Rails Signed-off-by: Kenji Okimoto --- app/controllers/misc_controller.rb | 4 ++-- app/controllers/plugins_controller.rb | 8 ++++---- app/jobs/all_plugin_check_update_job.rb | 10 ++++++++++ app/jobs/application_job.rb | 2 ++ .../fluentd_ui_restart_job.rb} | 8 ++++---- .../fluentd_ui_update_check_job.rb} | 8 ++------ .../gem_installer_job.rb} | 9 ++++----- app/jobs/gem_uninstaller_job.rb | 14 ++++++++++++++ app/jobs/gem_update_check_job.rb | 9 +++++++++ app/workers/all_plugin_check_update.rb | 14 -------------- app/workers/gem_uninstaller.rb | 15 --------------- app/workers/gem_update_check.rb | 10 ---------- config/application.rb | 4 +++- config/initializers/fluentd_ui_update_check.rb | 2 +- config/initializers/prefetch_gem_updates.rb | 2 +- 15 files changed, 56 insertions(+), 63 deletions(-) create mode 100644 app/jobs/all_plugin_check_update_job.rb create mode 100644 app/jobs/application_job.rb rename app/{workers/fluentd_ui_restart.rb => jobs/fluentd_ui_restart_job.rb} (81%) rename app/{workers/fluentd_ui_update_check.rb => jobs/fluentd_ui_update_check_job.rb} (65%) rename app/{workers/gem_installer.rb => jobs/gem_installer_job.rb} (64%) create mode 100644 app/jobs/gem_uninstaller_job.rb create mode 100644 app/jobs/gem_update_check_job.rb delete mode 100644 app/workers/all_plugin_check_update.rb delete mode 100644 app/workers/gem_uninstaller.rb delete mode 100644 app/workers/gem_update_check.rb diff --git a/app/controllers/misc_controller.rb b/app/controllers/misc_controller.rb index 630592c..2e3b240 100644 --- a/app/controllers/misc_controller.rb +++ b/app/controllers/misc_controller.rb @@ -19,7 +19,7 @@ class MiscController < ApplicationController end def upgrading_status - if FluentdUiRestart::LOCK.present? + if FluentdUiRestartJob::LOCK.present? return render text: "updating" end @@ -73,6 +73,6 @@ class MiscController < ApplicationController end def update! - FluentdUiRestart.new.async.perform + FluentdUiRestart.perform_later end end diff --git a/app/controllers/plugins_controller.rb b/app/controllers/plugins_controller.rb index 3ceb196..f770716 100644 --- a/app/controllers/plugins_controller.rb +++ b/app/controllers/plugins_controller.rb @@ -17,27 +17,27 @@ class PluginsController < ApplicationController def install params[:plugins].each do |gem_name| - GemInstaller.new.async.perform(gem_name) + GemInstallerJob.perform_later(gem_name) end redirect_to plugins_path end def uninstall params[:plugins].each do |gem_name| - GemUninstaller.new.async.perform(gem_name) + GemUninstallerJob.perform_later(gem_name) end redirect_to plugins_path end def upgrade - GemInstaller.new.async.perform(params[:plugins][:name], params[:plugins][:version]) + GemInstallerJob.perform_later(params[:plugins][:name], params[:plugins][:version]) redirect_to plugins_path end def bulk_upgrade params[:plugins].each do |gem_name| pl = Plugin.new(gem_name: gem_name) - GemInstaller.new.async.perform(gem_name, pl.latest_version) + GemInstallerJob.perform_later(gem_name, pl.latest_version) end redirect_to plugins_path end diff --git a/app/jobs/all_plugin_check_update_job.rb b/app/jobs/all_plugin_check_update_job.rb new file mode 100644 index 0000000..5f296b4 --- /dev/null +++ b/app/jobs/all_plugin_check_update_job.rb @@ -0,0 +1,10 @@ +class AllPluginCheckUpdateJob < ApplicationJob + queue_as :default + + def perform(*args) + Plugin.installed.each do |pl| + GemUpdateCheckJob.perform_later(pl.gem_name) + end + later(3600) # will be checked every hour + end +end diff --git a/app/jobs/application_job.rb b/app/jobs/application_job.rb new file mode 100644 index 0000000..a009ace --- /dev/null +++ b/app/jobs/application_job.rb @@ -0,0 +1,2 @@ +class ApplicationJob < ActiveJob::Base +end diff --git a/app/workers/fluentd_ui_restart.rb b/app/jobs/fluentd_ui_restart_job.rb similarity index 81% rename from app/workers/fluentd_ui_restart.rb rename to app/jobs/fluentd_ui_restart_job.rb index 5b40744..f49b45b 100644 --- a/app/workers/fluentd_ui_restart.rb +++ b/app/jobs/fluentd_ui_restart_job.rb @@ -1,5 +1,5 @@ -class FluentdUiRestart - include SuckerPunch::Job +class FluentdUiRestartJob < ApplicationJob + queue_as :default LOCK = [] @@ -20,7 +20,7 @@ class FluentdUiRestart lock! # NOTE: install will be failed before released fluentd-ui gem - SuckerPunch.logger.info "[restart] install new fluentd-ui" + logger.info "[restart] install new fluentd-ui" Plugin.new(gem_name: "fluentd-ui").install! if Rails.env.production? @@ -29,7 +29,7 @@ class FluentdUiRestart cmd = %W(bundle exec rails s) end - SuckerPunch.logger.info "[restart] will restart" + logger.info "[restart] will restart" Bundler.with_clean_env do restarter = "#{Rails.root}/bin/fluentd-ui-restart" Process.spawn(*[restarter, $$.to_s, *cmd, *ARGV]) && Process.kill(:TERM, $$) diff --git a/app/workers/fluentd_ui_update_check.rb b/app/jobs/fluentd_ui_update_check_job.rb similarity index 65% rename from app/workers/fluentd_ui_update_check.rb rename to app/jobs/fluentd_ui_update_check_job.rb index cf916f0..f05ce26 100644 --- a/app/workers/fluentd_ui_update_check.rb +++ b/app/jobs/fluentd_ui_update_check_job.rb @@ -1,5 +1,5 @@ -class FluentdUiUpdateCheck - include SuckerPunch::Job +class FluentdUiUpdateCheckJob < ApplicationJob + queue_as :default def perform pl = Plugin.new(gem_name: "fluentd-ui") @@ -8,8 +8,4 @@ class FluentdUiUpdateCheck end later(3600) # will be checked every hour end - - def later(sec) - after(sec) { perform } - end end diff --git a/app/workers/gem_installer.rb b/app/jobs/gem_installer_job.rb similarity index 64% rename from app/workers/gem_installer.rb rename to app/jobs/gem_installer_job.rb index 071d64b..9be59b7 100644 --- a/app/workers/gem_installer.rb +++ b/app/jobs/gem_installer_job.rb @@ -1,6 +1,5 @@ -class GemInstaller - include SuckerPunch::Job - workers 16 +class GemInstallerJob < ApplicationJob + queue_as :default def perform(gem_name, version = nil) SuckerPunch.logger.info "install #{gem_name} #{version}" @@ -9,9 +8,9 @@ class GemInstaller # NOTE: uninstall all versions of `gem_name` then install it for upgrade/downgrade pl.uninstall! if pl.installed? pl.install! - SuckerPunch.logger.info "installed #{gem_name} #{version}" + logger.info "installed #{gem_name} #{version}" rescue Plugin::GemError - SuckerPunch.logger.warn "installing #{gem_name} #{version} is failed" + logger.warn "installing #{gem_name} #{version} is failed" end end end diff --git a/app/jobs/gem_uninstaller_job.rb b/app/jobs/gem_uninstaller_job.rb new file mode 100644 index 0000000..dc78cc4 --- /dev/null +++ b/app/jobs/gem_uninstaller_job.rb @@ -0,0 +1,14 @@ +class GemUninstallerJob < ApplicationJob + queue_as :default + + def perform(gem_name) + logger.info "uninstall #{gem_name}" + pl = Plugin.new(gem_name: gem_name) + begin + pl.uninstall! + logger.info "uninstalled #{gem_name}" + rescue Plugin::GemError + logger.warn "uninstalling #{gem_name} is failed" + end + end +end diff --git a/app/jobs/gem_update_check_job.rb b/app/jobs/gem_update_check_job.rb new file mode 100644 index 0000000..16cd53b --- /dev/null +++ b/app/jobs/gem_update_check_job.rb @@ -0,0 +1,9 @@ +class GemUpdateCheckJob < ApplicationJob + queue_as :default + + def perform(gem_name) + logger.info "check #{gem_name} latest version" + pl = Plugin.new(gem_name: gem_name) + pl.gem_versions! + end +end diff --git a/app/workers/all_plugin_check_update.rb b/app/workers/all_plugin_check_update.rb deleted file mode 100644 index f67a35b..0000000 --- a/app/workers/all_plugin_check_update.rb +++ /dev/null @@ -1,14 +0,0 @@ -class AllPluginCheckUpdate - include SuckerPunch::Job - - def perform - Plugin.installed.each do |pl| - GemUpdateCheck.new.async.perform(pl.gem_name) - end - later(3600) # will be checked every hour - end - - def later(sec) - after(sec) { perform } - end -end diff --git a/app/workers/gem_uninstaller.rb b/app/workers/gem_uninstaller.rb deleted file mode 100644 index 04eac9f..0000000 --- a/app/workers/gem_uninstaller.rb +++ /dev/null @@ -1,15 +0,0 @@ -class GemUninstaller - include SuckerPunch::Job - workers 16 - - def perform(gem_name) - SuckerPunch.logger.info "uninstall #{gem_name}" - pl = Plugin.new(gem_name: gem_name) - begin - pl.uninstall! - SuckerPunch.logger.info "uninstalled #{gem_name}" - rescue Plugin::GemError - SuckerPunch.logger.warn "uninstalling #{gem_name} is failed" - end - end -end diff --git a/app/workers/gem_update_check.rb b/app/workers/gem_update_check.rb deleted file mode 100644 index e533ce9..0000000 --- a/app/workers/gem_update_check.rb +++ /dev/null @@ -1,10 +0,0 @@ -class GemUpdateCheck - include SuckerPunch::Job - workers 16 - - def perform(gem_name) - SuckerPunch.logger.info "check #{gem_name} latest version" - pl = Plugin.new(gem_name: gem_name) - pl.gem_versions! - end -end diff --git a/config/application.rb b/config/application.rb index 56bed7b..1669951 100644 --- a/config/application.rb +++ b/config/application.rb @@ -35,7 +35,9 @@ module FluentdUi # The default locale is :en and all translations from config/locales/*.rb,yml are auto loaded. # config.i18n.load_path += Dir[Rails.root.join('my', 'locales', '*.{rb,yml}').to_s] config.i18n.default_locale = 'en' - config.autoload_paths += %W(#{config.root}/app/workers #{config.root}/lib) + config.autoload_paths += %W(#{config.root}/lib) + + config.active_job.queue_adapter = :sucker_punch # NOTE: currently, fluentd-ui does not using ActiveRecord, and using Time.now instead of Time.zone.now for each different TZ for users. # If AR will be used, please comment in and check timezone. diff --git a/config/initializers/fluentd_ui_update_check.rb b/config/initializers/fluentd_ui_update_check.rb index 820a475..224809b 100644 --- a/config/initializers/fluentd_ui_update_check.rb +++ b/config/initializers/fluentd_ui_update_check.rb @@ -1,6 +1,6 @@ unless Rails.env.test? unless FluentdUI.td_agent_ui? # td-agent-ui shouldn't auto update - FluentdUiUpdateCheck.new.async.perform + FluentdUiUpdateCheckJob.perform_later end end diff --git a/config/initializers/prefetch_gem_updates.rb b/config/initializers/prefetch_gem_updates.rb index 60d2370..ad88b87 100644 --- a/config/initializers/prefetch_gem_updates.rb +++ b/config/initializers/prefetch_gem_updates.rb @@ -1 +1 @@ -AllPluginCheckUpdate.new.async.perform +AllPluginCheckUpdateJob.perform_later From 18d5782e4ba16f5e2a7a2e1057d9a0f275b6aec4 Mon Sep 17 00:00:00 2001 From: Kenji Okimoto Date: Tue, 17 Apr 2018 16:21:16 +0900 Subject: [PATCH 03/31] Fix NoMethodError Signed-off-by: Kenji Okimoto --- app/jobs/all_plugin_check_update_job.rb | 3 ++- app/jobs/fluentd_ui_update_check_job.rb | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/app/jobs/all_plugin_check_update_job.rb b/app/jobs/all_plugin_check_update_job.rb index 5f296b4..d49613d 100644 --- a/app/jobs/all_plugin_check_update_job.rb +++ b/app/jobs/all_plugin_check_update_job.rb @@ -5,6 +5,7 @@ class AllPluginCheckUpdateJob < ApplicationJob Plugin.installed.each do |pl| GemUpdateCheckJob.perform_later(pl.gem_name) end - later(3600) # will be checked every hour + # sucker_punch adapter does not implement enqueue_at + # AllPluginCheckUpdateJob.set(wait: 1.hour).perform_later # will be checked every hour end end diff --git a/app/jobs/fluentd_ui_update_check_job.rb b/app/jobs/fluentd_ui_update_check_job.rb index f05ce26..f71662a 100644 --- a/app/jobs/fluentd_ui_update_check_job.rb +++ b/app/jobs/fluentd_ui_update_check_job.rb @@ -6,6 +6,7 @@ class FluentdUiUpdateCheckJob < ApplicationJob if pl.gem_versions FluentdUI.latest_version = pl.latest_version end - later(3600) # will be checked every hour + # sucker_punch adapter does not implement enqueue_at + # FluentdUiUpdateCheckJob.set(wait: 1.hour).perfom_later # will be checked every hour end end From 63952701e4d32944ea9e28503093684d42b98935 Mon Sep 17 00:00:00 2001 From: Kenji Okimoto Date: Tue, 17 Apr 2018 13:11:57 +0900 Subject: [PATCH 04/31] Use latest webmock to follow net/http API changes Signed-off-by: Kenji Okimoto --- Gemfile | 2 +- Gemfile.lock | 12 +++++++----- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/Gemfile b/Gemfile index f5d69d0..eb330db 100644 --- a/Gemfile +++ b/Gemfile @@ -22,7 +22,7 @@ group :test do gem "capybara", "~> 2.18.0" gem "capybara-screenshot" gem "simplecov", "~> 0.16.1", require: false - gem "webmock", "~> 1.18.0" + gem "webmock", "~> 3.3.0" gem "timecop" gem "poltergeist" end diff --git a/Gemfile.lock b/Gemfile.lock index c5fc88a..af97fc5 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -59,8 +59,8 @@ GEM minitest (~> 5.1) thread_safe (~> 0.3, >= 0.3.4) tzinfo (~> 1.1) - addressable (2.5.1) - public_suffix (~> 2.0, >= 2.0.2) + addressable (2.5.2) + public_suffix (>= 2.0.2, < 4.0) arel (6.0.4) better_errors (2.1.1) coderay (>= 1.0.0) @@ -142,6 +142,7 @@ GEM haml (>= 4.0.6, < 6.0) html2haml (>= 1.0.1) railties (>= 4.0.1) + hashdiff (0.3.7) hike (1.2.3) hitimes (1.2.6) html2haml (2.2.0) @@ -209,7 +210,7 @@ GEM slop (~> 3.4) pry-rails (0.3.6) pry (>= 0.10.4) - public_suffix (2.0.5) + public_suffix (3.0.2) puma (3.11.4) rack (1.6.9) rack-test (0.6.3) @@ -308,9 +309,10 @@ GEM binding_of_caller (>= 0.7.2) railties (>= 4.0) sprockets-rails (>= 2.0, < 4.0) - webmock (1.18.0) + webmock (3.3.0) addressable (>= 2.3.6) crack (>= 0.3.2) + hashdiff webrobots (0.1.2) websocket-driver (0.6.5) websocket-extensions (>= 0.1.0) @@ -337,7 +339,7 @@ DEPENDENCIES simplecov (~> 0.16.1) timecop web-console (~> 2.0) - webmock (~> 1.18.0) + webmock (~> 3.3.0) BUNDLED WITH 1.16.1 From de1078e6184f5ef4de4a051417271aed2309f808 Mon Sep 17 00:00:00 2001 From: Kenji Okimoto Date: Wed, 18 Apr 2018 16:39:31 +0900 Subject: [PATCH 05/31] Update to Rails 5.0.7 Signed-off-by: Kenji Okimoto --- Gemfile | 6 +- Gemfile.lock | 212 +++++++++++++++++++++------------------------ fluentd-ui.gemspec | 6 +- 3 files changed, 106 insertions(+), 118 deletions(-) diff --git a/Gemfile b/Gemfile index eb330db..5318124 100644 --- a/Gemfile +++ b/Gemfile @@ -12,13 +12,13 @@ group :development, :test do end group :development do - gem 'i18n_generators', '1.2.1' + gem 'i18n_generators', '2.1.1' gem 'better_errors' - gem 'web-console', '~> 2.0' + gem 'web-console', '~> 3.6' end group :test do - gem "factory_girl_rails" + gem "factory_bot_rails" gem "capybara", "~> 2.18.0" gem "capybara-screenshot" gem "simplecov", "~> 0.16.1", require: false diff --git a/Gemfile.lock b/Gemfile.lock index af97fc5..0cf9f0b 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -5,7 +5,7 @@ PATH addressable bundler diff-lcs - draper (~> 2.1) + draper (~> 3.0) fluentd (>= 0.10.56, < 0.14) font-awesome-rails haml-rails (~> 1.0) @@ -15,9 +15,9 @@ PATH kramdown (> 1.0.0) kramdown-haml puma - rails (~> 4.2.0) + rails (~> 5.0.0) rubyzip (~> 1.1) - sass-rails (~> 4.0.3) + sass-rails (~> 5.0.7) settingslogic sucker_punch (~> 1.6.0) thor @@ -25,49 +25,55 @@ PATH GEM remote: https://rubygems.org/ specs: - actionmailer (4.2.10) - actionpack (= 4.2.10) - actionview (= 4.2.10) - activejob (= 4.2.10) + actioncable (5.0.7) + actionpack (= 5.0.7) + nio4r (>= 1.2, < 3.0) + websocket-driver (~> 0.6.1) + actionmailer (5.0.7) + actionpack (= 5.0.7) + actionview (= 5.0.7) + activejob (= 5.0.7) mail (~> 2.5, >= 2.5.4) - rails-dom-testing (~> 1.0, >= 1.0.5) - actionpack (4.2.10) - actionview (= 4.2.10) - activesupport (= 4.2.10) - rack (~> 1.6) - rack-test (~> 0.6.2) - rails-dom-testing (~> 1.0, >= 1.0.5) + rails-dom-testing (~> 2.0) + actionpack (5.0.7) + actionview (= 5.0.7) + activesupport (= 5.0.7) + rack (~> 2.0) + rack-test (~> 0.6.3) + rails-dom-testing (~> 2.0) rails-html-sanitizer (~> 1.0, >= 1.0.2) - actionview (4.2.10) - activesupport (= 4.2.10) + actionview (5.0.7) + activesupport (= 5.0.7) 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.3) - activejob (4.2.10) - activesupport (= 4.2.10) - globalid (>= 0.3.0) - activemodel (4.2.10) - activesupport (= 4.2.10) + activejob (5.0.7) + activesupport (= 5.0.7) + globalid (>= 0.3.6) + activemodel (5.0.7) + activesupport (= 5.0.7) + activemodel-serializers-xml (1.0.2) + activemodel (> 5.x) + activesupport (> 5.x) builder (~> 3.1) - activerecord (4.2.10) - activemodel (= 4.2.10) - activesupport (= 4.2.10) - arel (~> 6.0) - activesupport (4.2.10) - i18n (~> 0.7) + activerecord (5.0.7) + activemodel (= 5.0.7) + activesupport (= 5.0.7) + arel (~> 7.0) + activesupport (5.0.7) + concurrent-ruby (~> 1.0, >= 1.0.2) + i18n (>= 0.7, < 2) minitest (~> 5.1) - thread_safe (~> 0.3, >= 0.3.4) tzinfo (~> 1.1) addressable (2.5.2) public_suffix (>= 2.0.2, < 4.0) - arel (6.0.4) + arel (7.1.4) better_errors (2.1.1) coderay (>= 1.0.0) erubis (>= 2.6.6) rack (>= 0.9.0) - binding_of_caller (0.7.2) - debug_inspector (>= 0.0.1) + bindex (0.5.0) builder (3.2.3) capybara (2.18.0) addressable @@ -103,22 +109,21 @@ GEM crack (0.4.3) safe_yaml (~> 1.0.0) crass (1.0.4) - debug_inspector (0.0.2) diff-lcs (1.3) docile (1.3.0) - domain_name (0.5.20170404) - unf (>= 0.0.5, < 1.0.0) - draper (2.1.0) - actionpack (>= 3.0) - activemodel (>= 3.0) - activesupport (>= 3.0) + draper (3.0.1) + actionpack (~> 5.0) + activemodel (~> 5.0) + activemodel-serializers-xml (~> 1.0) + activesupport (~> 5.0) request_store (~> 1.0) erubis (2.7.0) - factory_girl (4.8.0) + factory_bot (4.8.2) activesupport (>= 3.0.0) - factory_girl_rails (4.8.0) - factory_girl (~> 4.8.0) + factory_bot_rails (4.8.2) + factory_bot (~> 4.8.2) railties (>= 3.0.0) + ffi (1.9.23) fluentd (0.12.43) cool.io (>= 1.2.2, < 2.0.0) http_parser.rb (>= 0.5.1, < 0.7.0) @@ -143,21 +148,17 @@ GEM html2haml (>= 1.0.1) railties (>= 4.0.1) hashdiff (0.3.7) - hike (1.2.3) hitimes (1.2.6) html2haml (2.2.0) erubis (~> 2.7.0) haml (>= 4.0, < 6) nokogiri (>= 1.6.0) ruby_parser (~> 3.5) - http-cookie (1.0.3) - domain_name (~> 0.5) http_parser.rb (0.6.0) httpclient (2.8.3) - i18n (0.9.5) + i18n (1.0.1) concurrent-ruby (~> 1.0) - i18n_generators (1.2.1) - mechanize + i18n_generators (2.1.1) rails (>= 3.0.0) jbuilder (2.7.0) activesupport (>= 4.2.0) @@ -177,29 +178,15 @@ GEM nokogiri (>= 1.5.9) mail (2.7.0) mini_mime (>= 0.1.1) - mechanize (2.7.5) - domain_name (~> 0.5, >= 0.5.1) - http-cookie (~> 1.0) - mime-types (>= 1.17.2) - net-http-digest_auth (~> 1.1, >= 1.1.1) - net-http-persistent (~> 2.5, >= 2.5.2) - nokogiri (~> 1.6) - ntlm-http (~> 0.1, >= 0.1.1) - webrobots (>= 0.0.9, < 0.2) method_source (0.8.2) - mime-types (3.1) - mime-types-data (~> 3.2015) - mime-types-data (3.2016.0521) mini_mime (1.0.0) mini_portile2 (2.3.0) minitest (5.11.3) msgpack (1.2.4) multi_json (1.13.1) - net-http-digest_auth (1.4.1) - net-http-persistent (2.9.4) + nio4r (2.3.0) nokogiri (1.8.2) mini_portile2 (~> 2.3.0) - ntlm-http (0.1.1) poltergeist (1.14.0) capybara (~> 2.1) cliver (~> 0.3.1) @@ -212,34 +199,36 @@ GEM pry (>= 0.10.4) public_suffix (3.0.2) puma (3.11.4) - rack (1.6.9) + rack (2.0.4) rack-test (0.6.3) rack (>= 1.0) - rails (4.2.10) - actionmailer (= 4.2.10) - actionpack (= 4.2.10) - actionview (= 4.2.10) - activejob (= 4.2.10) - activemodel (= 4.2.10) - activerecord (= 4.2.10) - activesupport (= 4.2.10) - bundler (>= 1.3.0, < 2.0) - railties (= 4.2.10) - sprockets-rails - rails-deprecated_sanitizer (1.0.3) - activesupport (>= 4.2.0.alpha) - rails-dom-testing (1.0.9) - activesupport (>= 4.2.0, < 5.0) - nokogiri (~> 1.6) - rails-deprecated_sanitizer (>= 1.0.1) + rails (5.0.7) + actioncable (= 5.0.7) + actionmailer (= 5.0.7) + actionpack (= 5.0.7) + actionview (= 5.0.7) + activejob (= 5.0.7) + activemodel (= 5.0.7) + activerecord (= 5.0.7) + activesupport (= 5.0.7) + bundler (>= 1.3.0) + railties (= 5.0.7) + sprockets-rails (>= 2.0.0) + rails-dom-testing (2.0.3) + activesupport (>= 4.2.0) + nokogiri (>= 1.6) rails-html-sanitizer (1.0.4) loofah (~> 2.2, >= 2.2.2) - railties (4.2.10) - actionpack (= 4.2.10) - activesupport (= 4.2.10) + railties (5.0.7) + actionpack (= 5.0.7) + activesupport (= 5.0.7) + method_source rake (>= 0.8.7) thor (>= 0.18.1, < 2.0) rake (12.3.1) + rb-fsevent (0.10.3) + rb-inotify (0.9.10) + ffi (>= 0.5.0, < 2) request_store (1.4.1) rack (>= 1.4) rspec-core (3.5.4) @@ -263,12 +252,17 @@ GEM sexp_processor (~> 4.9) rubyzip (1.2.1) safe_yaml (1.0.4) - sass (3.2.19) - sass-rails (4.0.5) - railties (>= 4.0.0, < 5.0) - sass (~> 3.2.2) - sprockets (~> 2.8, < 3.0) - sprockets-rails (~> 2.0) + sass (3.5.6) + sass-listen (~> 4.0.0) + 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 (~> 3.1) + sprockets (>= 2.8, < 4.0) + sprockets-rails (>= 2.0, < 4.0) + tilt (>= 1.1, < 3) settingslogic (2.0.9) sexp_processor (4.11.0) sigdump (0.2.4) @@ -278,22 +272,20 @@ GEM simplecov-html (~> 0.10.0) simplecov-html (0.10.2) slop (3.6.0) - sprockets (2.12.4) - hike (~> 1.2) - multi_json (~> 1.0) - rack (~> 1.0) - tilt (~> 1.1, != 1.3.0) - sprockets-rails (2.3.3) - actionpack (>= 3.0) - activesupport (>= 3.0) - sprockets (>= 2.8, < 4.0) + sprockets (3.7.1) + concurrent-ruby (~> 1.0) + rack (> 1, < 3) + sprockets-rails (3.2.1) + actionpack (>= 4.0) + activesupport (>= 4.0) + sprockets (>= 3.0.0) string-scrub (0.0.5) sucker_punch (1.6.0) celluloid (~> 0.17.2) temple (0.8.0) thor (0.20.0) thread_safe (0.3.6) - tilt (1.4.1) + tilt (2.0.8) timecop (0.8.1) timers (4.1.2) hitimes @@ -301,19 +293,15 @@ GEM thread_safe (~> 0.1) tzinfo-data (1.2018.4) tzinfo (>= 1.0.0) - unf (0.1.4) - unf_ext - unf_ext (0.0.7.4) - web-console (2.3.0) - activemodel (>= 4.0) - binding_of_caller (>= 0.7.2) - railties (>= 4.0) - sprockets-rails (>= 2.0, < 4.0) + web-console (3.6.0) + actionview (>= 5.0) + activemodel (>= 5.0) + bindex (>= 0.4.0) + railties (>= 5.0) webmock (3.3.0) addressable (>= 2.3.6) crack (>= 0.3.2) hashdiff - webrobots (0.1.2) websocket-driver (0.6.5) websocket-extensions (>= 0.1.0) websocket-extensions (0.1.2) @@ -328,9 +316,9 @@ DEPENDENCIES better_errors capybara (~> 2.18.0) capybara-screenshot - factory_girl_rails + factory_bot_rails fluentd-ui! - i18n_generators (= 1.2.1) + i18n_generators (= 2.1.1) poltergeist pry pry-rails @@ -338,7 +326,7 @@ DEPENDENCIES rspec-rails (~> 3.0) simplecov (~> 0.16.1) timecop - web-console (~> 2.0) + web-console (~> 3.6) webmock (~> 3.3.0) BUNDLED WITH diff --git a/fluentd-ui.gemspec b/fluentd-ui.gemspec index 1b7cf87..8457e7a 100644 --- a/fluentd-ui.gemspec +++ b/fluentd-ui.gemspec @@ -25,15 +25,15 @@ Gem::Specification.new do |spec| spec.require_paths = ["lib"] spec.add_dependency "fluentd", [">= 0.10.56", "< 0.14"] - spec.add_dependency 'rails', '~> 4.2.0' + spec.add_dependency 'rails', '~> 5.0.0' spec.add_dependency 'sucker_punch', "~> 1.6.0" spec.add_dependency 'addressable' spec.add_dependency "font-awesome-rails" - spec.add_dependency 'sass-rails', '~> 4.0.3' + spec.add_dependency 'sass-rails', '~> 5.0.7' spec.add_dependency "haml-rails", "~> 1.0" spec.add_dependency 'jquery-rails', "~> 4.3.1" spec.add_dependency 'jbuilder', '~> 2.0' - spec.add_dependency "draper", '~> 2.1' + spec.add_dependency "draper", '~> 3.0' spec.add_dependency "bundler" spec.add_dependency "httpclient", "~> 2.5" # same as td-agent spec.add_dependency "settingslogic" From 0afc17c00aad69c899328b71f7f97aacc8b7201d Mon Sep 17 00:00:00 2001 From: Kenji Okimoto Date: Wed, 18 Apr 2018 16:45:25 +0900 Subject: [PATCH 06/31] Follow changes in previous commit FactoryGirl -> FactoryBot Signed-off-by: Kenji Okimoto --- spec/factories/fluentd.rb | 2 +- spec/factories/plugins.rb | 4 ++-- spec/factories/user.rb | 2 +- spec/spec_helper.rb | 4 ++-- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/spec/factories/fluentd.rb b/spec/factories/fluentd.rb index ceccc65..aff33b9 100644 --- a/spec/factories/fluentd.rb +++ b/spec/factories/fluentd.rb @@ -1,4 +1,4 @@ -FactoryGirl.define do +FactoryBot.define do factory :fluentd do dir = Rails.root.join("tmp/fluentd-test").to_s FileUtils.mkdir_p(dir) diff --git a/spec/factories/plugins.rb b/spec/factories/plugins.rb index 94e9cb5..010699b 100644 --- a/spec/factories/plugins.rb +++ b/spec/factories/plugins.rb @@ -1,6 +1,6 @@ -# Read about factories at https://github.com/thoughtbot/factory_girl +# Read about factories at https://github.com/thoughtbot/factory_bot -FactoryGirl.define do +FactoryBot.define do factory :plugin do gem_name "fluent-plugin-dummy" version "1.2.3" diff --git a/spec/factories/user.rb b/spec/factories/user.rb index d691850..e5f5e63 100644 --- a/spec/factories/user.rb +++ b/spec/factories/user.rb @@ -1,4 +1,4 @@ -FactoryGirl.define do +FactoryBot.define do factory :user do name "admin" password "changeme" diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index 7364240..a57ff68 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -27,8 +27,8 @@ RSpec.configure do |config| # config.mock_with :flexmock # config.mock_with :rr - # Syntax sugar to use the FactoryGirl methods directly instead FactoryGirl.create ete. - config.include FactoryGirl::Syntax::Methods + # Syntax sugar to use the FactoryBot methods directly instead FactoryBot.create ete. + config.include FactoryBot::Syntax::Methods config.include LoginMacro config.include JavascriptMacro config.include StubDaemon From 5f9bb9f8fb16e3acffc364ec655bd2e8857875a3 Mon Sep 17 00:00:00 2001 From: Kenji Okimoto Date: Wed, 18 Apr 2018 16:51:47 +0900 Subject: [PATCH 07/31] Regenerate config/locales/ja.yml But I removed ActiveRecord related entries because we don't use ActiveRecord. Signed-off-by: Kenji Okimoto --- config/locales/ja.yml | 118 ++++++++++++++++++++++-------------------- 1 file changed, 61 insertions(+), 57 deletions(-) diff --git a/config/locales/ja.yml b/config/locales/ja.yml index f86780d..a6ebaf8 100644 --- a/config/locales/ja.yml +++ b/config/locales/ja.yml @@ -1,3 +1,4 @@ +--- ja: date: abbr_day_names: @@ -31,9 +32,9 @@ ja: - 金曜日 - 土曜日 formats: - default: ! '%Y/%m/%d' - long: ! '%Y年%m月%d日(%a)' - short: ! '%m/%d' + default: "%Y/%m/%d" + long: "%Y年%m月%d日(%a)" + short: "%m/%d" month_names: - - 1月 @@ -65,29 +66,32 @@ ja: other: 約%{count}年 almost_x_years: one: 1年弱 - other: ! '%{count}年弱' + other: "%{count}年弱" half_a_minute: 30秒前後 less_than_x_minutes: one: 1分以内 - other: ! '%{count}分未満' + other: "%{count}分未満" less_than_x_seconds: one: 1秒以内 - other: ! '%{count}秒未満' + other: "%{count}秒未満" over_x_years: one: 1年以上 - other: ! '%{count}年以上' + other: "%{count}年以上" x_days: one: 1日 - other: ! '%{count}日' + other: "%{count}日" x_minutes: one: 1分 - other: ! '%{count}分' + other: "%{count}分" x_months: one: 1ヶ月 - other: ! '%{count}ヶ月' + other: "%{count}ヶ月" + x_years: + one: 1年 + other: "%{count}年" x_seconds: one: 1秒 - other: ! '%{count}秒' + other: "%{count}秒" prompts: day: 日 hour: 時 @@ -96,40 +100,40 @@ ja: second: 秒 year: 年 errors: - format: ! '%{attribute}%{message}' + format: "%{attribute}%{message}" messages: - accepted: を受諾してください。 - blank: を入力してください。 - present: は入力しないでください。 - confirmation: と%{attribute}の入力が一致しません。 - empty: を入力してください。 - equal_to: は%{count}にしてください。 - even: は偶数にしてください。 - exclusion: は予約されています。 - greater_than: は%{count}より大きい値にしてください。 - greater_than_or_equal_to: は%{count}以上の値にしてください。 - inclusion: は一覧にありません。 - invalid: は不正な値です。 - less_than: は%{count}より小さい値にしてください。 - less_than_or_equal_to: は%{count}以下の値にしてください。 - not_a_number: は数値で入力してください。 - not_an_integer: は整数で入力してください。 - odd: は奇数にしてください。 - record_invalid: バリデーションに失敗しました。 %{errors} - restrict_dependent_destroy: ! '%{record}が存在しているので削除できません。' - taken: はすでに存在します。 - too_long: は%{count}文字以内で入力してください。 - too_short: は%{count}文字以上で入力してください。 - wrong_length: は%{count}文字で入力してください。 - other_than: "は%{count}以外の値にしてください。" + accepted: を受諾してください + blank: を入力してください + present: は入力しないでください + confirmation: と%{attribute}の入力が一致しません + empty: を入力してください + equal_to: は%{count}にしてください + even: は偶数にしてください + exclusion: は予約されています + greater_than: は%{count}より大きい値にしてください + greater_than_or_equal_to: は%{count}以上の値にしてください + inclusion: は一覧にありません + invalid: は不正な値です + less_than: は%{count}より小さい値にしてください + less_than_or_equal_to: は%{count}以下の値にしてください + model_invalid: "バリデーションに失敗しました: %{errors}" + not_a_number: は数値で入力してください + not_an_integer: は整数で入力してください + odd: は奇数にしてください + required: を入力してください + taken: はすでに存在します + too_long: は%{count}文字以内で入力してください + too_short: は%{count}文字以上で入力してください + wrong_length: は%{count}文字で入力してください + other_than: は%{count}以外の値にしてください template: - body: 次の項目を確認してください。 + body: 次の項目を確認してください header: - one: ! '%{model}にエラーが発生しました。' - other: ! '%{model}に%{count}個のエラーが発生しました。' + one: "%{model}にエラーが発生しました" + other: "%{model}に%{count}個のエラーが発生しました" helpers: select: - prompt: 選択してください。 + prompt: 選択してください submit: create: 登録する submit: 保存する @@ -137,22 +141,22 @@ ja: number: currency: format: - delimiter: ! ',' - format: ! '%n%u' + delimiter: "," + format: "%n%u" precision: 0 - separator: . + separator: "." significant: false strip_insignificant_zeros: false unit: 円 format: - delimiter: ! ',' + delimiter: "," precision: 3 - separator: . + separator: "." significant: false strip_insignificant_zeros: false human: decimal_units: - format: ! '%n %u' + format: "%n %u" units: billion: 十億 million: 百万 @@ -166,13 +170,13 @@ ja: significant: true strip_insignificant_zeros: true storage_units: - format: ! '%n%u' + format: "%n%u" units: byte: バイト - gb: ギガバイト - kb: キロバイト - mb: メガバイト - tb: テラバイト + gb: GB + kb: KB + mb: MB + tb: TB percentage: format: delimiter: '' @@ -182,13 +186,13 @@ ja: delimiter: '' support: array: - last_word_connector: と - two_words_connector: と - words_connector: と + last_word_connector: 、 + two_words_connector: 、 + words_connector: 、 time: am: 午前 formats: - default: ! '%Y/%m/%d %H:%M:%S' - long: ! '%Y年%m月%d日(%a) %H時%M分%S秒 %z' - short: ! '%y/%m/%d %H:%M' + default: "%Y/%m/%d %H:%M:%S" + long: "%Y年%m月%d日(%a) %H時%M分%S秒 %z" + short: "%y/%m/%d %H:%M" pm: 午後 From 6c22e1b5c2f0162ffe4adbc2e20e9520b847e6a8 Mon Sep 17 00:00:00 2001 From: Kenji Okimoto Date: Wed, 18 Apr 2018 16:59:54 +0900 Subject: [PATCH 08/31] Fix deprecation warnings > DEPRECATION WARNING: ActiveModel::Errors#get is deprecated and will be > removed in Rails 5.1. To achieve the same use > model.errors[:config_file]. Signed-off-by: Kenji Okimoto --- spec/models/fluentd_spec.rb | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/spec/models/fluentd_spec.rb b/spec/models/fluentd_spec.rb index 8581d2a..b23f238 100644 --- a/spec/models/fluentd_spec.rb +++ b/spec/models/fluentd_spec.rb @@ -21,19 +21,19 @@ describe Fluentd do context "not writable" do before { FileUtils.chmod(0400, path) } it { should_not be_blank } - it { subject.get(column).should include(I18n.t('activerecord.errors.messages.lack_write_permission')) } + it { subject[column].should include(I18n.t('activerecord.errors.messages.lack_write_permission')) } end context "not readable" do before { FileUtils.chmod(0200, path) } it { should_not be_blank } - it { subject.get(column).should include(I18n.t('activerecord.errors.messages.lack_read_permission')) } + it { subject[column].should include(I18n.t('activerecord.errors.messages.lack_read_permission')) } end context "is directory" do before { fluentd.send("#{column}=", Rails.root + "tmp") } it { should_not be_blank } - it { subject.get(column).should include(I18n.t('activerecord.errors.messages.is_a_directory')) } + it { subject[column].should include(I18n.t('activerecord.errors.messages.is_a_directory')) } end end @@ -50,7 +50,7 @@ describe Fluentd do context "not writable" do before { FileUtils.chmod(0500, dir) } it { should_not be_blank } - it { subject.get(column).should include(I18n.t('activerecord.errors.messages.lack_write_permission')) } + it { subject[column].should include(I18n.t('activerecord.errors.messages.lack_write_permission')) } end end end From 1fb7252a3b6d898706858ff22ffb029ff2353df4 Mon Sep 17 00:00:00 2001 From: Kenji Okimoto Date: Wed, 18 Apr 2018 17:01:40 +0900 Subject: [PATCH 09/31] Suppress deprecation warning > DEPRECATION WARNING: `config.static_cache_control` is deprecated and > will be removed in Rails 5.1. Please use > `config.public_file_server.headers = { 'Cache-Control' => 'public, > max-age=3600' }` instead. Signed-off-by: Kenji Okimoto --- config/environments/test.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/environments/test.rb b/config/environments/test.rb index 10db31f..81bba17 100644 --- a/config/environments/test.rb +++ b/config/environments/test.rb @@ -14,7 +14,7 @@ Rails.application.configure do # Configure static file server for tests with Cache-Control for performance. config.serve_static_files = true - config.static_cache_control = 'public, max-age=3600' + config.public_file_server_headers = { 'Cache-Control' => 'public, max-age=3600' } # Show full error reports and disable caching. config.consider_all_requests_local = true From 1958aa7747bbc9739e4d36f438203f633306cdb9 Mon Sep 17 00:00:00 2001 From: Kenji Okimoto Date: Wed, 18 Apr 2018 17:03:33 +0900 Subject: [PATCH 10/31] Suppress deprecation warning > DEPRECATION WARNING: `config.serve_static_files` is deprecated and > will be removed in Rails 5.1. Please use > `config.public_file_server.enabled = true` instead. Signed-off-by: Kenji Okimoto --- config/environments/test.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/environments/test.rb b/config/environments/test.rb index 81bba17..db7d559 100644 --- a/config/environments/test.rb +++ b/config/environments/test.rb @@ -13,7 +13,7 @@ Rails.application.configure do config.eager_load = false # Configure static file server for tests with Cache-Control for performance. - config.serve_static_files = true + config.public_file_server.enabled = true config.public_file_server_headers = { 'Cache-Control' => 'public, max-age=3600' } # Show full error reports and disable caching. From 4fb68236694ed2f52eb65b0cde0a1c15a3ae3f66 Mon Sep 17 00:00:00 2001 From: Kenji Okimoto Date: Wed, 18 Apr 2018 17:12:22 +0900 Subject: [PATCH 11/31] Set available locales to avoid errors > I18n::InvalidLocale: "ja" is not a valid locale Signed-off-by: Kenji Okimoto --- config/application.rb | 1 + 1 file changed, 1 insertion(+) diff --git a/config/application.rb b/config/application.rb index 1669951..aa8df9b 100644 --- a/config/application.rb +++ b/config/application.rb @@ -35,6 +35,7 @@ module FluentdUi # The default locale is :en and all translations from config/locales/*.rb,yml are auto loaded. # config.i18n.load_path += Dir[Rails.root.join('my', 'locales', '*.{rb,yml}').to_s] config.i18n.default_locale = 'en' + config.i18n.available_locales = %i(en ja) config.autoload_paths += %W(#{config.root}/lib) config.active_job.queue_adapter = :sucker_punch From fe4dd681b66f9f50ff1d9e6bbe28346f4e521241 Mon Sep 17 00:00:00 2001 From: Kenji Okimoto Date: Thu, 19 Apr 2018 08:47:07 +0900 Subject: [PATCH 12/31] Fix render option to suppress deprecation warning > DEPRECATION WARNING: `render :text` is deprecated because it does not > actually render a `text/plain` response. Switch to `render plain: > 'plain text'` to render as `text/plain`, `render html: > 'HTML'` to render as `text/html`, or `render body: > 'raw'` to match the deprecated behavior and render with the default > Content-Type, which is `text/html`. Signed-off-by: Kenji Okimoto --- spec/controllers/application_controller_spec.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spec/controllers/application_controller_spec.rb b/spec/controllers/application_controller_spec.rb index 236ec8e..d06fa74 100644 --- a/spec/controllers/application_controller_spec.rb +++ b/spec/controllers/application_controller_spec.rb @@ -6,7 +6,7 @@ describe DummyController do controller DummyController do skip_before_action :login_required def index - render :text => "Hello World" + render plain: "Hello World" end end From 8468beb39c514502e2fa24b476633147836e3c88 Mon Sep 17 00:00:00 2001 From: Kenji Okimoto Date: Thu, 19 Apr 2018 08:54:13 +0900 Subject: [PATCH 13/31] Use new keyword style to suppress deprecation warnings > DEPRECATION WARNING: Using positional arguments in functional tests has been deprecated, > in favor of keyword arguments, and will be removed in Rails 5.1. > > Deprecated style: > get :show, { id: 1 }, nil, { notice: "This is a flash message" } > > New keyword style: > get :show, params: { id: 1 }, flash: { notice: "This is a flash message" }, > session: nil # Can safely be omitted. > DEPRECATION WARNING: Using positional arguments in functional tests has been deprecated, > in favor of keyword arguments, and will be removed in Rails 5.1. > > Deprecated style: > get :show, { id: 1 }, nil, { notice: "This is a flash message" } > > New keyword style: > get :show, params: { id: 1 }, flash: { notice: "This is a flash message" }, > session: nil # Can safely be omitted. Signed-off-by: Kenji Okimoto --- spec/controllers/application_controller_spec.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spec/controllers/application_controller_spec.rb b/spec/controllers/application_controller_spec.rb index d06fa74..5de8b17 100644 --- a/spec/controllers/application_controller_spec.rb +++ b/spec/controllers/application_controller_spec.rb @@ -23,7 +23,7 @@ describe DummyController do context 'with params[:lang]' do before do - get 'index', lang: param_lang + get 'index', params: { lang: param_lang } end context 'and in available_locales' do From 56452b211b4521bb86470229c9d74d34ac1174e6 Mon Sep 17 00:00:00 2001 From: Kenji Okimoto Date: Thu, 19 Apr 2018 08:55:12 +0900 Subject: [PATCH 14/31] Remove unnecessary stubs Signed-off-by: Kenji Okimoto --- spec/controllers/application_controller_spec.rb | 4 ---- 1 file changed, 4 deletions(-) diff --git a/spec/controllers/application_controller_spec.rb b/spec/controllers/application_controller_spec.rb index 5de8b17..75a4daf 100644 --- a/spec/controllers/application_controller_spec.rb +++ b/spec/controllers/application_controller_spec.rb @@ -12,12 +12,8 @@ describe DummyController do describe '#set_locale' do let!(:default_locale) { :en } - let!(:available_locales) { [:en, :ja] } before do - I18n.stub(:default_locale).and_return(default_locale) - I18n.stub(:available_locales).and_return(available_locales) - I18n.locale = I18n.default_locale #initialize end From 79777eed9e7b28de288f8e15acf32d06d53aed59 Mon Sep 17 00:00:00 2001 From: Kenji Okimoto Date: Thu, 19 Apr 2018 09:15:59 +0900 Subject: [PATCH 15/31] Use redirect_back to suppress deprecation warning > DEPRECATION WARNING: `redirect_to :back` is deprecated and will be > removed from Rails 5.1. Please use `redirect_back(fallback_location: > fallback_location)` where `fallback_location` represents the location > to use if the request has no HTTP referer information. Signed-off-by: Kenji Okimoto --- app/controllers/concerns/setting_history_concern.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/concerns/setting_history_concern.rb b/app/controllers/concerns/setting_history_concern.rb index 12accf3..72c43af 100644 --- a/app/controllers/concerns/setting_history_concern.rb +++ b/app/controllers/concerns/setting_history_concern.rb @@ -28,7 +28,7 @@ module SettingHistoryConcern else flash = { danger: @fluentd.agent.log.tail(1).first } end - redirect_to :back, flash: flash + redirect_back fallback_location: root_url, flash: flash end end From d02e1bac389d1387f49e9b30933ba420d1aab084 Mon Sep 17 00:00:00 2001 From: Kenji Okimoto Date: Thu, 19 Apr 2018 09:42:29 +0900 Subject: [PATCH 16/31] Use headless chrome Update following gems: * capybara to 3.0.2 * capybara-screenshot to 1.0.19 * remove poltergeist * add selenium-webdriver Signed-off-by: Kenji Okimoto --- Gemfile | 4 ++-- Gemfile.lock | 28 ++++++++++++++-------------- spec/spec_helper.rb | 14 ++++++++++++-- 3 files changed, 28 insertions(+), 18 deletions(-) diff --git a/Gemfile b/Gemfile index 5318124..1c060a1 100644 --- a/Gemfile +++ b/Gemfile @@ -19,10 +19,10 @@ end group :test do gem "factory_bot_rails" - gem "capybara", "~> 2.18.0" + gem "capybara", "~> 3.0.2" gem "capybara-screenshot" gem "simplecov", "~> 0.16.1", require: false gem "webmock", "~> 3.3.0" gem "timecop" - gem "poltergeist" + gem "selenium-webdriver", "~> 3.11" end diff --git a/Gemfile.lock b/Gemfile.lock index 0cf9f0b..c25f898 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -75,15 +75,15 @@ GEM rack (>= 0.9.0) bindex (0.5.0) builder (3.2.3) - capybara (2.18.0) + capybara (3.0.2) addressable mini_mime (>= 0.1.3) - nokogiri (>= 1.3.3) - rack (>= 1.0.0) - rack-test (>= 0.5.4) - xpath (>= 2.0, < 4.0) - capybara-screenshot (1.0.14) - capybara (>= 1.0, < 3) + nokogiri (~> 1.8) + rack (>= 1.6.0) + rack-test (>= 0.6.3) + xpath (~> 3.0) + capybara-screenshot (1.0.19) + capybara (>= 1.0, < 4) launchy celluloid (0.17.3) celluloid-essentials @@ -102,7 +102,8 @@ GEM timers (>= 4.1.1) celluloid-supervision (0.20.6) timers (>= 4.1.1) - cliver (0.3.2) + childprocess (0.9.0) + ffi (~> 1.0, >= 1.0.11) coderay (1.1.1) concurrent-ruby (1.0.5) cool.io (1.5.3) @@ -187,10 +188,6 @@ GEM nio4r (2.3.0) nokogiri (1.8.2) mini_portile2 (~> 2.3.0) - poltergeist (1.14.0) - capybara (~> 2.1) - cliver (~> 0.3.1) - websocket-driver (>= 0.2.0) pry (0.10.4) coderay (~> 1.1.0) method_source (~> 0.8.1) @@ -263,6 +260,9 @@ GEM sprockets (>= 2.8, < 4.0) sprockets-rails (>= 2.0, < 4.0) tilt (>= 1.1, < 3) + selenium-webdriver (3.11.0) + childprocess (~> 0.5) + rubyzip (~> 1.2) settingslogic (2.0.9) sexp_processor (4.11.0) sigdump (0.2.4) @@ -314,16 +314,16 @@ PLATFORMS DEPENDENCIES better_errors - capybara (~> 2.18.0) + capybara (~> 3.0.2) capybara-screenshot factory_bot_rails fluentd-ui! i18n_generators (= 2.1.1) - poltergeist pry pry-rails rake rspec-rails (~> 3.0) + selenium-webdriver (~> 3.11) simplecov (~> 0.16.1) timecop web-console (~> 3.6) diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index a57ff68..fc2b2a7 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -9,8 +9,18 @@ require File.expand_path("../../config/environment", __FILE__) require 'rspec/rails' require 'webmock/rspec' WebMock.disable_net_connect!(allow_localhost: true) -require 'capybara/poltergeist' -Capybara.javascript_driver = :poltergeist +require 'capybara/rspec' +Capybara.register_driver :selenium do |app| + Capybara::Selenium::Driver.new(app, + browser: :chrome, + desired_capabilities: Selenium::WebDriver::Remote::Capabilities.chrome( + chrome_options: { + args: %w(headless disable-gpu window-size=1920,1080), + }, + ) + ) +end +Capybara.javascript_driver = :selenium require 'capybara-screenshot/rspec' # Requires supporting ruby files with custom matchers and macros, etc, From c4d7698b204e9c091cba7749daeb3b1d30a6fafb Mon Sep 17 00:00:00 2001 From: Kenji Okimoto Date: Thu, 19 Apr 2018 10:12:31 +0900 Subject: [PATCH 17/31] Enable periodical job Signed-off-by: Kenji Okimoto --- app/jobs/all_plugin_check_update_job.rb | 3 +-- app/jobs/fluentd_ui_update_check_job.rb | 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/app/jobs/all_plugin_check_update_job.rb b/app/jobs/all_plugin_check_update_job.rb index d49613d..d37ba1a 100644 --- a/app/jobs/all_plugin_check_update_job.rb +++ b/app/jobs/all_plugin_check_update_job.rb @@ -5,7 +5,6 @@ class AllPluginCheckUpdateJob < ApplicationJob Plugin.installed.each do |pl| GemUpdateCheckJob.perform_later(pl.gem_name) end - # sucker_punch adapter does not implement enqueue_at - # AllPluginCheckUpdateJob.set(wait: 1.hour).perform_later # will be checked every hour + AllPluginCheckUpdateJob.set(wait: 1.hour).perform_later # will be checked every hour end end diff --git a/app/jobs/fluentd_ui_update_check_job.rb b/app/jobs/fluentd_ui_update_check_job.rb index f71662a..3aaffeb 100644 --- a/app/jobs/fluentd_ui_update_check_job.rb +++ b/app/jobs/fluentd_ui_update_check_job.rb @@ -6,7 +6,6 @@ class FluentdUiUpdateCheckJob < ApplicationJob if pl.gem_versions FluentdUI.latest_version = pl.latest_version end - # sucker_punch adapter does not implement enqueue_at - # FluentdUiUpdateCheckJob.set(wait: 1.hour).perfom_later # will be checked every hour + FluentdUiUpdateCheckJob.set(wait: 1.hour).perform_later # will be checked every hour end end From cb2c0ef5de3fa4a7796af411b0217e99fe8ad881 Mon Sep 17 00:00:00 2001 From: Kenji Okimoto Date: Thu, 19 Apr 2018 10:17:52 +0900 Subject: [PATCH 18/31] Update sucker_punch gem to 2.0.4 Signed-off-by: Kenji Okimoto --- Gemfile.lock | 26 +++----------------------- fluentd-ui.gemspec | 2 +- 2 files changed, 4 insertions(+), 24 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index c25f898..44ea7fc 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -19,7 +19,7 @@ PATH rubyzip (~> 1.1) sass-rails (~> 5.0.7) settingslogic - sucker_punch (~> 1.6.0) + sucker_punch (~> 2.0.4) thor GEM @@ -85,23 +85,6 @@ GEM capybara-screenshot (1.0.19) capybara (>= 1.0, < 4) launchy - celluloid (0.17.3) - celluloid-essentials - celluloid-extras - celluloid-fsm - celluloid-pool - celluloid-supervision - timers (>= 4.1.1) - celluloid-essentials (0.20.5) - timers (>= 4.1.1) - celluloid-extras (0.20.5) - timers (>= 4.1.1) - celluloid-fsm (0.20.5) - timers (>= 4.1.1) - celluloid-pool (0.20.5) - timers (>= 4.1.1) - celluloid-supervision (0.20.6) - timers (>= 4.1.1) childprocess (0.9.0) ffi (~> 1.0, >= 1.0.11) coderay (1.1.1) @@ -149,7 +132,6 @@ GEM html2haml (>= 1.0.1) railties (>= 4.0.1) hashdiff (0.3.7) - hitimes (1.2.6) html2haml (2.2.0) erubis (~> 2.7.0) haml (>= 4.0, < 6) @@ -280,15 +262,13 @@ GEM activesupport (>= 4.0) sprockets (>= 3.0.0) string-scrub (0.0.5) - sucker_punch (1.6.0) - celluloid (~> 0.17.2) + sucker_punch (2.0.4) + concurrent-ruby (~> 1.0.0) temple (0.8.0) thor (0.20.0) thread_safe (0.3.6) tilt (2.0.8) timecop (0.8.1) - timers (4.1.2) - hitimes tzinfo (1.2.5) thread_safe (~> 0.1) tzinfo-data (1.2018.4) diff --git a/fluentd-ui.gemspec b/fluentd-ui.gemspec index 8457e7a..1e0c066 100644 --- a/fluentd-ui.gemspec +++ b/fluentd-ui.gemspec @@ -26,7 +26,7 @@ Gem::Specification.new do |spec| spec.add_dependency "fluentd", [">= 0.10.56", "< 0.14"] spec.add_dependency 'rails', '~> 5.0.0' - spec.add_dependency 'sucker_punch', "~> 1.6.0" + spec.add_dependency 'sucker_punch', "~> 2.0.4" spec.add_dependency 'addressable' spec.add_dependency "font-awesome-rails" spec.add_dependency 'sass-rails', '~> 5.0.7' From 6f5ef48eea4da41ec10938bf1c94e681e6a3a1f2 Mon Sep 17 00:00:00 2001 From: Kenji Okimoto Date: Thu, 19 Apr 2018 10:18:05 +0900 Subject: [PATCH 19/31] Update jquery-rails Signed-off-by: Kenji Okimoto --- Gemfile.lock | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Gemfile.lock b/Gemfile.lock index 44ea7fc..ea7644e 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -146,7 +146,7 @@ GEM jbuilder (2.7.0) activesupport (>= 4.2.0) multi_json (>= 1.2) - jquery-rails (4.3.1) + jquery-rails (4.3.3) rails-dom-testing (>= 1, < 3) railties (>= 4.2.0) thor (>= 0.14, < 2.0) From c34eeba2cae7b5720ce389b453cd7bcebc8dab7c Mon Sep 17 00:00:00 2001 From: Kenji Okimoto Date: Thu, 19 Apr 2018 10:39:37 +0900 Subject: [PATCH 20/31] Avoid RuntimeError > RuntimeError Circular dependency detected while autoloading constant Plugin Signed-off-by: Kenji Okimoto --- config/initializers/fluentd_ui_update_check.rb | 1 + config/initializers/prefetch_gem_updates.rb | 1 + 2 files changed, 2 insertions(+) diff --git a/config/initializers/fluentd_ui_update_check.rb b/config/initializers/fluentd_ui_update_check.rb index 224809b..b045033 100644 --- a/config/initializers/fluentd_ui_update_check.rb +++ b/config/initializers/fluentd_ui_update_check.rb @@ -1,3 +1,4 @@ +require "plugin" # Avoid: RuntimeError Circular dependency detected while autoloading constant Plugin unless Rails.env.test? unless FluentdUI.td_agent_ui? # td-agent-ui shouldn't auto update diff --git a/config/initializers/prefetch_gem_updates.rb b/config/initializers/prefetch_gem_updates.rb index ad88b87..d6850f6 100644 --- a/config/initializers/prefetch_gem_updates.rb +++ b/config/initializers/prefetch_gem_updates.rb @@ -1 +1,2 @@ +require "plugin" # Avoid: RuntimeError Circular dependency detected while autoloading constant Plugin AllPluginCheckUpdateJob.perform_later From a279b8207882a95f104fbcd31cf6e48933668e79 Mon Sep 17 00:00:00 2001 From: Kenji Okimoto Date: Thu, 19 Apr 2018 11:54:42 +0900 Subject: [PATCH 21/31] Update spec Signed-off-by: Kenji Okimoto --- spec/features/fluentd/setting/histories_spec.rb | 13 +++++++------ .../features/fluentd/setting/running_backup_spec.rb | 7 ++++--- 2 files changed, 11 insertions(+), 9 deletions(-) diff --git a/spec/features/fluentd/setting/histories_spec.rb b/spec/features/fluentd/setting/histories_spec.rb index e0965da..0c5e3f3 100644 --- a/spec/features/fluentd/setting/histories_spec.rb +++ b/spec/features/fluentd/setting/histories_spec.rb @@ -35,16 +35,17 @@ describe "histories", stub: :daemon do it 'show histories#show' do page.should have_css('h1', text: I18n.t('fluentd.settings.histories.show.page_title')) - page.should have_text(last_backup_file.content) + + page.should has_text?(last_backup_file.content) end describe 'diff' do context 'has diff' do it 'shows diff between current and target' do - page.should have_text("- type http") - page.should have_text("+ type forward") - page.should have_text("- port 8899") - page.should have_text("+ port 24224") + page.should has_text?("- type http") + page.should has_text?("+ type forward") + page.should has_text?("- port 8899") + page.should has_text?("+ port 24224") end end @@ -64,7 +65,7 @@ describe "histories", stub: :daemon do page.should have_css('h1', text: I18n.t('fluentd.settings.show.page_title')) page.should have_text(I18n.t('messages.config_successfully_copied', brand: 'fluentd') ) - page.should have_text(last_backup_file.content) + page.should has_text?(last_backup_file.content) end describe "configtest" do diff --git a/spec/features/fluentd/setting/running_backup_spec.rb b/spec/features/fluentd/setting/running_backup_spec.rb index 52a3f23..8500fb7 100644 --- a/spec/features/fluentd/setting/running_backup_spec.rb +++ b/spec/features/fluentd/setting/running_backup_spec.rb @@ -39,9 +39,10 @@ describe "running_backup", stub: :daemon do describe 'diff' do context 'has diff' do it 'shows diff between current and running' do - expect(page).to have_text("- type http") - expect(page).to have_text("- port 8899") - expect(page).to have_text("+ Running backup file content") + diff = page.first(".diff pre").native.inner_text + expect(diff).to include("- type http") + expect(diff).to include("- port 8899") + expect(diff).to include("+ Running backup file content") end end From 88adfb800abf96e9674c16dfee0a2244604e5865 Mon Sep 17 00:00:00 2001 From: Kenji Okimoto Date: Thu, 19 Apr 2018 14:32:02 +0900 Subject: [PATCH 22/31] Stub dryrun method for the environment does not have td-agent Signed-off-by: Kenji Okimoto --- spec/features/setting_spec.rb | 1 + 1 file changed, 1 insertion(+) diff --git a/spec/features/setting_spec.rb b/spec/features/setting_spec.rb index 129a7cc..682dc67 100644 --- a/spec/features/setting_spec.rb +++ b/spec/features/setting_spec.rb @@ -50,6 +50,7 @@ describe 'setting', stub: :daemon do describe "config" do before do + Fluentd::Agent::TdAgent.any_instance.stub(:dryrun).with(an_instance_of(String)).and_return(true) daemon.agent.config_write conf click_link I18n.t('terms.edit') end From 161af79c229f11b7308a381d8fade1a476d6c879 Mon Sep 17 00:00:00 2001 From: Kenji Okimoto Date: Thu, 19 Apr 2018 14:34:33 +0900 Subject: [PATCH 23/31] Update rails to 5.1.6 Signed-off-by: Kenji Okimoto --- Gemfile.lock | 83 +++++++++++++++++++++++----------------------- fluentd-ui.gemspec | 2 +- 2 files changed, 43 insertions(+), 42 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index ea7644e..4bed524 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -15,7 +15,7 @@ PATH kramdown (> 1.0.0) kramdown-haml puma - rails (~> 5.0.0) + rails (~> 5.1.0) rubyzip (~> 1.1) sass-rails (~> 5.0.7) settingslogic @@ -25,50 +25,50 @@ PATH GEM remote: https://rubygems.org/ specs: - actioncable (5.0.7) - actionpack (= 5.0.7) - nio4r (>= 1.2, < 3.0) + actioncable (5.1.6) + actionpack (= 5.1.6) + nio4r (~> 2.0) websocket-driver (~> 0.6.1) - actionmailer (5.0.7) - actionpack (= 5.0.7) - actionview (= 5.0.7) - activejob (= 5.0.7) + actionmailer (5.1.6) + actionpack (= 5.1.6) + actionview (= 5.1.6) + activejob (= 5.1.6) mail (~> 2.5, >= 2.5.4) rails-dom-testing (~> 2.0) - actionpack (5.0.7) - actionview (= 5.0.7) - activesupport (= 5.0.7) + actionpack (5.1.6) + actionview (= 5.1.6) + activesupport (= 5.1.6) rack (~> 2.0) - rack-test (~> 0.6.3) + rack-test (>= 0.6.3) rails-dom-testing (~> 2.0) rails-html-sanitizer (~> 1.0, >= 1.0.2) - actionview (5.0.7) - activesupport (= 5.0.7) + actionview (5.1.6) + activesupport (= 5.1.6) 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) - activesupport (= 5.0.7) + activejob (5.1.6) + activesupport (= 5.1.6) globalid (>= 0.3.6) - activemodel (5.0.7) - activesupport (= 5.0.7) + activemodel (5.1.6) + activesupport (= 5.1.6) activemodel-serializers-xml (1.0.2) activemodel (> 5.x) activesupport (> 5.x) builder (~> 3.1) - activerecord (5.0.7) - activemodel (= 5.0.7) - activesupport (= 5.0.7) - arel (~> 7.0) - activesupport (5.0.7) + activerecord (5.1.6) + activemodel (= 5.1.6) + activesupport (= 5.1.6) + arel (~> 8.0) + activesupport (5.1.6) concurrent-ruby (~> 1.0, >= 1.0.2) i18n (>= 0.7, < 2) minitest (~> 5.1) tzinfo (~> 1.1) addressable (2.5.2) public_suffix (>= 2.0.2, < 4.0) - arel (7.1.4) + arel (8.0.0) better_errors (2.1.1) coderay (>= 1.0.0) erubis (>= 2.6.6) @@ -101,6 +101,7 @@ GEM activemodel-serializers-xml (~> 1.0) activesupport (~> 5.0) request_store (~> 1.0) + erubi (1.7.1) erubis (2.7.0) factory_bot (4.8.2) activesupport (>= 3.0.0) @@ -179,28 +180,28 @@ GEM public_suffix (3.0.2) puma (3.11.4) rack (2.0.4) - rack-test (0.6.3) - rack (>= 1.0) - rails (5.0.7) - actioncable (= 5.0.7) - actionmailer (= 5.0.7) - actionpack (= 5.0.7) - actionview (= 5.0.7) - activejob (= 5.0.7) - activemodel (= 5.0.7) - activerecord (= 5.0.7) - activesupport (= 5.0.7) + rack-test (1.0.0) + rack (>= 1.0, < 3) + rails (5.1.6) + actioncable (= 5.1.6) + actionmailer (= 5.1.6) + actionpack (= 5.1.6) + actionview (= 5.1.6) + activejob (= 5.1.6) + activemodel (= 5.1.6) + activerecord (= 5.1.6) + activesupport (= 5.1.6) bundler (>= 1.3.0) - railties (= 5.0.7) + railties (= 5.1.6) sprockets-rails (>= 2.0.0) rails-dom-testing (2.0.3) activesupport (>= 4.2.0) nokogiri (>= 1.6) rails-html-sanitizer (1.0.4) loofah (~> 2.2, >= 2.2.2) - railties (5.0.7) - actionpack (= 5.0.7) - activesupport (= 5.0.7) + railties (5.1.6) + actionpack (= 5.1.6) + activesupport (= 5.1.6) method_source rake (>= 0.8.7) thor (>= 0.18.1, < 2.0) @@ -284,7 +285,7 @@ GEM hashdiff websocket-driver (0.6.5) websocket-extensions (>= 0.1.0) - websocket-extensions (0.1.2) + websocket-extensions (0.1.3) xpath (3.0.0) nokogiri (~> 1.8) yajl-ruby (1.3.1) diff --git a/fluentd-ui.gemspec b/fluentd-ui.gemspec index 1e0c066..cf3c536 100644 --- a/fluentd-ui.gemspec +++ b/fluentd-ui.gemspec @@ -25,7 +25,7 @@ Gem::Specification.new do |spec| spec.require_paths = ["lib"] spec.add_dependency "fluentd", [">= 0.10.56", "< 0.14"] - spec.add_dependency 'rails', '~> 5.0.0' + spec.add_dependency 'rails', '~> 5.1.0' spec.add_dependency 'sucker_punch', "~> 2.0.4" spec.add_dependency 'addressable' spec.add_dependency "font-awesome-rails" From f43392f58048c8610fe6a707445bb21a0f97d4e0 Mon Sep 17 00:00:00 2001 From: Kenji Okimoto Date: Thu, 19 Apr 2018 14:51:45 +0900 Subject: [PATCH 24/31] Use Ubuntu Trusty Signed-off-by: Kenji Okimoto --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index b40d57f..41373cd 100644 --- a/.travis.yml +++ b/.travis.yml @@ -5,5 +5,5 @@ sudo: required install: - bundle -v - gem i bundler - - sudo sh -c 'curl -L https://toolbelt.treasuredata.com/sh/install-ubuntu-precise-td-agent2.sh | sh' + - sudo sh -c 'curl -L https://toolbelt.treasuredata.com/sh/install-ubuntu-trusty-td-agent2.sh | sh' - bundle install --jobs=4 --retry=4 From e10e32a238f70f37b7a3dfe801163301fe6f2181 Mon Sep 17 00:00:00 2001 From: Kenji Okimoto Date: Thu, 19 Apr 2018 14:51:57 +0900 Subject: [PATCH 25/31] Update Ruby version to use Rails 5 Because Rails 5 drops Ruby 2.1 support. Signed-off-by: Kenji Okimoto --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 41373cd..83e1da3 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,4 +1,4 @@ -rvm: 2.1.3 +rvm: 2.2.10 sudo: required From 2a5b2ce0d812ff75f72b73db6e4aec2cedec2655 Mon Sep 17 00:00:00 2001 From: Kenji Okimoto Date: Thu, 19 Apr 2018 15:02:39 +0900 Subject: [PATCH 26/31] Add an addon chrome to run feature spec Signed-off-by: Kenji Okimoto --- .travis.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.travis.yml b/.travis.yml index 83e1da3..94ec0ce 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,6 +1,8 @@ rvm: 2.2.10 sudo: required +addons: + - chrome: stable install: - bundle -v From de6c89952ae16d3f41206c2a17c1d82685d85ab0 Mon Sep 17 00:00:00 2001 From: Kenji Okimoto Date: Thu, 19 Apr 2018 15:18:04 +0900 Subject: [PATCH 27/31] Set DISPLAY environment variable See https://docs.travis-ci.com/user/gui-and-headless-browsers/#Ruby Signed-off-by: Kenji Okimoto --- .travis.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.travis.yml b/.travis.yml index 94ec0ce..5fea454 100644 --- a/.travis.yml +++ b/.travis.yml @@ -4,6 +4,10 @@ sudo: required addons: - chrome: stable +env: + global: + DISPLAY: ":99.0" + install: - bundle -v - gem i bundler From 330912a10db59d2925142dca61dd714212da088d Mon Sep 17 00:00:00 2001 From: Kenji Okimoto Date: Thu, 19 Apr 2018 15:39:33 +0900 Subject: [PATCH 28/31] Try to install chromedriver command Signed-off-by: Kenji Okimoto --- .travis.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.travis.yml b/.travis.yml index 5fea454..93279d2 100644 --- a/.travis.yml +++ b/.travis.yml @@ -8,6 +8,11 @@ env: global: DISPLAY: ":99.0" +before_install: + - wget http://chromedriver.storage.googleapis.com/2.38/chromedriver_linux64.zip + - unzip chromedriver_linux64.zip + - sudo mv chromedriver /usr/local/bin/chromedriver + install: - bundle -v - gem i bundler From c68560570510bc55e24554bce522eea9307db65d Mon Sep 17 00:00:00 2001 From: Kenji Okimoto Date: Thu, 19 Apr 2018 15:53:24 +0900 Subject: [PATCH 29/31] Display google-chrome version Signed-off-by: Kenji Okimoto --- .travis.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.travis.yml b/.travis.yml index 93279d2..efd1c2d 100644 --- a/.travis.yml +++ b/.travis.yml @@ -9,6 +9,7 @@ env: DISPLAY: ":99.0" before_install: + - google-chrome-stable --version - wget http://chromedriver.storage.googleapis.com/2.38/chromedriver_linux64.zip - unzip chromedriver_linux64.zip - sudo mv chromedriver /usr/local/bin/chromedriver From b93273dcb147de20273ed6dafb9d4f43264a5034 Mon Sep 17 00:00:00 2001 From: Kenji Okimoto Date: Thu, 19 Apr 2018 15:57:05 +0900 Subject: [PATCH 30/31] Use chromedriver 2.35 $ google-chrome-stable --version Google Chrome 62.0.3202.94 Signed-off-by: Kenji Okimoto --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index efd1c2d..9d93db0 100644 --- a/.travis.yml +++ b/.travis.yml @@ -10,7 +10,7 @@ env: before_install: - google-chrome-stable --version - - wget http://chromedriver.storage.googleapis.com/2.38/chromedriver_linux64.zip + - wget http://chromedriver.storage.googleapis.com/2.35/chromedriver_linux64.zip - unzip chromedriver_linux64.zip - sudo mv chromedriver /usr/local/bin/chromedriver From e6703163f19687b2c1dcc1f178fb2ee23fc4fb99 Mon Sep 17 00:00:00 2001 From: Kenji Okimoto Date: Thu, 19 Apr 2018 16:06:02 +0900 Subject: [PATCH 31/31] Update rails to 5.2.0 Signed-off-by: Kenji Okimoto --- Gemfile.lock | 82 +++++++++++++++++++++++++--------------------- fluentd-ui.gemspec | 2 +- 2 files changed, 46 insertions(+), 38 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index 4bed524..1ee5b7e 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -15,7 +15,7 @@ PATH kramdown (> 1.0.0) kramdown-haml puma - rails (~> 5.1.0) + rails (~> 5.2.0) rubyzip (~> 1.1) sass-rails (~> 5.0.7) settingslogic @@ -25,50 +25,54 @@ PATH GEM remote: https://rubygems.org/ specs: - actioncable (5.1.6) - actionpack (= 5.1.6) + actioncable (5.2.0) + actionpack (= 5.2.0) nio4r (~> 2.0) - websocket-driver (~> 0.6.1) - actionmailer (5.1.6) - actionpack (= 5.1.6) - actionview (= 5.1.6) - activejob (= 5.1.6) + websocket-driver (>= 0.6.1) + actionmailer (5.2.0) + actionpack (= 5.2.0) + actionview (= 5.2.0) + activejob (= 5.2.0) mail (~> 2.5, >= 2.5.4) rails-dom-testing (~> 2.0) - actionpack (5.1.6) - actionview (= 5.1.6) - activesupport (= 5.1.6) + actionpack (5.2.0) + actionview (= 5.2.0) + activesupport (= 5.2.0) rack (~> 2.0) rack-test (>= 0.6.3) rails-dom-testing (~> 2.0) rails-html-sanitizer (~> 1.0, >= 1.0.2) - actionview (5.1.6) - activesupport (= 5.1.6) + actionview (5.2.0) + activesupport (= 5.2.0) builder (~> 3.1) erubi (~> 1.4) rails-dom-testing (~> 2.0) rails-html-sanitizer (~> 1.0, >= 1.0.3) - activejob (5.1.6) - activesupport (= 5.1.6) + activejob (5.2.0) + activesupport (= 5.2.0) globalid (>= 0.3.6) - activemodel (5.1.6) - activesupport (= 5.1.6) + activemodel (5.2.0) + activesupport (= 5.2.0) activemodel-serializers-xml (1.0.2) activemodel (> 5.x) activesupport (> 5.x) builder (~> 3.1) - activerecord (5.1.6) - activemodel (= 5.1.6) - activesupport (= 5.1.6) - arel (~> 8.0) - activesupport (5.1.6) + activerecord (5.2.0) + activemodel (= 5.2.0) + activesupport (= 5.2.0) + arel (>= 9.0) + activestorage (5.2.0) + actionpack (= 5.2.0) + activerecord (= 5.2.0) + marcel (~> 0.3.1) + activesupport (5.2.0) concurrent-ruby (~> 1.0, >= 1.0.2) i18n (>= 0.7, < 2) minitest (~> 5.1) tzinfo (~> 1.1) addressable (2.5.2) public_suffix (>= 2.0.2, < 4.0) - arel (8.0.0) + arel (9.0.0) better_errors (2.1.1) coderay (>= 1.0.0) erubis (>= 2.6.6) @@ -162,7 +166,10 @@ GEM nokogiri (>= 1.5.9) mail (2.7.0) mini_mime (>= 0.1.1) + marcel (0.3.2) + mimemagic (~> 0.3.2) method_source (0.8.2) + mimemagic (0.3.2) mini_mime (1.0.0) mini_portile2 (2.3.0) minitest (5.11.3) @@ -182,26 +189,27 @@ GEM rack (2.0.4) rack-test (1.0.0) rack (>= 1.0, < 3) - rails (5.1.6) - actioncable (= 5.1.6) - actionmailer (= 5.1.6) - actionpack (= 5.1.6) - actionview (= 5.1.6) - activejob (= 5.1.6) - activemodel (= 5.1.6) - activerecord (= 5.1.6) - activesupport (= 5.1.6) + rails (5.2.0) + actioncable (= 5.2.0) + actionmailer (= 5.2.0) + actionpack (= 5.2.0) + actionview (= 5.2.0) + activejob (= 5.2.0) + activemodel (= 5.2.0) + activerecord (= 5.2.0) + activestorage (= 5.2.0) + activesupport (= 5.2.0) bundler (>= 1.3.0) - railties (= 5.1.6) + railties (= 5.2.0) sprockets-rails (>= 2.0.0) rails-dom-testing (2.0.3) activesupport (>= 4.2.0) nokogiri (>= 1.6) rails-html-sanitizer (1.0.4) loofah (~> 2.2, >= 2.2.2) - railties (5.1.6) - actionpack (= 5.1.6) - activesupport (= 5.1.6) + railties (5.2.0) + actionpack (= 5.2.0) + activesupport (= 5.2.0) method_source rake (>= 0.8.7) thor (>= 0.18.1, < 2.0) @@ -283,7 +291,7 @@ GEM addressable (>= 2.3.6) crack (>= 0.3.2) hashdiff - websocket-driver (0.6.5) + websocket-driver (0.7.0) websocket-extensions (>= 0.1.0) websocket-extensions (0.1.3) xpath (3.0.0) diff --git a/fluentd-ui.gemspec b/fluentd-ui.gemspec index cf3c536..74e4344 100644 --- a/fluentd-ui.gemspec +++ b/fluentd-ui.gemspec @@ -25,7 +25,7 @@ Gem::Specification.new do |spec| spec.require_paths = ["lib"] spec.add_dependency "fluentd", [">= 0.10.56", "< 0.14"] - spec.add_dependency 'rails', '~> 5.1.0' + spec.add_dependency 'rails', '~> 5.2.0' spec.add_dependency 'sucker_punch', "~> 2.0.4" spec.add_dependency 'addressable' spec.add_dependency "font-awesome-rails"