ratom 0.6.4 → 0.6.5
Sign up to get free protection for your applications and to get access to all the features.
- data/History.txt +4 -0
- data/Rakefile +1 -0
- data/VERSION.yml +1 -1
- data/lib/atom.rb +26 -6
- data/lib/atom/configuration.rb +1 -1
- data/lib/atom/pub.rb +1 -1
- data/lib/atom/version.rb +7 -0
- data/lib/atom/xml/parser.rb +1 -1
- data/spec/atom/pub_spec.rb +1 -1
- data/spec/atom_spec.rb +1 -1
- data/spec/spec_helper.rb +1 -1
- metadata +4 -3
data/History.txt
CHANGED
data/Rakefile
CHANGED
data/VERSION.yml
CHANGED
data/lib/atom.rb
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
# Copyright (c) 2008 The Kaphan Foundation
|
2
2
|
#
|
3
|
-
# For licensing information see LICENSE.
|
3
|
+
# For licensing information see LICENSE.
|
4
4
|
#
|
5
5
|
# Please visit http://www.peerworks.org/contact for further information.
|
6
6
|
#
|
@@ -85,7 +85,7 @@ module Atom # :nodoc:
|
|
85
85
|
#
|
86
86
|
# +xml+:: An XML::Reader object.
|
87
87
|
#
|
88
|
-
def initialize(o =
|
88
|
+
def initialize(o = {})
|
89
89
|
case o
|
90
90
|
when XML::Reader
|
91
91
|
@name = o.read_string.strip
|
@@ -94,6 +94,8 @@ module Atom # :nodoc:
|
|
94
94
|
o.each do |k, v|
|
95
95
|
self.send("#{k.to_s}=", v)
|
96
96
|
end
|
97
|
+
else
|
98
|
+
raise ArgumentError, "Got #{o.class} but expected a Hash or XML::Reader"
|
97
99
|
end
|
98
100
|
|
99
101
|
yield(self) if block_given?
|
@@ -116,7 +118,7 @@ module Atom # :nodoc:
|
|
116
118
|
include SimpleExtensions
|
117
119
|
attribute :label, :scheme, :term
|
118
120
|
|
119
|
-
def initialize(o =
|
121
|
+
def initialize(o = {})
|
120
122
|
case o
|
121
123
|
when XML::Reader
|
122
124
|
parse(o, :once => true)
|
@@ -124,6 +126,8 @@ module Atom # :nodoc:
|
|
124
126
|
o.each do |k, v|
|
125
127
|
self.send("#{k.to_s}=", v)
|
126
128
|
end
|
129
|
+
else
|
130
|
+
raise ArgumentError, "Got #{o.class} but expected a Hash or XML::Reader"
|
127
131
|
end
|
128
132
|
|
129
133
|
yield(self) if block_given?
|
@@ -152,7 +156,11 @@ module Atom # :nodoc:
|
|
152
156
|
o.each do |k, v|
|
153
157
|
self.send("#{k.to_s}=", v)
|
154
158
|
end
|
159
|
+
else
|
160
|
+
raise ArgumentError, "Got #{o.class} but expected a Hash or XML::Reader"
|
155
161
|
end
|
162
|
+
|
163
|
+
yield(self) if block_given?
|
156
164
|
end
|
157
165
|
|
158
166
|
def inspect
|
@@ -214,7 +222,9 @@ module Atom # :nodoc:
|
|
214
222
|
@type = "text"
|
215
223
|
when XML::Reader
|
216
224
|
super(o.read_string)
|
217
|
-
parse(o, :once => true)
|
225
|
+
parse(o, :once => true)
|
226
|
+
else
|
227
|
+
raise ArgumentError, "Got #{o} which isn't a String or XML::Reader"
|
218
228
|
end
|
219
229
|
end
|
220
230
|
|
@@ -240,6 +250,8 @@ module Atom # :nodoc:
|
|
240
250
|
when String
|
241
251
|
super(o)
|
242
252
|
@type = 'html'
|
253
|
+
else
|
254
|
+
raise ArgumentError, "Got #{o} which isn't a String or XML::Reader"
|
243
255
|
end
|
244
256
|
end
|
245
257
|
|
@@ -290,7 +302,9 @@ module Atom # :nodoc:
|
|
290
302
|
end
|
291
303
|
|
292
304
|
# get back to the end of the element we were created with
|
293
|
-
while xml.read == 1 && xml.depth > starting_depth; end
|
305
|
+
while xml.read == 1 && xml.depth > starting_depth; end
|
306
|
+
else
|
307
|
+
raise ArgumentError, "Got #{o} which isn't a String or XML::Reader"
|
294
308
|
end
|
295
309
|
end
|
296
310
|
|
@@ -326,7 +340,7 @@ module Atom # :nodoc:
|
|
326
340
|
elements :authors, :contributors, :class => Person
|
327
341
|
elements :links
|
328
342
|
|
329
|
-
def initialize(o =
|
343
|
+
def initialize(o = {})
|
330
344
|
@authors, @contributors, @links = [], [], Links.new
|
331
345
|
|
332
346
|
case o
|
@@ -341,6 +355,8 @@ module Atom # :nodoc:
|
|
341
355
|
o.each do |k, v|
|
342
356
|
self.send("#{k.to_s}=", v)
|
343
357
|
end
|
358
|
+
else
|
359
|
+
raise ArgumentError, "Got #{o.class} but expected a Hash or XML::Reader"
|
344
360
|
end
|
345
361
|
|
346
362
|
yield(self) if block_given?
|
@@ -431,6 +447,8 @@ module Atom # :nodoc:
|
|
431
447
|
o.each do |k, v|
|
432
448
|
self.send("#{k.to_s}=", v)
|
433
449
|
end
|
450
|
+
else
|
451
|
+
raise ArgumentError, "Got #{o.class} but expected a Hash or XML::Reader"
|
434
452
|
end
|
435
453
|
|
436
454
|
yield(self) if block_given?
|
@@ -574,6 +592,8 @@ module Atom # :nodoc:
|
|
574
592
|
o.each do |k,v|
|
575
593
|
send("#{k.to_s}=", v)
|
576
594
|
end
|
595
|
+
else
|
596
|
+
raise ArgumentError, "Got #{o.class} but expected a Hash or XML::Reader"
|
577
597
|
end
|
578
598
|
|
579
599
|
yield(self) if block_given?
|
data/lib/atom/configuration.rb
CHANGED
data/lib/atom/pub.rb
CHANGED
data/lib/atom/version.rb
ADDED
data/lib/atom/xml/parser.rb
CHANGED
data/spec/atom/pub_spec.rb
CHANGED
data/spec/atom_spec.rb
CHANGED
data/spec/spec_helper.rb
CHANGED
metadata
CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
|
|
5
5
|
segments:
|
6
6
|
- 0
|
7
7
|
- 6
|
8
|
-
-
|
9
|
-
version: 0.6.
|
8
|
+
- 5
|
9
|
+
version: 0.6.5
|
10
10
|
platform: ruby
|
11
11
|
authors:
|
12
12
|
- Peerworks
|
@@ -15,7 +15,7 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2010-04-
|
18
|
+
date: 2010-04-07 00:00:00 +09:30
|
19
19
|
default_executable:
|
20
20
|
dependencies:
|
21
21
|
- !ruby/object:Gem::Dependency
|
@@ -63,6 +63,7 @@ files:
|
|
63
63
|
- lib/atom.rb
|
64
64
|
- lib/atom/configuration.rb
|
65
65
|
- lib/atom/pub.rb
|
66
|
+
- lib/atom/version.rb
|
66
67
|
- lib/atom/xml/parser.rb
|
67
68
|
- spec/app/member_entry.atom
|
68
69
|
- spec/app/service.xml
|