planet 0.5.0 → 0.5.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 3b41f2c2e719bea8b0245cd84911d31287a40df4
4
- data.tar.gz: af039754a9c06fcbbfabf412253ac85351c2239d
3
+ metadata.gz: c3f10043797a9bca9f1ba85f58c9e78e2f6072ba
4
+ data.tar.gz: 26ed44e3f4fb01059819d29a866ce16bcba02241
5
5
  SHA512:
6
- metadata.gz: 47e0a708f32784cf166372fbd7e73558bdb0b3f29de3c5740700afdddf387491d19d411ac1e1c02bd78300cf603160b3bee2ec4ff8e13c905c76104efc304c09
7
- data.tar.gz: 3f52250663f7a55612edf7d7c77c9b9b0573a8168bad9a2f8d1f274f3a00ca03eaf718d44e2d10f79895ec98ba49bc07c679d76b696514cfb8763a46ccc43c02
6
+ metadata.gz: f7086f6942ac55ff20da540e2cb732fa9e3cbab1588f759ceea56294012bf8c181b73c2027659dbe9322ecf1cd05e038d432a24cac3bbb1e1913e22a82196db0
7
+ data.tar.gz: d36c5070f39fe5a634eaf8276ef0e74499e7feaf68eecf9db4584ed656c521fe009c65474facaeb700b61d2f31e10b6d056515cfedb43f206df25f3cb266c757
data/bin/planet CHANGED
@@ -8,23 +8,31 @@ require 'box'
8
8
 
9
9
  include GLI::App
10
10
 
11
-
12
11
  program_desc 'Planet.rb is an awesome feed-aggregator gem that consumes RSS/Atom feeds and outputs them in a format suitable to use with Octopress or Jekyll'
13
12
 
14
13
  desc 'Parses planet.yml file for blogs and generates their posts in Jekyll compliant format under the _posts directory'
15
14
  command :generate do |c|
16
15
 
16
+ c.flag [:e,:extension], :desc => "Set post extension (markdown or html) ", :default_value => 'markdown', :long_desc => %Q{
17
+ Set the post's extension to the flag value.
18
+ The default is markdown, but many feeds deliver content
19
+ in html, and sometimes it is better to use that directly,
20
+ due to spacing issues possible with markdown.
21
+ }
17
22
  c.action do |global_options,options,args|
18
23
 
19
24
  Planet::Importer.import('planet.yml') do |planet|
20
25
 
26
+ post_extension = options[:extension] || 'markdown'
27
+ post_extension = '.' + post_extension unless post_extension[0] == '.'
28
+
21
29
  posts_dir = planet.config.fetch('posts_directory', 'source/_posts/')
22
30
  FileUtils.mkdir_p(posts_dir)
23
31
  puts "=> Writing #{ planet.posts.size } posts to the #{ posts_dir } directory."
24
32
 
25
33
  planet.posts.each do |post|
26
34
  file_name = posts_dir + post.file_name
27
- File.open(file_name + '.markdown', "w+") { |f| f.write(post.to_s) }
35
+ File.open(file_name + post_extension, "w+") { |f| f.write(post.to_s) }
28
36
  end
29
37
 
30
38
  end
@@ -53,7 +53,7 @@ class Planet
53
53
  title: entry.title.nil? ? self.name : entry.title,
54
54
  content: content,
55
55
  date: entry.published,
56
- url: self.url + entry.url,
56
+ url: entry.url,
57
57
  blog: self
58
58
  )
59
59
 
@@ -2,7 +2,7 @@ class Planet
2
2
  module Version
3
3
  MAJOR = 0
4
4
  MINOR = 5
5
- PATCH = 0
5
+ PATCH = 1
6
6
 
7
7
  def self.to_s
8
8
  [MAJOR, MINOR, PATCH].join('.')
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: planet
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.0
4
+ version: 0.5.1
5
5
  platform: ruby
6
6
  authors:
7
- - Pablo Astigarraga
7
+ - PoTe
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-09-16 00:00:00.000000000 Z
11
+ date: 2013-10-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: gli
@@ -101,7 +101,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
101
101
  version: '0'
102
102
  requirements: []
103
103
  rubyforge_project:
104
- rubygems_version: 2.0.0
104
+ rubygems_version: 2.0.3
105
105
  signing_key:
106
106
  specification_version: 4
107
107
  summary: An rss/atom feed aggregator designed to work with Octopress/Jekyll