ratom 0.6.0 → 0.6.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,4 +1,11 @@
1
- == 0.6.0 2009-19-03
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, = 0.5.2.0
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
@@ -17,8 +17,7 @@ module Atom # :nodoc:
17
17
  module Pub
18
18
  NAMESPACE = 'http://www.w3.org/2007/app'
19
19
  end
20
- # Raised when a Parsing Error occurs.
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 ParseError, "Entry created with node other than atom:entry: #{o.name}"
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, ParseError => ae
727
+ rescue ArgumentError
729
728
  Net::HTTP.get_response(URI.parse(self.href)).body
730
729
  end
731
730
  end
@@ -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 ParseError, "#{message} at #{line}"
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 Atom::ParseError
148
+ rescue ArgumentError
145
149
  entry
146
150
  end
147
151
 
@@ -8,7 +8,7 @@ module Atom #:nodoc:
8
8
  module VERSION #:nodoc:
9
9
  MAJOR = 0
10
10
  MINOR = 6
11
- TINY = 0
11
+ TINY = 1
12
12
 
13
13
  STRING = [MAJOR, MINOR, TINY].join('.')
14
14
  end
@@ -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 ParseError, "#{message} at #{line} in #{o}"
301
+ raise ArgumentError, "#{message} at #{line} in #{o}"
302
302
  end
303
303
  end
304
304
  end
@@ -1,2 +1 @@
1
1
  --colour
2
- --diff
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.0
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-19 00:00:00 +10:30
13
+ date: 2009-03-27 00:00:00 +10:30
14
14
  default_executable:
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency