xml-smart 0.3.4.1 → 0.3.5

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 6a429d9590203bf2b2101f76dfedc2136fb19cce
4
- data.tar.gz: 75b56a9c1571ff7625f753dc4b1dbf3b514859ef
3
+ metadata.gz: b1d00ead7e2b7ad516c905a75f50b0f24b4ac15c
4
+ data.tar.gz: c45a0c3874450913a3803ccad2d81a785e75367b
5
5
  SHA512:
6
- metadata.gz: 27e44349cc65c797a43eb1998391370c7bce4864f6c91d6c0fdd9e7871d1dbfa87b23ca5d4bc85f4e7a53b139925e9cfe75b969ba5f5e2a7526dbbcdccad9310
7
- data.tar.gz: f4798f9c938caa4784066d33cfdfbc8a6624c63a4bc767d71ab0ed3bea5361ca367e2307ba249b672227cb051649cf12ccdbdd79aa751efb8f3fee160a5b260e
6
+ metadata.gz: 9d07f89468068d75cb1ea49507c4bbd2f5012b9d78dd5df8454a756b80f10e3316474a02fefe3f72c55ce4d2b6d7d9f40e9cb54d7d8e45712dd7b877b9bbaed0
7
+ data.tar.gz: 97d48e6326585cc1258f6f023569c368d6d117c2e8a4a892f704112101c5c3256053818f4c7e04a18cc9017241d69d27e48b6bb26f04e6720f3a779e66152b85
data/lib/xml/smart.rb CHANGED
@@ -109,16 +109,15 @@ module Nokogiri
109
109
  end
110
110
 
111
111
  module XML
112
- VERSION = '0.3.4.1'
113
- LIBXML_VERSION = Nokogiri::VERSION_INFO['libxml']['loaded']
114
- LOCKFILE = {
115
- :min_sleep => 0.25,
116
- :max_sleep => 5,
117
- :sleep_inc => 0.25,
118
- :max_age => 5
119
- }
120
-
121
112
  module Smart
113
+ VERSION = File.read(File.expand_path(File.dirname(__FILE__) + '/../../xml-smart.gemspec')).match(/\.version\s*=[^\n]+?([\d\.]+)[^\n]+\n/)[1]
114
+ LIBXML_VERSION = Nokogiri::VERSION_INFO['libxml']['loaded']
115
+ LOCKFILE = {
116
+ :min_sleep => 0.25,
117
+ :max_sleep => 5,
118
+ :sleep_inc => 0.25,
119
+ :max_age => 5
120
+ }
122
121
  COPY = 0
123
122
  MOVE = 1
124
123
 
data/lib/xml/smart_dom.rb CHANGED
@@ -64,8 +64,8 @@ module XML
64
64
  def save_unformated=(val); @save_unformated = (val.is_a?(TrueClass) ? true : false); end
65
65
  def save_unformated?; @save_unformated; end
66
66
 
67
- def xinclude!
68
- Element.new(@dom.root).xinclude!
67
+ def xinclude!(basedir=nil)
68
+ Element.new(@dom.root).xinclude!(basedir)
69
69
  end
70
70
 
71
71
  def self::smart_helper(node)
@@ -152,8 +152,12 @@ module XML
152
152
  end
153
153
  def namespaces; NamespaceSet.new(self,@element); end
154
154
 
155
- def xinclude!
156
- @element.do_xinclude
155
+ def xinclude!(basedir=nil)
156
+ if basedir.is_a?(String) && File.directory?(basedir)
157
+ Dir.chdir(basedir) { @element.do_xinclude Nokogiri::XML::ParseOptions::STRICT }
158
+ else
159
+ @element.do_xinclude Nokogiri::XML::ParseOptions::STRICT
160
+ end
157
161
  @element.document.custom_namespace_prefixes_update
158
162
  @element.document.ns_update
159
163
  true
data/test/EXAMPLE.xml CHANGED
@@ -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-05-23 20:00:53 +0200</name>
3
+ <name team="0" a="3">2013-05-31 17:12:29 +0200</name>
4
4
  <name team="1">Jürgen</name>
5
5
  <name team="1">Michel</name>
6
6
  <name team="1">Raphi</name>
data/test/concurrent.xml CHANGED
@@ -1,7 +1 @@
1
- <solutions>
2
- <solution matnr="9906264" name="mangler" secid="1" when="2013-05-23T20:00:41+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>
@@ -0,0 +1,9 @@
1
+ require File.expand_path(::File.dirname(__FILE__) + '/../lib/xml/smart')
2
+ require File.expand_path(::File.dirname(__FILE__) + '/smartrunner.rb')
3
+
4
+ class TestXSL < MiniTest::Unit::TestCase
5
+ def test_xsl
6
+ assert XML::Smart::VERSION.is_a? String
7
+ assert XML::Smart::VERSION =~ /\d+\.\d+\.\d+(\.\d+)?/
8
+ end
9
+ end
data/xml-smart.gemspec CHANGED
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = "xml-smart"
3
- s.version = "0.3.4.1"
3
+ s.version = "0.3.5"
4
4
  s.platform = Gem::Platform::RUBY
5
5
  s.license = "LGPL-2"
6
6
  s.summary = "An xml library that doesn't suck - since 2004."
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: xml-smart
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.4.1
4
+ version: 0.3.5
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: 2013-05-23 00:00:00.000000000 Z
11
+ date: 2013-05-31 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: nokogiri
@@ -121,6 +121,7 @@ files:
121
121
  - test/tc_relaxng.rb
122
122
  - test/tc_xinclude.rb
123
123
  - test/tc_xpath.rb
124
+ - test/tc_version.rb
124
125
  - test/HELLO.xml
125
126
  - test/EXAMPLE.tmp.xml
126
127
  - test/2.xml
@@ -192,6 +193,7 @@ test_files:
192
193
  - test/tc_relaxng.rb
193
194
  - test/tc_xinclude.rb
194
195
  - test/tc_xpath.rb
196
+ - test/tc_version.rb
195
197
  - test/HELLO.xml
196
198
  - test/EXAMPLE.tmp.xml
197
199
  - test/2.xml