yarss 0.0.1 → 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/yarss/version.rb +1 -1
- data/lib/yarss.rb +3 -2
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: cb088fb3631b5463bb8927d313274cf60231cc77
|
4
|
+
data.tar.gz: 3d32d941a069626c5ca40095aa94141d336e2ca8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: cd09570af97b5d8abe25d824293b5a7d5bd08411b6e8e968d9fe72ea274ae4e08f42066a49f6507245f714a8321775bd7e503ed26522557b541c4a1ae58b676e
|
7
|
+
data.tar.gz: 7ed021d0ec037c09e6e19fbb023450f9d8b8e36ad0d23236e38fca69cc1876acb2db6ae0da88aa97a129e993168ffee464982f2fd04e7ad3a319f87cd64d29b5
|
data/lib/yarss/version.rb
CHANGED
data/lib/yarss.rb
CHANGED
@@ -113,14 +113,15 @@ module Yarss
|
|
113
113
|
# end
|
114
114
|
#
|
115
115
|
# @return [Feed]
|
116
|
-
def self.from_string(data, path_or_io)
|
116
|
+
def self.from_string(data, path_or_io = nil)
|
117
117
|
data = MultiXml.parse(data)
|
118
118
|
|
119
119
|
return Rss::FeedParser.new(data).parse if data['rss']
|
120
120
|
return Atom::FeedParser.new(data).parse if data['feed']
|
121
121
|
return Rdf::FeedParser.new(data).parse if data['rdf:RDF'] || data['RDF']
|
122
122
|
|
123
|
-
|
123
|
+
msg = "Cannot find parser for #{path_or_io}" if path_or_io
|
124
|
+
raise UnknownParserError, msg
|
124
125
|
rescue MultiXml::ParseError => e
|
125
126
|
raise ParseError, e
|
126
127
|
end
|