xml-smart 0.5.0 → 0.5.2

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
  SHA256:
3
- metadata.gz: 7442401013fd975d2ffb250e156372e4fc7a6e6d9fba5776c07d643e5c91f8bd
4
- data.tar.gz: 1a98c2d2cf23fe2980f75fda07935fb92e802f0411647a8ea3e034731a8365d3
3
+ metadata.gz: cfe8c2fc13f2a69f5070626a391bb93a3767a19c25326569e92611ade77d77d7
4
+ data.tar.gz: fc5f83de13c78e2092a3b0d8c802522e79e5f55c81b1b81acda018b0cff7d515
5
5
  SHA512:
6
- metadata.gz: 10c1b36e9d1f8323ed955dbb7e416a47f6501915e9d2ceb68085e83befabc131b514069f44753185711b213f3b8a791305356a46762516b3e725c8bea3c700f8
7
- data.tar.gz: 829844fea52e292815884037cb004e609f28e447edeecb995bca58d15d271475b22bbb36e2135e16e125f38efcbbeda6c67424c6b2512549696cbed033c8a4e7
6
+ metadata.gz: 32851327e59702b2f7664706cdcb5148e91aa260543810312a6a42572a0496c4d96a84ef14b7e649b94645b6a31c3686752f706f34fd8cd5a56637c4342373d6
7
+ data.tar.gz: 719e57fcc9d636eece10acb376db47119eff7ef1a577605f793da3dd14f5c15129a6fbf10234826dd7fc5da6de172efe89193f7373814675a297d9b6977e69b9
data/AUTHORS CHANGED
@@ -2,3 +2,4 @@ Jürgen Mangler <juergen.mangler@univie.ac.at>
2
2
  Christian Neukirchen <chneukirchen@gmail.com>
3
3
  Jonathan Paisley <jp#{spidermonkey}dcs#{dot}gla#{dot}ac#{dot}uk>
4
4
  Emmanuel Touzery <emmanuel#{dot}touzery#{spidermonkey}wanadoo#{dot}fr>
5
+ Heinrich Fenkart <hnrch02@gmail.com>
data/example/xpath_visual CHANGED
@@ -40,7 +40,7 @@ if ARGV.length < 2
40
40
  else
41
41
  # xpath expression that should be visualised
42
42
  xpath = ARGV[1..-1].join(' ') || "/"
43
- unless File.exists?(ARGV[0])
43
+ unless File.exist?(ARGV[0])
44
44
  help
45
45
  end
46
46
  doc = XML::Smart.open_unprotected(ARGV[0])
data/lib/xml/smart.rb CHANGED
@@ -102,8 +102,9 @@ module Nokogiri
102
102
  ctx.register_namespaces "xi"=>"http://www.w3.org/2001/XInclude"
103
103
  ctx.evaluate('.//xi:include').each do |ele|
104
104
  name = ele.attributes['href'].value
105
- name = path + name if name !~ /^(https?:|ftp:|\/)/
106
- content = open(name,:ssl_verify_mode => OpenSSL::SSL::VERIFY_NONE).read
105
+ is_path = name !~ %r{\A[A-Za-z][A-Za-z0-9+\-\.]*://}
106
+ name = path + name if is_path && !name.start_with?('/')
107
+ content = ::URI::open(name, is_path ? 'r' : {:ssl_verify_mode => OpenSSL::SSL::VERIFY_NONE}).read
107
108
  insert = begin
108
109
  Nokogiri::XML::parse(content).root # {|config| config.noblanks.noent.strict }.root
109
110
  rescue
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">2021-11-03 02:24:58 +0100</name>
3
+ <name team="0" a="3">2023-06-11 19:39:57 +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="2021-11-03T02:24:55+01: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>
data/test/tc_create.rb CHANGED
@@ -6,7 +6,7 @@ class TestCreate < Minitest::Test
6
6
  # When a string as second paramter is provided, then a empty
7
7
  # xml file is created if it not exists. A block has to be supplied
8
8
  #
9
- # XML::Smart.modify(FILE,STRING) {} ... create file if !exists?
9
+ # XML::Smart.modify(FILE,STRING) {} ... create file if !exist?
10
10
  # XML::Smart.modify(FILE) {} ... just open file change and write back (LOCKTIMEOUT defaults to 7)
11
11
 
12
12
  File.unlink ::File.dirname(__FILE__) + "/EXAMPLE.tmp.xml" rescue nil
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.5.0"
3
+ s.version = "0.5.2"
4
4
  s.platform = Gem::Platform::RUBY
5
5
  s.license = "LGPL-3.0"
6
6
  s.summary = "An xml library that doesn't suck (for me) - 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.5.0
4
+ version: 0.5.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Juergen eTM Mangler
8
8
  autorequire:
9
9
  bindir: example
10
10
  cert_chain: []
11
- date: 2023-03-17 00:00:00.000000000 Z
11
+ date: 2023-06-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: nokogiri
@@ -164,7 +164,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
164
164
  - !ruby/object:Gem::Version
165
165
  version: '0'
166
166
  requirements: []
167
- rubygems_version: 3.4.6
167
+ rubygems_version: 3.4.10
168
168
  signing_key:
169
169
  specification_version: 4
170
170
  summary: An xml library that doesn't suck (for me) - since 2004.