From 0ac55022327c90b849a444f4cbe4b2ad0e375df3 Mon Sep 17 00:00:00 2001 From: Donavan Wells <33439357+donavanwells@users.noreply.github.com> Date: Mon, 6 Nov 2017 21:30:26 -0800 Subject: [PATCH 01/76] Update README.md (#167) Merge pull request 167 --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 7e67460..2f6cc96 100644 --- a/README.md +++ b/README.md @@ -34,7 +34,7 @@ Or install it yourself as: Once it's installed into your evironment, add it to your `_config.yml`: ```yaml -gems: +plugins: - jekyll-redirect-from ``` From dd5cbc6769029534c732c0aed67b0bcdffbfde4a Mon Sep 17 00:00:00 2001 From: jekyllbot Date: Tue, 7 Nov 2017 00:30:27 -0500 Subject: [PATCH 02/76] Update history to reflect merge of #167 [ci skip] --- History.markdown | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/History.markdown b/History.markdown index 5001743..9195cc6 100644 --- a/History.markdown +++ b/History.markdown @@ -17,6 +17,10 @@ * Create redirects.json file (#147) +### Documentation + + * Update README.md (#167) + ## 0.12.1 / 2017-01-12 ### Development Fixes From 37eed64edc1cb9e21f6a151064beef059d2e31ea Mon Sep 17 00:00:00 2001 From: jekyllbot Date: Tue, 7 Nov 2017 10:46:14 -0500 Subject: [PATCH 03/76] Rubocop: autocorrect (#165) Merge pull request 165 --- Gemfile | 2 ++ Rakefile | 2 ++ jekyll-redirect-from.gemspec | 6 +++--- lib/jekyll-redirect-from.rb | 2 ++ lib/jekyll-redirect-from/context.rb | 2 ++ lib/jekyll-redirect-from/generator.rb | 2 ++ lib/jekyll-redirect-from/layout.rb | 2 ++ lib/jekyll-redirect-from/page_without_a_file.rb | 2 ++ lib/jekyll-redirect-from/redirect_page.rb | 2 +- lib/jekyll-redirect-from/redirectable.rb | 2 ++ lib/jekyll-redirect-from/version.rb | 2 ++ spec/integrations_spec.rb | 2 ++ spec/jekyll_redirect_from/context_spec.rb | 2 ++ spec/jekyll_redirect_from/generator_spec.rb | 2 ++ spec/jekyll_redirect_from/layout_spec.rb | 2 ++ spec/jekyll_redirect_from/redirect_page_spec.rb | 2 +- spec/jekyll_redirect_from/redirectable_spec.rb | 2 ++ spec/spec_helper.rb | 2 ++ 18 files changed, 35 insertions(+), 5 deletions(-) diff --git a/Gemfile b/Gemfile index 668785f..42d51da 100644 --- a/Gemfile +++ b/Gemfile @@ -1,3 +1,5 @@ +# frozen_string_literal: true + source "https://rubygems.org" gemspec diff --git a/Rakefile b/Rakefile index b7e9ed5..ee617bb 100644 --- a/Rakefile +++ b/Rakefile @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "bundler/gem_tasks" require "rspec/core/rake_task" diff --git a/jekyll-redirect-from.gemspec b/jekyll-redirect-from.gemspec index ed00a1b..68e6fde 100644 --- a/jekyll-redirect-from.gemspec +++ b/jekyll-redirect-from.gemspec @@ -1,4 +1,4 @@ -# coding: utf-8 +# frozen_string_literal: true lib = File.expand_path("lib", __dir__) $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib) @@ -24,8 +24,8 @@ Gem::Specification.new do |spec| spec.add_runtime_dependency "jekyll", "~> 3.3" spec.add_development_dependency "bundler", "~> 1.3" - spec.add_development_dependency "rspec", "~> 3.5" - spec.add_development_dependency "rake", "~> 12.0" spec.add_development_dependency "jekyll-sitemap", "~> 1.0" + spec.add_development_dependency "rake", "~> 12.0" + spec.add_development_dependency "rspec", "~> 3.5" spec.add_development_dependency "rubocop", "~> 0.43" end diff --git a/lib/jekyll-redirect-from.rb b/lib/jekyll-redirect-from.rb index 8e2a0aa..1922bc1 100644 --- a/lib/jekyll-redirect-from.rb +++ b/lib/jekyll-redirect-from.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "jekyll" require "jekyll-redirect-from/version" require "jekyll-redirect-from/generator" diff --git a/lib/jekyll-redirect-from/context.rb b/lib/jekyll-redirect-from/context.rb index 4f7de76..25cfcf9 100644 --- a/lib/jekyll-redirect-from/context.rb +++ b/lib/jekyll-redirect-from/context.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module JekyllRedirectFrom # Stubbed LiquidContext to support relative_url and absolute_url helpers class Context diff --git a/lib/jekyll-redirect-from/generator.rb b/lib/jekyll-redirect-from/generator.rb index a93560d..71f78ee 100644 --- a/lib/jekyll-redirect-from/generator.rb +++ b/lib/jekyll-redirect-from/generator.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module JekyllRedirectFrom class Generator < Jekyll::Generator safe true diff --git a/lib/jekyll-redirect-from/layout.rb b/lib/jekyll-redirect-from/layout.rb index 82ad1c0..b39ca9d 100644 --- a/lib/jekyll-redirect-from/layout.rb +++ b/lib/jekyll-redirect-from/layout.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module JekyllRedirectFrom # A stubbed layout for our default redirect template # We cannot use the standard Layout class because of site.in_source_dir diff --git a/lib/jekyll-redirect-from/page_without_a_file.rb b/lib/jekyll-redirect-from/page_without_a_file.rb index dddf90e..9604cb8 100644 --- a/lib/jekyll-redirect-from/page_without_a_file.rb +++ b/lib/jekyll-redirect-from/page_without_a_file.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module JekyllRedirectFrom class PageWithoutAFile < Jekyll::Page def read_yaml(*) diff --git a/lib/jekyll-redirect-from/redirect_page.rb b/lib/jekyll-redirect-from/redirect_page.rb index 0bf64a9..b8ab4b1 100644 --- a/lib/jekyll-redirect-from/redirect_page.rb +++ b/lib/jekyll-redirect-from/redirect_page.rb @@ -1,4 +1,4 @@ -# Encoding: utf-8 +# frozen_string_literal: true module JekyllRedirectFrom # Specialty page which implements the redirect path logic diff --git a/lib/jekyll-redirect-from/redirectable.rb b/lib/jekyll-redirect-from/redirectable.rb index f9dffd8..741ddc4 100644 --- a/lib/jekyll-redirect-from/redirectable.rb +++ b/lib/jekyll-redirect-from/redirectable.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module JekyllRedirectFrom # Module which can be mixed in to documents (and pages) to provide # redirect_to and redirect_from helpers diff --git a/lib/jekyll-redirect-from/version.rb b/lib/jekyll-redirect-from/version.rb index 964cca0..b4afce3 100644 --- a/lib/jekyll-redirect-from/version.rb +++ b/lib/jekyll-redirect-from/version.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module JekyllRedirectFrom VERSION = "0.12.1".freeze end diff --git a/spec/integrations_spec.rb b/spec/integrations_spec.rb index 404eed5..2ca7b64 100644 --- a/spec/integrations_spec.rb +++ b/spec/integrations_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + RSpec.describe "JekyllRedirectFrom integration tests" do before { site.process } let(:relative_path) { "" } diff --git a/spec/jekyll_redirect_from/context_spec.rb b/spec/jekyll_redirect_from/context_spec.rb index bdf3e0d..b619d03 100644 --- a/spec/jekyll_redirect_from/context_spec.rb +++ b/spec/jekyll_redirect_from/context_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + RSpec.describe JekyllRedirectFrom::Context do subject { described_class.new(site) } diff --git a/spec/jekyll_redirect_from/generator_spec.rb b/spec/jekyll_redirect_from/generator_spec.rb index 536efcc..37db991 100644 --- a/spec/jekyll_redirect_from/generator_spec.rb +++ b/spec/jekyll_redirect_from/generator_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + RSpec.describe JekyllRedirectFrom::Generator do before(:each) do site.read diff --git a/spec/jekyll_redirect_from/layout_spec.rb b/spec/jekyll_redirect_from/layout_spec.rb index 12a0748..60d6f42 100644 --- a/spec/jekyll_redirect_from/layout_spec.rb +++ b/spec/jekyll_redirect_from/layout_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + RSpec.describe JekyllRedirectFrom::Layout do subject { described_class.new(@site) } diff --git a/spec/jekyll_redirect_from/redirect_page_spec.rb b/spec/jekyll_redirect_from/redirect_page_spec.rb index fefcc8d..e3cd2c6 100644 --- a/spec/jekyll_redirect_from/redirect_page_spec.rb +++ b/spec/jekyll_redirect_from/redirect_page_spec.rb @@ -1,4 +1,4 @@ -# Encoding: utf-8 +# frozen_string_literal: true describe JekyllRedirectFrom::RedirectPage do let(:from) { "/foo" } diff --git a/spec/jekyll_redirect_from/redirectable_spec.rb b/spec/jekyll_redirect_from/redirectable_spec.rb index 09cfc92..c9a2108 100644 --- a/spec/jekyll_redirect_from/redirectable_spec.rb +++ b/spec/jekyll_redirect_from/redirectable_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class RedirectableTestHelper include JekyllRedirectFrom::Redirectable attr_reader :to_liquid diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index ca35d6d..d77ceaf 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "jekyll" require File.expand_path("lib/jekyll-redirect-from.rb") From 4e7611a0aefad811620bcf97a00f0184e8e19fe1 Mon Sep 17 00:00:00 2001 From: jekyllbot Date: Tue, 7 Nov 2017 10:46:15 -0500 Subject: [PATCH 04/76] Update history to reflect merge of #165 [ci skip] --- History.markdown | 1 + 1 file changed, 1 insertion(+) diff --git a/History.markdown b/History.markdown index 9195cc6..e121a48 100644 --- a/History.markdown +++ b/History.markdown @@ -6,6 +6,7 @@ * Rubocop (#141) * Fix tests for jekyll 3.5.x (#160) + * Rubocop: autocorrect (#165) ### Minor Enhancements From eaa72617845f73045e5d0deabd33bb921b8909f7 Mon Sep 17 00:00:00 2001 From: Frank Taillandier Date: Sun, 3 Dec 2017 20:13:51 +0100 Subject: [PATCH 05/76] Docs: Plugins is the new gems Fix #166 --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index 2f6cc96..afed061 100644 --- a/README.md +++ b/README.md @@ -38,6 +38,8 @@ plugins: - jekyll-redirect-from ``` +💡 If you are using a Jekyll version less than 3.5.0, use the `gems` key instead of `plugins`. + If you're using Jekyll in `safe` mode to mimic GitHub Pages, make sure to add jekyll-redirect-from to your whitelist: From 5204a093c9a394874773a187a84c6c96ce69aa2d Mon Sep 17 00:00:00 2001 From: Frank Taillandier Date: Sun, 3 Dec 2017 20:14:51 +0100 Subject: [PATCH 06/76] Security: Bump Rubocop --- jekyll-redirect-from.gemspec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/jekyll-redirect-from.gemspec b/jekyll-redirect-from.gemspec index 68e6fde..ed37a5c 100644 --- a/jekyll-redirect-from.gemspec +++ b/jekyll-redirect-from.gemspec @@ -27,5 +27,5 @@ Gem::Specification.new do |spec| spec.add_development_dependency "jekyll-sitemap", "~> 1.0" spec.add_development_dependency "rake", "~> 12.0" spec.add_development_dependency "rspec", "~> 3.5" - spec.add_development_dependency "rubocop", "~> 0.43" + spec.add_development_dependency "rubocop", "~> 0.51" end From 4158b04fc1c9ba996cf8c6f3662a0e5b1fc2fec5 Mon Sep 17 00:00:00 2001 From: Frank Taillandier Date: Sun, 3 Dec 2017 20:16:11 +0100 Subject: [PATCH 07/76] Style: Target Ruby 2.1 --- .rubocop.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.rubocop.yml b/.rubocop.yml index 6d673b2..301d047 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -2,6 +2,7 @@ inherit_gem: jekyll: .rubocop.yml AllCops: + TargetRubyVersion: 2.1 Exclude: - vendor/**/* From 50d5493f602d38db04440f7baea8955f6764e8cf Mon Sep 17 00:00:00 2001 From: Frank Taillandier Date: Sun, 3 Dec 2017 20:20:32 +0100 Subject: [PATCH 08/76] Dev: Standardize scripts --- script/bootstrap | 3 ++- script/cibuild | 6 +++--- script/fmt | 10 ++++++++++ 3 files changed, 15 insertions(+), 4 deletions(-) create mode 100755 script/fmt diff --git a/script/bootstrap b/script/bootstrap index 02278d9..e3126bf 100755 --- a/script/bootstrap +++ b/script/bootstrap @@ -1,3 +1,4 @@ #! /bin/bash +set -e -bundle install -j8 +bundle install -j8 || bundle install diff --git a/script/cibuild b/script/cibuild index 10ff25d..40589af 100755 --- a/script/cibuild +++ b/script/cibuild @@ -1,6 +1,6 @@ #! /bin/bash set -e -bundle exec rake spec -bundle exec rubocop -S -D -gem build jekyll-redirect-from.gemspec +script/test +script/fmt +bundle exec rake build diff --git a/script/fmt b/script/fmt new file mode 100755 index 0000000..c5351ec --- /dev/null +++ b/script/fmt @@ -0,0 +1,10 @@ +#!/bin/bash +set -e + +echo "Rubocop $(bundle exec rubocop --version)" +bundle exec rubocop -D -E $@ +success=$? +if ((success != 0)); then + echo -e "\nTry running \`script/fmt -a\` to automatically fix errors" +fi +exit $success From 3da9e1892fa1c18a4b66a730ed3eb1550fcd5615 Mon Sep 17 00:00:00 2001 From: Frank Taillandier Date: Sun, 3 Dec 2017 20:26:12 +0100 Subject: [PATCH 09/76] Bump year --- LICENSE.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/LICENSE.txt b/LICENSE.txt index 9830ee4..ab38ad0 100644 --- a/LICENSE.txt +++ b/LICENSE.txt @@ -1,4 +1,4 @@ -Copyright (c) 2013 Parker Moore +Copyright (c) 2017 Parker Moore MIT License From a09ca8fc06eb6d7dc9f7cf06a26d5a5f440a2751 Mon Sep 17 00:00:00 2001 From: Frank Taillandier Date: Sun, 3 Dec 2017 20:28:23 +0100 Subject: [PATCH 10/76] Dev: Check before release --- script/release | 1 + 1 file changed, 1 insertion(+) diff --git a/script/release b/script/release index fbddd87..6c9fcf2 100755 --- a/script/release +++ b/script/release @@ -1,3 +1,4 @@ #! /bin/bash +script/cibuild bundle exec rake release From 9d27dc9d44aee0b976a3aafd8fa9723f1212bbe9 Mon Sep 17 00:00:00 2001 From: Frank Taillandier Date: Sun, 3 Dec 2017 20:29:12 +0100 Subject: [PATCH 11/76] Release :gem: 0.13.0 --- lib/jekyll-redirect-from/version.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/jekyll-redirect-from/version.rb b/lib/jekyll-redirect-from/version.rb index b4afce3..b41ebd1 100644 --- a/lib/jekyll-redirect-from/version.rb +++ b/lib/jekyll-redirect-from/version.rb @@ -1,5 +1,5 @@ # frozen_string_literal: true module JekyllRedirectFrom - VERSION = "0.12.1".freeze + VERSION = "0.13.0".freeze end From bae143f857793c9be8d4fc7b126210e4f506ddb4 Mon Sep 17 00:00:00 2001 From: Frank Taillandier Date: Mon, 4 Dec 2017 10:36:13 +0100 Subject: [PATCH 12/76] Update History.markdown --- History.markdown | 2 ++ 1 file changed, 2 insertions(+) diff --git a/History.markdown b/History.markdown index e121a48..5c13e43 100644 --- a/History.markdown +++ b/History.markdown @@ -1,5 +1,7 @@ ## HEAD +## 0.13.0 / 2017-12-03 + * Test against same version of Ruby that GitHub Pages uses (#132) ### Development Fixes From d6bc5364b7fd7fe3258b633d20ce7bdfea53074b Mon Sep 17 00:00:00 2001 From: Frank Taillandier Date: Mon, 11 Dec 2017 15:14:39 +0100 Subject: [PATCH 13/76] Update Copyright notice --- LICENSE.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/LICENSE.txt b/LICENSE.txt index ab38ad0..4262e40 100644 --- a/LICENSE.txt +++ b/LICENSE.txt @@ -1,4 +1,4 @@ -Copyright (c) 2017 Parker Moore +Copyright (c) 2013-2017 Parker Moore and contributors MIT License From 793b40c5826310366e02d7f943fceb709af9b783 Mon Sep 17 00:00:00 2001 From: Frank Taillandier Date: Wed, 3 Jan 2018 19:44:41 +0100 Subject: [PATCH 14/76] Update LICENSE.txt --- LICENSE.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/LICENSE.txt b/LICENSE.txt index 4262e40..0295617 100644 --- a/LICENSE.txt +++ b/LICENSE.txt @@ -1,4 +1,4 @@ -Copyright (c) 2013-2017 Parker Moore and contributors +Copyright (c) 2013-present Parker Moore and jekyll-redirect-from contributors MIT License From 394fc8a4c927ed9783a06e78809ddec4ec3ed13d Mon Sep 17 00:00:00 2001 From: jekyllbot Date: Sat, 3 Feb 2018 16:22:15 -0500 Subject: [PATCH 15/76] Test against Ruby 2.5 (#173) Merge pull request 173 --- .rubocop.yml | 2 +- .travis.yml | 12 ++++++------ jekyll-redirect-from.gemspec | 4 ++-- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/.rubocop.yml b/.rubocop.yml index 301d047..295b7e3 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -2,7 +2,7 @@ inherit_gem: jekyll: .rubocop.yml AllCops: - TargetRubyVersion: 2.1 + TargetRubyVersion: 2.2 Exclude: - vendor/**/* diff --git a/.travis.yml b/.travis.yml index aba38c0..61855dd 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,17 +1,17 @@ language: ruby -before_script: bundle update -script: "script/cibuild" sudo: false cache: bundler - matrix: include: - # GitHub Pages - rvm: 2.4.0 + rvm: 2.4.2 env: GH_PAGES=true - rvm: + - 2.5 - 2.4 - 2.3 - 2.2 - - 2.1 +before_install: +- gem update --system +before_script: bundle update +script: script/cibuild diff --git a/jekyll-redirect-from.gemspec b/jekyll-redirect-from.gemspec index ed37a5c..f42cc2f 100644 --- a/jekyll-redirect-from.gemspec +++ b/jekyll-redirect-from.gemspec @@ -23,9 +23,9 @@ Gem::Specification.new do |spec| spec.require_paths = ["lib"] spec.add_runtime_dependency "jekyll", "~> 3.3" - spec.add_development_dependency "bundler", "~> 1.3" + spec.add_development_dependency "bundler", "~> 1.16" spec.add_development_dependency "jekyll-sitemap", "~> 1.0" spec.add_development_dependency "rake", "~> 12.0" spec.add_development_dependency "rspec", "~> 3.5" - spec.add_development_dependency "rubocop", "~> 0.51" + spec.add_development_dependency "rubocop", "0.51" end From 5da12f355ca909af9cc2a51a324e81106d3f39b9 Mon Sep 17 00:00:00 2001 From: jekyllbot Date: Sat, 3 Feb 2018 16:22:16 -0500 Subject: [PATCH 16/76] Update history to reflect merge of #173 [ci skip] --- History.markdown | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/History.markdown b/History.markdown index 5c13e43..1b24d2c 100644 --- a/History.markdown +++ b/History.markdown @@ -1,5 +1,9 @@ ## HEAD +### Development Fixes + + * Test against Ruby 2.5 (#173) + ## 0.13.0 / 2017-12-03 * Test against same version of Ruby that GitHub Pages uses (#132) From 97c2841d4b971c8e5b5b4f7d219891cd229c6636 Mon Sep 17 00:00:00 2001 From: New Future Date: Sat, 30 Jun 2018 05:16:06 +0800 Subject: [PATCH 17/76] run javascript at first to avoid splash (#158) Merge pull request 158 --- lib/jekyll-redirect-from/redirect.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/jekyll-redirect-from/redirect.html b/lib/jekyll-redirect-from/redirect.html index 54ed750..6640310 100644 --- a/lib/jekyll-redirect-from/redirect.html +++ b/lib/jekyll-redirect-from/redirect.html @@ -3,9 +3,9 @@ Redirecting… +

Redirecting…

Click here if you are not redirected. - From 7c0b7c238b17f4b5ff870b7bcec869d34ed23277 Mon Sep 17 00:00:00 2001 From: jekyllbot Date: Fri, 29 Jun 2018 17:16:08 -0400 Subject: [PATCH 18/76] Update history to reflect merge of #158 [ci skip] --- History.markdown | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/History.markdown b/History.markdown index 1b24d2c..60175fa 100644 --- a/History.markdown +++ b/History.markdown @@ -4,6 +4,10 @@ * Test against Ruby 2.5 (#173) +### Minor Enhancements + + * run javascript at first to avoid splash (#158) + ## 0.13.0 / 2017-12-03 * Test against same version of Ruby that GitHub Pages uses (#132) From 083cdcc48fb8df2a02df180deb974a25ddc65efb Mon Sep 17 00:00:00 2001 From: Frank Taillandier Date: Fri, 29 Jun 2018 23:26:09 +0200 Subject: [PATCH 19/76] Use Rubocop 0.57 --- jekyll-redirect-from.gemspec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/jekyll-redirect-from.gemspec b/jekyll-redirect-from.gemspec index f42cc2f..99255a5 100644 --- a/jekyll-redirect-from.gemspec +++ b/jekyll-redirect-from.gemspec @@ -27,5 +27,5 @@ Gem::Specification.new do |spec| spec.add_development_dependency "jekyll-sitemap", "~> 1.0" spec.add_development_dependency "rake", "~> 12.0" spec.add_development_dependency "rspec", "~> 3.5" - spec.add_development_dependency "rubocop", "0.51" + spec.add_development_dependency "rubocop", "~> 0.57" end From 78042a362564cb2647f3cf709974d19a1882fc50 Mon Sep 17 00:00:00 2001 From: Frank Taillandier Date: Fri, 29 Jun 2018 23:26:23 +0200 Subject: [PATCH 20/76] Target Ruby 2.3 --- .rubocop.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.rubocop.yml b/.rubocop.yml index 295b7e3..0d2bccc 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -2,7 +2,7 @@ inherit_gem: jekyll: .rubocop.yml AllCops: - TargetRubyVersion: 2.2 + TargetRubyVersion: 2.3 Exclude: - vendor/**/* From 9739a8b7feabfbad3a0a3831328bac950f4366ae Mon Sep 17 00:00:00 2001 From: Frank Taillandier Date: Fri, 29 Jun 2018 23:26:46 +0200 Subject: [PATCH 21/76] List offenses --- .rubocop.yml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/.rubocop.yml b/.rubocop.yml index 0d2bccc..86b43bd 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -13,3 +13,11 @@ Metrics/BlockLength: Metrics/LineLength: Exclude: - spec/**/* + +Naming/MemoizedInstanceVariableName: + Exclude: + - lib/jekyll-redirect-from/page_without_a_file.rb + +Naming/UncommunicativeMethodParamName: + Exclude: + - lib/jekyll-redirect-from/redirect_page.rb From e22763b82beb3c58619aa1bc5f22763209a779bb Mon Sep 17 00:00:00 2001 From: Frank Taillandier Date: Fri, 29 Jun 2018 23:27:09 +0200 Subject: [PATCH 22/76] End testing Ruby 2.2 (EOL) --- .travis.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 61855dd..4d8487b 100644 --- a/.travis.yml +++ b/.travis.yml @@ -10,7 +10,6 @@ rvm: - 2.5 - 2.4 - 2.3 - - 2.2 before_install: - gem update --system before_script: bundle update From 62c5bb71cb1ff62a8f2e2d5e494ad8c22f0dcfb0 Mon Sep 17 00:00:00 2001 From: Frank Taillandier Date: Fri, 29 Jun 2018 23:27:47 +0200 Subject: [PATCH 23/76] Release :gem: v0.14 --- History.markdown | 12 +++++++----- lib/jekyll-redirect-from/version.rb | 2 +- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/History.markdown b/History.markdown index 60175fa..602bbfa 100644 --- a/History.markdown +++ b/History.markdown @@ -1,12 +1,14 @@ -## HEAD +## 0.14.0 / 2018-06-29 -### Development Fixes +### Minor Enhancements - * Test against Ruby 2.5 (#173) + * Run javascript at first to avoid splash (#158) -### Minor Enhancements +### Development Fixes - * run javascript at first to avoid splash (#158) + * Use Rubocop 0.57 + * Target Ruby 2.3 + * Test against Ruby 2.5 (#173) ## 0.13.0 / 2017-12-03 diff --git a/lib/jekyll-redirect-from/version.rb b/lib/jekyll-redirect-from/version.rb index b41ebd1..5115b58 100644 --- a/lib/jekyll-redirect-from/version.rb +++ b/lib/jekyll-redirect-from/version.rb @@ -1,5 +1,5 @@ # frozen_string_literal: true module JekyllRedirectFrom - VERSION = "0.13.0".freeze + VERSION = "0.14.0" end From fbc4eef9ad299331a32a2fcfd7891c5aaeef1b01 Mon Sep 17 00:00:00 2001 From: Frank Taillandier Date: Wed, 11 Jul 2018 16:13:54 +0200 Subject: [PATCH 24/76] Rubocop ~> 0.57.2 --- jekyll-redirect-from.gemspec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/jekyll-redirect-from.gemspec b/jekyll-redirect-from.gemspec index 99255a5..cde60e0 100644 --- a/jekyll-redirect-from.gemspec +++ b/jekyll-redirect-from.gemspec @@ -27,5 +27,5 @@ Gem::Specification.new do |spec| spec.add_development_dependency "jekyll-sitemap", "~> 1.0" spec.add_development_dependency "rake", "~> 12.0" spec.add_development_dependency "rspec", "~> 3.5" - spec.add_development_dependency "rubocop", "~> 0.57" + spec.add_development_dependency "rubocop", "~> 0.57.2" end From 464e906ee294a3165486baaff41f093da47de1f4 Mon Sep 17 00:00:00 2001 From: Frank Taillandier Date: Tue, 24 Jul 2018 17:04:56 +0200 Subject: [PATCH 25/76] Lint with rubocop-jekyll --- .rubocop.yml | 4 +++- jekyll-redirect-from.gemspec | 4 +++- lib/jekyll-redirect-from/redirect_page.rb | 6 +++--- 3 files changed, 9 insertions(+), 5 deletions(-) diff --git a/.rubocop.yml b/.rubocop.yml index 86b43bd..9065597 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -1,5 +1,7 @@ +require: rubocop-jekyll + inherit_gem: - jekyll: .rubocop.yml + rubocop-jekyll: .rubocop.yml AllCops: TargetRubyVersion: 2.3 diff --git a/jekyll-redirect-from.gemspec b/jekyll-redirect-from.gemspec index cde60e0..45fc1b3 100644 --- a/jekyll-redirect-from.gemspec +++ b/jekyll-redirect-from.gemspec @@ -22,10 +22,12 @@ Gem::Specification.new do |spec| spec.test_files = spec.files.grep(%r!^(test|spec|features)/!) spec.require_paths = ["lib"] + spec.required_ruby_version = ">= 2.3.0" + spec.add_runtime_dependency "jekyll", "~> 3.3" spec.add_development_dependency "bundler", "~> 1.16" spec.add_development_dependency "jekyll-sitemap", "~> 1.0" spec.add_development_dependency "rake", "~> 12.0" spec.add_development_dependency "rspec", "~> 3.5" - spec.add_development_dependency "rubocop", "~> 0.57.2" + spec.add_development_dependency "rubocop-jekyll", "~> 0.1.0" end diff --git a/lib/jekyll-redirect-from/redirect_page.rb b/lib/jekyll-redirect-from/redirect_page.rb index b8ab4b1..0ae65d2 100644 --- a/lib/jekyll-redirect-from/redirect_page.rb +++ b/lib/jekyll-redirect-from/redirect_page.rb @@ -45,13 +45,13 @@ def read_yaml(_base, _name, _opts = {}) def set_paths(from, to) @context ||= context from = ensure_leading_slash(from) - data.merge!({ + data.merge!( "permalink" => from, "redirect" => { "from" => from, "to" => to =~ %r!^https?://! ? to : absolute_url(to), - }, - }) + } + ) end def redirect_from From 80d6610833a4ac3fc10f79706809ccc84a0a30fa Mon Sep 17 00:00:00 2001 From: Frank Taillandier Date: Fri, 26 Oct 2018 17:45:24 +0200 Subject: [PATCH 26/76] chore(ci): match GitHub Pages version --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 4d8487b..ec1445a 100644 --- a/.travis.yml +++ b/.travis.yml @@ -4,7 +4,7 @@ cache: bundler matrix: include: - # GitHub Pages - rvm: 2.4.2 + rvm: 2.5.1 env: GH_PAGES=true rvm: - 2.5 From 32856d751d49cbbd9b4f173a527f69aa50d3b087 Mon Sep 17 00:00:00 2001 From: jekyllbot Date: Fri, 26 Oct 2018 12:02:28 -0400 Subject: [PATCH 27/76] chore(deps): rubocop-jekyll 0.3 (#187) Merge pull request 187 --- .rubocop.yml | 18 ++---------------- .rubocop_todo.yml | 21 +++++++++++++++++++++ jekyll-redirect-from.gemspec | 2 +- lib/jekyll-redirect-from/generator.rb | 3 +++ 4 files changed, 27 insertions(+), 17 deletions(-) create mode 100644 .rubocop_todo.yml diff --git a/.rubocop.yml b/.rubocop.yml index 9065597..f91ffe3 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -1,3 +1,5 @@ +inherit_from: .rubocop_todo.yml + require: rubocop-jekyll inherit_gem: @@ -7,19 +9,3 @@ AllCops: TargetRubyVersion: 2.3 Exclude: - vendor/**/* - -Metrics/BlockLength: - Exclude: - - spec/**/* - -Metrics/LineLength: - Exclude: - - spec/**/* - -Naming/MemoizedInstanceVariableName: - Exclude: - - lib/jekyll-redirect-from/page_without_a_file.rb - -Naming/UncommunicativeMethodParamName: - Exclude: - - lib/jekyll-redirect-from/redirect_page.rb diff --git a/.rubocop_todo.yml b/.rubocop_todo.yml new file mode 100644 index 0000000..c16811b --- /dev/null +++ b/.rubocop_todo.yml @@ -0,0 +1,21 @@ +# This configuration was generated by +# `rubocop --auto-gen-config` +# on 2018-10-26 17:43:57 +0200 using RuboCop version 0.60.0. +# 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: 1 +# Configuration parameters: EnforcedStyleForLeadingUnderscores. +# SupportedStylesForLeadingUnderscores: disallowed, required, optional +Naming/MemoizedInstanceVariableName: + Exclude: + - 'lib/jekyll-redirect-from/page_without_a_file.rb' + +# Offense count: 2 +# Configuration parameters: MinNameLength, AllowNamesEndingInNumbers, AllowedNames, ForbiddenNames. +# AllowedNames: io, id, to, by, on, in, at, ip, db +Naming/UncommunicativeMethodParamName: + Exclude: + - 'lib/jekyll-redirect-from/redirect_page.rb' diff --git a/jekyll-redirect-from.gemspec b/jekyll-redirect-from.gemspec index 45fc1b3..dfff65a 100644 --- a/jekyll-redirect-from.gemspec +++ b/jekyll-redirect-from.gemspec @@ -29,5 +29,5 @@ Gem::Specification.new do |spec| spec.add_development_dependency "jekyll-sitemap", "~> 1.0" spec.add_development_dependency "rake", "~> 12.0" spec.add_development_dependency "rspec", "~> 3.5" - spec.add_development_dependency "rubocop-jekyll", "~> 0.1.0" + spec.add_development_dependency "rubocop-jekyll", "~> 0.3" end diff --git a/lib/jekyll-redirect-from/generator.rb b/lib/jekyll-redirect-from/generator.rb index 71f78ee..5ef5375 100644 --- a/lib/jekyll-redirect-from/generator.rb +++ b/lib/jekyll-redirect-from/generator.rb @@ -17,6 +17,7 @@ def generate(site) # Must duplicate pages to modify while in loop (site.docs_to_write + site.pages.dup).each do |doc| next unless JekyllRedirectFrom::CLASSES.include?(doc.class) + generate_redirect_from(doc) generate_redirect_to(doc) end @@ -37,6 +38,7 @@ def generate_redirect_from(doc) def generate_redirect_to(doc) return unless doc.redirect_to + page = RedirectPage.redirect_to(doc, doc.redirect_to) doc.data.merge!(page.data) doc.content = doc.output = page.output @@ -45,6 +47,7 @@ def generate_redirect_to(doc) def generate_redirects_json return if File.exist? site.in_source_dir("redirects.json") + page = PageWithoutAFile.new(site, "", "", "redirects.json") page.content = redirects.to_json page.data["layout"] = nil From 9782c108bb5b1eb32520b426c650b0420b4512b5 Mon Sep 17 00:00:00 2001 From: jekyllbot Date: Fri, 26 Oct 2018 12:02:29 -0400 Subject: [PATCH 28/76] Update history to reflect merge of #187 [ci skip] --- History.markdown | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/History.markdown b/History.markdown index 602bbfa..a774196 100644 --- a/History.markdown +++ b/History.markdown @@ -1,3 +1,9 @@ +## HEAD + +### Development Fixes + + * chore(deps): rubocop-jekyll 0.3 (#187) + ## 0.14.0 / 2018-06-29 ### Minor Enhancements From b34fff5b6784f1127a7eaf80149c33f8b70eec9b Mon Sep 17 00:00:00 2001 From: Frank Taillandier Date: Thu, 6 Dec 2018 11:50:28 +0100 Subject: [PATCH 29/76] chore(deps): rubocop-jekyll 0.4 --- jekyll-redirect-from.gemspec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/jekyll-redirect-from.gemspec b/jekyll-redirect-from.gemspec index dfff65a..f7685a7 100644 --- a/jekyll-redirect-from.gemspec +++ b/jekyll-redirect-from.gemspec @@ -29,5 +29,5 @@ Gem::Specification.new do |spec| spec.add_development_dependency "jekyll-sitemap", "~> 1.0" spec.add_development_dependency "rake", "~> 12.0" spec.add_development_dependency "rspec", "~> 3.5" - spec.add_development_dependency "rubocop-jekyll", "~> 0.3" + spec.add_development_dependency "rubocop-jekyll", "~> 0.4" end From 573d2940f7eecd91389311867b1c2cc2ad6e9850 Mon Sep 17 00:00:00 2001 From: Frank Taillandier Date: Thu, 6 Dec 2018 11:51:59 +0100 Subject: [PATCH 30/76] style: safe-auto-correct --- Gemfile | 4 +--- spec/jekyll_redirect_from/generator_spec.rb | 2 +- spec/spec_helper.rb | 6 +++--- 3 files changed, 5 insertions(+), 7 deletions(-) diff --git a/Gemfile b/Gemfile index 42d51da..a13ed56 100644 --- a/Gemfile +++ b/Gemfile @@ -3,6 +3,4 @@ source "https://rubygems.org" gemspec -if ENV["GH_PAGES"] - gem "github-pages" -end +gem "github-pages" if ENV["GH_PAGES"] diff --git a/spec/jekyll_redirect_from/generator_spec.rb b/spec/jekyll_redirect_from/generator_spec.rb index 37db991..b7110b5 100644 --- a/spec/jekyll_redirect_from/generator_spec.rb +++ b/spec/jekyll_redirect_from/generator_spec.rb @@ -142,7 +142,7 @@ it "doesn't overwrite redirets.json" do expect(path).to exist - expect(redirects).to eql({ "foo" => "bar" }) + expect(redirects).to eql("foo" => "bar") end end end diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index d77ceaf..5a59fff 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -34,7 +34,7 @@ def dest_dir(*paths) end def config - Jekyll.configuration({ + Jekyll.configuration( "source" => fixtures_path.to_s, "destination" => fixtures_path.join("_site").to_s, "collections" => { @@ -49,8 +49,8 @@ def config "defaults" => [{ "scope" => { "path" => "" }, "values" => { "layout" => "layout" }, - },], - }).backwards_compatibilize + }] + ).backwards_compatibilize end def site From 07b6b3ba962e643464863a727eea19727d5be915 Mon Sep 17 00:00:00 2001 From: Frank Taillandier Date: Thu, 6 Dec 2018 11:52:15 +0100 Subject: [PATCH 31/76] style: auo-gen-exclude-only --- .rubocop_todo.yml | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/.rubocop_todo.yml b/.rubocop_todo.yml index c16811b..b0fac8c 100644 --- a/.rubocop_todo.yml +++ b/.rubocop_todo.yml @@ -1,11 +1,30 @@ # This configuration was generated by # `rubocop --auto-gen-config` -# on 2018-10-26 17:43:57 +0200 using RuboCop version 0.60.0. +# on 2018-12-06 11:51:19 +0100 using RuboCop version 0.61.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: 12 +# Configuration parameters: CountComments, Max, ExcludedMethods. +# ExcludedMethods: refine +Metrics/BlockLength: + Exclude: + - 'spec/integrations_spec.rb' + - 'spec/jekyll_redirect_from/generator_spec.rb' + - 'spec/jekyll_redirect_from/redirect_page_spec.rb' + - 'spec/jekyll_redirect_from/redirectable_spec.rb' + - 'spec/spec_helper.rb' + +# Offense count: 3 +# Configuration parameters: Max, AllowHeredoc, AllowURI, URISchemes, IgnoreCopDirectives, IgnoredPatterns. +# URISchemes: http, https +Metrics/LineLength: + Exclude: + - 'spec/jekyll_redirect_from/generator_spec.rb' + - 'spec/jekyll_redirect_from/redirect_page_spec.rb' + # Offense count: 1 # Configuration parameters: EnforcedStyleForLeadingUnderscores. # SupportedStylesForLeadingUnderscores: disallowed, required, optional From 557cebc4e469960e7674130bf24e7267d4f652ec Mon Sep 17 00:00:00 2001 From: Frank Taillandier Date: Thu, 6 Dec 2018 11:52:51 +0100 Subject: [PATCH 32/76] chore(ci): test oldest and latest Ruby versions only --- .travis.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index ec1445a..f1130af 100644 --- a/.travis.yml +++ b/.travis.yml @@ -8,7 +8,6 @@ matrix: env: GH_PAGES=true rvm: - 2.5 - - 2.4 - 2.3 before_install: - gem update --system From 162dd9e9d461c03c5f94a09e321cbc0b53ff8042 Mon Sep 17 00:00:00 2001 From: Frank Taillandier Date: Sun, 6 Jan 2019 19:35:47 +0100 Subject: [PATCH 33/76] chore(deps): relax version constraint on bundler --- jekyll-redirect-from.gemspec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/jekyll-redirect-from.gemspec b/jekyll-redirect-from.gemspec index f7685a7..e9e7fa1 100644 --- a/jekyll-redirect-from.gemspec +++ b/jekyll-redirect-from.gemspec @@ -25,7 +25,7 @@ Gem::Specification.new do |spec| spec.required_ruby_version = ">= 2.3.0" spec.add_runtime_dependency "jekyll", "~> 3.3" - spec.add_development_dependency "bundler", "~> 1.16" + spec.add_development_dependency "bundler" spec.add_development_dependency "jekyll-sitemap", "~> 1.0" spec.add_development_dependency "rake", "~> 12.0" spec.add_development_dependency "rspec", "~> 3.5" From a61d30b2fe78d82e4bebfe885782a6d1c8c36a1e Mon Sep 17 00:00:00 2001 From: Frank Taillandier Date: Sun, 6 Jan 2019 20:11:26 +0100 Subject: [PATCH 34/76] chore(ci): Add Ruby 2.6, drop Ruby 2.3 --- .travis.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.travis.yml b/.travis.yml index f1130af..2ec68f0 100644 --- a/.travis.yml +++ b/.travis.yml @@ -4,11 +4,11 @@ cache: bundler matrix: include: - # GitHub Pages - rvm: 2.5.1 + rvm: 2.5.3 env: GH_PAGES=true rvm: - - 2.5 - - 2.3 + - 2.6 + - 2.4 before_install: - gem update --system before_script: bundle update From be6c5b26589d8263b229d4e73bb9a1877ddb942e Mon Sep 17 00:00:00 2001 From: Frank Taillandier Date: Wed, 6 Mar 2019 13:32:54 +0100 Subject: [PATCH 35/76] chore (ci): remove deprecated `sudo: false` in .travis.yml https://blog.travis-ci.com/2018-11-19-required-linux-infrastructure-migration --- .travis.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 2ec68f0..e337855 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,5 +1,4 @@ language: ruby -sudo: false cache: bundler matrix: include: From 86e49cf50c46e2cdd63109639d59a03622c59526 Mon Sep 17 00:00:00 2001 From: Ashwin Maroli Date: Sun, 24 Mar 2019 01:34:36 +0530 Subject: [PATCH 36/76] Allow testing and using with Jekyll 4.x (#196) Merge pull request 196 --- .travis.yml | 12 +++++++++--- Gemfile | 1 + jekyll-redirect-from.gemspec | 3 ++- 3 files changed, 12 insertions(+), 4 deletions(-) diff --git a/.travis.yml b/.travis.yml index e337855..96b19e0 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,13 +1,19 @@ language: ruby cache: bundler +rvm: + - &latest_ruby 2.6 + - 2.4 + - 2.3 +env: + - JEKYLL_VERSION="~> 3.8" matrix: include: - # GitHub Pages rvm: 2.5.3 env: GH_PAGES=true -rvm: - - 2.6 - - 2.4 + - rvm: *latest_ruby + env: JEKYLL_VERSION=">= 4.0.0.pre.alpha1" + before_install: - gem update --system before_script: bundle update diff --git a/Gemfile b/Gemfile index a13ed56..7ffc8ba 100644 --- a/Gemfile +++ b/Gemfile @@ -4,3 +4,4 @@ source "https://rubygems.org" gemspec gem "github-pages" if ENV["GH_PAGES"] +gem "jekyll", ENV["JEKYLL_VERSION"] if ENV["JEKYLL_VERSION"] diff --git a/jekyll-redirect-from.gemspec b/jekyll-redirect-from.gemspec index e9e7fa1..c24cee8 100644 --- a/jekyll-redirect-from.gemspec +++ b/jekyll-redirect-from.gemspec @@ -24,7 +24,8 @@ Gem::Specification.new do |spec| spec.required_ruby_version = ">= 2.3.0" - spec.add_runtime_dependency "jekyll", "~> 3.3" + spec.add_runtime_dependency "jekyll", ">= 3.3", "< 5.0" + spec.add_development_dependency "bundler" spec.add_development_dependency "jekyll-sitemap", "~> 1.0" spec.add_development_dependency "rake", "~> 12.0" From 0bde11ffc32a993119b90a81c8aa8b6d716d0342 Mon Sep 17 00:00:00 2001 From: jekyllbot Date: Sat, 23 Mar 2019 16:04:37 -0400 Subject: [PATCH 37/76] Update history to reflect merge of #196 [ci skip] --- History.markdown | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/History.markdown b/History.markdown index a774196..ecd257d 100644 --- a/History.markdown +++ b/History.markdown @@ -4,6 +4,10 @@ * chore(deps): rubocop-jekyll 0.3 (#187) +### Bug Fixes + + * Allow testing and using with Jekyll 4.x (#196) + ## 0.14.0 / 2018-06-29 ### Minor Enhancements From 17534ddc9739f45be6940df92b7b28e78e1bfc03 Mon Sep 17 00:00:00 2001 From: Frank Taillandier Date: Sat, 23 Mar 2019 22:07:56 +0100 Subject: [PATCH 38/76] Release: v0.15.0 --- .gitignore | 1 + History.markdown | 2 +- lib/jekyll-redirect-from/version.rb | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index 98dcaca..0b0112f 100644 --- a/.gitignore +++ b/.gitignore @@ -13,6 +13,7 @@ pkg rdoc spec/reports spec/fixtures/.jekyll-metadata +spec/fixtures/.jekyll-cache test/tmp test/version_tmp tmp diff --git a/History.markdown b/History.markdown index ecd257d..4337daa 100644 --- a/History.markdown +++ b/History.markdown @@ -1,4 +1,4 @@ -## HEAD +## 0.15.0 / 2019-03-23 ### Development Fixes diff --git a/lib/jekyll-redirect-from/version.rb b/lib/jekyll-redirect-from/version.rb index 5115b58..3a4963e 100644 --- a/lib/jekyll-redirect-from/version.rb +++ b/lib/jekyll-redirect-from/version.rb @@ -1,5 +1,5 @@ # frozen_string_literal: true module JekyllRedirectFrom - VERSION = "0.14.0" + VERSION = "0.15.0" end From f952abf34c51460add16a53b5cd380fc2ec9be95 Mon Sep 17 00:00:00 2001 From: "David J. Malan" Date: Sat, 23 Mar 2019 17:55:49 -0400 Subject: [PATCH 39/76] Simplifies YAML for redirect_to (#185) Merge pull request 185 --- README.md | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/README.md b/README.md index afed061..65118e9 100644 --- a/README.md +++ b/README.md @@ -113,13 +113,9 @@ Sometimes, you may want to redirect a site page to a totally different website. ```yaml title: My amazing post -redirect_to: - - http://www.github.com +redirect_to: http://www.github.com ``` -If you have multiple `redirect_to`s set, only the first one will be respected. - - **Note**: Using `redirect_to` or `redirect_from` with collections will only work with files which are output to HTML, such as `.md`, `.textile`, `.html` etc. ## Customizing the redirect template From d360b8722ff380c74d7ecb93ebc4f97b12e7c812 Mon Sep 17 00:00:00 2001 From: jekyllbot Date: Sat, 23 Mar 2019 17:55:50 -0400 Subject: [PATCH 40/76] Update history to reflect merge of #185 [ci skip] --- History.markdown | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/History.markdown b/History.markdown index 4337daa..beb123e 100644 --- a/History.markdown +++ b/History.markdown @@ -1,3 +1,9 @@ +## HEAD + +### Documentation + + * Simplifies YAML for redirect_to (#185) + ## 0.15.0 / 2019-03-23 ### Development Fixes From 873f537f67eb1d69da6acd9711fd967cd43f4e01 Mon Sep 17 00:00:00 2001 From: Ashwin Maroli Date: Fri, 3 May 2019 21:34:58 +0530 Subject: [PATCH 41/76] Use `Hash#key?` instead of `Hash#keys.any?` (#201) Merge pull request 201 --- lib/jekyll-redirect-from/generator.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/jekyll-redirect-from/generator.rb b/lib/jekyll-redirect-from/generator.rb index 5ef5375..5cf0414 100644 --- a/lib/jekyll-redirect-from/generator.rb +++ b/lib/jekyll-redirect-from/generator.rb @@ -10,7 +10,7 @@ def generate(site) @redirects = {} # Inject our layout, unless the user has already specified a redirect layout' - unless site.layouts.keys.any? { |name| name == "redirect" } + unless site.layouts.key?("redirect") site.layouts["redirect"] = JekyllRedirectFrom::Layout.new(site) end From 21d18e0751df69a0d1a6951cb3462c77f291201b Mon Sep 17 00:00:00 2001 From: jekyllbot Date: Fri, 3 May 2019 12:05:00 -0400 Subject: [PATCH 42/76] Update history to reflect merge of #201 [ci skip] --- History.markdown | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/History.markdown b/History.markdown index beb123e..fe50dbf 100644 --- a/History.markdown +++ b/History.markdown @@ -4,6 +4,10 @@ * Simplifies YAML for redirect_to (#185) +### Bug Fixes + + * Use `Hash#key?` instead of `Hash#keys.any?` (#201) + ## 0.15.0 / 2019-03-23 ### Development Fixes From e1266f15547a37b4be5b16bc6d90ce7bbe3edd88 Mon Sep 17 00:00:00 2001 From: Ashwin Maroli Date: Thu, 12 Dec 2019 17:22:06 +0530 Subject: [PATCH 43/76] Stop testing with backwards-compatible site config (#211) Merge pull request 211 --- .travis.yml | 2 +- spec/spec_helper.rb | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.travis.yml b/.travis.yml index 96b19e0..3570263 100644 --- a/.travis.yml +++ b/.travis.yml @@ -12,7 +12,7 @@ matrix: rvm: 2.5.3 env: GH_PAGES=true - rvm: *latest_ruby - env: JEKYLL_VERSION=">= 4.0.0.pre.alpha1" + env: JEKYLL_VERSION="~> 4.0" before_install: - gem update --system diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index 5a59fff..ef597e7 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -42,7 +42,7 @@ def config "authors" => {}, }, "url" => "http://jekyllrb.com", - "gems" => [ + "plugins" => [ "jekyll-redirect-from", "jekyll-sitemap", ], @@ -50,7 +50,7 @@ def config "scope" => { "path" => "" }, "values" => { "layout" => "layout" }, }] - ).backwards_compatibilize + ) end def site From 26d6e61d1def4a10e495cd015422e21d5617618c Mon Sep 17 00:00:00 2001 From: jekyllbot Date: Thu, 12 Dec 2019 06:52:08 -0500 Subject: [PATCH 44/76] Update history to reflect merge of #211 [ci skip] --- History.markdown | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/History.markdown b/History.markdown index fe50dbf..5891eee 100644 --- a/History.markdown +++ b/History.markdown @@ -8,6 +8,10 @@ * Use `Hash#key?` instead of `Hash#keys.any?` (#201) +### Development Fixes + + * Stop testing with backwards-compatible site config (#211) + ## 0.15.0 / 2019-03-23 ### Development Fixes From b708d481622a43e28d3d03c96e080ef85a320bff Mon Sep 17 00:00:00 2001 From: "David J. Malan" Date: Sun, 26 Jan 2020 15:23:39 -0500 Subject: [PATCH 45/76] Allows generation of redirects.json to be disabled (#207) Merge pull request 207 --- README.md | 13 +++++++++++++ lib/jekyll-redirect-from/generator.rb | 6 +++++- spec/jekyll_redirect_from/generator_spec.rb | 12 ++++++++++-- 3 files changed, 28 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 65118e9..706435b 100644 --- a/README.md +++ b/README.md @@ -127,6 +127,19 @@ Your layout will get the following variables: * `page.redirect.from` - the relative path to the redirect page * `page.redirect.to` - the absolute URL (where available) to the target page +## Configuration + +You can configure this plugin in `_config.yml` by adding to the `redirect_from` key. + +### Disabling `redirects.json` + +By default, a file called `redirects.json`, which can be used for automated testing or to implement server-side redirects, will be included in the output. To exclude it from the output, set the `json` key to `false`: + +```yml +redirect_from: + json: false +``` + ## Contributing 1. Fork it diff --git a/lib/jekyll-redirect-from/generator.rb b/lib/jekyll-redirect-from/generator.rb index 5cf0414..b42e77e 100644 --- a/lib/jekyll-redirect-from/generator.rb +++ b/lib/jekyll-redirect-from/generator.rb @@ -22,7 +22,7 @@ def generate(site) generate_redirect_to(doc) end - generate_redirects_json + generate_redirects_json if generate_redirects_json? end private @@ -53,5 +53,9 @@ def generate_redirects_json page.data["layout"] = nil site.pages << page end + + def generate_redirects_json? + site.config.dig("redirect_from", "json") != false + end end end diff --git a/spec/jekyll_redirect_from/generator_spec.rb b/spec/jekyll_redirect_from/generator_spec.rb index b7110b5..42c33de 100644 --- a/spec/jekyll_redirect_from/generator_spec.rb +++ b/spec/jekyll_redirect_from/generator_spec.rb @@ -94,7 +94,7 @@ let(:redirects) { JSON.parse(contents) } let(:domain) { "http://jekyllrb.com" } - it "creates the redirets file" do + it "creates the redirects file" do expect(path).to exist end @@ -140,10 +140,18 @@ FileUtils.rm_f source_path end - it "doesn't overwrite redirets.json" do + it "doesn't overwrite redirects.json" do expect(path).to exist expect(redirects).to eql("foo" => "bar") end end + + context "when explicitly disabled" do + let(:site) { Jekyll::Site.new(config.merge("redirect_from" => { "json" => false })) } + + it "does not create the redirects file" do + expect(path).to_not exist + end + end end end From 5ecf4cebf3e73313739b0beff2405852ffe874e3 Mon Sep 17 00:00:00 2001 From: jekyllbot Date: Sun, 26 Jan 2020 15:23:41 -0500 Subject: [PATCH 46/76] Update history to reflect merge of #207 [ci skip] --- History.markdown | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/History.markdown b/History.markdown index 5891eee..6e3ead6 100644 --- a/History.markdown +++ b/History.markdown @@ -12,6 +12,10 @@ * Stop testing with backwards-compatible site config (#211) +### Minor Enhancements + + * Allows generation of redirects.json to be disabled (#207) + ## 0.15.0 / 2019-03-23 ### Development Fixes From 475bdf9ae9b324b04b415110798487c116e9a2db Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Radoslav=20Karl=C3=ADk?= Date: Sun, 26 Jan 2020 22:00:07 +0100 Subject: [PATCH 47/76] Allow redirects from and for subclasses of page and document (#204) Merge pull request 204 --- lib/jekyll-redirect-from/generator.rb | 6 +++++- spec/jekyll_redirect_from/generator_spec.rb | 14 ++++++++++++++ 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/lib/jekyll-redirect-from/generator.rb b/lib/jekyll-redirect-from/generator.rb index b42e77e..52e68f5 100644 --- a/lib/jekyll-redirect-from/generator.rb +++ b/lib/jekyll-redirect-from/generator.rb @@ -16,7 +16,7 @@ def generate(site) # Must duplicate pages to modify while in loop (site.docs_to_write + site.pages.dup).each do |doc| - next unless JekyllRedirectFrom::CLASSES.include?(doc.class) + next unless redirectable_document?(doc) generate_redirect_from(doc) generate_redirect_to(doc) @@ -54,6 +54,10 @@ def generate_redirects_json site.pages << page end + def redirectable_document?(doc) + doc.is_a?(Jekyll::Document) || doc.is_a?(Jekyll::Page) + end + def generate_redirects_json? site.config.dig("redirect_from", "json") != false end diff --git a/spec/jekyll_redirect_from/generator_spec.rb b/spec/jekyll_redirect_from/generator_spec.rb index 42c33de..5a7767b 100644 --- a/spec/jekyll_redirect_from/generator_spec.rb +++ b/spec/jekyll_redirect_from/generator_spec.rb @@ -154,4 +154,18 @@ end end end + + context "redirectable_document?" do + let(:generator) { JekyllRedirectFrom::Generator.new } + + it "accepts subclasses of Jekyll::Document" do + SubclassOfJekyllDocument = Class.new(Jekyll::Document) { define_method(:initialize) {} } + expect(generator.send(:redirectable_document?, SubclassOfJekyllDocument.new)).to be_truthy + end + + it "accepts subclasses of Jekyll::Page" do + SubclassOfJekyllPage = Class.new(Jekyll::Page) { define_method(:initialize) {} } + expect(generator.send(:redirectable_document?, SubclassOfJekyllPage.new)).to be_truthy + end + end end From 95f3d82e0432a30d79f1fe2192d0b15d7a53b9cd Mon Sep 17 00:00:00 2001 From: jekyllbot Date: Sun, 26 Jan 2020 16:00:09 -0500 Subject: [PATCH 48/76] Update history to reflect merge of #204 [ci skip] --- History.markdown | 1 + 1 file changed, 1 insertion(+) diff --git a/History.markdown b/History.markdown index 6e3ead6..89eb531 100644 --- a/History.markdown +++ b/History.markdown @@ -15,6 +15,7 @@ ### Minor Enhancements * Allows generation of redirects.json to be disabled (#207) + * Allow redirects from and for subclasses of page and document (#204) ## 0.15.0 / 2019-03-23 From f13c1b72a1ba0947d066a5e7946e2a7421661743 Mon Sep 17 00:00:00 2001 From: Frank Taillandier Date: Sun, 26 Jan 2020 22:04:48 +0100 Subject: [PATCH 49/76] chore: ignore vendor/bundle --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index 0b0112f..e47808f 100644 --- a/.gitignore +++ b/.gitignore @@ -17,3 +17,4 @@ spec/fixtures/.jekyll-cache test/tmp test/version_tmp tmp +vendor/bundle From 0f939070a7b90b41bab7e3a083993f7c70e1a31a Mon Sep 17 00:00:00 2001 From: Frank Taillandier Date: Sun, 26 Jan 2020 22:05:37 +0100 Subject: [PATCH 50/76] chore(deps): target Ruby 2.4 --- .rubocop.yml | 2 +- jekyll-redirect-from.gemspec | 2 +- lib/jekyll-redirect-from/redirect_page.rb | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.rubocop.yml b/.rubocop.yml index f91ffe3..abb6557 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -6,6 +6,6 @@ inherit_gem: rubocop-jekyll: .rubocop.yml AllCops: - TargetRubyVersion: 2.3 + TargetRubyVersion: 2.4 Exclude: - vendor/**/* diff --git a/jekyll-redirect-from.gemspec b/jekyll-redirect-from.gemspec index c24cee8..338ce1f 100644 --- a/jekyll-redirect-from.gemspec +++ b/jekyll-redirect-from.gemspec @@ -22,7 +22,7 @@ Gem::Specification.new do |spec| spec.test_files = spec.files.grep(%r!^(test|spec|features)/!) spec.require_paths = ["lib"] - spec.required_ruby_version = ">= 2.3.0" + spec.required_ruby_version = ">= 2.4.0" spec.add_runtime_dependency "jekyll", ">= 3.3", "< 5.0" diff --git a/lib/jekyll-redirect-from/redirect_page.rb b/lib/jekyll-redirect-from/redirect_page.rb index 0ae65d2..58d022c 100644 --- a/lib/jekyll-redirect-from/redirect_page.rb +++ b/lib/jekyll-redirect-from/redirect_page.rb @@ -49,7 +49,7 @@ def set_paths(from, to) "permalink" => from, "redirect" => { "from" => from, - "to" => to =~ %r!^https?://! ? to : absolute_url(to), + "to" => %r!^https?://!.match?(to) ? to : absolute_url(to), } ) end From 1ecf3cc2dfb0dfcdf3be8e6a4d68505718c65d9c Mon Sep 17 00:00:00 2001 From: Frank Taillandier Date: Sun, 26 Jan 2020 22:10:47 +0100 Subject: [PATCH 51/76] chore(release): :gem: v0.16.0 --- History.markdown | 13 +++++++------ jekyll-redirect-from.gemspec | 2 +- lib/jekyll-redirect-from/version.rb | 2 +- 3 files changed, 9 insertions(+), 8 deletions(-) diff --git a/History.markdown b/History.markdown index 89eb531..1190d11 100644 --- a/History.markdown +++ b/History.markdown @@ -1,8 +1,9 @@ -## HEAD +## 0.16.0 / 2020-01-26 -### Documentation +### Minor Enhancements - * Simplifies YAML for redirect_to (#185) + * Allows generation of `redirects.json` to be disabled (#207) + * Allow redirects from and for subclasses of page and document (#204) ### Bug Fixes @@ -10,12 +11,12 @@ ### Development Fixes + * Target Ruby 2.4 * Stop testing with backwards-compatible site config (#211) -### Minor Enhancements +### Documentation - * Allows generation of redirects.json to be disabled (#207) - * Allow redirects from and for subclasses of page and document (#204) + * Simplifies YAML for `redirect_to` (#185) ## 0.15.0 / 2019-03-23 diff --git a/jekyll-redirect-from.gemspec b/jekyll-redirect-from.gemspec index 338ce1f..cdad96a 100644 --- a/jekyll-redirect-from.gemspec +++ b/jekyll-redirect-from.gemspec @@ -30,5 +30,5 @@ Gem::Specification.new do |spec| spec.add_development_dependency "jekyll-sitemap", "~> 1.0" spec.add_development_dependency "rake", "~> 12.0" spec.add_development_dependency "rspec", "~> 3.5" - spec.add_development_dependency "rubocop-jekyll", "~> 0.4" + spec.add_development_dependency "rubocop-jekyll", "~> 0.10" end diff --git a/lib/jekyll-redirect-from/version.rb b/lib/jekyll-redirect-from/version.rb index 3a4963e..56f5d47 100644 --- a/lib/jekyll-redirect-from/version.rb +++ b/lib/jekyll-redirect-from/version.rb @@ -1,5 +1,5 @@ # frozen_string_literal: true module JekyllRedirectFrom - VERSION = "0.15.0" + VERSION = "0.16.0" end From bae0eaacc682e088dd5b8e0139f8b2b73d45d496 Mon Sep 17 00:00:00 2001 From: Frank Taillandier Date: Mon, 27 Jan 2020 20:43:09 +0100 Subject: [PATCH 52/76] chore(ci): stop testing Ruby 2.3 --- .travis.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 3570263..81ca9fa 100644 --- a/.travis.yml +++ b/.travis.yml @@ -3,7 +3,6 @@ cache: bundler rvm: - &latest_ruby 2.6 - 2.4 - - 2.3 env: - JEKYLL_VERSION="~> 3.8" matrix: From 52bcaa018c53a37998f7bf09d4f2b0d4ccbd6809 Mon Sep 17 00:00:00 2001 From: Frank Taillandier Date: Tue, 17 Mar 2020 23:09:48 +0100 Subject: [PATCH 53/76] chore(dev): simplify require for version --- jekyll-redirect-from.gemspec | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/jekyll-redirect-from.gemspec b/jekyll-redirect-from.gemspec index cdad96a..cbac525 100644 --- a/jekyll-redirect-from.gemspec +++ b/jekyll-redirect-from.gemspec @@ -1,8 +1,6 @@ # frozen_string_literal: true -lib = File.expand_path("lib", __dir__) -$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib) -require "jekyll-redirect-from/version" +require_relative "lib/jekyll-redirect-from/version" Gem::Specification.new do |spec| spec.name = "jekyll-redirect-from" From a36f3cb1bfe12461b858bcd33ca90aaefb34b4f2 Mon Sep 17 00:00:00 2001 From: Frank Taillandier Date: Mon, 13 Apr 2020 13:02:32 +0200 Subject: [PATCH 54/76] chore(ci): bump Ruby versions Ruby 2.4 is now EOL --- .travis.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index 81ca9fa..62d8c2b 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,8 +1,8 @@ language: ruby cache: bundler rvm: - - &latest_ruby 2.6 - - 2.4 + - &latest_ruby 2.7 + - 2.5 env: - JEKYLL_VERSION="~> 3.8" matrix: From 65f346c3f88939f5fa25d7e443d8845290ed3e44 Mon Sep 17 00:00:00 2001 From: Frank Taillandier Date: Mon, 13 Apr 2020 13:27:28 +0200 Subject: [PATCH 55/76] fix: rubocop cop name --- .rubocop_todo.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.rubocop_todo.yml b/.rubocop_todo.yml index b0fac8c..440ad7b 100644 --- a/.rubocop_todo.yml +++ b/.rubocop_todo.yml @@ -35,6 +35,6 @@ Naming/MemoizedInstanceVariableName: # Offense count: 2 # Configuration parameters: MinNameLength, AllowNamesEndingInNumbers, AllowedNames, ForbiddenNames. # AllowedNames: io, id, to, by, on, in, at, ip, db -Naming/UncommunicativeMethodParamName: +Naming/MethodParameterName: Exclude: - 'lib/jekyll-redirect-from/redirect_page.rb' From 5b5bacd7b3af8c11e09d621119b127e04a64202b Mon Sep 17 00:00:00 2001 From: Frank Taillandier Date: Mon, 13 Apr 2020 13:38:33 +0200 Subject: [PATCH 56/76] style: fix Rubocop offenses --- .rubocop_todo.yml | 2 +- spec/integrations_spec.rb | 2 +- spec/spec_helper.rb | 5 +---- 3 files changed, 3 insertions(+), 6 deletions(-) diff --git a/.rubocop_todo.yml b/.rubocop_todo.yml index 440ad7b..6b63e0b 100644 --- a/.rubocop_todo.yml +++ b/.rubocop_todo.yml @@ -20,7 +20,7 @@ Metrics/BlockLength: # Offense count: 3 # Configuration parameters: Max, AllowHeredoc, AllowURI, URISchemes, IgnoreCopDirectives, IgnoredPatterns. # URISchemes: http, https -Metrics/LineLength: +Layout/LineLength: Exclude: - 'spec/jekyll_redirect_from/generator_spec.rb' - 'spec/jekyll_redirect_from/redirect_page_spec.rb' diff --git a/spec/integrations_spec.rb b/spec/integrations_spec.rb index 2ca7b64..cb6f53d 100644 --- a/spec/integrations_spec.rb +++ b/spec/integrations_spec.rb @@ -17,7 +17,7 @@ end context "multiple redirect froms" do - %w(help contact let-there/be/light-he-said geepers/mccreepin).each do |redirect| + ["help", "contact", "let-there/be/light-he-said", "geepers/mccreepin"].each do |redirect| context "the #{redirect} redirect" do let(:relative_path) { "#{redirect}.html" } diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index ef597e7..c089254 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -42,10 +42,7 @@ def config "authors" => {}, }, "url" => "http://jekyllrb.com", - "plugins" => [ - "jekyll-redirect-from", - "jekyll-sitemap", - ], + "plugins" => %w(jekyll-redirect-from jekyll-sitemap), "defaults" => [{ "scope" => { "path" => "" }, "values" => { "layout" => "layout" }, From e4fb7383371065b7d6470a171953328f60ad488f Mon Sep 17 00:00:00 2001 From: Frank Taillandier Date: Mon, 13 Apr 2020 15:18:17 +0200 Subject: [PATCH 57/76] style: Style/SpecialGlobalVars (#216) Merge pull request 216 --- jekyll-redirect-from.gemspec | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/jekyll-redirect-from.gemspec b/jekyll-redirect-from.gemspec index cbac525..e670c0b 100644 --- a/jekyll-redirect-from.gemspec +++ b/jekyll-redirect-from.gemspec @@ -1,5 +1,6 @@ # frozen_string_literal: true +require "English" require_relative "lib/jekyll-redirect-from/version" Gem::Specification.new do |spec| @@ -12,9 +13,7 @@ Gem::Specification.new do |spec| spec.homepage = "https://github.com/jekyll/jekyll-redirect-from" spec.license = "MIT" - # rubocop:disable Style/SpecialGlobalVars - spec.files = `git ls-files`.split($/) - # rubocop:enable Style/SpecialGlobalVars + spec.files = `git ls-files`.split($INPUT_RECORD_SEPARATOR) spec.executables = spec.files.grep(%r!^bin/!) { |f| File.basename(f) } spec.test_files = spec.files.grep(%r!^(test|spec|features)/!) From d1ccfdf3d6a2d7d05cf019031a3743b03a5ffbe6 Mon Sep 17 00:00:00 2001 From: jekyllbot Date: Mon, 13 Apr 2020 09:18:19 -0400 Subject: [PATCH 58/76] Update history to reflect merge of #216 [ci skip] --- History.markdown | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/History.markdown b/History.markdown index 1190d11..c82939f 100644 --- a/History.markdown +++ b/History.markdown @@ -1,3 +1,9 @@ +## HEAD + +### styles + + * style: Style/SpecialGlobalVars (#216) + ## 0.16.0 / 2020-01-26 ### Minor Enhancements From 4cc0614d6bf096f1882ab5832148d98786717a23 Mon Sep 17 00:00:00 2001 From: Satyajeet Kanetkar Date: Sun, 16 Aug 2020 12:43:48 +0530 Subject: [PATCH 59/76] fix Gemfile to correctly install jekyll 3.9 (#224) Merge pull request 224 --- .travis.yml | 2 +- Gemfile | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 62d8c2b..a76f444 100644 --- a/.travis.yml +++ b/.travis.yml @@ -4,7 +4,7 @@ rvm: - &latest_ruby 2.7 - 2.5 env: - - JEKYLL_VERSION="~> 3.8" + - JEKYLL_VERSION="~> 3.9" matrix: include: - # GitHub Pages diff --git a/Gemfile b/Gemfile index 7ffc8ba..661fc4f 100644 --- a/Gemfile +++ b/Gemfile @@ -5,3 +5,4 @@ gemspec gem "github-pages" if ENV["GH_PAGES"] gem "jekyll", ENV["JEKYLL_VERSION"] if ENV["JEKYLL_VERSION"] +gem "kramdown-parser-gfm" if ENV["JEKYLL_VERSION"] == "~> 3.9" From 3520d23ef8725db8a85b1d57fc6b88909cb7cc66 Mon Sep 17 00:00:00 2001 From: jekyllbot Date: Sun, 16 Aug 2020 03:13:50 -0400 Subject: [PATCH 60/76] Update history to reflect merge of #224 [ci skip] --- History.markdown | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/History.markdown b/History.markdown index c82939f..cd0fcf1 100644 --- a/History.markdown +++ b/History.markdown @@ -4,6 +4,10 @@ * style: Style/SpecialGlobalVars (#216) +### Development Fixes + + * fix Gemfile to correctly install jekyll 3.9 (#224) + ## 0.16.0 / 2020-01-26 ### Minor Enhancements From 8eff45b4262f12e28efb4f38870dceb9feffc636 Mon Sep 17 00:00:00 2001 From: Satyajeet Kanetkar Date: Mon, 14 Sep 2020 17:40:50 +0530 Subject: [PATCH 61/76] Refactor specs for RedirectPage (#222) Merge pull request 222 --- .../redirect_page_spec.rb | 238 ++++++++---------- 1 file changed, 109 insertions(+), 129 deletions(-) diff --git a/spec/jekyll_redirect_from/redirect_page_spec.rb b/spec/jekyll_redirect_from/redirect_page_spec.rb index e3cd2c6..b5af971 100644 --- a/spec/jekyll_redirect_from/redirect_page_spec.rb +++ b/spec/jekyll_redirect_from/redirect_page_spec.rb @@ -1,148 +1,142 @@ # frozen_string_literal: true describe JekyllRedirectFrom::RedirectPage do - let(:from) { "/foo" } - let(:to) { "/bar" } let(:site_url) { site.config["url"] } - subject { described_class.from_paths(site, from, to) } before { site.read } - context "being a page" do - before { subject.read_yaml(nil, nil, nil) } + shared_examples "a redirect page" do + context "being a page" do + before { page.read_yaml(nil, nil, nil) } - it "returns no content" do - expect(subject.content).to eql("") - end + it "returns no content" do + expect(page.content).to eql("") + end - it "returns no output" do - expect(subject.output).to eql("") - end + it "returns no output" do + expect(page.output).to eql("") + end - it "sets default data" do - expect(subject.to_liquid["layout"]).to eql("redirect") - expect(subject.to_liquid["sitemap"]).to be_falsey - end - end + it "sets default data" do + expect(page.to_liquid["layout"]).to eql("redirect") + expect(page.to_liquid["sitemap"]).to be_falsey + end - context "creating a page from paths" do - it "sets the permalink" do - expect(subject.to_liquid["permalink"]).to eql(from) - end + it "sets the paths" do + expect(page.to_liquid["permalink"]).to eql(from) + expect(page.to_liquid).to have_key("redirect") + expect(page.to_liquid["redirect"]["from"]).to eql(from) + expect(page.to_liquid["redirect"]["to"]).to eql("#{site_url}#{to}") + end + + it "sets the permalink" do + expect(page.to_liquid["permalink"]).to eql(from) + end - it "sets redirect metadata" do - expect(subject.to_liquid).to have_key("redirect") - expect(subject.to_liquid["redirect"]["from"]).to eql(from) - expect(subject.to_liquid["redirect"]["to"]).to eql("#{site_url}#{to}") + it "sets redirect metadata" do + expect(page.to_liquid).to have_key("redirect") + expect(page.to_liquid["redirect"]["from"]).to eql(from) + expect(page.to_liquid["redirect"]["to"]).to eql("#{site_url}#{to}") + end end - context "with a document" do - let(:doc) { site.documents.first } + context "generating" do + before { site.generate } + let(:output) { Jekyll::Renderer.new(site, page, site.site_payload).run } - context "redirect from" do - let(:page) { described_class.redirect_from(doc, from) } + it "renders the template" do + expect(output).to_not be_nil + expect(output.to_s).to_not be_empty + end - it "creates with redirect_from" do - expect(page.to_liquid["permalink"]).to eql(from) - expect(page.to_liquid).to have_key("redirect") - expect(page.to_liquid["redirect"]["from"]).to eql(from) - expected = "http://jekyllrb.com/2014/01/03/redirect-me-plz.html" - expect(page.to_liquid["redirect"]["to"]).to eql(expected) - end + it "contains the meta refresh tag" do + expect(output).to match("") end - context "redirect to" do - let(:page) { described_class.redirect_to(doc, to) } + it "contains the javascript redirect" do + expect(output).to match("") + end - context "redirecting to a path" do - let(:to) { "/bar" } + it "contains canonical link in header" do + expect(output).to match("") + end - it "redirects" do - expect(page.to_liquid["permalink"]).to eql("/2014/01/03/redirect-me-plz.html") - expect(page.to_liquid).to have_key("redirect") - expect(page.to_liquid["redirect"]["to"]).to eql("#{site_url}#{to}") - expect(page.to_liquid["redirect"]["from"]).to eql("/2014/01/03/redirect-me-plz.html") - end + it "contains the clickable link" do + expect(output).to match("Click here if you are not redirected.") + end + end + end - context "with no leading slash" do - let(:to) { "bar" } + context "redirecting to" do + let(:to) { "/bar" } + let(:doc) { site.documents.first } + subject(:page) { described_class.redirect_to(doc, to) } + let(:from) { doc.url } - it "redirects" do - expect(page.to_liquid).to have_key("redirect") - expect(page.to_liquid["redirect"]["to"]).to eql("#{site_url}/#{to}") - end - end + it_behaves_like "a redirect page" - context "with a trailing slash" do - let(:to) { "/bar/" } + context "a relative path" do + let(:to) { "/bar" } - it "redirects" do - expect(page.to_liquid).to have_key("redirect") - expect(page.to_liquid["redirect"]["to"]).to eql("#{site_url}#{to}") - end - end - end + it "redirects" do + expect(page.to_liquid["permalink"]).to eql("/2014/01/03/redirect-me-plz.html") + expect(page.to_liquid).to have_key("redirect") + expect(page.to_liquid["redirect"]["to"]).to eql("#{site_url}#{to}") + expect(page.to_liquid["redirect"]["from"]).to eql("/2014/01/03/redirect-me-plz.html") + end - context "redirecting to a URL" do - let(:to) { "https://foo.invalid" } + context "with no leading slash" do + let(:to) { "bar" } - it "redirects" do - expect(page.to_liquid["permalink"]).to eql("/2014/01/03/redirect-me-plz.html") - expect(page.to_liquid).to have_key("redirect") - expect(page.to_liquid["redirect"]["to"]).to eql("https://foo.invalid") - expect(page.to_liquid["redirect"]["from"]).to eql("/2014/01/03/redirect-me-plz.html") - end + it "redirects" do + expect(page.to_liquid).to have_key("redirect") + expect(page.to_liquid["redirect"]["to"]).to eql("#{site_url}/#{to}") end end - end - end - - context "setting the paths" do - let(:from) { "/foo2" } - let(:to) { "/bar2" } - before { subject.set_paths(from, to) } + context "with a trailing slash" do + let(:to) { "/bar/" } - it "sets the paths" do - expect(subject.to_liquid["permalink"]).to eql(from) - expect(subject.to_liquid).to have_key("redirect") - expect(subject.to_liquid["redirect"]["from"]).to eql(from) - expect(subject.to_liquid["redirect"]["to"]).to eql("#{site_url}#{to}") + it "redirects" do + expect(page.to_liquid).to have_key("redirect") + expect(page.to_liquid["redirect"]["to"]).to eql("#{site_url}#{to}") + end + end end - end - - context "generating" do - before { site.generate } - let(:output) { Jekyll::Renderer.new(site, subject, site.site_payload).run } - it "renders the template" do - expect(output).to_not be_nil - expect(output.to_s).to_not be_empty - end + context "an absolute URL" do + let(:to) { "https://foo.invalid" } - it "contains the meta refresh tag" do - expect(output).to match("") + it "redirects" do + expect(page.to_liquid["permalink"]).to eql("/2014/01/03/redirect-me-plz.html") + expect(page.to_liquid).to have_key("redirect") + expect(page.to_liquid["redirect"]["to"]).to eql("https://foo.invalid") + expect(page.to_liquid["redirect"]["from"]).to eql("/2014/01/03/redirect-me-plz.html") + end end + end - it "contains the javascript redirect" do - expect(output).to match("") - end + context "redirecting from" do + let(:from) { "/foo" } + let(:doc) { site.documents.first } + subject(:page) { described_class.redirect_from(doc, from) } + let(:to) { doc.url } - it "contains canonical link in header" do - expect(output).to match("") - end + it_behaves_like "a redirect page" - it "contains the clickable link" do - expect(output).to match("Click here if you are not redirected.") + it "sets liquid data for the page" do + expect(page.to_liquid["permalink"]).to eql(from) + expect(page.to_liquid).to have_key("redirect") + expect(page.to_liquid["redirect"]["from"]).to eql(from) + expected = "http://jekyllrb.com/2014/01/03/redirect-me-plz.html" + expect(page.to_liquid["redirect"]["to"]).to eql(expected) end - end - context "redirect from destination" do context "when redirect from has no extension" do let(:from) { "/foo" } it "adds .html" do expected = File.expand_path "foo.html", site.dest - expect(subject.destination("/")).to eql(expected) + expect(page.destination("/")).to eql(expected) end end @@ -151,7 +145,11 @@ it "knows to add the index.html" do expected = File.expand_path "foo/index.html", site.dest - expect(subject.destination("/")).to eql(expected) + expect(page.destination("/")).to eql(expected) + end + + it "uses HTML" do + expect(page.output_ext).to eql(".html") end end @@ -160,7 +158,7 @@ it "adds .html" do expected = File.expand_path "foo.html", site.dest - expect(subject.destination("/")).to eql(expected) + expect(page.destination("/")).to eql(expected) end end @@ -169,7 +167,11 @@ it "doesn't add .html" do expected = File.expand_path "foo.htm", site.dest - expect(subject.destination("/")).to eql(expected) + expect(page.destination("/")).to eql(expected) + end + + it "honors the extension" do + expect(page.output_ext).to eql(".htm") end end @@ -178,33 +180,11 @@ it "adds the slash" do expected = File.expand_path "foo.html", site.dest - expect(subject.destination("/")).to eql(expected) + expect(page.destination("/")).to eql(expected) end - end - end - - context "output extension" do - context "with an extension" do - let(:from) { "foo.htm" } - - it "honors the extension" do - expect(subject.output_ext).to eql(".htm") - end - end - - context "with a trailing slash" do - let(:from) { "foo/" } - - it "uses HTML" do - expect(subject.output_ext).to eql(".html") - end - end - - context "with no slash" do - let(:from) { "foo" } it "uses HTML" do - expect(subject.output_ext).to eql(".html") + expect(page.output_ext).to eql(".html") end end end From 18af46357a435b5e6fc764dc19f4c8ac2174de3c Mon Sep 17 00:00:00 2001 From: jekyllbot Date: Mon, 14 Sep 2020 08:10:52 -0400 Subject: [PATCH 62/76] Update history to reflect merge of #222 [ci skip] --- History.markdown | 1 + 1 file changed, 1 insertion(+) diff --git a/History.markdown b/History.markdown index cd0fcf1..39d7f89 100644 --- a/History.markdown +++ b/History.markdown @@ -7,6 +7,7 @@ ### Development Fixes * fix Gemfile to correctly install jekyll 3.9 (#224) + * Refactor specs for RedirectPage (#222) ## 0.16.0 / 2020-01-26 From 635a78b878ee99190b73b39a2185a824664b3631 Mon Sep 17 00:00:00 2001 From: Frank Taillandier Date: Thu, 24 Dec 2020 13:44:47 +0100 Subject: [PATCH 63/76] chore(ci): GitHub Pages runs Ruby 2.7.1 --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index a76f444..20df1f0 100644 --- a/.travis.yml +++ b/.travis.yml @@ -8,7 +8,7 @@ env: matrix: include: - # GitHub Pages - rvm: 2.5.3 + rvm: 2.7.1 env: GH_PAGES=true - rvm: *latest_ruby env: JEKYLL_VERSION="~> 4.0" From 2a226ed2074bcdf64db1110ac9af3bace5cd59ed Mon Sep 17 00:00:00 2001 From: "Bruno P. Kinoshita" Date: Thu, 6 May 2021 08:30:57 +1200 Subject: [PATCH 64/76] Fix typo in README --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 706435b..ef19d60 100644 --- a/README.md +++ b/README.md @@ -31,7 +31,7 @@ Or install it yourself as: $ gem install jekyll-redirect-from -Once it's installed into your evironment, add it to your `_config.yml`: +Once it's installed into your environment, add it to your `_config.yml`: ```yaml plugins: @@ -52,7 +52,7 @@ Then run `jekyll --safe` like normal. ## Usage -The object of this gem is to allow an author to specify multiple URLs for a +The objective of this gem is to allow an author to specify multiple URLs for a page, such that the alternative URLs redirect to the new Jekyll URL. To use it, simply add the array to the YAML front-matter of your page or post: From 0f07aa0d3ebcf519877b4494237e2994fffb619d Mon Sep 17 00:00:00 2001 From: lemonez <36384768+lemonez@users.noreply.github.com> Date: Fri, 20 Aug 2021 10:26:52 -0700 Subject: [PATCH 65/76] Add YAML syntax highlighting to README.md (#237) --- README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index ef19d60..651e58b 100644 --- a/README.md +++ b/README.md @@ -68,7 +68,7 @@ Redirects including a trailing slash will generate a corresponding subdirectory For example... -```text +```yaml redirect_from: - /post/123456789/my-amazing-post ``` @@ -81,7 +81,7 @@ redirect_from: While... -```text +```yaml redirect_from: - /post/123456789/my-amazing-post/ ``` @@ -96,7 +96,7 @@ These pages will contain an HTTP-REFRESH meta tag which redirect to your URL. You can also specify just **one url** like this: -```text +```yaml title: My other awesome post redirect_from: /post/123456798/ ``` From 993a507751e7e520d333921bd17d76a51a150c07 Mon Sep 17 00:00:00 2001 From: Ashwin Maroli Date: Sun, 22 Aug 2021 12:24:09 +0530 Subject: [PATCH 66/76] Add workflow file for Continuous Integration --- .github/workflows/ci.yml | 55 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 55 insertions(+) create mode 100644 .github/workflows/ci.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..320b9c8 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,55 @@ +name: Continuous Integration + +on: + pull_request: + branches: + - master + +jobs: + ci: + if: "!contains(github.event.commits[0].message, '[ci skip]')" + name: 'Ruby ${{ matrix.ruby_version }}' + runs-on: 'ubuntu-latest' + + strategy: + fail-fast: false + matrix: + ruby_version: + - 2.5 + - 2.7 + - 3.0 + steps: + - uses: actions/checkout@v2 + with: + fetch-depth: 5 + - name: "Set up Ruby ${{ matrix.ruby_version }}" + uses: ruby/setup-ruby@v1 + with: + ruby-version: ${{ matrix.ruby_version }} + bundler-cache: true + - name: Execute tests + run: bash script/test + - name: Check Style Offenses + run: bash script/fmt + - name: Test Gem build + run: bundle exec rake build + + ghp: + if: "!contains(github.event.commits[0].message, '[ci skip]')" + name: Ruby 2.7 with GitHub Pages Gem + runs-on: 'ubuntu-latest' + env: + GH_PAGES: true + strategy: + fail-fast: false + steps: + - uses: actions/checkout@v2 + with: + fetch-depth: 5 + - name: "Set up Ruby 2.7" + uses: ruby/setup-ruby@v1 + with: + ruby-version: 2.7 + bundler-cache: true + - name: Execute tests + run: bash script/test From e51c1417bba212df033d20594a71970fdeebb674 Mon Sep 17 00:00:00 2001 From: Ashwin Maroli Date: Thu, 26 Aug 2021 20:25:07 +0530 Subject: [PATCH 67/76] Refactor Redirectable mixin to reduce allocations (#241) Merge pull request 241 --- lib/jekyll-redirect-from/redirectable.rb | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/lib/jekyll-redirect-from/redirectable.rb b/lib/jekyll-redirect-from/redirectable.rb index 741ddc4..4512a03 100644 --- a/lib/jekyll-redirect-from/redirectable.rb +++ b/lib/jekyll-redirect-from/redirectable.rb @@ -7,21 +7,15 @@ module Redirectable # Returns a string representing the relative path or URL # to which the document should be redirected def redirect_to - if to_liquid["redirect_to"].is_a?(Array) - to_liquid["redirect_to"].compact.first - else - to_liquid["redirect_to"] - end + meta_data = to_liquid["redirect_to"] + meta_data.is_a?(Array) ? meta_data.compact.first : meta_data end # Returns an array representing the relative paths to other # documents which should be redirected to this document def redirect_from - if to_liquid["redirect_from"].is_a?(Array) - to_liquid["redirect_from"].compact - else - [to_liquid["redirect_from"]].compact - end + meta_data = to_liquid["redirect_from"] + meta_data.is_a?(Array) ? meta_data.compact : [meta_data].compact end end end From 03b70baf0f2715116383cd98e051e68c7cf5b177 Mon Sep 17 00:00:00 2001 From: jekyllbot Date: Thu, 26 Aug 2021 10:55:08 -0400 Subject: [PATCH 68/76] Update history to reflect merge of #241 [ci skip] --- History.markdown | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/History.markdown b/History.markdown index 39d7f89..165de26 100644 --- a/History.markdown +++ b/History.markdown @@ -9,6 +9,10 @@ * fix Gemfile to correctly install jekyll 3.9 (#224) * Refactor specs for RedirectPage (#222) +### Bug Fixes + + * Refactor Redirectable mixin to reduce allocations (#241) + ## 0.16.0 / 2020-01-26 ### Minor Enhancements From 0de03e3f9a09b9c2f7f8acbdacd51003bbd1b54a Mon Sep 17 00:00:00 2001 From: Ashwin Maroli Date: Fri, 27 Aug 2021 10:44:23 +0530 Subject: [PATCH 69/76] Run CI workflow on the `master` branch as well --- .github/workflows/ci.yml | 3 +++ .travis.yml | 19 ------------------- README.md | 2 +- 3 files changed, 4 insertions(+), 20 deletions(-) delete mode 100644 .travis.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 320b9c8..a3b910c 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,6 +1,9 @@ name: Continuous Integration on: + push: + branches: + - master pull_request: branches: - master diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 20df1f0..0000000 --- a/.travis.yml +++ /dev/null @@ -1,19 +0,0 @@ -language: ruby -cache: bundler -rvm: - - &latest_ruby 2.7 - - 2.5 -env: - - JEKYLL_VERSION="~> 3.9" -matrix: - include: - - # GitHub Pages - rvm: 2.7.1 - env: GH_PAGES=true - - rvm: *latest_ruby - env: JEKYLL_VERSION="~> 4.0" - -before_install: -- gem update --system -before_script: bundle update -script: script/cibuild diff --git a/README.md b/README.md index 651e58b..ba340d5 100644 --- a/README.md +++ b/README.md @@ -9,7 +9,7 @@ impractical to create new pages in the proper subdirectories so they, e.g. Instead of dealing with maintaining those pages for redirection, let `jekyll-redirect-from` handle it for you. -[![Build Status](https://travis-ci.org/jekyll/jekyll-redirect-from.svg?branch=master)](https://travis-ci.org/jekyll/jekyll-redirect-from) +[![Build Status](https://github.com/jekyll/jekyll-redirect-from/actions/workflows/ci.yml/badge.svg?branch=master)](https://github.com/jekyll/jekyll-redirect-from/actions/workflows/ci.yml) ## How it Works From de551ddaacc66b949c96adb3c2a5e8bb42fc1594 Mon Sep 17 00:00:00 2001 From: Ashwin Maroli Date: Fri, 17 Sep 2021 19:49:10 +0530 Subject: [PATCH 70/76] Lock to RuboCop v1.18.x (#242) Merge pull request 242 --- .rubocop.yml | 29 +++++++++++++++++++++++++++- .rubocop_todo.yml | 37 ++++++++++++------------------------ jekyll-redirect-from.gemspec | 4 ++-- script/fmt | 2 +- 4 files changed, 43 insertions(+), 29 deletions(-) diff --git a/.rubocop.yml b/.rubocop.yml index abb6557..dc87809 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -6,6 +6,33 @@ inherit_gem: rubocop-jekyll: .rubocop.yml AllCops: - TargetRubyVersion: 2.4 + TargetRubyVersion: 2.5 + SuggestExtensions: false Exclude: - vendor/**/* + +Layout/LineEndStringConcatenationIndentation: + Enabled: true + +Lint/EmptyInPattern: + Enabled: false + +Naming/InclusiveLanguage: + Enabled: false +Naming/MemoizedInstanceVariableName: + Exclude: + - 'lib/jekyll-redirect-from/page_without_a_file.rb' + +Performance/MapCompact: + Enabled: true +Performance/RedundantEqualityComparisonBlock: + Enabled: true +Performance/RedundantSplitRegexpArgument: + Enabled: true + +Style/InPatternThen: + Enabled: false +Style/MultilineInPatternThen: + Enabled: false +Style/QuotedSymbols: + Enabled: true diff --git a/.rubocop_todo.yml b/.rubocop_todo.yml index 6b63e0b..b870d5e 100644 --- a/.rubocop_todo.yml +++ b/.rubocop_todo.yml @@ -1,40 +1,27 @@ # This configuration was generated by # `rubocop --auto-gen-config` -# on 2018-12-06 11:51:19 +0100 using RuboCop version 0.61.1. +# on 2021-09-17 12:49:45 UTC using RuboCop version 1.18.4. # 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: 12 -# Configuration parameters: CountComments, Max, ExcludedMethods. -# ExcludedMethods: refine -Metrics/BlockLength: - Exclude: - - 'spec/integrations_spec.rb' - - 'spec/jekyll_redirect_from/generator_spec.rb' - - 'spec/jekyll_redirect_from/redirect_page_spec.rb' - - 'spec/jekyll_redirect_from/redirectable_spec.rb' - - 'spec/spec_helper.rb' - # Offense count: 3 -# Configuration parameters: Max, AllowHeredoc, AllowURI, URISchemes, IgnoreCopDirectives, IgnoredPatterns. +# Cop supports --auto-correct. +# Configuration parameters: AutoCorrect, AllowHeredoc, AllowURI, URISchemes, IgnoreCopDirectives, IgnoredPatterns. # URISchemes: http, https Layout/LineLength: - Exclude: - - 'spec/jekyll_redirect_from/generator_spec.rb' - - 'spec/jekyll_redirect_from/redirect_page_spec.rb' + Max: 105 -# Offense count: 1 -# Configuration parameters: EnforcedStyleForLeadingUnderscores. -# SupportedStylesForLeadingUnderscores: disallowed, required, optional -Naming/MemoizedInstanceVariableName: +# Offense count: 2 +# Configuration parameters: AllowedMethods. +# AllowedMethods: enums +Lint/ConstantDefinitionInBlock: Exclude: - - 'lib/jekyll-redirect-from/page_without_a_file.rb' + - 'spec/jekyll_redirect_from/generator_spec.rb' # Offense count: 2 -# Configuration parameters: MinNameLength, AllowNamesEndingInNumbers, AllowedNames, ForbiddenNames. -# AllowedNames: io, id, to, by, on, in, at, ip, db -Naming/MethodParameterName: +# Configuration parameters: AllowComments, AllowEmptyLambdas. +Lint/EmptyBlock: Exclude: - - 'lib/jekyll-redirect-from/redirect_page.rb' + - 'spec/jekyll_redirect_from/generator_spec.rb' diff --git a/jekyll-redirect-from.gemspec b/jekyll-redirect-from.gemspec index e670c0b..c838419 100644 --- a/jekyll-redirect-from.gemspec +++ b/jekyll-redirect-from.gemspec @@ -19,7 +19,7 @@ Gem::Specification.new do |spec| spec.test_files = spec.files.grep(%r!^(test|spec|features)/!) spec.require_paths = ["lib"] - spec.required_ruby_version = ">= 2.4.0" + spec.required_ruby_version = ">= 2.5.0" spec.add_runtime_dependency "jekyll", ">= 3.3", "< 5.0" @@ -27,5 +27,5 @@ Gem::Specification.new do |spec| spec.add_development_dependency "jekyll-sitemap", "~> 1.0" spec.add_development_dependency "rake", "~> 12.0" spec.add_development_dependency "rspec", "~> 3.5" - spec.add_development_dependency "rubocop-jekyll", "~> 0.10" + spec.add_development_dependency "rubocop-jekyll", "~> 0.12.0" end diff --git a/script/fmt b/script/fmt index c5351ec..913591a 100755 --- a/script/fmt +++ b/script/fmt @@ -1,7 +1,7 @@ #!/bin/bash set -e -echo "Rubocop $(bundle exec rubocop --version)" +echo "RuboCop $(bundle exec rubocop --version)" bundle exec rubocop -D -E $@ success=$? if ((success != 0)); then From 06701e5220a50a769fec803586c2471ee691dff7 Mon Sep 17 00:00:00 2001 From: jekyllbot Date: Fri, 17 Sep 2021 10:19:12 -0400 Subject: [PATCH 71/76] Update history to reflect merge of #242 [ci skip] --- History.markdown | 1 + 1 file changed, 1 insertion(+) diff --git a/History.markdown b/History.markdown index 165de26..6541da0 100644 --- a/History.markdown +++ b/History.markdown @@ -8,6 +8,7 @@ * fix Gemfile to correctly install jekyll 3.9 (#224) * Refactor specs for RedirectPage (#222) + * Lock to RuboCop v1.18.x (#242) ### Bug Fixes From 4f93bd2a5ee94e79d708d1c029da0ef76e575eaa Mon Sep 17 00:00:00 2001 From: Ashwin Maroli Date: Thu, 23 Sep 2021 23:05:04 +0530 Subject: [PATCH 72/76] Test gem install in GH Actions CI --- .github/workflows/ci.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index a3b910c..b6072a2 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -34,8 +34,10 @@ jobs: run: bash script/test - name: Check Style Offenses run: bash script/fmt - - name: Test Gem build - run: bundle exec rake build + - name: Test gem build + run: bundle exec gem build jekyll-redirect-from.gemspec + - name: Test gem install + run: bundle exec gem install jekyll-redirect-from --local --verbose ghp: if: "!contains(github.event.commits[0].message, '[ci skip]')" From 07cba489c2e72eafbcb5b10e5d9694f06082c6c6 Mon Sep 17 00:00:00 2001 From: Ashwin Maroli Date: Mon, 27 Sep 2021 20:50:08 +0530 Subject: [PATCH 73/76] Clean up gemspec (#243) Merge pull request 243 --- jekyll-redirect-from.gemspec | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/jekyll-redirect-from.gemspec b/jekyll-redirect-from.gemspec index c838419..56ba1e9 100644 --- a/jekyll-redirect-from.gemspec +++ b/jekyll-redirect-from.gemspec @@ -1,6 +1,5 @@ # frozen_string_literal: true -require "English" require_relative "lib/jekyll-redirect-from/version" Gem::Specification.new do |spec| @@ -8,15 +7,11 @@ Gem::Specification.new do |spec| spec.version = JekyllRedirectFrom::VERSION spec.authors = ["Parker Moore"] spec.email = ["parkrmoore@gmail.com"] - spec.summary = "Seamlessly specify multiple redirection URLs " \ - "for your pages and posts" + spec.summary = "Seamlessly specify multiple redirection URLs for your pages and posts" spec.homepage = "https://github.com/jekyll/jekyll-redirect-from" spec.license = "MIT" - spec.files = `git ls-files`.split($INPUT_RECORD_SEPARATOR) - - spec.executables = spec.files.grep(%r!^bin/!) { |f| File.basename(f) } - spec.test_files = spec.files.grep(%r!^(test|spec|features)/!) + spec.files = `git ls-files lib`.split("\n").concat(%w(LICENSE.txt README.md History.markdown)) spec.require_paths = ["lib"] spec.required_ruby_version = ">= 2.5.0" From 6a751b274300ece194d8ba7cea934c396dff6163 Mon Sep 17 00:00:00 2001 From: jekyllbot Date: Mon, 27 Sep 2021 11:20:09 -0400 Subject: [PATCH 74/76] Update history to reflect merge of #243 [ci skip] --- History.markdown | 1 + 1 file changed, 1 insertion(+) diff --git a/History.markdown b/History.markdown index 6541da0..2fcdd8e 100644 --- a/History.markdown +++ b/History.markdown @@ -9,6 +9,7 @@ * fix Gemfile to correctly install jekyll 3.9 (#224) * Refactor specs for RedirectPage (#222) * Lock to RuboCop v1.18.x (#242) + * Clean up gemspec (#243) ### Bug Fixes From 1f644b9fbad002ca8bc35581950645bb7ea47ef1 Mon Sep 17 00:00:00 2001 From: Ashwin Maroli Date: Sun, 22 Sep 2024 19:12:01 +0530 Subject: [PATCH 75/76] Bump versions in CI workflow (#273) Merge pull request 273 --- .github/workflows/ci.yml | 16 ++++++++-------- .rubocop.yml | 3 +++ jekyll-redirect-from.gemspec | 4 ++-- 3 files changed, 13 insertions(+), 10 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index b6072a2..42b69f5 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -18,11 +18,11 @@ jobs: fail-fast: false matrix: ruby_version: - - 2.5 - - 2.7 - - 3.0 + - "2.7" + - "3.0" + - "3.3" steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 with: fetch-depth: 5 - name: "Set up Ruby ${{ matrix.ruby_version }}" @@ -41,20 +41,20 @@ jobs: ghp: if: "!contains(github.event.commits[0].message, '[ci skip]')" - name: Ruby 2.7 with GitHub Pages Gem + name: Ruby 3.3 with GitHub Pages Gem runs-on: 'ubuntu-latest' env: GH_PAGES: true strategy: fail-fast: false steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 with: fetch-depth: 5 - - name: "Set up Ruby 2.7" + - name: "Set up Ruby 3.3" uses: ruby/setup-ruby@v1 with: - ruby-version: 2.7 + ruby-version: 3.3 bundler-cache: true - name: Execute tests run: bash script/test diff --git a/.rubocop.yml b/.rubocop.yml index dc87809..64db333 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -30,6 +30,9 @@ Performance/RedundantEqualityComparisonBlock: Performance/RedundantSplitRegexpArgument: Enabled: true +Style/ConcatArrayLiterals: + Exclude: + - 'jekyll-redirect-from.gemspec' Style/InPatternThen: Enabled: false Style/MultilineInPatternThen: diff --git a/jekyll-redirect-from.gemspec b/jekyll-redirect-from.gemspec index 56ba1e9..713ef0b 100644 --- a/jekyll-redirect-from.gemspec +++ b/jekyll-redirect-from.gemspec @@ -20,7 +20,7 @@ Gem::Specification.new do |spec| spec.add_development_dependency "bundler" spec.add_development_dependency "jekyll-sitemap", "~> 1.0" - spec.add_development_dependency "rake", "~> 12.0" + spec.add_development_dependency "rake", "~> 13.0" spec.add_development_dependency "rspec", "~> 3.5" - spec.add_development_dependency "rubocop-jekyll", "~> 0.12.0" + spec.add_development_dependency "rubocop-jekyll", "~> 0.13.0" end From 0378df2984ef689ce16fbe9912ee4e0a199ded73 Mon Sep 17 00:00:00 2001 From: jekyllbot Date: Sun, 22 Sep 2024 06:42:03 -0700 Subject: [PATCH 76/76] Update history to reflect merge of #273 [ci skip] --- History.markdown | 1 + 1 file changed, 1 insertion(+) diff --git a/History.markdown b/History.markdown index 2fcdd8e..5926bd5 100644 --- a/History.markdown +++ b/History.markdown @@ -10,6 +10,7 @@ * Refactor specs for RedirectPage (#222) * Lock to RuboCop v1.18.x (#242) * Clean up gemspec (#243) + * Bump versions in CI workflow (#273) ### Bug Fixes