jekyll-redirect-from 0.14.0 → 0.15.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: d896608ee5b8bb8f9e439f22a81cf4b31dbbec19439c32fac516807792fab749
4
- data.tar.gz: c1270871822061bc5b6cc1b250d9a638f19ddaf997147538980189d725b12ba4
3
+ metadata.gz: e8fa3fc03dd67c563c6018790133a100fcc0f04912859e8622efb6762116fc08
4
+ data.tar.gz: fce8c765fea3f6f17ae338fee50ce01331c91cc1f083f26d4294681b709972eb
5
5
  SHA512:
6
- metadata.gz: 6134b8983c7f06bf2e4d00113e22a6d908989a5ab4e48bcd1b2acf3b48022669f8af96f141ba33e943911e58b7d7f84b3689ce36873490655ae0364f5f396da9
7
- data.tar.gz: 6f8cb2062c0c580d3a8c80bc68d7310d1759c047bf01ab94291968e41ee9542bd4b5529771acee5e6d8541e1c85bbd4674249cc883cd53823ead8a58573b407c
6
+ metadata.gz: 217696213cdf50a1f85dc636ced9efa29dd80567837989a00c87b7f68add82c84a74eb2319a547e3f04612b04eb8731685490d79a334ac85121fb78063d791fe
7
+ data.tar.gz: 01044dde063223161451b32fd6a4fa56cc17451eae306b88065f56a72e21b5f8f3b63f10fb0aba19bc7a6856e20b84d9fcad9ad920f7c7bc500e15ba70950c0a
data/.gitignore CHANGED
@@ -13,6 +13,7 @@ pkg
13
13
  rdoc
14
14
  spec/reports
15
15
  spec/fixtures/.jekyll-metadata
16
+ spec/fixtures/.jekyll-cache
16
17
  test/tmp
17
18
  test/version_tmp
18
19
  tmp
data/.rubocop.yml CHANGED
@@ -1,23 +1,11 @@
1
+ inherit_from: .rubocop_todo.yml
2
+
3
+ require: rubocop-jekyll
4
+
1
5
  inherit_gem:
2
- jekyll: .rubocop.yml
6
+ rubocop-jekyll: .rubocop.yml
3
7
 
4
8
  AllCops:
5
9
  TargetRubyVersion: 2.3
6
10
  Exclude:
7
11
  - vendor/**/*
8
-
9
- Metrics/BlockLength:
10
- Exclude:
11
- - spec/**/*
12
-
13
- Metrics/LineLength:
14
- Exclude:
15
- - spec/**/*
16
-
17
- Naming/MemoizedInstanceVariableName:
18
- Exclude:
19
- - lib/jekyll-redirect-from/page_without_a_file.rb
20
-
21
- Naming/UncommunicativeMethodParamName:
22
- Exclude:
23
- - lib/jekyll-redirect-from/redirect_page.rb
data/.rubocop_todo.yml ADDED
@@ -0,0 +1,40 @@
1
+ # This configuration was generated by
2
+ # `rubocop --auto-gen-config`
3
+ # on 2018-12-06 11:51:19 +0100 using RuboCop version 0.61.1.
4
+ # The point is for the user to remove these configuration records
5
+ # one by one as the offenses are removed from the code base.
6
+ # Note that changes in the inspected code, or installation of new
7
+ # versions of RuboCop, may require this file to be generated again.
8
+
9
+ # Offense count: 12
10
+ # Configuration parameters: CountComments, Max, ExcludedMethods.
11
+ # ExcludedMethods: refine
12
+ Metrics/BlockLength:
13
+ Exclude:
14
+ - 'spec/integrations_spec.rb'
15
+ - 'spec/jekyll_redirect_from/generator_spec.rb'
16
+ - 'spec/jekyll_redirect_from/redirect_page_spec.rb'
17
+ - 'spec/jekyll_redirect_from/redirectable_spec.rb'
18
+ - 'spec/spec_helper.rb'
19
+
20
+ # Offense count: 3
21
+ # Configuration parameters: Max, AllowHeredoc, AllowURI, URISchemes, IgnoreCopDirectives, IgnoredPatterns.
22
+ # URISchemes: http, https
23
+ Metrics/LineLength:
24
+ Exclude:
25
+ - 'spec/jekyll_redirect_from/generator_spec.rb'
26
+ - 'spec/jekyll_redirect_from/redirect_page_spec.rb'
27
+
28
+ # Offense count: 1
29
+ # Configuration parameters: EnforcedStyleForLeadingUnderscores.
30
+ # SupportedStylesForLeadingUnderscores: disallowed, required, optional
31
+ Naming/MemoizedInstanceVariableName:
32
+ Exclude:
33
+ - 'lib/jekyll-redirect-from/page_without_a_file.rb'
34
+
35
+ # Offense count: 2
36
+ # Configuration parameters: MinNameLength, AllowNamesEndingInNumbers, AllowedNames, ForbiddenNames.
37
+ # AllowedNames: io, id, to, by, on, in, at, ip, db
38
+ Naming/UncommunicativeMethodParamName:
39
+ Exclude:
40
+ - 'lib/jekyll-redirect-from/redirect_page.rb'
data/.travis.yml CHANGED
@@ -1,15 +1,19 @@
1
1
  language: ruby
