xml-mixup 0.1.4 → 0.1.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/xml/mixup/version.rb +1 -1
- data/lib/xml/mixup.rb +3 -3
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c6f10546e968af9292ba31e384146b6461c81156a6ef61b53814523aa1f3c9e6
|
4
|
+
data.tar.gz: 88a54c22e2b4c5bb4cedf8e54b739d1fcbcd69b54bdf0388c2e7f18b761f56c6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7bdb9ecb2b6f5c786280dd32b70ffe62f6555b2675cff8dfd1bca8064d30f046f7f4ec39547ee868b4e036d743ab8fff56b8701d1fbabe18b8e84b982234e73e
|
7
|
+
data.tar.gz: 98d060668d6e9bc16801a6a5b9d6866e5f239b80e646e6956da22d8c7b7b7cbecb8783c638cf7cdc9caba557e6ef8aefcdf6eeb810620394356414b4b7731bfd
|
data/lib/xml/mixup/version.rb
CHANGED
data/lib/xml/mixup.rb
CHANGED
@@ -25,7 +25,7 @@ module XML::Mixup
|
|
25
25
|
sibling.add_previous_sibling node
|
26
26
|
end,
|
27
27
|
after: lambda { |node, sibling| sibling.add_next_sibling node },
|
28
|
-
replace: lambda { |node, target|
|
28
|
+
replace: lambda { |node, target| target.replace node },
|
29
29
|
}.freeze
|
30
30
|
|
31
31
|
RESERVED = Set.new(%w{comment cdata doctype dtd elem element
|
@@ -110,7 +110,7 @@ module XML::Mixup
|
|
110
110
|
def markup spec: nil, doc: nil, args: [], **nodes
|
111
111
|
# handle adjacent node declaration
|
112
112
|
adj = nil
|
113
|
-
ADJACENT.keys do |k|
|
113
|
+
ADJACENT.keys.each do |k|
|
114
114
|
if nodes[k]
|
115
115
|
if adj
|
116
116
|
raise "Cannot bind to #{k}: #{adj} is already present"
|
@@ -125,7 +125,7 @@ module XML::Mixup
|
|
125
125
|
# generate doc/parent
|
126
126
|
if adj
|
127
127
|
doc ||= nodes[adj].document
|
128
|
-
unless adj ==
|
128
|
+
unless adj.to_sym == :parent
|
129
129
|
unless (nodes[:parent] = nodes[adj].parent)
|
130
130
|
raise "#{adj} node must have a parent node!"
|
131
131
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: xml-mixup
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Dorian Taylor
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-05-
|
11
|
+
date: 2018-05-16 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|