planet 0.4.0 → 0.4.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.
Files changed (3) hide show
  1. data/bin/planet +50 -40
  2. data/lib/planet/version.rb +1 -1
  3. metadata +20 -4
data/bin/planet CHANGED
@@ -4,45 +4,10 @@ $LOAD_PATH.unshift(File.dirname(__FILE__) + '/../lib')
4
4
  require 'gli'
5
5
  require 'planet'
6
6
  require 'fileutils'
7
+ require 'box'
7
8
 
8
9
  include GLI::App
9
10
 
10
- TEMPLATES = {
11
- author: '
12
- <div class="author">
13
- <img src="{{ image_url }}" style="width: 96px; height: 96;">
14
- <span style="position: absolute; padding: 32px 15px;">
15
- <i>Original post by <a href="{{ twitter_url }}">{{ author }}</a> - check out <a href="{{ blog_url }}">{{ blog_name }}</a></i>
16
- </span>
17
- </div>
18
- ',
19
- header: '---
20
- title: "{{ post_title }}"
21
- kind: article
22
- created_at: {{ post_date }}
23
- author: {{ author }}
24
- layout: post
25
- ---
26
- ',
27
- planet: '## Planet.rb default config file, modify it and spawn awesomeness!
28
-
29
- planet:
30
- posts_directory: source/_posts/
31
- templates_directory: source/_layouts/
32
-
33
- blogs:
34
- # Bare minimum to get it working
35
- - author: "Cubox"
36
- feed: "http://blog.cuboxlabs.com/atom.xml"
37
- image: "http://cuboxlabs.com/img/cubox-humans/could-be-you.png"
38
-
39
- - author: "Pablo Astigarraga"
40
- feed: "http://blog.poteland.com/atom.xml"
41
- image: "http://poteland.com/images/avatars/red_mage.png"
42
- # Other fields:
43
- twitter: "poteland"
44
- url: "http://blog.poteland.com" # => only required for people that don\'t have a \'url\' field on their RSS/Atom field'
45
- }
46
11
 
47
12
  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'
48
13
 
@@ -72,7 +37,7 @@ command :init do |c|
72
37
  c.action do |global_options,options,args|
73
38
  abort 'There is already a planet.yml file present' if File.exist? 'planet.yml'
74
39
 
75
- File.open('planet.yml', 'w') { |f| f.write(TEMPLATES[:planet]) }
40
+ File.open('planet.yml', 'w') { |f| f.write(Box::FILES['planet']) }
76
41
 
77
42
  puts '=> Created default planet.yml'
78
43
  end
@@ -88,14 +53,14 @@ command :create_templates do |c|
88
53
  FileUtils.mkdir_p(templates_dir)
89
54
 
90
55
  if !File.exists?(templates_dir + 'author.html')
91
- File.open(templates_dir + 'author.html', 'w') { |f| f.write(TEMPLATES[:author]) }
56
+ File.open(templates_dir + 'author.html', 'w') { |f| f.write(Box::FILES['author']) }
92
57
  puts "=> Created default #{ templates_dir }author.html"
93
58
  else
94
59
  puts "=> Template #{ templates_dir }author.html already exists, skipping"
95
60
  end
96
61
 
97
62
  if !File.exists?(templates_dir + 'header.md')
98
- File.open(templates_dir + 'header.md', 'w') { |f| f.write(TEMPLATES[:header]) }
63
+ File.open(templates_dir + 'header.md', 'w') { |f| f.write(Box::FILES['header']) }
99
64
  puts "=> Created default #{ templates_dir }header.md"
100
65
  else
101
66
  puts "=> Template #{ templates_dir }header.md already exists, skipping"
@@ -103,6 +68,13 @@ command :create_templates do |c|
103
68
  end
104
69
  end
105
70
 
71
+ desc 'Outputs planet.rb gem version'
72
+ command :version do |c|
73
+ c.action do |global_options,options,args|
74
+ puts "planet.rb version: #{ Planet::VERSION }"
75
+ end
76
+ end
77
+
106
78
  desc 'Delete existing templates and recreate them'
107
79
  command :update_templates do |c|
108
80
  c.action do |global_options,options,args|
