ratom 0.6.0 → 0.6.1
Sign up to get free protection for your applications and to get access to all the features.
- data/History.txt +8 -1
- data/README.txt +1 -1
- data/lib/atom.rb +3 -4
- data/lib/atom/pub.rb +6 -2
- data/lib/atom/version.rb +1 -1
- data/lib/atom/xml/parser.rb +1 -1
- data/spec/spec.opts +0 -1
- metadata +2 -2
data/History.txt
CHANGED
@@ -1,4 +1,11 @@
|
|
1
|
-
== 0.6.
|
1
|
+
== 0.6.1 2009-03-27
|
2
|
+
|
3
|
+
Some minor exception fixes.
|
4
|
+
|
5
|
+
* Removed Atom::ParseError. Parse errors now will only throw ArgumentError.
|
6
|
+
* ProtocolError has a to string method.
|
7
|
+
|
8
|
+
== 0.6.0 2009-03-19
|
2
9
|
|
3
10
|
* Now depends on libxml-ruby 1.1.2.
|
4
11
|
* Added support for hreflang on links. (David Arango)
|
data/README.txt
CHANGED
@@ -14,7 +14,7 @@ and can be used to access Atom feeds or to script publishing entries to a blog s
|
|
14
14
|
|
15
15
|
== Prerequisites
|
16
16
|
|
17
|
-
* libxml-ruby,
|
17
|
+
* libxml-ruby, >= 1.1.2
|
18
18
|
* rspec (Only required for tests)
|
19
19
|
|
20
20
|
libxml-ruby in turn requires the libxml2 library to be installed. libxml2 can be downloaded
|
data/lib/atom.rb
CHANGED
@@ -17,8 +17,7 @@ module Atom # :nodoc:
|
|
17
17
|
module Pub
|
18
18
|
NAMESPACE = 'http://www.w3.org/2007/app'
|
19
19
|
end
|
20
|
-
|
21
|
-
class ParseError < StandardError; end
|
20
|
+
|
22
21
|
# Raised when a Serialization Error occurs.
|
23
22
|
class SerializationError < StandardError; end
|
24
23
|
|
@@ -554,7 +553,7 @@ module Atom # :nodoc:
|
|
554
553
|
o.read
|
555
554
|
parse(o)
|
556
555
|
else
|
557
|
-
raise
|
556
|
+
raise ArgumentError, "Entry created with node other than atom:entry: #{o.name}"
|
558
557
|
end
|
559
558
|
when Hash
|
560
559
|
o.each do |k,v|
|
@@ -725,7 +724,7 @@ module Atom # :nodoc:
|
|
725
724
|
def fetch(options = {})
|
726
725
|
begin
|
727
726
|
Atom::Feed.load_feed(URI.parse(self.href), options)
|
728
|
-
rescue ArgumentError
|
727
|
+
rescue ArgumentError
|
729
728
|
Net::HTTP.get_response(URI.parse(self.href)).body
|
730
729
|
end
|
731
730
|
end
|
data/lib/atom/pub.rb
CHANGED
@@ -21,6 +21,10 @@ module Atom
|
|
21
21
|
def initialize(response)
|
22
22
|
@response = response
|
23
23
|
end
|
24
|
+
|
25
|
+
def to_s
|
26
|
+
"Invalid response: #{@response}"
|
27
|
+
end
|
24
28
|
end
|
25
29
|
|
26
30
|
class Service
|
@@ -29,7 +33,7 @@ module Atom
|
|
29
33
|
elements :workspaces
|
30
34
|
loadable! do |reader, message, severity, base, line|
|
31
35
|
if severity == XML::Reader::SEVERITY_ERROR
|
32
|
-
raise
|
36
|
+
raise ArgumentError, "#{message} at #{line}"
|
33
37
|
end
|
34
38
|
end
|
35
39
|
|
@@ -141,7 +145,7 @@ module Atom
|
|
141
145
|
when Net::HTTPCreated
|
142
146
|
published = begin
|
143
147
|
Atom::Entry.load_entry(response.body)
|
144
|
-
rescue
|
148
|
+
rescue ArgumentError
|
145
149
|
entry
|
146
150
|
end
|
147
151
|
|
data/lib/atom/version.rb
CHANGED
data/lib/atom/xml/parser.rb
CHANGED
@@ -298,7 +298,7 @@ module Atom
|
|
298
298
|
else
|
299
299
|
XML::Error.set_handler do |reader, message, severity, base, line|
|
300
300
|
if severity == XML::Reader::SEVERITY_ERROR
|
301
|
-
raise
|
301
|
+
raise ArgumentError, "#{message} at #{line} in #{o}"
|
302
302
|
end
|
303
303
|
end
|
304
304
|
end
|
data/spec/spec.opts
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ratom
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.6.
|
4
|
+
version: 0.6.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Peerworks
|
@@ -10,7 +10,7 @@ autorequire:
|
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
12
|
|
13
|
-
date: 2009-03-
|
13
|
+
date: 2009-03-27 00:00:00 +10:30
|
14
14
|
default_executable:
|
15
15
|
dependencies:
|
16
16
|
- !ruby/object:Gem::Dependency
|