xml-smart 0.3.11 → 0.3.12

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 8fffa4518ad68d20fdc2381150cf1f4fa46db4ee
4
- data.tar.gz: fcbb8255ce7608914eb9e7e099e53cecb4b436b5
3
+ metadata.gz: be39705fa3c69647ef581c26f96bc40df8073474
4
+ data.tar.gz: daf048cf47a87e78342788896a3844fb6f8f22b3
5
5
  SHA512:
6
- metadata.gz: b26670924bfb214004dd18279929e2775d84525441cab41833c47c1316fccf0e3d9e42f14cdd24c3948413bf38ddacdf0c7ed47d81d8b4f6dcc281ed272fb1a8
7
- data.tar.gz: f7ae7468bccd4692b79ffb3e7a71b020bd9ced789452346252094d902c858207782ddb9768f9841730e7f92623686c4b336607adedb20a0c23996564cff19bd4
6
+ metadata.gz: 2288bb3cd7925f304dc175890c0eccc3637fcd51feff4692e04774f731bc98eae2535d30056cfe83c51ab711b48c2cdd36ca6c2e2b03afc9346a459e0c484c64
7
+ data.tar.gz: 7d72f428e5393033c3c353625fcebb56d6fab8f14144e49d06e43eb12101f80f35c137f177002a5341fd322378b270271e43205b8b3b9984bfcb614752ae62ff
@@ -36,35 +36,26 @@ module Nokogiri
36
36
 
37
37
  def custom_namespace_prefixes_update
38
38
  result = {}
39
-
40
- diffs = []
41
- self.xpath('//namespace::*')
42
- ns = self.xpath('//namespace::*').to_a.delete_if do |n|
43
- if diffs.include? n.href
44
- true
45
- else
46
- diffs.push(n.href).uniq!
47
- false
48
- end
39
+ nsall = {}
40
+ nsde = {}
41
+
42
+ self.xpath('//namespace::*').each do |n|
43
+ unless n.prefix == 'xml'
44
+ nsde[n.href] = n.prefix if n.prefix.nil?
45
+ nsall[n.href] = n.prefix
46
+ end
49
47
  end
50
48
 
51
- de = ns.find_all{|n| n.prefix.nil?}
52
- if de.length == 1
53
- result['xmlns'] = de[0].href
54
- end
55
- if de.length > 1
56
- i = 0
57
- de.each do |n|
58
- unless result.has_value? n.href
59
- result["xmlns#{i}"] = n.href
60
- i += 1
61
- end
49
+ count = -1
50
+ nsall.each do |k,v|
51
+ if v.nil? && nsde.length == 1
52
+ result['xmlns'] = k
53
+ elsif v.nil? && nsde.length > 1
54
+ result["xmlns#{count+=1}"] = k
55
+ else
56
+ result[v] = k
62
57
  end
63
58
  end
64
-
65
- ns.find_all{|n| !n.prefix.nil? && !(n.prefix == 'xml')}.each do |n|
66
- result[n.prefix] = n.href
67
- end
68
59
  @custom_namespace_prefixes = result
69
60
  end
70
61
  def custom_namespace_prefixes
@@ -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">2014-09-05 02:20:31 +0200</name>
3
+ <name team="0" a="3">2015-03-13 11:04:34 +0100</name>
4
4
  <name team="1">Jürgen</name>
5
5
  <name team="1">Michel</name>
6
6
  <name team="1">Raphi</name>
@@ -13,11 +13,11 @@ class TestCreate < Minitest::Test
13
13
  t1 = Thread.new do
14
14
  XML::Smart.modify(::File.dirname(__FILE__) + "/EXAMPLE.tmp.xml","<elements/>") { |doc|
15
15
  node = doc.root.add("element","Thread 1")
16
+ sleep 1
16
17
  }
17
- sleep 1
18
18
  end
19
19
  t2 = Thread.new do
20
- Thread.pass
20
+ sleep 0.5
21
21
  XML::Smart.modify(::File.dirname(__FILE__) + "/EXAMPLE.tmp.xml","<elements/>") { |doc|
22
22
  node = doc.root.add("element","Thread 2")
23
23
  }
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = "xml-smart"
3
- s.version = "0.3.11"
3
+ s.version = "0.3.12"
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."
@@ -18,7 +18,7 @@ Gem::Specification.new do |s|
18
18
 