@@ -136,7 +108,7 @@ pre do |global,command,options,args|
136
108
  puts "=> You are missing some files in your templates directory, planet.rb will create them for you - make sure to review them on #{ templates_dir }!"
137
109
  response = `#{$0} create_templates`
138
110
  puts response
139
- elsif TEMPLATES[name] != File.read(path)
111
+ elsif Box::FILES[name] != File.read(path)
140
112
  puts "!! WARNING: your planet.rb template files are different from the default, if you haven't made specific changes to them yourself then planet.rb default templates might have changed.Run 'planet update_templates' to override your current files with the newest default file available."
141
113
  end
142
114
  end
@@ -154,3 +126,41 @@ on_error do |exception|
154
126
  end
155
127
 
156
128
  exit run(ARGV)
129
+
130
+ __END__
131
+ @@ author
132
+ <div class="author">
133
+ <img src="{{ image_url }}" style="width: 96px; height: 96;">
134
+ <span style="position: absolute; padding: 32px 15px;">
135
+ <i>Original post by <a href="{{ twitter_url }}">{{ author }}</a> - check out <a href="{{ blog_url }}">{{ blog_name }}</a></i>
136
+ </span>
137
+ </div>
138
+
139
+ @@ header
140
+ ---
141
+ title: "{{ post_title }}"
142
+ kind: article
143
+ created_at: {{ post_date }}
144
+ author: {{ author }}
145
+ layout: post
146
+ ---
147
+
148
+ @@ planet
149
+ ## Planet.rb default config file, modify it and spawn awesomeness!
150
+
151
+ planet:
152
+ posts_directory: source/_posts/
153
+ templates_directory: source/_layouts/
154
+
155
+ blogs:
156
+ # Bare minimum to get it working
157
+ - author: "Cubox"
158
+ feed: "http://blog.cuboxlabs.com/atom.xml"
159
+ image: "http://cuboxlabs.com/img/cubox-humans/could-be-you.png"
160
+
161
+ - author: "Pablo Astigarraga"
162
+ feed: "http://blog.poteland.com/atom.xml"
163
+ image: "http://poteland.com/images/avatars/red_mage.png"
164
+ # Other fields:
165
+ twitter: "poteland"
166
+ url: "http://blog.poteland.com" # => only required for people that don\'t have a \'url\' field on their RSS/Atom field'
@@ -2,7 +2,7 @@ class Planet
2
2
  module Version
3
3
  MAJOR = 0
4
4
  MINOR = 4
5
- PATCH = 0
5
+ PATCH = 1
6
6
 
7
7
  def self.to_s
8
8
  [MAJOR, MINOR, PATCH].join('.')
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: planet
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.0
4
+ version: 0.4.1
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-12-14 00:00:00.000000000 Z
12
+ date: 2013-01-18 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: gli
@@ -59,6 +59,22 @@ dependencies:
59
59
  - - ! '>='
60
60
  - !ruby/object:Gem::Version
61
61
  version: '0'
62
+ - !ruby/object:Gem::Dependency
63
+ name: box
64
+ requirement: !ruby/object:Gem::Requirement
65
+ none: false
66
+ requirements:
67
+ - - ! '>='
68
+ - !ruby/object:Gem::Version
69
+ version: '0'
70
+ type: :runtime
71
+ prerelease: false
72
+ version_requirements: !ruby/object:Gem::Requirement
73
+ none: false
74
+ requirements:
75
+ - - ! '>='
76
+ - !ruby/object:Gem::Version
77
+ version: '0'
62
78
  description:
63
79
  email: pote@tardis.com.uy
64
80
  executables:
@@ -74,7 +90,7 @@ files:
74
90
  - lib/planet/post.rb
75
91
  - lib/planet/version.rb
76
92
  - lib/planet.rb
77
- homepage: http://poteland.com
93
+ homepage: http://github.com/pote/planet.rb
78
94
  licenses: []
79
95
  post_install_message:
80
96
  rdoc_options: []
@@ -98,5 +114,5 @@ rubyforge_project:
98
114
  rubygems_version: 1.8.24
99
115
  signing_key:
100
116
  specification_version: 3
101
- summary: An awesome rss/atom feed aggregator designed to work with Octopress/Jekyll
117
+ summary: An rss/atom feed aggregator designed to work with Octopress/Jekyll
102
118
  test_files: []