ratom 0.6.4 → 0.6.5

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,3 +1,7 @@
1
+ == 0.6.5
2
+
3
+ * Fixed missing version.rb, now loads version.yml. [Greg Campbell]
4
+
1
5
  == 0.6.4
2
6
 
3
7
  * Remove Hoe dependency and converted to a Jeweler based project build.
data/Rakefile CHANGED
@@ -18,6 +18,7 @@ begin
18
18
  Jeweler::GemcutterTasks.new
19
19
  Jeweler::RubyforgeTasks.new do |rf|
20
20
  rf.doc_task = 'rdoc'
21
+ rf.remote_doc_path = ''
21
22
  end
22
23
  rescue LoadError
23
24
  puts "Jeweler (or a dependency) not available. Install it with: gem install jeweler"
@@ -1,5 +1,5 @@
1
1
  ---
2
+ :patch: 5
2
3
  :major: 0
3
4
  :build:
4
5
  :minor: 6
5
- :patch: 4
@@ -1,6 +1,6 @@
1
1
  # Copyright (c) 2008 The Kaphan Foundation
2
2
  #
3
- # For licensing information see LICENSE.txt.
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 = nil)
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 = nil)
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 = nil)
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?
@@ -1,6 +1,6 @@
1
1
  # Copyright (c) 2008 The Kaphan Foundation
2
2
  #
3
- # For licensing information see LICENSE.txt.
3
+ # For licensing information see LICENSE.
4
4
  #
5
5
  # Please visit http://www.peerworks.org/contact for further information.
6
6
  #
@@ -1,6 +1,6 @@
1
1
  # Copyright (c) 2008 The Kaphan Foundation
2
2
  #
3
- # For licensing information see LICENSE.txt.
3
+ # For licensing information see LICENSE.
4
4
  #
5
5
  # Please visit http://www.peerworks.org/contact for further information.
6
6
  #
@@ -0,0 +1,7 @@
1
+ require 'yaml'
2
+ module Atom
3
+ module VERSION
4
+ INFO = YAML.load_file(File.join(File.dirname(__FILE__), "..", "..", "VERSION.yml"))
5
+ STRING = [:major, :minor, :patch, :build].map {|l| INFO[l]}.compact.join('.')
6
+ end
7
+ end
@@ -1,6 +1,6 @@
1
1
  # Copyright (c) 2008 The Kaphan Foundation
2
2
  #
3
- # For licensing information see LICENSE.txt.
3
+ # For licensing information see LICENSE.
4
4
  #
5
5
  # Please visit http://www.peerworks.org/contact for further information.
6
6
  #
@@ -1,6 +1,6 @@
1
1
  # Copyright (c) 2008 The Kaphan Foundation
2
2
  #
3
- # For licensing information see LICENSE.txt.
3
+ # For licensing information see LICENSE.
4
4
  #
5
5
  # Please visit http://www.peerworks.org/contact for further information.
6
6
  #
@@ -1,6 +1,6 @@
1
1
  # Copyright (c) 2008 The Kaphan Foundation
2
2
  #
3
- # For licensing information see LICENSE.txt.
3
+ # For licensing information see LICENSE.
4
4
  #
5
5
  # Please visit http://www.peerworks.org/contact for further information.
6
6
  #
@@ -1,6 +1,6 @@
1
1
  # Copyright (c) 2008 The Kaphan Foundation
2
2
  #
3
- # For licensing information see LICENSE.txt.
3
+ # For licensing information see LICENSE.
4
4
  #
5
5
  # Please visit http://www.peerworks.org/contact for further information.
6
6
  #
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 0
7
7
  - 6
8
- - 4
9
- version: 0.6.4
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-02 00:00:00 +10:30
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