Skip to content
Browse files

Allow to specify the entries directly as an Array instead of reading …

…them from site
  • Loading branch information...
1 parent 495870f commit ecdd7d97bc3f6e96641dd726e5cf72b76a29cf20 @goldmann committed Apr 18, 2012
Showing with 3 additions and 3 deletions.
  1. +3 −3 lib/awestruct/extensions/atomizer.rb
View
6 lib/awestruct/extensions/atomizer.rb
@@ -2,16 +2,16 @@ module Awestruct
module Extensions
class Atomizer
- def initialize(entries_name, output_path, opts={})
- @entries_name = entries_name
+ def initialize(entries, output_path, opts={})
+ @entries = entries
@output_path = output_path
@num_entries = opts[:num_entries] || 50
@content_url = opts[:content_url]
@feed_title = opts[:feed_title]
end
def execute(site)
- entries = site.send( @entries_name ) || []
+ entries = @entries.is_a?(Array) ? @entries : site.send( @entries ) || []
unless ( @num_entries == :all )
entries = entries[0, @num_entries]
end

0 comments on commit ecdd7d9

Please sign in to comment.
Something went wrong with that request. Please try again.