9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
|
# File 'lib/imap-feeder/imapfeederconfig.rb', line 9
def self.create(opml_file, root_folder)
root_folder = root_folder ? "INBOX.#{root_folder}" : "INBOX"
if opml_file
items = process(OpmlReader.get(File.open(opml_file)), "#{root_folder}").flatten
else
items = [
{"feed" => {"url" => "http://rubyforge.org/export/rss_sfnews.php", "path" => "#{root_folder}.rubyforge"}},
{"feed" => {"url" => "http://feeds.feedburner.com/DilbertDailyStrip", "path" => "#{root_folder}.dilbert"}}
]
end
File.open("#{Dir.pwd}/feeds.yml", "w+") do |file|
YAML.dump(items, file)
end
File.copy "#{File.dirname(__FILE__)}/../../settings.rb.example", "#{Dir.pwd}/settings.rb"
end
|