xml-smart 0.3.7 → 0.3.7.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -141,6 +141,7 @@ module XML
141
141
  io.flock(File::LOCK_EX)
142
142
  end
143
143
  dom = Dom.new Nokogiri::XML::parse(io){|config| config.noblanks.noent.nsclean.strict }
144
+ io.rewind
144
145
  end
145
146
  block.call(dom)
146
147
  dom.save_as(io)
@@ -148,7 +149,12 @@ module XML
148
149
  puts e.message
149
150
  raise Error, "could not open #{name}"
150
151
  ensure
151
- io.flock(File::LOCK_UN) if io
152
+ if io
153
+ io.flush
154
+ io.truncate(io.pos)
155
+ io.flock(File::LOCK_UN)
156
+ io.close if name.is_a?(String)
157
+ end
152
158
  end
153
159
  nil
154
160
  end
@@ -192,7 +192,7 @@ module XML
192
192
  end
193
193
  def parent?; !@element.parent.nil?; end
194
194
 
195
- def empty?; @element.blank?; end
195
+ def empty?; children?; end
196
196
  def mixed?;
197
197
  @element.xpath_fast('*').length > 0 && @element.xpath_fast("string(text())") != '';
198
198
  end
@@ -1,4 +1,3 @@
1
1
  <elements>
2
- <element>Thread 1</element>
3
2
  <element>Thread 2</element>
4
3
  </elements>
@@ -1,6 +1,6 @@
1
1
  <test xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xml:lang="de">
2
2
  <names>
3
- <name team="0" a="3">2013-07-31 19:41:52 +0200</name>
3
+ <name team="0" a="3">2013-08-30 00:29:20 +0200</name>
4
4
  <name team="1">Jürgen</name>
5
5
  <name team="1">Michel</name>
6
6
  <name team="1">Raphi</name>
@@ -1,7 +1 @@
1
- <solutions>
2
- <solution matnr="9906264" name="mangler" secid="1" when="2013-07-31T19:41:48+02:00" assessment="16">
3
- <question block="1" question="2"/>
4
- <question block="2" question="4"/>
5
- <question block="3" question="6"/>
6
- </solution>
7
- </solutions>
1
+ <solutions><solution matnr="9906264" name="mangler" secid="1" assessment="16"><question block="1" question="2"/><question block="2" question="4"/><question block="3" question="6"/></solution></solutions>
@@ -4,7 +4,7 @@ require File.expand_path(::File.dirname(__FILE__) + '/smartrunner.rb')
4
4
  class TestConcurrent < MiniTest::Unit::TestCase
5
5
  def test_unformated
6
6
  # Watch the power
7
- nums = 100
7
+ nums = 1000
8
8
 
9
9
  id = 16
10
10
  e_matnr = "9906264"
@@ -39,7 +39,7 @@ class TestConcurrent < MiniTest::Unit::TestCase
39
39
 
40
40
  def test_formated
41
41
  # Watch the power
42
- nums = 100
42
+ nums = 1000
43
43
 
44
44
  id = 16
45
45
  e_matnr = "9906264"
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = "xml-smart"
3
- s.version = "0.3.7"
3
+ s.version = "0.3.7.1"
4
4
  s.platform = Gem::Platform::RUBY
5
5
  s.license = "LGPL-3"
6
6
  s.summary = "An xml library that doesn't suck - since 2004."
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: xml-smart
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.7
4
+ version: 0.3.7.1
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-07-31 00:00:00.000000000 Z
12
+ date: 2013-08-29 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: nokogiri