octopress-feeds 1.0.0 → 1.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +11 -0
- data/README.md +16 -15
- data/assets/includes/entry.xml +2 -2
- data/assets/includes/head.xml +1 -1
- data/assets/pages/article-feed.xml +1 -1
- data/assets/pages/link-feed.xml +1 -1
- data/lib/octopress-feeds/version.rb +2 -4
- data/lib/octopress-feeds.rb +51 -43
- metadata +92 -46
- data/.gitignore +0 -23
- data/.travis.yml +0 -5
- data/Gemfile +0 -4
- data/Rakefile +0 -2
- data/octopress-feeds.gemspec +0 -26
- data/test/Gemfile +0 -8
- data/test/_config.yml +0 -9
- data/test/_expected/2014/05/26/awesome-link.html +0 -3
- data/test/_expected/2014/05/26/some-great-post-idea.html +0 -3
- data/test/_expected/feed/articles/index.xml +0 -36
- data/test/_expected/feed/index.xml +0 -60
- data/test/_expected/feed/links/index.xml +0 -39
- data/test/_includes/head.html +0 -1
- data/test/_layouts/post.html +0 -2
- data/test/_octopress.yml +0 -11
- data/test/_plugins/feeds/config.yml +0 -3
- data/test/_posts/2014-05-26-some-great-post-idea.markdown +0 -6
- data/test/_posts/2014-05-27-awesome-link.markdown +0 -9
- data/test/_templates/page +0 -4
- data/test/_templates/post +0 -5
- data/test/test.rb +0 -8
- data/test/test_suite.rb +0 -182
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a967ab2b1b0362bd7c24d6c73d258e2211f9bf02
|
4
|
+
data.tar.gz: da93c88384ce140e93a74ab822f13e65b97a4f7a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d37e03cb7566d270d5efbaa940163b32e3d9844d318f3cad2c528dc875485da0153d71ff72712c716e44b52c08d644ebef70596943cd8d316e7c8aee4171a3ab
|
7
|
+
data.tar.gz: 990f1bb81175708a759f3a7a053dd287d2ac6ea384e50fcbc0c499eb9877a3d02fee8ae910021fb21db73b8fe13181bfe491b6b568bf0e2e1cf504bc104de99c
|
data/CHANGELOG.md
ADDED
data/README.md
CHANGED
@@ -4,34 +4,35 @@ Add nice RSS feeds to Octopress and Jekyll sites. Supports a standard feed, an a
|
|
4
4
|
|
5
5
|
## Installation
|
6
6
|
|
7
|
-
|
7
|
+
Using Bundler:
|
8
8
|
|
9
|
-
|
9
|
+
Add this gem to your site's Gemfile in the `:jekyll_plugins` group:
|
10
10
|
|
11
|
-
|
11
|
+
group :jekyll_plugins do
|
12
|
+
gem 'octopress-feeds'
|
13
|
+
end
|
12
14
|
|
13
|
-
|
15
|
+
Then install the gem with Bundler
|
14
16
|
|
15
|
-
|
17
|
+
$ bundle
|
16
18
|
|
17
|
-
|
19
|
+
Or install manually:
|
18
20
|
|
19
|
-
|
21
|
+
$ gem install octopress-feeds
|
20
22
|
|
21
|
-
|
23
|
+
Then add the gem to your Jekyll configuration.
|
22
24
|
|
23
|
-
|
24
|
-
|
25
|
-
- octopress-feed
|
26
|
-
```
|
25
|
+
gems:
|
26
|
+
-octopress-feeds
|
27
27
|
|
28
28
|
## Usage
|
29
29
|
|
30
|
-
Be sure your Jekyll configuration has a `url`, a `
|
30
|
+
Be sure your Jekyll configuration has a `url`, a `name` and an `author`. If you want your feed to have linkblogging features, be sure
|
31
|
+
to install [Octopress Linkblog](https://github.com/octopress/linkblog).
|
31
32
|
|
32
33
|
```yaml
|
33
34
|
url: http://yoursite.com/
|
34
|
-
|
35
|
+
name: My Awesome Site
|
35
36
|
author: Guy McDude
|
36
37
|
```
|
37
38
|
|
@@ -103,7 +104,7 @@ This will create a configuration file populated with the defaults for this plugi
|
|
103
104
|
|
104
105
|
## Contributing
|
105
106
|
|
106
|
-
1. Fork it ( https://github.com/octopress/
|
107
|
+
1. Fork it ( https://github.com/octopress/feeds/fork )
|
107
108
|
2. Create your feature branch (`git checkout -b my-new-feature`)
|
108
109
|
3. Commit your changes (`git commit -am 'Add some feature'`)
|
109
110
|
4. Push to the branch (`git push origin my-new-feature`)
|
data/assets/includes/entry.xml
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
<title type="html">{
|
1
|
+
<title type="html">{% return post.title_text || post.title %}</title>
|
2
2
|
{% if post.linkpost and plugins.feeds.external_links %}
|
3
3
|
<link rel="alternate" type="text/html" href="{{ post.external-url }}"/>
|
4
4
|
<link rel="related" type="text/html" href="{{ post.url | full_url }}"/>
|
@@ -7,7 +7,7 @@
|
|
7
7
|
{% endif %}
|
8
8
|
<id>{{ post.id }}</id>
|
9
9
|
<published>{{ post.date_xml }}</published>
|
10
|
-
<updated>{% return post.
|
10
|
+
<updated>{% return post.date_updated_xml || post.date_xml %}</updated>
|
11
11
|
<author>
|
12
12
|
<name>{% return post.author || site.author %}</name>
|
13
13
|
<uri>{% return post.author_site || site.url %}</uri>
|
data/assets/includes/head.xml
CHANGED
@@ -3,7 +3,7 @@
|
|
3
3
|
<title>{% return site.name || site.title %}</title>
|
4
4
|
<link rel="alternate" type="text/html" href="{{ site.url }}/"/>
|
5
5
|
<link rel="self" type="application/atom+xml" href="{{ page.url | remove:'index.xml' | full_url }}"/>
|
6
|
-
<id>{{ url }}</id>
|
6
|
+
<id>{{ site.url }}</id>
|
7
7
|
<updated>{% feed_updated_date %}</updated>
|
8
8
|
<generator uri="http://octopress.org/">Octopress</generator>
|
9
9
|
<rights>Copyright © {{ site.time | date: '%Y' }}, {{ site.author | strip_html }}</rights>
|
@@ -3,7 +3,7 @@ permalink: /feed/articles/
|
|
3
3
|
title: Articles-only Feed
|
4
4
|
feed: articles
|
5
5
|
---
|
6
|
-
{% if plugins.feeds.articles_feed %}
|
6
|
+
{% if site.articles && plugins.feeds.articles_feed %}
|
7
7
|
{% include feeds:head.xml %}
|
8
8
|
{% for post in site.articles limit:plugins.feeds.count %}
|
9
9
|
<entry>
|
data/assets/pages/link-feed.xml
CHANGED
@@ -3,7 +3,7 @@ permalink: /feed/links/
|
|
3
3
|
title: Linkpost Feed
|
4
4
|
feed: linkposts
|
5
5
|
---
|
6
|
-
{% if plugins.feeds.linkposts_feed %}
|
6
|
+
{% if site.linkposts && plugins.feeds.linkposts_feed %}
|
7
7
|
{% include feeds:head.xml %}
|
8
8
|
{% for post in site.linkposts limit:plugins.feeds.count %}
|
9
9
|
<entry>
|
data/lib/octopress-feeds.rb
CHANGED
@@ -1,55 +1,52 @@
|
|
1
1
|
require 'octopress-feeds/version'
|
2
2
|
require 'octopress-ink'
|
3
|
+
require 'octopress-include-tag'
|
4
|
+
require 'octopress-abort-tag'
|
5
|
+
require 'octopress-return-tag'
|
6
|
+
require 'octopress-date-format'
|
3
7
|
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
assets_path: File.expand_path(File.join(File.dirname(__FILE__), "../assets")),
|
8
|
-
type: "plugin",
|
9
|
-
version: Octopress::Ink::Feeds::VERSION,
|
10
|
-
description: "A nice RSS feed for Octopress and Jekyll sites.",
|
11
|
-
website: "https://github.com/octopress/feeds"
|
12
|
-
})
|
8
|
+
begin
|
9
|
+
require 'octopress-linkblog'
|
10
|
+
rescue LoadError; end
|
13
11
|
|
14
12
|
module Octopress
|
15
|
-
module
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
tag(p.page)
|
24
|
-
end
|
13
|
+
module Feeds
|
14
|
+
class FeedTag < Liquid::Tag
|
15
|
+
def render(context)
|
16
|
+
tags = []
|
17
|
+
|
18
|
+
Ink.plugin('feeds').pages.dup.map do |p|
|
19
|
+
if p.filename == 'main-feed.xml' && !p.disabled?
|
20
|
+
tag(p.page)
|
25
21
|
end
|
26
22
|
end
|
23
|
+
end
|
27
24
|
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
end
|
25
|
+
def tag(page)
|
26
|
+
url = page.url.sub(/index\.xml/, '')
|
27
|
+
"<link href='#{url}' rel='alternate' title='#{page.data['title']}: #{Octopress.site.config['name']}' type='application/atom+xml'>"
|
32
28
|
end
|
29
|
+
end
|
33
30
|
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
if post.data['updated']
|
48
|
-
post.data['updated_date_xml']
|
49
|
-
else
|
50
|
-
post.data['date_xml']
|
51
|
-
end
|
31
|
+
class FeedUpdatedTag < Liquid::Tag
|
32
|
+
def render(context)
|
33
|
+
feed = context.environments.first['page']['feed'] || 'posts'
|
34
|
+
site = context.environments.first['site']
|
35
|
+
|
36
|
+
case feed
|
37
|
+
when 'articles'
|
38
|
+
posts = site['articles']
|
39
|
+
when 'linkposts'
|
40
|
+
posts = site['linkposts']
|
41
|
+
else
|
42
|
+
posts = site['posts']
|
52
43
|
end
|
44
|
+
|
45
|
+
post = posts.sort_by{ |p|
|
46
|
+
p.data['date_updated'] || p.data['date']
|
47
|
+
}.last
|
48
|
+
|
49
|
+
post.data['date_updated_xml'] || post.data['date_xml']
|
53
50
|
end
|
54
51
|
end
|
55
52
|
end
|
@@ -57,6 +54,17 @@ end
|
|
57
54
|
|
58
55
|
|
59
56
|
|
60
|
-
Liquid::Template.register_tag('feed_tag', Octopress::
|
61
|
-
Liquid::Template.register_tag('feed_updated_date', Octopress::
|
57
|
+
Liquid::Template.register_tag('feed_tag', Octopress::Feeds::FeedTag)
|
58
|
+
Liquid::Template.register_tag('feed_updated_date', Octopress::Feeds::FeedUpdatedTag)
|
59
|
+
|
60
|
+
Octopress::Ink.add_plugin({
|
61
|
+
name: "Octopress Feeds",
|
62
|
+
slug: "feeds",
|
63
|
+
gem: "octopress-feeds",
|
64
|
+
path: File.expand_path(File.join(File.dirname(__FILE__), "../")),
|
65
|
+
type: "plugin",
|
66
|
+
version: Octopress::Feeds::VERSION,
|
67
|
+
description: "RSS feeds supporting link-blogging for Octopress and Jekyll sites.",
|
68
|
+
website: "https://github.com/octopress/feeds"
|
69
|
+
})
|
62
70
|
|
metadata
CHANGED
@@ -1,15 +1,71 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: octopress-feeds
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Brandon Mathis
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2015-01-06 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: octopress-ink
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - ">="
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: 1.0.0.rc
|
20
|
+
type: :runtime
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - ">="
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: 1.0.0.rc
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: octopress-abort-tag
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - ">="
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '0'
|
34
|
+
type: :runtime
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - ">="
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '0'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: octopress-return-tag
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - ">="
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '0'
|
48
|
+
type: :runtime
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - ">="
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '0'
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: octopress-date-format
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - ">="
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '0'
|
62
|
+
type: :runtime
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - ">="
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: '0'
|
13
69
|
- !ruby/object:Gem::Dependency
|
14
70
|
name: bundler
|
15
71
|
requirement: !ruby/object:Gem::Requirement
|
@@ -53,19 +109,47 @@ dependencies:
|
|
53
109
|
- !ruby/object:Gem::Version
|
54
110
|
version: '0'
|
55
111
|
- !ruby/object:Gem::Dependency
|
56
|
-
name:
|
112
|
+
name: clash
|
57
113
|
requirement: !ruby/object:Gem::Requirement
|
58
114
|
requirements:
|
59
115
|
- - ">="
|
60
116
|
- !ruby/object:Gem::Version
|
61
|
-
version:
|
62
|
-
type: :
|
117
|
+
version: '0'
|
118
|
+
type: :development
|
63
119
|
prerelease: false
|
64
120
|
version_requirements: !ruby/object:Gem::Requirement
|
65
121
|
requirements:
|
66
122
|
- - ">="
|
67
123
|
- !ruby/object:Gem::Version
|
68
|
-
version:
|
124
|
+
version: '0'
|
125
|
+
- !ruby/object:Gem::Dependency
|
126
|
+
name: octopress-linkblog
|
127
|
+
requirement: !ruby/object:Gem::Requirement
|
128
|
+
requirements:
|
129
|
+
- - ">="
|
130
|
+
- !ruby/object:Gem::Version
|
131
|
+
version: '0'
|
132
|
+
type: :development
|
133
|
+
prerelease: false
|
134
|
+
version_requirements: !ruby/object:Gem::Requirement
|
135
|
+
requirements:
|
136
|
+
- - ">="
|
137
|
+
- !ruby/object:Gem::Version
|
138
|
+
version: '0'
|
139
|
+
- !ruby/object:Gem::Dependency
|
140
|
+
name: pry-byebug
|
141
|
+
requirement: !ruby/object:Gem::Requirement
|
142
|
+
requirements:
|
143
|
+
- - ">="
|
144
|
+
- !ruby/object:Gem::Version
|
145
|
+
version: '0'
|
146
|
+
type: :development
|
147
|
+
prerelease: false
|
148
|
+
version_requirements: !ruby/object:Gem::Requirement
|
149
|
+
requirements:
|
150
|
+
- - ">="
|
151
|
+
- !ruby/object:Gem::Version
|
152
|
+
version: '0'
|
69
153
|
description: A nice RSS feeds for Octopress and Jekyll sites.
|
70
154
|
email:
|
71
155
|
- brandon@imathis.com
|
@@ -73,12 +157,9 @@ executables: []
|
|
73
157
|
extensions: []
|
74
158
|
extra_rdoc_files: []
|
75
159
|
files:
|
76
|
-
-
|
77
|
-
- ".travis.yml"
|
78
|
-
- Gemfile
|
160
|
+
- CHANGELOG.md
|
79
161
|
- LICENSE.txt
|
80
162
|
- README.md
|
81
|
-
- Rakefile
|
82
163
|
- assets/config.yml
|
83
164
|
- assets/includes/entry.xml
|
84
165
|
- assets/includes/head.xml
|
@@ -87,24 +168,6 @@ files:
|
|
87
168
|
- assets/pages/main-feed.xml
|
88
169
|
- lib/octopress-feeds.rb
|
89
170
|
- lib/octopress-feeds/version.rb
|
90
|
-
- octopress-feeds.gemspec
|
91
|
-
- test/Gemfile
|
92
|
-
- test/_config.yml
|
93
|
-
- test/_expected/2014/05/26/awesome-link.html
|
94
|
-
- test/_expected/2014/05/26/some-great-post-idea.html
|
95
|
-
- test/_expected/feed/articles/index.xml
|
96
|
-
- test/_expected/feed/index.xml
|
97
|
-
- test/_expected/feed/links/index.xml
|
98
|
-
- test/_includes/head.html
|
99
|
-
- test/_layouts/post.html
|
100
|
-
- test/_octopress.yml
|
101
|
-
- test/_plugins/feeds/config.yml
|
102
|
-
- test/_posts/2014-05-26-some-great-post-idea.markdown
|
103
|
-
- test/_posts/2014-05-27-awesome-link.markdown
|
104
|
-
- test/_templates/page
|
105
|
-
- test/_templates/post
|
106
|
-
- test/test.rb
|
107
|
-
- test/test_suite.rb
|
108
171
|
homepage: https://github.com/octopress/feeds
|
109
172
|
licenses:
|
110
173
|
- MIT
|
@@ -129,21 +192,4 @@ rubygems_version: 2.2.2
|
|
129
192
|
signing_key:
|
130
193
|
specification_version: 4
|
131
194
|
summary: A nice RSS feeds for Octopress and Jekyll sites.
|
132
|
-
test_files:
|
133
|
-
- test/Gemfile
|
134
|
-
- test/_config.yml
|
135
|
-
- test/_expected/2014/05/26/awesome-link.html
|
136
|
-
- test/_expected/2014/05/26/some-great-post-idea.html
|
137
|
-
- test/_expected/feed/articles/index.xml
|
138
|
-
- test/_expected/feed/index.xml
|
139
|
-
- test/_expected/feed/links/index.xml
|
140
|
-
- test/_includes/head.html
|
141
|
-
- test/_layouts/post.html
|
142
|
-
- test/_octopress.yml
|
143
|
-
- test/_plugins/feeds/config.yml
|
144
|
-
- test/_posts/2014-05-26-some-great-post-idea.markdown
|
145
|
-
- test/_posts/2014-05-27-awesome-link.markdown
|
146
|
-
- test/_templates/page
|
147
|
-
- test/_templates/post
|
148
|
-
- test/test.rb
|
149
|
-
- test/test_suite.rb
|
195
|
+
test_files: []
|
data/.gitignore
DELETED
@@ -1,23 +0,0 @@
|
|
1
|
-
*.gem
|
2
|
-
*.rbc
|
3
|
-
.bundle
|
4
|
-
.config
|
5
|
-
.yardoc
|
6
|
-
Gemfile.lock
|
7
|
-
InstalledFiles
|
8
|
-
_yardoc
|
9
|
-
coverage
|
10
|
-
doc/
|
11
|
-
lib/bundler/man
|
12
|
-
pkg
|
13
|
-
rdoc
|
14
|
-
spec/reports
|
15
|
-
test/tmp
|
16
|
-
test/version_tmp
|
17
|
-
tmp
|
18
|
-
*.bundle
|
19
|
-
*.so
|
20
|
-
*.o
|
21
|
-
*.a
|
22
|
-
mkmf.log
|
23
|
-
_site
|
data/.travis.yml
DELETED
data/Gemfile
DELETED
data/Rakefile
DELETED
data/octopress-feeds.gemspec
DELETED
@@ -1,26 +0,0 @@
|
|
1
|
-
# coding: utf-8
|
2
|
-
lib = File.expand_path('../lib', __FILE__)
|
3
|
-
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
|
-
require 'octopress-feeds/version'
|
5
|
-
|
6
|
-
Gem::Specification.new do |spec|
|
7
|
-
spec.name = "octopress-feeds"
|
8
|
-
spec.version = Octopress::Ink::Feeds::VERSION
|
9
|
-
spec.authors = ["Brandon Mathis"]
|
10
|
-
spec.email = ["brandon@imathis.com"]
|
11
|
-
spec.summary = %q{A nice RSS feeds for Octopress and Jekyll sites.}
|
12
|
-
spec.description = %q{A nice RSS feeds for Octopress and Jekyll sites.}
|
13
|
-
spec.homepage = "https://github.com/octopress/feeds"
|
14
|
-
spec.license = "MIT"
|
15
|
-
|
16
|
-
spec.files = `git ls-files -z`.split("\x0")
|
17
|
-
spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
|
18
|
-
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
19
|
-
spec.require_paths = ["lib"]
|
20
|
-
|
21
|
-
spec.add_development_dependency "bundler", "~> 1.6"
|
22
|
-
spec.add_development_dependency "rake"
|
23
|
-
spec.add_development_dependency "octopress"
|
24
|
-
|
25
|
-
spec.add_runtime_dependency "octopress-ink", ">= 1.0.0.rc.8"
|
26
|
-
end
|
data/test/Gemfile
DELETED
data/test/_config.yml
DELETED
@@ -1,36 +0,0 @@
|
|
1
|
-
|
2
|
-
<?xml version="1.0" encoding="utf-8"?>
|
3
|
-
<feed xmlns="http://www.w3.org/2005/Atom">
|
4
|
-
<title>Some awesome Jekyll site</title>
|
5
|
-
<link rel="alternate" type="text/html" href="http://octopress.org//"/>
|
6
|
-
<link rel="self" type="application/atom+xml" href="http://octopress.org/feed/articles/"/>
|
7
|
-
<id></id>
|
8
|
-
<updated>2014-05-26T22:29:13-05:00</updated>
|
9
|
-
<generator uri="http://octopress.org/">Octopress</generator>
|
10
|
-
<rights>Copyright © 2014, Bob McDiggity</rights>
|
11
|
-
|
12
|
-
<entry>
|
13
|
-
<title type="html">Some Great Post Idea</title>
|
14
|
-
|
15
|
-
<link rel="alternate" type="text/html" href="http://octopress.org/2014/05/26/some-great-post-idea.html"/>
|
16
|
-
|
17
|
-
<id>/2014/05/26/some-great-post-idea</id>
|
18
|
-
<published>2014-05-26T22:29:13-05:00</published>
|
19
|
-
<updated>2014-05-26T22:29:13-05:00</updated>
|
20
|
-
<author>
|
21
|
-
<name>Bob McDiggity</name>
|
22
|
-
<uri>http://octopress.org/</uri>
|
23
|
-
</author>
|
24
|
-
<content type="html" xml:base="http://octopress.org/" xml:lang="en">
|
25
|
-
<![CDATA[
|
26
|
-
|
27
|
-
<p>totally sweet stuff.</p>
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
]]>
|
32
|
-
</content>
|
33
|
-
</entry>
|
34
|
-
|
35
|
-
</feed>
|
36
|
-
|
@@ -1,60 +0,0 @@
|
|
1
|
-
<?xml version="1.0" encoding="utf-8"?>
|
2
|
-
<feed xmlns="http://www.w3.org/2005/Atom">
|
3
|
-
<title>Some awesome Jekyll site</title>
|
4
|
-
<link rel="alternate" type="text/html" href="http://octopress.org//"/>
|
5
|
-
<link rel="self" type="application/atom+xml" href="http://octopress.org/feed/"/>
|
6
|
-
<id></id>
|
7
|
-
<updated>2014-06-01T22:45:41-05:00</updated>
|
8
|
-
<generator uri="http://octopress.org/">Octopress</generator>
|
9
|
-
<rights>Copyright © 2014, Bob McDiggity</rights>
|
10
|
-
|
11
|
-
<entry>
|
12
|
-
<title type="html">Awesome Link →</title>
|
13
|
-
|
14
|
-
<link rel="alternate" type="text/html" href="http://timecube.com"/>
|
15
|
-
<link rel="related" type="text/html" href="http://octopress.org/2014/05/26/awesome-link.html"/>
|
16
|
-
|
17
|
-
<id>/2014/05/26/awesome-link</id>
|
18
|
-
<published>2014-05-26T22:45:41-05:00</published>
|
19
|
-
<updated>2014-06-01T22:45:41-05:00</updated>
|
20
|
-
<author>
|
21
|
-
<name>Bob McDiggity</name>
|
22
|
-
<uri>http://octopress.org/</uri>
|
23
|
-
</author>
|
24
|
-
<content type="html" xml:base="http://octopress.org/" xml:lang="en">
|
25
|
-
<![CDATA[
|
26
|
-
|
27
|
-
<p>This contains all knowledge.</p>
|
28
|
-
|
29
|
-
|
30
|
-
<p><a href="http://octopress.org/2014/05/26/awesome-link.html">∞ Permalink</a></p>
|
31
|
-
|
32
|
-
|
33
|
-
]]>
|
34
|
-
</content>
|
35
|
-
</entry>
|
36
|
-
|
37
|
-
<entry>
|
38
|
-
<title type="html">Some Great Post Idea</title>
|
39
|
-
|
40
|
-
<link rel="alternate" type="text/html" href="http://octopress.org/2014/05/26/some-great-post-idea.html"/>
|
41
|
-
|
42
|
-
<id>/2014/05/26/some-great-post-idea</id>
|
43
|
-
<published>2014-05-26T22:29:13-05:00</published>
|
44
|
-
<updated>2014-05-26T22:29:13-05:00</updated>
|
45
|
-
<author>
|
46
|
-
<name>Bob McDiggity</name>
|
47
|
-
<uri>http://octopress.org/</uri>
|
48
|
-
</author>
|
49
|
-
<content type="html" xml:base="http://octopress.org/" xml:lang="en">
|
50
|
-
<![CDATA[
|
51
|
-
|
52
|
-
<p>totally sweet stuff.</p>
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
]]>
|
57
|
-
</content>
|
58
|
-
</entry>
|
59
|
-
|
60
|
-
</feed>
|
@@ -1,39 +0,0 @@
|
|
1
|
-
|
2
|
-
<?xml version="1.0" encoding="utf-8"?>
|
3
|
-
<feed xmlns="http://www.w3.org/2005/Atom">
|
4
|
-
<title>Some awesome Jekyll site</title>
|
5
|
-
<link rel="alternate" type="text/html" href="http://octopress.org//"/>
|
6
|
-
<link rel="self" type="application/atom+xml" href="http://octopress.org/feed/links/"/>
|
7
|
-
<id></id>
|
8
|
-
<updated>2014-06-01T22:45:41-05:00</updated>
|
9
|
-
<generator uri="http://octopress.org/">Octopress</generator>
|
10
|
-
<rights>Copyright © 2014, Bob McDiggity</rights>
|
11
|
-
|
12
|
-
<entry>
|
13
|
-
<title type="html">Awesome Link →</title>
|
14
|
-
|
15
|
-
<link rel="alternate" type="text/html" href="http://timecube.com"/>
|
16
|
-
<link rel="related" type="text/html" href="http://octopress.org/2014/05/26/awesome-link.html"/>
|
17
|
-
|
18
|
-
<id>/2014/05/26/awesome-link</id>
|
19
|
-
<published>2014-05-26T22:45:41-05:00</published>
|
20
|
-
<updated>2014-06-01T22:45:41-05:00</updated>
|
21
|
-
<author>
|
22
|
-
<name>Bob McDiggity</name>
|
23
|
-
<uri>http://octopress.org/</uri>
|
24
|
-
</author>
|
25
|
-
<content type="html" xml:base="http://octopress.org/" xml:lang="en">
|
26
|
-
<![CDATA[
|
27
|
-
|
28
|
-
<p>This contains all knowledge.</p>
|
29
|
-
|
30
|
-
|
31
|
-
<p><a href="http://octopress.org/2014/05/26/awesome-link.html">∞ Permalink</a></p>
|
32
|
-
|
33
|
-
|
34
|
-
]]>
|
35
|
-
</content>
|
36
|
-
</entry>
|
37
|
-
|
38
|
-
</feed>
|
39
|
-
|
data/test/_includes/head.html
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
<head>{% feed_tag %}</head>
|
data/test/_layouts/post.html
DELETED
data/test/_octopress.yml
DELETED
data/test/_templates/page
DELETED
data/test/_templates/post
DELETED
data/test/test.rb
DELETED
data/test/test_suite.rb
DELETED
@@ -1,182 +0,0 @@
|
|
1
|
-
require 'colorator'
|
2
|
-
require 'find'
|
3
|
-
|
4
|
-
# This is a makeshift integration test-suite.
|
5
|
-
# It is unapologetically pragmatic.
|
6
|
-
|
7
|
-
|
8
|
-
# Build Jekyll
|
9
|
-
#
|
10
|
-
def build(options={})
|
11
|
-
config = ['_config.yml'] << options[:config]
|
12
|
-
|
13
|
-
if options[:config]
|
14
|
-
options[:config].each do |name, file|
|
15
|
-
case name
|
16
|
-
when :jekyll
|
17
|
-
config << "_configs/#{file}"
|
18
|
-
when :octopress
|
19
|
-
FileUtils.cp "_configs/#{file}", "_octopress.yml"
|
20
|
-
else
|
21
|
-
FileUtils.cp "_configs/#{file}", "_plugins/#{name}/config.yml"
|
22
|
-
end
|
23
|
-
end
|
24
|
-
end
|
25
|
-
|
26
|
-
cmd = "rm -rf site && bundle exec jekyll build --config #{config.join(',')}"
|
27
|
-
|
28
|
-
`#{cmd}`
|
29
|
-
|
30
|
-
if options[:config]
|
31
|
-
options[:config].each do |name, file|
|
32
|
-
case name
|
33
|
-
when :jekyll
|
34
|
-
next
|
35
|
-
when :octopress
|
36
|
-
`rm _octopress.yml`
|
37
|
-
else
|
38
|
-
`rm _plugins/#{name}/config.yml`
|
39
|
-
end
|
40
|
-
end
|
41
|
-
end
|
42
|
-
end
|
43
|
-
|
44
|
-
|
45
|
-
# Find all files in a given directory
|
46
|
-
#
|
47
|
-
def dir_files(dir)
|
48
|
-
Find.find(dir).to_a.reject!{|f| File.directory?(f) }
|
49
|
-
end
|
50
|
-
|
51
|
-
# Recursively diff two directories
|
52
|
-
#
|
53
|
-
# This will walk through dir1 and diff matching paths in dir2
|
54
|
-
#
|
55
|
-
def test_dirs(desc, dir1, dir2)
|
56
|
-
|
57
|
-
test_missing_files(desc, dir1, dir2)
|
58
|
-
|
59
|
-
dir_files(dir1).each do |file|
|
60
|
-
file2 = file.sub(dir1, dir2)
|
61
|
-
if File.exist?(file2)
|
62
|
-
if diff = diff_file(file, file2)
|
63
|
-
@failures << {
|
64
|
-
desc: "#{desc}\nDiff of file: #{file.sub(dir1+'/', '')}\n",
|
65
|
-
result: format_diff(diff)
|
66
|
-
}
|
67
|
-
pout 'F'.red
|
68
|
-
else
|
69
|
-
pout '.'.green
|
70
|
-
end
|
71
|
-
end
|
72
|
-
end
|
73
|
-
end
|
74
|
-
|
75
|
-
def format_diff(diff)
|
76
|
-
"#{diff.gsub(/\A.+?\n/,'').gsub(/^[^><].+/,'---').gsub(/^>.+/){|m|
|
77
|
-
m.green
|
78
|
-
}.gsub(/^(<.+?)$/){ |m|
|
79
|
-
m.red
|
80
|
-
}}"
|
81
|
-
end
|
82
|
-
|
83
|
-
# List differences between files in two directories
|
84
|
-
#
|
85
|
-
def test_missing_files(desc, dir1, dir2)
|
86
|
-
files1 = dir_files(dir1).map {|f| f.sub(dir1,'') }
|
87
|
-
files2 = dir_files(dir2).map {|f| f.sub(dir2,'') }
|
88
|
-
|
89
|
-
missing = []
|
90
|
-
|
91
|
-
(files2 - files1).each do |file|
|
92
|
-
missing << File.join(dir1, file)
|
93
|
-
end
|
94
|
-
|
95
|
-
(files1 - files2).each do |file|
|
96
|
-
missing << File.join(dir2, file)
|
97
|
-
end
|
98
|
-
|
99
|
-
if !missing.empty?
|
100
|
-
@failures << {
|
101
|
-
desc: "#{desc}\nMissing files:\n",
|
102
|
-
result: " - " + missing.join("\n - ")
|
103
|
-
}
|
104
|
-
|
105
|
-
pout 'F'.red
|
106
|
-
else
|
107
|
-
pout '.'.green
|
108
|
-
end
|
109
|
-
end
|
110
|
-
|
111
|
-
# Diff two files
|
112
|
-
#
|
113
|
-
def diff_file(file1, file2)
|
114
|
-
diff = `diff #{file1} #{file2}`
|
115
|
-
if diff.size > 0
|
116
|
-
diff
|
117
|
-
else
|
118
|
-
false
|
119
|
-
end
|
120
|
-
end
|
121
|
-
|
122
|
-
# Test command output
|
123
|
-
#
|
124
|
-
# Input: options hash, format:
|
125
|
-
# {
|
126
|
-
# desc: description of task
|
127
|
-
# cmd: system command to be run, (String or Array)
|
128
|
-
# expect: expected output from command
|
129
|
-
# }
|
130
|
-
#
|
131
|
-
def test_cmd(options)
|
132
|
-
if cmd = options[:cmd]
|
133
|
-
cmd = [cmd] unless cmd.is_a? Array
|
134
|
-
|
135
|
-
# In debug mode command output is printed
|
136
|
-
#
|
137
|
-
if options[:debug]
|
138
|
-
system cmd.join('; ')
|
139
|
-
else
|
140
|
-
output = `#{cmd.join('; ')}`.gsub(/#{Dir.pwd}\/*/,'').strip
|
141
|
-
|
142
|
-
# Remove character color codes
|
143
|
-
output = output.gsub("\e",'').gsub(/\[\d+m/,'').gsub("\[0m",'')
|
144
|
-
end
|
145
|
-
if options[:expect] && options[:expect].strip == output
|
146
|
-
pout '.'.green
|
147
|
-
elsif options[:expect]
|
148
|
-
pout 'F'.red
|
149
|
-
@failures << {
|
150
|
-
desc: options[:desc]+"\n",
|
151
|
-
result: <<-HERE
|
152
|
-
expected: #{(options[:expect] || '').strip.green}
|
153
|
-
result: #{(output || '').strip.red}
|
154
|
-
HERE
|
155
|
-
}
|
156
|
-
end
|
157
|
-
end
|
158
|
-
end
|
159
|
-
|
160
|
-
|
161
|
-
# Print a single character without a newline
|
162
|
-
#
|
163
|
-
def pout(str)
|
164
|
-
print str
|
165
|
-
$stdout.flush
|
166
|
-
end
|
167
|
-
|
168
|
-
# Ouptut nicely formatted failure messages
|
169
|
-
#
|
170
|
-
def print_results
|
171
|
-
if !@failures.empty?
|
172
|
-
@failures.each do |test|
|
173
|
-
pout "\nFailed: #{test[:desc]}"
|
174
|
-
puts test[:result]
|
175
|
-
# print a newline for easier reading
|
176
|
-
puts ""
|
177
|
-
end
|
178
|
-
abort
|
179
|
-
else
|
180
|
-
puts "All passed!".green
|
181
|
-
end
|
182
|
-
end
|