2
- sudo: false
3
2
  cache: bundler
3
+ rvm:
4
+ - &latest_ruby 2.6
5
+ - 2.4
6
+ - 2.3
7
+ env:
8
+ - JEKYLL_VERSION="~> 3.8"
4
9
  matrix:
5
10
  include:
6
11
  - # GitHub Pages
7
- rvm: 2.4.2
12
+ rvm: 2.5.3
8
13
  env: GH_PAGES=true
9
- rvm:
10
- - 2.5
11
- - 2.4
12
- - 2.3
14
+ - rvm: *latest_ruby
15
+ env: JEKYLL_VERSION=">= 4.0.0.pre.alpha1"
16
+
13
17
  before_install:
14
18
  - gem update --system
15
19
  before_script: bundle update
data/Gemfile CHANGED
@@ -3,6 +3,5 @@
3
3
  source "https://rubygems.org"
4
4
  gemspec
5
5
 
6
- if ENV["GH_PAGES"]
7
- gem "github-pages"
8
- end
6
+ gem "github-pages" if ENV["GH_PAGES"]
7
+ gem "jekyll", ENV["JEKYLL_VERSION"] if ENV["JEKYLL_VERSION"]
data/History.markdown CHANGED
@@ -1,3 +1,13 @@
1
+ ## 0.15.0 / 2019-03-23
2
+
3
+ ### Development Fixes
4
+
5
+ * chore(deps): rubocop-jekyll 0.3 (#187)
6
+
7
+ ### Bug Fixes
8
+
9
+ * Allow testing and using with Jekyll 4.x (#196)
10
+
1
11
  ## 0.14.0 / 2018-06-29
2
12
 
3
13
  ### Minor Enhancements
@@ -22,10 +22,13 @@ Gem::Specification.new do |spec|
22
22
  spec.test_files = spec.files.grep(%r!^(test|spec|features)/!)
23
23
  spec.require_paths = ["lib"]
24
24
 
25
- spec.add_runtime_dependency "jekyll", "~> 3.3"
26
- spec.add_development_dependency "bundler", "~> 1.16"
25
+ spec.required_ruby_version = ">= 2.3.0"
26
+
27
+ spec.add_runtime_dependency "jekyll", ">= 3.3", "< 5.0"
28
+
29
+ spec.add_development_dependency "bundler"
27
30
  spec.add_development_dependency "jekyll-sitemap", "~> 1.0"
28
31
  spec.add_development_dependency "rake", "~> 12.0"
29
32
  spec.add_development_dependency "rspec", "~> 3.5"
30
- spec.add_development_dependency "rubocop", "~> 0.57"
33
+ spec.add_development_dependency "rubocop-jekyll", "~> 0.4"
31
34
  end
@@ -17,6 +17,7 @@ module JekyllRedirectFrom
17
17
  # Must duplicate pages to modify while in loop
18
18
  (site.docs_to_write + site.pages.dup).each do |doc|
19
19
  next unless JekyllRedirectFrom::CLASSES.include?(doc.class)
20
+
20
21
  generate_redirect_from(doc)
21
22
  generate_redirect_to(doc)
22
23
  end
@@ -37,6 +38,7 @@ module JekyllRedirectFrom
37
38
 
38
39
  def generate_redirect_to(doc)
39
40
  return unless doc.redirect_to
41
+
40
42
  page = RedirectPage.redirect_to(doc, doc.redirect_to)
41
43
  doc.data.merge!(page.data)
42
44
  doc.content = doc.output = page.output
@@ -45,6 +47,7 @@ module JekyllRedirectFrom
45
47
 
46
48
  def generate_redirects_json
47
49
  return if File.exist? site.in_source_dir("redirects.json")
50
+
48
51
  page = PageWithoutAFile.new(site, "", "", "redirects.json")
49
52
  page.content = redirects.to_json
50
53
  page.data["layout"] = nil
@@ -45,13 +45,13 @@ module JekyllRedirectFrom
45
45
  def set_paths(from, to)
46
46
  @context ||= context
47
47
  from = ensure_leading_slash(from)
48
- data.merge!({
48
+ data.merge!(
49
49
  "permalink" => from,
50
50
  "redirect" => {
51
51
  "from" => from,
52
52
  "to" => to =~ %r!^https?://! ? to : absolute_url(to),
53
- },
54
- })
53
+ }
54
+ )
55
55
  end
56
56
 
57
57
  def redirect_from
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module JekyllRedirectFrom
4
- VERSION = "0.14.0"
4
+ VERSION = "0.15.0"
5
5
  end
@@ -142,7 +142,7 @@ RSpec.describe JekyllRedirectFrom::Generator do
142
142
 
143
143
  it "doesn't overwrite redirets.json" do
144
144
  expect(path).to exist
145
- expect(redirects).to eql({ "foo" => "bar" })
145
+ expect(redirects).to eql("foo" => "bar")
146
146
  end
147
147
  end
148
148
  end
data/spec/spec_helper.rb CHANGED
@@ -34,7 +34,7 @@ RSpec.configure do |config|
34
34
  end
35
35
 
36
36
  def config
37
- Jekyll.configuration({
37
+ Jekyll.configuration(
38
38
  "source" => fixtures_path.to_s,
39
39
  "destination" => fixtures_path.join("_site").to_s,
40
40
  "collections" => {
@@ -49,8 +49,8 @@ RSpec.configure do |config|
49
49
  "defaults" => [{
50
50
  "scope" => { "path" => "" },
51
51
  "values" => { "layout" => "layout" },
52
- },],
53
- }).backwards_compatibilize
52
+ }]
53
+ ).backwards_compatibilize
54
54
  end
