From a95ce9f49b66ccf35eb11d12b872f9a9a1d37ef7 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 25 Aug 2023 15:12:32 +0000 Subject: [PATCH 1/4] Update rubocop requirement from ~> 1.52.0 to ~> 1.56.1 Updates the requirements on [rubocop](https://github.com/rubocop/rubocop) to permit the latest version. - [Release notes](https://github.com/rubocop/rubocop/releases) - [Changelog](https://github.com/rubocop/rubocop/blob/master/CHANGELOG.md) - [Commits](https://github.com/rubocop/rubocop/compare/v1.52.0...v1.56.1) --- updated-dependencies: - dependency-name: rubocop dependency-type: direct:development ... Signed-off-by: dependabot[bot] --- publify_core.gemspec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/publify_core.gemspec b/publify_core.gemspec index e0f10674..918417dd 100644 --- a/publify_core.gemspec +++ b/publify_core.gemspec @@ -56,7 +56,7 @@ Gem::Specification.new do |s| s.add_development_dependency "pry", "~> 0.14.2" s.add_development_dependency "rails-controller-testing", "~> 1.0.1" s.add_development_dependency "rspec-rails", "~> 6.0" - s.add_development_dependency "rubocop", "~> 1.52.0" + s.add_development_dependency "rubocop", "~> 1.56.1" s.add_development_dependency "rubocop-factory_bot", "~> 2.23.1" s.add_development_dependency "rubocop-performance", "~> 1.19.0" s.add_development_dependency "rubocop-rails", "~> 2.20.2" From 1b8a21ff6b730070c3b250fc55f7f682c3ba60ea Mon Sep 17 00:00:00 2001 From: Matijs van Zuijlen Date: Sat, 26 Aug 2023 08:39:04 +0200 Subject: [PATCH 2/4] Replace .rss only at the end of the URL --- app/controllers/articles_controller.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/articles_controller.rb b/app/controllers/articles_controller.rb index 908426e9..a6f9fe19 100644 --- a/app/controllers/articles_controller.rb +++ b/app/controllers/articles_controller.rb @@ -201,7 +201,7 @@ def extract_feed_format(from) case from when /^.*\.rss$/ request.format = "rss" - from = from.gsub(/\.rss/, "") + from = from.gsub(/\.rss$/, "") when /^.*\.atom$/ request.format = "atom" from = from.gsub(/\.atom$/, "") From 4be375b135e0b83bbd9874911af9935ba8f041db Mon Sep 17 00:00:00 2001 From: Matijs van Zuijlen Date: Sat, 26 Aug 2023 08:40:25 +0200 Subject: [PATCH 3/4] Autocorrect Style/RedundantRegexpArgument --- app/helpers/base_helper.rb | 2 +- lib/text_filter_plugin.rb | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/app/helpers/base_helper.rb b/app/helpers/base_helper.rb index 4a9d4273..8fe6c982 100644 --- a/app/helpers/base_helper.rb +++ b/app/helpers/base_helper.rb @@ -138,7 +138,7 @@ def page_header_includes v = v.chomp # trim the same number of spaces from the beginning of each line # this way plugins can indent nicely without making ugly source output - spaces = /\A[ \t]*/.match(v)[0].gsub(/\t/, " ") + spaces = /\A[ \t]*/.match(v)[0].gsub("\t", " ") # add 2 spaces to line up with the assumed position of the surrounding tags v.gsub!(/^#{spaces}/, " ") end diff --git a/lib/text_filter_plugin.rb b/lib/text_filter_plugin.rb index d34103a7..9f1b7529 100644 --- a/lib/text_filter_plugin.rb +++ b/lib/text_filter_plugin.rb @@ -131,12 +131,12 @@ def self.attributes_parse(string) attributes = {} string.gsub(/([^ =]+="[^"]*")/) do |match| - key, value = match.split(/=/, 2) + key, value = match.split("=", 2) attributes[key] = value.delete('"') end string.gsub(/([^ =]+='[^']*')/) do |match| - key, value = match.split(/=/, 2) + key, value = match.split("=", 2) attributes[key] = value.delete("'") end From 9dcd90c15c5800cd6cebc10e606f05d6f74a5150 Mon Sep 17 00:00:00 2001 From: Matijs van Zuijlen Date: Sat, 26 Aug 2023 08:41:52 +0200 Subject: [PATCH 4/4] Autocorrect Style/RedundantReturn offense --- app/models/article.rb | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/app/models/article.rb b/app/models/article.rb index c537bfd5..56d69a07 100644 --- a/app/models/article.rb +++ b/app/models/article.rb @@ -174,8 +174,7 @@ def self.requested_article(params) if params[:title] req_params[:permalink] = CGI.escape(params[:title]) - article = published.find_by(req_params) - return article if article + published.find_by(req_params) end end