blog-generator 0.0.6 → 0.0.7
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/blog-generator.rb +4 -2
- data/lib/blog-generator/post.rb +1 -1
- data/lib/blog-generator/post_list.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2d99102c7282e8b497bb3ee93e22ba80fc93a571
|
4
|
+
data.tar.gz: a125def0764764fbc248d39aa8c9f47f60246422
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 254ac9f801bf59d256bf430866d952e97788c3846bbb64b2bdc299c2989e4ce0690c739e04ae638460e672f749b6f2be5ee94d4295f4ad5a1b72ea1529e0c57c
|
7
|
+
data.tar.gz: 2bf7abd9c10a769925d7c9fde83ace10eeb58ca0ed9dc0a8f23fcdb0b144d14464f43f91d700daad7dfda2c2565855a8e67bf46ba7c77cee2bfd4be27c95b75a
|
data/lib/blog-generator.rb
CHANGED
@@ -12,11 +12,13 @@ module BlogGenerator
|
|
12
12
|
posts.push(Post.new(site, path))
|
13
13
|
end
|
14
14
|
|
15
|
-
|
15
|
+
published_posts = posts.select { |post| ! post.metadata[:draft] }
|
16
|
+
|
17
|
+
published_posts.sort! do |a, b|
|
16
18
|
b.published_on <=> a.published_on
|
17
19
|
end
|
18
20
|
|
19
|
-
self.new(site, PostList.new(site,
|
21
|
+
self.new(site, PostList.new(site, published_posts))
|
20
22
|
end
|
21
23
|
|
22
24
|
attr_reader :site, :posts
|
data/lib/blog-generator/post.rb
CHANGED
@@ -29,7 +29,7 @@ module BlogGenerator
|
|
29
29
|
@metadata[:tags].map! do |tag|
|
30
30
|
slug = generate_slug(tag)
|
31
31
|
feed = "#{site.base_url}/#{slug}.atom"
|
32
|
-
{title: tag, slug: slug, feed: feed}
|
32
|
+
{title: tag, slug: slug, path: "/tags/#{slug}", feed: feed}
|
33
33
|
end
|
34
34
|
|
35
35
|
tag_feeds = @metadata[:tags].map do |tag|
|
@@ -10,7 +10,7 @@ module BlogGenerator
|
|
10
10
|
@site, @posts = site, posts
|
11
11
|
end
|
12
12
|
|
13
|
-
def_delegators :@posts, :reduce, :each, :sort, :first, :last, :[], :empty?, :any
|
13
|
+
def_delegators :@posts, :reduce, :each, :sort, :first, :last, :[], :empty?, :any?, :select # It might be about time to use some metaprogramming.
|
14
14
|
|
15
15
|
def as_json
|
16
16
|
self.posts.map do |post|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: blog-generator
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.7
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- James C Russell
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-01-
|
11
|
+
date: 2017-01-20 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: nokogiri
|