xmlcodec 0.0.1 → 0.0.2

Sign up to get free protection for your applications and to get access to all the features.
data/Rakefile CHANGED
@@ -1,5 +1,5 @@
1
1
  PKG_NAME = 'xmlcodec'
2
- PKG_VERSION = '0.0.1'
2
+ PKG_VERSION = '0.0.2'
3
3
 
4
4
  require 'rake'
5
5
  require 'rake/testtask'
@@ -52,7 +52,7 @@ Rake::RDocTask.new do |rd|
52
52
  rd.name = :docs
53
53
  rd.rdoc_files.include("README", "lib/**/*.rb")
54
54
  rd.rdoc_dir = 'doc'
55
- rd.title = PKG_NAME+' API"'
55
+ rd.title = "#{PKG_NAME} API"
56
56
  rd.options = ['-S', '-w 2', '-N']
57
57
  end
58
58
 
data/lib/XMLElement.rb CHANGED
@@ -457,10 +457,9 @@ module XMLCodec
457
457
  self.__parent.start_partial_export(file)
458
458
  end
459
459
 
460
- file << indentation+create_open_tag+"\n"
461
-
460
+ file << create_open_tag
462
461
  if self.hasvalue?
463
- file << indentation(1)+XMLUtils::escape_xml(self.value)+"\n"
462
+ file << XMLUtils::escape_xml(self.value)
464
463
  end
465
464
 
466
465
  each_subelement do |e|
@@ -478,8 +477,8 @@ module XMLCodec
478
477
  e.end_partial_export(file)
479
478
  end
480
479
 
481
- file << indentation+create_close_tag+"\n"
482
-
480
+ file << create_close_tag
481
+
483
482
  if self.__parent
484
483
  self.__parent.delete_element(self)
485
484
  end
@@ -30,8 +30,13 @@ module XMLCodec
30
30
  def end_partial_export(file)
31
31
  end
32
32
 
33
- def partial_export(file, except=nil)
34
- file << __parent.indentation(1)+self.xml_text+"\n"
33
+ def start_partial_export(file)
34
+ file << self.xml_text
35
+ end
36
+
37
+ def partial_export(file)
38
+ start_partial_export(file)
39
+ end_partial_export(file)
35
40
  end
36
41
  end
37
42
 
@@ -92,7 +97,7 @@ module XMLCodec
92
97
 
93
98
  # Iterate all the values in the collection
94
99
  def each
95
- @elements.each {|e| yield e}
100
+ @elements.dup.each {|e| yield e}
96
101
  end
97
102
 
98
103
  # Delete a certain element from the collection
metadata CHANGED
@@ -3,8 +3,8 @@ rubygems_version: 0.8.11
3
3
  specification_version: 1
4
4
  name: xmlcodec
5
5
  version: !ruby/object:Gem::Version
6
- version: 0.0.1
7
- date: 2006-05-12 00:00:00 +01:00
6
+ version: 0.0.2
7
+ date: 2006-05-18 00:00:00 +01:00
8
8
  summary: Generic Importer/Exporter of XML formats
9
9
  require_paths:
10
10
  - lib