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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 89705604d51c635f63af6e51d88d5a00c6fb8783
4
- data.tar.gz: dc573368e8082a64b9d08ad40f0c77a3ab8570c5
3
+ metadata.gz: 2d99102c7282e8b497bb3ee93e22ba80fc93a571
4
+ data.tar.gz: a125def0764764fbc248d39aa8c9f47f60246422
5
5
  SHA512:
6
- metadata.gz: 90eeffbf7ed4edf565b69e314b1c9b7eaa51729175578a99670432f305e4ef490404cd9d9484f65083cd0f6cc9c07ff0a3a51710b65fca2ace576eda204ced7f
7
- data.tar.gz: bf08cc6f45b266358f4d4c4dd432659715e8f3c07ae353377abd8ae8782f0dc0c8854704be856ccab01df698b7ddd4460b3969ad0dbb9bd42dd25a32682ab6c6
6
+ metadata.gz: 254ac9f801bf59d256bf430866d952e97788c3846bbb64b2bdc299c2989e4ce0690c739e04ae638460e672f749b6f2be5ee94d4295f4ad5a1b72ea1529e0c57c
7
+ data.tar.gz: 2bf7abd9c10a769925d7c9fde83ace10eeb58ca0ed9dc0a8f23fcdb0b144d14464f43f91d700daad7dfda2c2565855a8e67bf46ba7c77cee2bfd4be27c95b75a
@@ -12,11 +12,13 @@ module BlogGenerator
12
12
  posts.push(Post.new(site, path))
13
13
  end
14
14
 
15
- posts = posts.sort do |a, b|
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, posts))
21
+ self.new(site, PostList.new(site, published_posts))
20
22
  end
21
23
 
22
24
  attr_reader :site, :posts
@@ -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.6
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-19 00:00:00.000000000 Z
11
+ date: 2017-01-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: nokogiri