19
19
  s.required_ruby_version = '>=1.9.3'
20
20
 
21
- s.add_runtime_dependency 'nokogiri'
22
- s.add_runtime_dependency 'term-ansicolor'
23
- s.add_runtime_dependency 'minitest', '>= 5.0.0'
21
+ s.add_runtime_dependency 'nokogiri', '~> 1', '>= 1.6.6'
22
+ s.add_runtime_dependency 'term-ansicolor', '~> 1', '>= 1.3'
23
+ s.add_runtime_dependency 'minitest', '~> 5', '>= 5.0.0'
24
24
  end
metadata CHANGED
@@ -1,47 +1,62 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: xml-smart
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.11
4
+ version: 0.3.12
5
5
  platform: ruby
6
6
  authors:
7
7
  - Juergen eTM Mangler
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-09-05 00:00:00.000000000 Z
11
+ date: 2015-03-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: nokogiri
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: '1'
17
20
  - - ">="
18
21
  - !ruby/object:Gem::Version
19
- version: '0'
22
+ version: 1.6.6
20
23
  type: :runtime
21
24
  prerelease: false
22
25
  version_requirements: !ruby/object:Gem::Requirement
23
26
  requirements:
27
+ - - "~>"
28
+ - !ruby/object:Gem::Version
29
+ version: '1'
24
30
  - - ">="
25
31
  - !ruby/object:Gem::Version
26
- version: '0'
32
+ version: 1.6.6
27
33
  - !ruby/object:Gem::Dependency
28
34
  name: term-ansicolor
29
35
  requirement: !ruby/object:Gem::Requirement
30
36
  requirements:
37
+ - - "~>"
38
+ - !ruby/object:Gem::Version
39
+ version: '1'
31
40
  - - ">="
32
41
  - !ruby/object:Gem::Version
33
- version: '0'
42
+ version: '1.3'
34
43
  type: :runtime
35
44
  prerelease: false
36
45
  version_requirements: !ruby/object:Gem::Requirement
37
46
  requirements:
47
+ - - "~>"
48
+ - !ruby/object:Gem::Version
49
+ version: '1'
38
50
  - - ">="
39
51
  - !ruby/object:Gem::Version
40
- version: '0'
52
+ version: '1.3'
41
53
  - !ruby/object:Gem::Dependency
42
54
  name: minitest
43
55
  requirement: !ruby/object:Gem::Requirement
44
56
  requirements:
57
+ - - "~>"
58
+ - !ruby/object:Gem::Version
59
+ version: '5'
45
60
  - - ">="
46
61
  - !ruby/object:Gem::Version
47
62
  version: 5.0.0
@@ -49,6 +64,9 @@ dependencies:
49
64
  prerelease: false
50
65
  version_requirements: !ruby/object:Gem::Requirement
51
66
  requirements:
67
+ - - "~>"
68
+ - !ruby/object:Gem::Version
69
+ version: '5'
52
70
  - - ">="
53
71
  - !ruby/object:Gem::Version
54
72
  version: 5.0.0
@@ -60,71 +78,71 @@ extensions: []
60
78
  extra_rdoc_files:
61
79
  - README.rdoc
62
80
  files:
63
- - lib/xml/smart_domattributeset.rb
81
+ - AUTHORS
82
+ - COPYING
83
+ - README.rdoc
84
+ - Rakefile
85
+ - example/EXAMPLE.xml
86
+ - example/xpath_visual.rb
87
+ - lib/xml/XSDtoRNG.xsl
88
+ - lib/xml/smart.rb
89
+ - lib/xml/smart_dom.rb
64
90
  - lib/xml/smart_domattribute.rb
65
- - lib/xml/smart_domother.rb
91
+ - lib/xml/smart_domattributeset.rb
66
92
  - lib/xml/smart_domelement.rb
67
- - lib/xml/smart_domtext.rb
68
93
  - lib/xml/smart_domnamespace.rb
69
- - lib/xml/smart_domnodeset.rb
70
- - lib/xml/smart.rb
71
- - lib/xml/XSDtoRNG.xsl
72
- - lib/xml/smart_dom.rb
73
94
  - lib/xml/smart_domnamespaceset.rb
74
- - lib/xml/smart_qname.rb
95
+ - lib/xml/smart_domnodeset.rb
96
+ - lib/xml/smart_domother.rb
97
+ - lib/xml/smart_domtext.rb
75
98
  - lib/xml/smart_processinginstruction.rb