55
55
 
56
56
  def site
metadata CHANGED
@@ -1,43 +1,49 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jekyll-redirect-from
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.14.0
4
+ version: 0.15.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Parker Moore
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-06-29 00:00:00.000000000 Z
11
+ date: 2019-03-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: jekyll
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - "~>"
17
+ - - ">="
18
18
  - !ruby/object:Gem::Version
19
19
  version: '3.3'
20
+ - - "<"
21
+ - !ruby/object:Gem::Version
22
+ version: '5.0'
20
23
  type: :runtime
21
24
  prerelease: false
22
25
  version_requirements: !ruby/object:Gem::Requirement
23
26
  requirements:
24
- - - "~>"
27
+ - - ">="
25
28
  - !ruby/object:Gem::Version
26
29
  version: '3.3'
30
+ - - "<"
31
+ - !ruby/object:Gem::Version
32
+ version: '5.0'
27
33
  - !ruby/object:Gem::Dependency
28
34
  name: bundler
29
35
  requirement: !ruby/object:Gem::Requirement
30
36
  requirements:
31
- - - "~>"
37
+ - - ">="
32
38
  - !ruby/object:Gem::Version
33
- version: '1.16'
39
+ version: '0'
34
40
  type: :development
35
41
  prerelease: false
36
42
  version_requirements: !ruby/object:Gem::Requirement
37
43
  requirements:
38
- - - "~>"
44
+ - - ">="
39
45
  - !ruby/object:Gem::Version
40
- version: '1.16'
46
+ version: '0'
41
47
  - !ruby/object:Gem::Dependency
42
48
  name: jekyll-sitemap
43
49
  requirement: !ruby/object:Gem::Requirement
@@ -81,19 +87,19 @@ dependencies:
81
87
  - !ruby/object:Gem::Version
82
88
  version: '3.5'
83
89
  - !ruby/object:Gem::Dependency
84
- name: rubocop
90
+ name: rubocop-jekyll
85
91
  requirement: !ruby/object:Gem::Requirement
86
92
  requirements:
87
93
  - - "~>"
88
94
  - !ruby/object:Gem::Version
89
- version: '0.57'
95
+ version: '0.4'
90
96
  type: :development
91
97
  prerelease: false
92
98
  version_requirements: !ruby/object:Gem::Requirement
93
99
  requirements:
94
100
  - - "~>"
95
101
  - !ruby/object:Gem::Version
96
- version: '0.57'
102
+ version: '0.4'
97
103
  description:
98
104
  email:
99
105
  - parkrmoore@gmail.com
@@ -104,6 +110,7 @@ files:
104
110
  - ".gitignore"
105
111
  - ".rspec"
106
112
  - ".rubocop.yml"
113
+ - ".rubocop_todo.yml"
107
114
  - ".travis.yml"
108
115
  - Gemfile
109
116
  - History.markdown
@@ -156,15 +163,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
156
163
  requirements:
157
164
  - - ">="
158
165
  - !ruby/object:Gem::Version
159
- version: '0'
166
+ version: 2.3.0
160
167
  required_rubygems_version: !ruby/object:Gem::Requirement
161
168
  requirements:
162
169
  - - ">="
163
170
  - !ruby/object:Gem::Version
164
171
  version: '0'
165
172
  requirements: []
166
- rubyforge_project:
167
- rubygems_version: 2.7.7
173
+ rubygems_version: 3.0.3
168
174
  signing_key:
169
175
  specification_version: 4
170
176
  summary: Seamlessly specify multiple redirection URLs for your pages and posts