forked from id774/automaticruby
-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathrand.rb
More file actions
28 lines (25 loc) · 725 Bytes
/
rand.rb
File metadata and controls
28 lines (25 loc) · 725 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
# -*- coding: utf-8 -*-
# Name:: Automatic::Plugin::Filter::Rand
# Author:: soramugi <http://soramugi.net>
# 774 <http://id774.net>
# Created:: Mar 6, 2013
# Updated:: Feb 21, 2014
# Copyright:: Copyright (c) 2012-2014 Automatic Ruby Developers.
# License:: Licensed under the GNU GENERAL PUBLIC LICENSE, Version 3.0.
module Automatic::Plugin
class FilterRand
def initialize(config, pipeline=[])
@config = config
@pipeline = pipeline
end
def run
@return_feeds = []
@pipeline.each {|feed|
unless feed.nil?
@return_feeds << Automatic::FeedMaker.create_pipeline(feed.items.shuffle)
end
}
@return_feeds
end
end
end