summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAntonio Terceiro <terceiro@softwarelivre.org>2013-08-27 22:28:58 -0300
committerAntonio Terceiro <terceiro@softwarelivre.org>2013-08-27 22:28:58 -0300
commita1b2e9080f53a3db984f4297d8f19892d6582d37 (patch)
tree6ddb8734a76af313c39bb606077ff628a94fc5b4
parent64455d1615ee34e03166b106f1ac33b3179fef75 (diff)
downloadfeed2imap-a1b2e9080f53a3db984f4297d8f19892d6582d37.tar.gz
feed2imap-a1b2e9080f53a3db984f4297d8f19892d6582d37.tar.bz2
feed2imap-a1b2e9080f53a3db984f4297d8f19892d6582d37.zip
Pass feed URL to ruby-feedparser
This will make ruby-feedparser automatically calculate the full URL of feed items whose link is present in the feed with only a path and not hostname. ruby-feedparser will add the hostname where the feed came from.
-rw-r--r--Rakefile4
-rw-r--r--lib/feed2imap/feed2imap.rb2
2 files changed, 3 insertions, 3 deletions
diff --git a/Rakefile b/Rakefile
index 95fd2f8..ead0b27 100644
--- a/Rakefile
+++ b/Rakefile
@@ -7,7 +7,7 @@ require 'find'
task :default => [:test]
PKG_NAME = 'feed2imap'
-PKG_VERSION = '1.1'
+PKG_VERSION = '1.2'
PKG_FILES = [ 'ChangeLog', 'README', 'COPYING', 'setup.rb', 'Rakefile']
Find.find('bin/', 'lib/', 'test/', 'data/') do |f|
if FileTest.directory?(f) and f =~ /\.svn/
@@ -48,7 +48,7 @@ begin
s.summary = "RSS/Atom feed aggregator"
s.name = PKG_NAME
s.version = PKG_VERSION
- s.requirements << 'feedparser'
+ s.add_runtime_dependency 'ruby-feedparser', '0.9'
s.require_path = 'lib'
s.executables = PKG_FILES.grep(%r{\Abin\/.}).map { |bin|
bin.gsub(%r{\Abin/}, '')
diff --git a/lib/feed2imap/feed2imap.rb b/lib/feed2imap/feed2imap.rb
index f1bc9cd..7ec355c 100644
--- a/lib/feed2imap/feed2imap.rb
+++ b/lib/feed2imap/feed2imap.rb
@@ -223,7 +223,7 @@ class Feed2Imap
next
end
begin
- feed = FeedParser::Feed::new(f.body.force_encoding('UTF-8'))
+ feed = FeedParser::Feed::new(f.body.force_encoding('UTF-8'), f.url)
rescue Exception
n = @cache.parse_failed(f.name)
m = "Error while parsing #{f.name}: #{$!} (failed #{n} times)"