76
- - example/EXAMPLE.xml
77
- - example/xpath_visual.rb
78
- - COPYING
79
- - Rakefile
80
- - xml-smart.gemspec
81
- - README.rdoc
82
- - AUTHORS
83
- - test/tc_xpath_attrs.rb
84
- - test/tc_pi.rb
99
+ - lib/xml/smart_qname.rb
100
+ - minitest/performancereporter_plugin.rb
101
+ - test/1.xml
102
+ - test/2.xml
103
+ - test/3.xml
104
+ - test/EXAMPLE-NS.xml
105
+ - test/EXAMPLE-NSE.xml
106
+ - test/EXAMPLE.str.xml
107
+ - test/EXAMPLE.tmp.xml
108
+ - test/EXAMPLE.xml
109
+ - test/HELLO-MORE.xml
110
+ - test/HELLO.rng
111
+ - test/HELLO.xml
112
+ - test/HELLO.xsd
113
+ - test/XSL_BASE.xml
114
+ - test/XSL_DOCUMENT.xml
115
+ - test/concurrent.xml
116
+ - test/smartrunner.rb
85
117
  - test/tc_add.rb
86
- - test/tc_relaxng.rb
87
- - test/tc_delete.rb
118
+ - test/tc_basic.rb
119
+ - test/tc_concurrent.rb
88
120
  - test/tc_copy.rb
89
- - test/tc_string.rb
90
- - test/tc_sort.rb
91
121
  - test/tc_create.rb
92
- - test/tc_namespace_find.rb
93
- - test/tc_xsl.rb
94
- - test/tc_nested.rb
95
- - test/tc_todoc.rb
122
+ - test/tc_delete.rb
96
123
  - test/tc_move_elements.rb
97
124
  - test/tc_namespace_default.rb
125
+ - test/tc_namespace_detailed.rb
126
+ - test/tc_namespace_find.rb
127
+ - test/tc_nested.rb
128
+ - test/tc_pi.rb
129
+ - test/tc_qname.rb
130
+ - test/tc_relaxng.rb
98
131
  - test/tc_root.rb
99
- - test/tc_xpath_functions.rb
100
132
  - test/tc_set_or_replace.rb
101
- - test/tc_concurrent.rb
102
- - test/tc_xmlschema.rb
103
- - test/tc_qname.rb
133
+ - test/tc_sort.rb
134
+ - test/tc_string.rb
135
+ - test/tc_todoc.rb
136
+ - test/tc_version.rb
104
137
  - test/tc_write.rb
105
138
  - test/tc_xinclude.rb
106
- - test/tc_basic.rb
139
+ - test/tc_xmlschema.rb
107
140
  - test/tc_xpath.rb
108
- - test/tc_version.rb
141
+ - test/tc_xpath_attrs.rb
142
+ - test/tc_xpath_functions.rb
109
143
  - test/tc_xpath_root.rb
110
- - test/tc_namespace_detailed.rb
111
- - test/XSL_BASE.xml
112
- - test/EXAMPLE.tmp.xml
113
- - test/1.xml
114
- - test/2.xml
115
- - test/EXAMPLE-NSE.xml
116
- - test/XSL_DOCUMENT.xml
117
- - test/3.xml
118
- - test/EXAMPLE.str.xml
119
- - test/HELLO-MORE.xml
120
- - test/EXAMPLE.xml
121
- - test/concurrent.xml
122
- - test/EXAMPLE-NS.xml
123
- - test/HELLO.xml
124
- - test/HELLO.rng
125
- - test/HELLO.xsd
126
- - test/smartrunner.rb
127
- - minitest/performancereporter_plugin.rb
144
+ - test/tc_xsl.rb
145
+ - xml-smart.gemspec
128
146
  homepage: http://www.wst.univie.ac.at/~mangler/xml-smart/
129
147
  licenses:
130
148
  - LGPL-3
@@ -145,7 +163,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
145
163
  version: '0'
146
164
  requirements: []
147
165
  rubyforge_project:
148
- rubygems_version: 2.0.14
166
+ rubygems_version: 2.4.5
149
167
  signing_key:
150
168
  specification_version: 4
151
169
  summary: An xml library that doesn't suck - since 2004.