xml-smart 0.3.14 → 0.3.15

Sign up to get free protection for your applications and to get access to all the features.
Files changed (4) hide show
  1. checksums.yaml +4 -4
  2. data/lib/xml/smart.rb +7 -3
  3. data/xml-smart.gemspec +1 -1
  4. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 9fa0cb5980990dae96d416b9122d90882d1ef5ae
4
- data.tar.gz: 26a3c1597a503cee447ab4eccd226d564d34ade5
3
+ metadata.gz: 6f5bdaa76b04eb422f59648a1387a106751fbd78
4
+ data.tar.gz: c782e442fc1e57a81a6e516bf5d73ba29652c24f
5
5
  SHA512:
6
- metadata.gz: 1cfd22611b531f7121c314edfcfee7830da6cd69f5e654020b238aad6582e0b08252e0d2885450cec4ac349d3735278c20937d8e8ddea3227b680ad016f31349
7
- data.tar.gz: 0b52ff70a78c074914b6bda148d02b5ade3cfc19140b8eab1d319d1406f6ca3c95003b350bad97e3bb884ed0a30e717a9285001dc3a56c7667322c921b5862bc
6
+ metadata.gz: 76bdff5b7e342a74293bbd7c799907cd027abaf222b06e2eb70f800457ae6d956401655218bec49f680adf9c5e29014c8113a12bea3cae7f7767628aeb83b23f
7
+ data.tar.gz: f9f5c313c4d6afdae809cae090ac81ac392ad5f0397569024f9c543e2c6f097aeb5d570a7ee51c40030a0c34574cd9d35329032b5ee72af543224213a9410776
data/lib/xml/smart.rb CHANGED
@@ -97,7 +97,7 @@ module Nokogiri
97
97
  path = ((relative_to || self.document.basepath.to_s) + '/').sub(/\/+$/,'/')
98
98
  ctx = XPathContext.new(self)
99
99
  ctx.register_namespaces "xi"=>"http://www.w3.org/2001/XInclude"
100
- ctx.evaluate('//xi:include').each do |ele|
100
+ ctx.evaluate('.//xi:include').each do |ele|
101
101
  name = ele.attributes['href'].value
102
102
  name = path + name if name !~ /^(https?:|ftp:)/
103
103
  content = open(name,{ssl_verify_mode: OpenSSL::SSL::VERIFY_NONE}).read
@@ -107,8 +107,12 @@ module Nokogiri
107
107
  content
108
108
  end
109
109
  x = ele.replace insert
110
- x.each do |n|
111
- n.do_xinclude_manual if n.is_a? Nokogiri::XML::Element
110
+ if x.is_a? Nokogiri::XML::Element
111
+ x.do_xinclude_manual(relative_to)
112
+ else
113
+ x.each do |n|
114
+ n.do_xinclude_manual(relative_to) if n.is_a? Nokogiri::XML::Element
115
+ end
112
116
  end
113
117
  end
114
118
  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.14"
3
+ s.version = "0.3.15"
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.14
4
+ version: 0.3.15
5
5
  platform: ruby
6
6
  authors:
7
7
  - Juergen eTM Mangler