diff --git a/.circleci/config.yml b/.circleci/config.yml index 8cef681..f323042 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -62,7 +62,8 @@ workflows: parameters: ruby_version: - 2.7.5 - # not yet compatible with Ruby 3.x + - 3.0.3 + # not yet compatible with 3.1 or 3.2 elasticsearch_version: - 7.17.7 # not yet compatible with Elasticsearch 8 diff --git a/.ruby-version b/.ruby-version index 849c0c4..e76033b 100644 --- a/.ruby-version +++ b/.ruby-version @@ -1 +1 @@ -ruby-2.7.5 +ruby-3.0.3 diff --git a/Gemfile b/Gemfile index d4763d4..8363474 100644 --- a/Gemfile +++ b/Gemfile @@ -11,9 +11,9 @@ gem 'rails', '~> 6.1.0' gem 'rake', '~> 13.0.6' -gem 'grape', '~> 1.3.2' +gem 'grape', '~> 1.7.0' -gem 'jbuilder', '~> 2.6.4' +gem 'jbuilder', '~> 2.11.5' gem 'elasticsearch-api', '~> 6.0' gem 'elasticsearch-model', '~> 5.0' @@ -41,9 +41,7 @@ group :development, :test do end group :development do - # Access an IRB console on exception pages or by using <%= console %> anywhere in the code. - gem 'listen', '>= 3.0.5', '< 3.2' - gem 'web-console', '>= 3.3.0' + gem 'listen', '~> 3.8.0' # Spring speeds up development by keeping your application running in the background. Read more: https://github.com/rails/spring gem 'spring' gem 'spring-watcher-listen', '~> 2.0.0' @@ -57,5 +55,5 @@ group :test do gem 'rspec-sidekiq', '~> 3.0.1' gem 'rspec_junit_formatter', '~> 0.4.1' gem 'simplecov', '~> 0.16.1' - gem 'webmock', '~> 3.5.1' + gem 'webmock', '~> 3.18' end diff --git a/Gemfile.lock b/Gemfile.lock index d84d569..06e9051 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,60 +1,60 @@ GEM remote: https://rubygems.org/ specs: - actioncable (6.1.7.1) - actionpack (= 6.1.7.1) - activesupport (= 6.1.7.1) + actioncable (6.1.7.2) + actionpack (= 6.1.7.2) + activesupport (= 6.1.7.2) nio4r (~> 2.0) websocket-driver (>= 0.6.1) - actionmailbox (6.1.7.1) - actionpack (= 6.1.7.1) - activejob (= 6.1.7.1) - activerecord (= 6.1.7.1) - activestorage (= 6.1.7.1) - activesupport (= 6.1.7.1) + actionmailbox (6.1.7.2) + actionpack (= 6.1.7.2) + activejob (= 6.1.7.2) + activerecord (= 6.1.7.2) + activestorage (= 6.1.7.2) + activesupport (= 6.1.7.2) mail (>= 2.7.1) - actionmailer (6.1.7.1) - actionpack (= 6.1.7.1) - actionview (= 6.1.7.1) - activejob (= 6.1.7.1) - activesupport (= 6.1.7.1) + actionmailer (6.1.7.2) + actionpack (= 6.1.7.2) + actionview (= 6.1.7.2) + activejob (= 6.1.7.2) + activesupport (= 6.1.7.2) mail (~> 2.5, >= 2.5.4) rails-dom-testing (~> 2.0) - actionpack (6.1.7.1) - actionview (= 6.1.7.1) - activesupport (= 6.1.7.1) + actionpack (6.1.7.2) + actionview (= 6.1.7.2) + activesupport (= 6.1.7.2) rack (~> 2.0, >= 2.0.9) rack-test (>= 0.6.3) rails-dom-testing (~> 2.0) rails-html-sanitizer (~> 1.0, >= 1.2.0) - actiontext (6.1.7.1) - actionpack (= 6.1.7.1) - activerecord (= 6.1.7.1) - activestorage (= 6.1.7.1) - activesupport (= 6.1.7.1) + actiontext (6.1.7.2) + actionpack (= 6.1.7.2) + activerecord (= 6.1.7.2) + activestorage (= 6.1.7.2) + activesupport (= 6.1.7.2) nokogiri (>= 1.8.5) - actionview (6.1.7.1) - activesupport (= 6.1.7.1) + actionview (6.1.7.2) + activesupport (= 6.1.7.2) builder (~> 3.1) erubi (~> 1.4) rails-dom-testing (~> 2.0) rails-html-sanitizer (~> 1.1, >= 1.2.0) - activejob (6.1.7.1) - activesupport (= 6.1.7.1) + activejob (6.1.7.2) + activesupport (= 6.1.7.2) globalid (>= 0.3.6) - activemodel (6.1.7.1) - activesupport (= 6.1.7.1) - activerecord (6.1.7.1) - activemodel (= 6.1.7.1) - activesupport (= 6.1.7.1) - activestorage (6.1.7.1) - actionpack (= 6.1.7.1) - activejob (= 6.1.7.1) - activerecord (= 6.1.7.1) - activesupport (= 6.1.7.1) + activemodel (6.1.7.2) + activesupport (= 6.1.7.2) + activerecord (6.1.7.2) + activemodel (= 6.1.7.2) + activesupport (= 6.1.7.2) + activestorage (6.1.7.2) + actionpack (= 6.1.7.2) + activejob (= 6.1.7.2) + activerecord (= 6.1.7.2) + activesupport (= 6.1.7.2) marcel (~> 1.0) mini_mime (>= 1.1.0) - activesupport (6.1.7.1) + activesupport (6.1.7.2) concurrent-ruby (~> 1.0, >= 1.0.2) i18n (>= 1.6, < 2) minitest (>= 5.1) @@ -67,7 +67,6 @@ GEM descendants_tracker (~> 0.0.4) ice_nine (~> 0.11.0) thread_safe (~> 0.3, >= 0.3.1) - bindex (0.8.1) binding_of_caller (1.0.0) debug_inspector (>= 0.0.1) builder (3.2.4) @@ -75,33 +74,34 @@ GEM coderay (1.1.3) coercible (1.0.0) descendants_tracker (~> 0.0.1) - concurrent-ruby (1.1.10) + concurrent-ruby (1.2.0) connection_pool (2.3.0) crack (0.4.5) rexml crass (1.0.6) - debug (1.6.3) - irb (>= 1.3.6) + date (3.3.3) + debug (1.7.1) + irb (>= 1.5.0) reline (>= 0.3.1) debug_inspector (1.1.0) descendants_tracker (0.0.4) thread_safe (~> 0.3, >= 0.3.1) diff-lcs (1.5.0) docile (1.4.0) - dry-container (0.11.0) + dry-core (1.0.0) concurrent-ruby (~> 1.0) - dry-core (0.8.1) + zeitwerk (~> 2.6) + dry-inflector (1.0.0) + dry-logic (1.5.0) concurrent-ruby (~> 1.0) - dry-inflector (0.3.0) - dry-logic (1.2.0) + dry-core (~> 1.0, < 2) + zeitwerk (~> 2.6) + dry-types (1.7.0) concurrent-ruby (~> 1.0) - dry-core (~> 0.5, >= 0.5) - dry-types (1.5.1) - concurrent-ruby (~> 1.0) - dry-container (~> 0.3) - dry-core (~> 0.5, >= 0.5) - dry-inflector (~> 0.1, >= 0.1.2) - dry-logic (~> 1.0, >= 1.0.2) + dry-core (~> 1.0, < 2) + dry-inflector (~> 1.0, < 2) + dry-logic (>= 1.4, < 2) + zeitwerk (~> 2.6) elasticsearch (6.8.3) elasticsearch-api (= 6.8.3) elasticsearch-transport (= 6.8.3) @@ -121,7 +121,7 @@ GEM elasticsearch-transport (6.8.3) faraday (~> 1) multi_json - erubi (1.11.0) + erubi (1.12.0) faraday (1.10.3) faraday-em_http (~> 1.0) faraday-em_synchrony (~> 1.0) @@ -154,9 +154,9 @@ GEM sax-machine (>= 1.0) ffi (1.15.5) flickraw (0.9.10) - globalid (1.0.1) + globalid (1.1.0) activesupport (>= 5.0) - grape (1.3.3) + grape (1.7.0) activesupport builder dry-types (>= 1.1) @@ -168,22 +168,24 @@ GEM i18n (1.12.0) concurrent-ruby (~> 1.0) ice_nine (0.11.2) - io-console (0.5.11) - irb (1.4.3) + io-console (0.6.0) + irb (1.6.2) reline (>= 0.3.0) - jbuilder (2.6.4) - activesupport (>= 3.0.0) - multi_json (>= 1.2) + jbuilder (2.11.5) + actionview (>= 5.0.0) + activesupport (>= 5.0.0) json (2.6.3) - listen (3.1.5) - rb-fsevent (~> 0.9, >= 0.9.4) - rb-inotify (~> 0.9, >= 0.9.7) - ruby_dep (~> 1.2) + listen (3.8.0) + rb-fsevent (~> 0.10, >= 0.10.3) + rb-inotify (~> 0.9, >= 0.9.10) loofah (2.19.1) crass (~> 1.0.2) nokogiri (>= 1.5.9) - mail (2.7.1) + mail (2.8.1) mini_mime (>= 0.1.1) + net-imap + net-pop + net-smtp marcel (1.0.2) method_source (1.0.0) mini_mime (1.1.2) @@ -191,18 +193,27 @@ GEM minitest (5.17.0) mock_redis (0.17.3) multi_json (1.15.0) - multipart-post (2.2.3) + multipart-post (2.3.0) mustermann (3.0.0) ruby2_keywords (~> 0.0.1) mustermann-grape (1.0.2) mustermann (>= 1.0.0) + net-imap (0.3.4) + date + net-protocol + net-pop (0.1.2) + net-protocol + net-protocol (0.2.1) + timeout + net-smtp (0.3.3) + net-protocol newrelic_rpm (6.15.0) nio4r (2.5.8) - nokogiri (1.13.10) + nokogiri (1.14.2) mini_portile2 (~> 2.8.0) racc (~> 1.4) parallel (1.22.1) - parser (3.2.0.0) + parser (3.2.1.0) ast (~> 2.4.1) pry (0.14.2) coderay (~> 1.1) @@ -220,29 +231,29 @@ GEM rack rack-test (2.0.2) rack (>= 1.3) - rails (6.1.7.1) - actioncable (= 6.1.7.1) - actionmailbox (= 6.1.7.1) - actionmailer (= 6.1.7.1) - actionpack (= 6.1.7.1) - actiontext (= 6.1.7.1) - actionview (= 6.1.7.1) - activejob (= 6.1.7.1) - activemodel (= 6.1.7.1) - activerecord (= 6.1.7.1) - activestorage (= 6.1.7.1) - activesupport (= 6.1.7.1) + rails (6.1.7.2) + actioncable (= 6.1.7.2) + actionmailbox (= 6.1.7.2) + actionmailer (= 6.1.7.2) + actionpack (= 6.1.7.2) + actiontext (= 6.1.7.2) + actionview (= 6.1.7.2) + activejob (= 6.1.7.2) + activemodel (= 6.1.7.2) + activerecord (= 6.1.7.2) + activestorage (= 6.1.7.2) + activesupport (= 6.1.7.2) bundler (>= 1.15.0) - railties (= 6.1.7.1) + railties (= 6.1.7.2) sprockets-rails (>= 2.0.0) rails-dom-testing (2.0.3) activesupport (>= 4.2.0) nokogiri (>= 1.6) - rails-html-sanitizer (1.4.4) + rails-html-sanitizer (1.5.0) loofah (~> 2.19, >= 2.19.1) - railties (6.1.7.1) - actionpack (= 6.1.7.1) - activesupport (= 6.1.7.1) + railties (6.1.7.2) + actionpack (= 6.1.7.2) + activesupport (= 6.1.7.2) method_source rake (>= 12.2) thor (~> 1.0) @@ -254,7 +265,7 @@ GEM redis (4.5.1) redis-namespace (1.6.0) redis (>= 3.0.4) - regexp_parser (2.6.2) + regexp_parser (2.7.0) reline (0.3.2) io-console (~> 0.5) rexml (3.2.5) @@ -290,9 +301,9 @@ GEM rubocop-ast (>= 1.23.0, < 2.0) ruby-progressbar (~> 1.7) unicode-display_width (>= 1.4.0, < 3.0) - rubocop-ast (1.24.1) - parser (>= 3.1.1.0) - rubocop-performance (1.15.2) + rubocop-ast (1.26.0) + parser (>= 3.2.1.0) + rubocop-performance (1.16.0) rubocop (>= 1.7.0, < 2.0) rubocop-ast (>= 0.4.0) rubocop-rails (2.17.4) @@ -305,9 +316,8 @@ GEM rubocop (~> 1.33) ruby-progressbar (1.11.0) ruby2_keywords (0.0.5) - ruby_dep (1.5.0) sax-machine (1.3.2) - searchgov_style (0.1.21) + searchgov_style (0.1.22) rubocop (= 1.39.0) rubocop-performance (~> 1.9) rubocop-rails (~> 2.9) @@ -331,37 +341,33 @@ GEM spring-watcher-listen (2.0.1) listen (>= 2.7, < 4.0) spring (>= 1.2, < 3.0) - sprockets (4.1.1) + sprockets (4.2.0) concurrent-ruby (~> 1.0) - rack (> 1, < 3) + rack (>= 2.2.4, < 4) sprockets-rails (3.4.2) actionpack (>= 5.2) activesupport (>= 5.2) sprockets (>= 3.0.0) thor (1.2.1) thread_safe (0.3.6) - tzinfo (2.0.5) + timeout (0.3.1) + tzinfo (2.0.6) concurrent-ruby (~> 1.0) unicode-display_width (2.4.2) virtus (2.0.0) axiom-types (~> 0.1) coercible (~> 1.0) descendants_tracker (~> 0.0, >= 0.0.3) - web-console (4.2.0) - actionview (>= 6.0.0) - activemodel (>= 6.0.0) - bindex (>= 0.4.0) - railties (>= 6.0.0) - webmock (3.5.1) - addressable (>= 2.3.6) + webmock (3.18.1) + addressable (>= 2.8.0) crack (>= 0.3.2) - hashdiff + hashdiff (>= 0.4.0, < 2.0.0) websocket-driver (0.7.5) websocket-extensions (>= 0.1.0) websocket-extensions (0.1.5) whenever (0.9.7) chronic (>= 0.6.3) - zeitwerk (2.6.6) + zeitwerk (2.6.7) PLATFORMS ruby @@ -375,10 +381,10 @@ DEPENDENCIES elasticsearch-transport (~> 6.0) feedjira (~> 2.2.0) flickraw (~> 0.9.8) - grape (~> 1.3.2) + grape (~> 1.7.0) hashie (~> 3.5.7) - jbuilder (~> 2.6.4) - listen (>= 3.0.5, < 3.2) + jbuilder (~> 2.11.5) + listen (~> 3.8.0) mock_redis (~> 0.17.3) newrelic_rpm (~> 6.15.0) pry-rails @@ -397,8 +403,7 @@ DEPENDENCIES simplecov (~> 0.16.1) spring spring-watcher-listen (~> 2.0.0) - web-console (>= 3.3.0) - webmock (~> 3.5.1) + webmock (~> 3.18) whenever (~> 0.9.4) BUNDLED WITH diff --git a/app/models/mrss_profile.rb b/app/models/mrss_profile.rb index 5d8cd84..9b03a65 100644 --- a/app/models/mrss_profile.rb +++ b/app/models/mrss_profile.rb @@ -17,7 +17,7 @@ def initialize(options) super(options) end - def self.find_by_name(mrss_name) + def self.find_by_mrss_profile_name(mrss_name) mrss_names_filter = TermsFilter.new('name', [mrss_name]) all(query: mrss_names_filter.query_body).first end @@ -30,7 +30,7 @@ def self.create_or_find_by_id(id) private - REDIS_KEY_NAME = "#{name}.name" + REDIS_KEY_NAME = "#{name}.name".freeze def assign_name # rubocop:disable Style/GlobalVars diff --git a/app/parsers/feedjira/parser/oasis/mrss.rb b/app/parsers/feedjira/parser/oasis/mrss.rb index 6493d74..5949649 100644 --- a/app/parsers/feedjira/parser/oasis/mrss.rb +++ b/app/parsers/feedjira/parser/oasis/mrss.rb @@ -15,7 +15,7 @@ class Mrss attr_accessor :feed_url - REGEX_MATCH = %r{http://purl.org/rss/1.0/modules/content/|http://search.yahoo.com/mrss/}.freeze + REGEX_MATCH = %r{http://purl.org/rss/1.0/modules/content/|http://search.yahoo.com/mrss/} def self.able_to_parse?(first_2k_xml) first_2k_xml =~ REGEX_MATCH diff --git a/app/workers/mrss_photos_importer.rb b/app/workers/mrss_photos_importer.rb index 68146c2..069d410 100644 --- a/app/workers/mrss_photos_importer.rb +++ b/app/workers/mrss_photos_importer.rb @@ -5,7 +5,7 @@ class MrssPhotosImporter sidekiq_options unique: true def perform(mrss_name) - @mrss = MrssProfile.find_by_name mrss_name + @mrss = MrssProfile.find_by_mrss_profile_name(name: mrss_name) photos = get_photos return if photos.blank? diff --git a/lib/capistrano/tasks/config_files.rake b/lib/capistrano/tasks/config_files.rake index cfa814e..ea1a95e 100644 --- a/lib/capistrano/tasks/config_files.rake +++ b/lib/capistrano/tasks/config_files.rake @@ -8,14 +8,14 @@ namespace :deploy do run_locally do Dir.chdir('config') do Dir.glob('*.yml') do |file_name| - cksum = capture 'cksum', File.join(Dir.pwd, file_name) + cksum = capture('cksum', File.join(Dir.pwd, file_name)) config_files[file_name] = cksum end end end on roles(:all) do - config_path = File.join shared_path, 'config' + config_path = File.join(shared_path, 'config') execute "mkdir -p #{config_path}" config_files.each do |file_name, local_cksum| @@ -25,7 +25,7 @@ namespace :deploy do lsum, _lsize, lpath = local_cksum.split if test("[ -f #{remote_file_name} ]") - remote_cksum = capture 'cksum', remote_file_name + remote_cksum = capture('cksum', remote_file_name) rsum, _rsize, _rpath = remote_cksum.split if lsum != rsum diff --git a/spec/rails_helper.rb b/spec/rails_helper.rb index cd73b8c..05aae99 100644 --- a/spec/rails_helper.rb +++ b/spec/rails_helper.rb @@ -3,7 +3,7 @@ # This file is copied to spec/ when you run 'rails generate rspec:install' ENV['RAILS_ENV'] ||= 'test' require 'spec_helper' -require File.expand_path('../../config/environment', __FILE__) +require File.expand_path('../config/environment', __dir__) require 'rspec/rails' # Requires supporting ruby files with custom matchers and macros, etc, in