Skip to content

Commit

Permalink
Allow to specify the entries directly as an Array instead of reading …
Browse files Browse the repository at this point in the history
…them from site
  • Loading branch information
goldmann authored and bobmcwhirter committed May 3, 2012
1 parent 5ec4507 commit 664fa7f
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lib/awestruct/extensions/atomizer.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 664fa7f

Please sign in to comment.