jekyll-feed 0.9.3 → 0.10.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
- SHA256:
3
- metadata.gz: fc06c19cf7a822a53cc32bbf9cce036aeca5bf709a111830442897033811850d
4
- data.tar.gz: c4729a2bfe3abb4490f32dcc04c6080259d3189c060f35af06242f5fa995ef7b
2
+ SHA1:
3
+ metadata.gz: 8f54ea4d5e7e1cca4e3f97822892ebbbbf0e1e14
4
+ data.tar.gz: a8f9d0597adee1a4f894dd7721c708099135bdce
5
5
  SHA512:
6
- metadata.gz: 844acc55c1bc3d14bc9fe1f061acc6ed8be1f425dcb86eaa1a51de6ccbb590f4424a77203a0f6faf6791f9a6302fbcbd213f297768835fa6ae4323a873feb63b
7
- data.tar.gz: 944201044de4e0efdcc0ac5fe5a8cb122a15f72c2b3526e757ce1f1a15c8771676978e506a1d7d2d1792a748ef73340c2602e41fdeef9f3f371cff7dbe485e91
6
+ metadata.gz: 4886bdd3fc8bf4bc520ddeab68ee7cc8823e3f6021f8633a5173390fc4ac59243edea9d69b651546f33f7d80e8aafba32cb21929bcdfda8c4480a7aeb2ac5212
7
+ data.tar.gz: 3b3614f94497c50ce1c091760be4e932b6cd917d40c540434d391e4d15cd5469e17a59f5d9a2bc61e61d807695071e2b945677e9b70391ac81625d1846d8f060
@@ -4,26 +4,25 @@ inherit_gem:
4
4
  AllCops:
5
5
  TargetRubyVersion: 2.3
6
6
  Include:
7
- - lib/*.rb
7
+ - lib/**/*.rb
8
8
 
9
9
  Exclude:
10
- - .rubocop.yml
11
- - .codeclimate.yml
12
- - .travis.yml
13
10
  - .gitignore
14
11
  - .rspec
12
+ - .rubocop.yml
13
+ - .travis.yml
15
14
 
16
15
  - Gemfile.lock
17
- - CHANGELOG.md
18
- - readme.md
16
+ - History.markdown
17
+ - LICENSE.txt
19
18
  - README.md
20
- - Readme.md
21
- - ReadMe.md
22
- - COPYING
23
- - LICENSE
24
19
 
25
- - test/**/*
26
- - vendor/**/*
27
20
  - features/**/*
28
21
  - script/**/*
29
22
  - spec/**/*
23
+ - test/**/*
24
+ - vendor/**/*
25
+
26
+ Naming/MemoizedInstanceVariableName:
27
+ Exclude:
28
+ - lib/jekyll-feed/page-without-a-file.rb
@@ -5,12 +5,12 @@ rvm:
5
5
  - 2.5
6
6
  - 2.4
7
7
  - 2.3
8
- - 2.2
9
8
  env:
10
9
  global:
11
10
  - NOKOGIRI_USE_SYSTEM_LIBRARIES=true
12
11
  before_install:
13
12
  - gem update --system
13
+ - gem install bundler
14
14
  before_script: bundle update
15
15
  script: script/cibuild
16
16
  notifications:
@@ -1,3 +1,18 @@
1
+ ## 0.10.0 / 2018-06-04
2
+
3
+ ### Bug Fixes
4
+
5
+ * Escape image URL (#209)
6
+
7
+ ### Development Fixes
8
+
9
+ * Rubocop 0.55 (#223)
10
+ * Bump Rubocop (#230)
11
+
12
+ ### Minor Enhancements
13
+
14
+ * Support Typhoeus 1.0 (#232)
15
+
1
16
  ## 0.9.3 / 2018-02-04
2
17
 
3
18
  * Define path with __dir (#187)
@@ -7,6 +22,7 @@
7
22
 
8
23
  * Fix: Add note about using plugins instead of gems key (#197)
9
24
  * Add documentation for disabling smartify filter (#205)
25
+ * Use `https` in more places. (#165)
10
26
 
11
27
  ### Development Fixes
12
28
 
@@ -14,15 +30,11 @@
14
30
  * Test feeds that have a `site.lang` (#164)
15
31
  * Test against Ruby 2.5 (#201)
16
32
 
17
- ## 0.9.3 / 2017-03-28
18
-
19
33
  ### Minor Enhancements
20
34
 
21
35
  * fix <entry> template for posts with post.lang defined (#168)
22
36
 
23
- ### Documentation
24
-
25
- * Use `https` in more places. (#165)
37
+ ## 0.9.3 / 2017-03-28
26
38
 
27
39
  ## 0.9.1 / 2017-02-17
28
40
 
@@ -24,6 +24,6 @@ Gem::Specification.new do |spec|
24
24
  spec.add_development_dependency "nokogiri", "~> 1.6"
25
25
  spec.add_development_dependency "rake", "~> 12.0"
26
26
  spec.add_development_dependency "rspec", "~> 3.0"
27
- spec.add_development_dependency "rubocop", "0.51"
28
- spec.add_development_dependency "typhoeus", "~> 0.7"
27
+ spec.add_development_dependency "rubocop", "0.56"
28
+ spec.add_development_dependency "typhoeus", ">= 0.7", "< 2.0"
29
29
  end
@@ -72,9 +72,9 @@
72
72
  {% assign post_image = post.image.path | default: post.image %}
73
73
  {% if post_image %}
74
74
  {% unless post_image contains "://" %}
75
- {% assign post_image = post_image | absolute_url | xml_escape %}
75
+ {% assign post_image = post_image | absolute_url %}
76
76
  {% endunless %}
77
- <media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="{{ post_image }}" />
77
+ <media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="{{ post_image | xml_escape }}" />
78
78
  {% endif %}
79
79
  </entry>
80
80
  {% endfor %}
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Jekyll
4
4
  module Feed
5
- VERSION = "0.9.3"
5
+ VERSION = "0.10.0"
6
6
  end
7
7
  end
@@ -1,5 +1,5 @@
1
1
  ---
2
- image: "https://cdn.example.org/absolute.png"
2
+ image: https://cdn.example.org/absolute.png?h=188&w=250
3
3
  ---
4
4
 
5
5
  March the second!
@@ -1,44 +1,45 @@
1
- require 'spec_helper'
1
+ # frozen_string_literal: true
2
+
3
+ require "spec_helper"
2
4
 
3
5
  describe(JekyllFeed) do
4
- let(:overrides) { Hash.new }
6
+ let(:overrides) { {} }
5
7
  let(:config) do
6
8
  Jekyll.configuration(Jekyll::Utils.deep_merge_hashes({
7
9
  "full_rebuild" => true,
8
- "source" => source_dir,
9
- "destination" => dest_dir,
10
- "show_drafts" => true,
11
- "url" => "http://example.org",
12
- "name" => "My awesome site",
13
- "author" => {
14
- "name" => "Dr. Jekyll"
10
+ "source" => source_dir,
11
+ "destination" => dest_dir,
12
+ "show_drafts" => true,
13
+ "url" => "http://example.org",
14
+ "name" => "My awesome site",
15
+ "author" => {
16
+ "name" => "Dr. Jekyll",
15
17
  },
16
- "collections" => {
18
+ "collections" => {
17
19
  "my_collection" => { "output" => true },
18
- "other_things" => { "output" => false }
19
- }
20
+ "other_things" => { "output" => false },
21
+ },
20
22
  }, overrides))
21
23
  end
22
24
  let(:site) { Jekyll::Site.new(config) }
23
25
  let(:contents) { File.read(dest_dir("feed.xml")) }
24
- let(:context) { make_context(site: site) }
26
+ let(:context) { make_context(:site => site) }
25
27
  let(:feed_meta) { Liquid::Template.parse("{% feed_meta %}").render!(context, {}) }
26
28
  before(:each) do
27
29
  site.process
28
30
  end
29
31
 
30
32
  it "has no layout" do
31
- expect(contents).not_to match(/\ATHIS IS MY LAYOUT/)
33
+ expect(contents).not_to match(%r!\ATHIS IS MY LAYOUT!)
32
34
  end
33
35
 
34
36
  it "creates a feed.xml file" do
35
37
  expect(Pathname.new(dest_dir("feed.xml"))).to exist
36
38
  end
37
39
 
38
-
39
40
  it "doesn't have multiple new lines or trailing whitespace" do
40
- expect(contents).to_not match /\s+\n/
41
- expect(contents).to_not match /\n{2,}/
41
+ expect(contents).to_not match %r!\s+\n!
42
+ expect(contents).to_not match %r!\n{2,}!
42
43
  end
43
44
 
44
45
  it "puts all the posts in the feed.xml file" do
@@ -55,7 +56,7 @@ describe(JekyllFeed) do
55
56
  end
56
57
 
57
58
  it "preserves linebreaks in preformatted text in posts" do
58
- expect(contents).to match /Line 1\nLine 2\nLine 3/
59
+ expect(contents).to match %r!Line 1\nLine 2\nLine 3!
59
60
  end
60
61
 
61
62
  it "supports post author name as an object" do
@@ -87,13 +88,13 @@ describe(JekyllFeed) do
87
88
  end
88
89
 
89
90
  it "renders Liquid inside posts" do
90
- expect(contents).to match /Liquid is rendered\./
91
- expect(contents).not_to match /Liquid is not rendered\./
91
+ expect(contents).to match %r!Liquid is rendered\.!
92
+ expect(contents).not_to match %r!Liquid is not rendered\.!
92
93
  end
93
94
 
94
95
  it "includes the item image" do
95
96
  expect(contents).to include('<media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://example.org/image.png" />')
96
- expect(contents).to include('<media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://cdn.example.org/absolute.png" />')
97
+ expect(contents).to include('<media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://cdn.example.org/absolute.png?h=188&amp;w=250" />')
97
98
  expect(contents).to include('<media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://example.org/object-image.png" />')
98
99
  end
99
100
 
@@ -140,7 +141,7 @@ describe(JekyllFeed) do
140
141
 
141
142
  context "with site.lang set" do
142
143
  lang = "en_US"
143
- let(:overrides) { {"lang" => lang} }
144
+ let(:overrides) { { "lang" => lang } }
144
145
  it "outputs a valid feed" do
145
146
  expect(feed.feed_type).to eql("atom")
146
147
  expect(feed.feed_version).to eql("1.0")
@@ -165,7 +166,7 @@ describe(JekyllFeed) do
165
166
 
166
167
  context "with site.title set" do
167
168
  let(:site_title) { "My Site Title" }
168
- let(:overrides) { {"title" => site_title} }
169
+ let(:overrides) { { "title" => site_title } }
169
170
 
170
171
  it "uses site.title for the title" do
171
172
  expect(feed.title.content).to eql(site_title)
@@ -174,7 +175,7 @@ describe(JekyllFeed) do
174
175
 
175
176
  context "with site.name set" do
176
177
  let(:site_name) { "My Site Name" }
177
- let(:overrides) { {"name" => site_name} }
178
+ let(:overrides) { { "name" => site_name } }
178
179
 
179
180
  it "uses site.name for the title" do
180
181
  expect(feed.title.content).to eql(site_name)
@@ -184,7 +185,7 @@ describe(JekyllFeed) do
184
185
  context "with site.name and site.title set" do
185
186
  let(:site_title) { "My Site Title" }
186
187
  let(:site_name) { "My Site Name" }
187
- let(:overrides) { {"title" => site_title, "name" => site_name} }
188
+ let(:overrides) { { "title" => site_title, "name" => site_name } }
188
189
 
189
190
  it "uses site.title for the title, dropping site.name" do
190
191
  expect(feed.title.content).to eql(site_title)
@@ -206,20 +207,20 @@ describe(JekyllFeed) do
206
207
  it "validates" do
207
208
  # See https://validator.w3.org/docs/api.html
208
209
  url = "https://validator.w3.org/feed/check.cgi?output=soap12"
209
- response = Typhoeus.post(url, body: { rawdata: contents }, accept_encoding: "gzip")
210
+ response = Typhoeus.post(url, :body => { :rawdata => contents }, :accept_encoding => "gzip")
210
211
  pending "Something went wrong with the W3 validator" unless response.success?
211
- result = Nokogiri::XML(response.body)
212
+ result = Nokogiri::XML(response.body)
212
213
  result.remove_namespaces!
213
214
 
214
215
  result.css("warning").each do |warning|
215
216
  # Quiet a warning that results from us passing the feed as a string
216
- next if warning.css("text").text =~ /Self reference doesn't match document location/
217
+ next if warning.css("text").text =~ %r!Self reference doesn't match document location!
217
218
 
218
219
  # Quiet expected warning that results from blank summary test case
219
- next if warning.css("text").text =~ /(content|summary) should not be blank/
220
+ next if warning.css("text").text =~ %r!(content|summary) should not be blank!
220
221
 
221
222
  # Quiet expected warning about multiple posts with same updated time
222
- next if warning.css("text").text =~ /Two entries with the same value for atom:updated/
223
+ next if warning.css("text").text =~ %r!Two entries with the same value for atom:updated!
223
224
 
224
225
  warn "Validation warning: #{warning.css("text").text} on line #{warning.css("line").text} column #{warning.css("column").text}"
225
226
  end
@@ -260,12 +261,12 @@ describe(JekyllFeed) do
260
261
  Jekyll.configuration({
261
262
  "source" => source_dir,
262
263
  "destination" => dest_dir,
263
- "url" => "http://example.org"
264
+ "url" => "http://example.org",
264
265
  })
265
266
  end
266
267
 
267
268
  it "does not output blank title" do
268
- expect(feed_meta).not_to include('title=')
269
+ expect(feed_meta).not_to include("title=")
269
270
  end
270
271
  end
271
272
  end
@@ -274,8 +275,8 @@ describe(JekyllFeed) do
274
275
  let(:overrides) do
275
276
  {
276
277
  "feed" => {
277
- "path" => "atom.xml"
278
- }
278
+ "path" => "atom.xml",
279
+ },
279
280
  }
280
281
  end
281
282
 
@@ -299,14 +300,14 @@ describe(JekyllFeed) do
299
300
  let(:overrides) { { "lang" => "en-US" } }
300
301
 
301
302
  it "should set the language" do
302
- expect(contents).to match %r{type="text/html" hreflang="en-US" />}
303
+ expect(contents).to match %r!type="text/html" hreflang="en-US" />!
303
304
  end
304
305
  end
305
306
 
306
- context "with post.lang set"do
307
+ context "with post.lang set" do
307
308
  it "should set the language for that entry" do
308
- expect(contents).to match %r{<entry xml:lang="en">}
309
- expect(contents).to match %r{<entry>}
309
+ expect(contents).to match %r!<entry xml:lang="en">!
310
+ expect(contents).to match %r!<entry>!
310
311
  end
311
312
  end
312
313
  end
@@ -1,15 +1,17 @@
1
- require 'jekyll'
2
- require 'typhoeus'
3
- require 'nokogiri'
4
- require 'rss'
5
- require File.expand_path('../lib/jekyll-feed', __dir__)
1
+ # frozen_string_literal: true
2
+
3
+ require "jekyll"
4
+ require "typhoeus"
5
+ require "nokogiri"
6
+ require "rss"
7
+ require File.expand_path("../lib/jekyll-feed", __dir__)
6
8
 
7
9
  Jekyll.logger.log_level = :error
8
10
 
9
11
  RSpec.configure do |config|
10
12
  config.run_all_when_everything_filtered = true
11
13
  config.filter_run :focus
12
- config.order = 'random'
14
+ config.order = "random"
13
15
 
14
16
  SOURCE_DIR = File.expand_path("fixtures", __dir__)
15
17
  DEST_DIR = File.expand_path("dest", __dir__)
@@ -23,6 +25,6 @@ RSpec.configure do |config|
23
25
  end
24
26
 
25
27
  def make_context(registers = {})
26
- Liquid::Context.new({}, {}, { site: site }.merge(registers))
28
+ Liquid::Context.new({}, {}, { :site => site }.merge(registers))
27
29
  end
28
30
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jekyll-feed
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.9.3
4
+ version: 0.10.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ben Balter
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-02-04 00:00:00.000000000 Z
11
+ date: 2018-06-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: jekyll
@@ -86,28 +86,34 @@ dependencies:
86
86
  requirements:
87
87
  - - '='
88
88
  - !ruby/object:Gem::Version
89
- version: '0.51'
89
+ version: '0.56'
90
90
  type: :development
91
91
  prerelease: false
92
92
  version_requirements: !ruby/object:Gem::Requirement
93
93
  requirements:
94
94
  - - '='
95
95
  - !ruby/object:Gem::Version
96
- version: '0.51'
96
+ version: '0.56'
97
97
  - !ruby/object:Gem::Dependency
98
98
  name: typhoeus
99
99
  requirement: !ruby/object:Gem::Requirement
100
100
  requirements:
101
- - - "~>"
101
+ - - ">="
102
102
  - !ruby/object:Gem::Version
103
103
  version: '0.7'
104
+ - - "<"
105
+ - !ruby/object:Gem::Version
106
+ version: '2.0'
104
107
  type: :development
105
108
  prerelease: false
106
109
  version_requirements: !ruby/object:Gem::Requirement
107
110
  requirements:
108
- - - "~>"
111
+ - - ">="
109
112
  - !ruby/object:Gem::Version
110
113
  version: '0.7'
114
+ - - "<"
115
+ - !ruby/object:Gem::Version
116
+ version: '2.0'
111
117
  description:
112
118
  email:
113
119
  - ben.balter@github.com
@@ -173,7 +179,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
173
179
  version: '0'
174
180
  requirements: []
175
181
  rubyforge_project:
176
- rubygems_version: 2.7.4
182
+ rubygems_version: 2.6.14
177
183
  signing_key:
178
184
  specification_version: 4
179
185
  summary: A Jekyll plugin to generate an Atom feed of your Jekyll posts