planet 0.3.5 → 0.3.6

Sign up to get free protection for your applications and to get access to all the features.
data/bin/planet CHANGED
@@ -49,7 +49,7 @@ end
49
49
  desc 'Creates basic templates on the templates_directory specified in planet.yml'
50
50
  command :create_templates do |c|
51
51
  c.action do |global_options,options,args|
52
- conf = YAML.load File.open('planet.yml', 'r') { |f| f.read }
52
+ conf = YAML.load_file('planet.yml')
53
53
 
54
54
  templates_dir = conf.fetch('planet').fetch('templates_directory', 'source/_layouts/')
55
55
 
data/lib/planet.rb CHANGED
@@ -35,7 +35,7 @@ class Planet
35
35
 
36
36
  class Post
37
37
 
38
- attr_accessor :title, :content, :date, :url, :blog, :author
38
+ attr_accessor :title, :content, :date, :url, :blog
39
39
 
40
40
  def initialize(attributes = {})
41
41
  self.title = attributes[:title]
@@ -43,7 +43,6 @@ class Planet
43
43
  self.date = attributes[:date]
44
44
  self.url = attributes[:url]
45
45
  self.blog = attributes[:blog]
46
- self.author = attributes[:author]
47
46
  end
48
47
 
49
48
  def to_s
@@ -56,7 +55,7 @@ class Planet
56
55
  post_title: self.title,
57
56
  post_date: self.date,
58
57
  image_url: self.blog.image,
59
- author: self.author,
58
+ author: self.blog.author,
60
59
  blog_url: self.blog.url,
61
60
  blog_name: self.blog.name,
62
61
  post_url: self.url,
@@ -108,7 +107,7 @@ class Planet
108
107
  feed = Feedzirra::Feed.fetch_and_parse(self.feed)
109
108
 
110
109
  self.name ||= feed.title || 'the source'
111
- self.url ||= feed.url
110
+ self..url ||= feed.url
112
111
 
113
112
  if self.url.nil?
114
113
  abort "#{ self.author }'s blog does not have a url field on it's feed, you will need to specify it on planet.yml"
@@ -117,14 +116,13 @@ class Planet
117
116
  feed.entries.each do |entry|
118
117
  self.posts << @post = Post.new(
119
118
  title: entry.title.sanitize,
120
- author: entry.author ? entry.author : self.author,
121
119
  content: self.sanitize_images(entry.content.strip),
122
120
  date: entry.published,
123
121
  url: self.url + entry.url,
124
122
  blog: self
125
123
  )
126
124
 
127
- puts "=> Found post titled #{ @post.title } - by #{ @post.author }"
125
+ puts "=> Found post titled #{ @post.title } - by #{ @post.blog.author }"
128
126
  end
129
127
  end
130
128
 
@@ -2,7 +2,7 @@ module Planet
2
2
  module Version
3
3
  MAJOR = 0
4
4
  MINOR = 3
5
- PATCH = 5
5
+ PATCH = 6
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.3.5
4
+ version: 0.3.6
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors: