xml-registry 0.7.1 → 0.8.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- checksums.yaml.gz.sig +0 -0
- data/lib/xml-registry.rb +10 -7
- data.tar.gz.sig +0 -0
- metadata +2 -2
- metadata.gz.sig +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 280ac5c817560aa72e83c93eabf4358d1a169781717442b7b4e2c7ee95ca1ec0
|
4
|
+
data.tar.gz: 0a8a32baea55901636b3a28ef6b585393883f4717107b17af84a46365a0c8658
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: af319f07195089806be005eb10b42267e359a65c6f668ccda8ba618b3b36019c433abede751bf10e5d7dadfdb1c3719309538db765bb56c1e7933fc528f42a56
|
7
|
+
data.tar.gz: a5bddd352a8865dc253cda635dde28a6ba8b66c1ad094c9b2cf5368bb1e74b32164cc8c7e2e9240be7e4e9f25d047a5ffcf1d1ed395ba748dbdf2498a376aca2
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
data/lib/xml-registry.rb
CHANGED
@@ -2,9 +2,11 @@
|
|
2
2
|
|
3
3
|
# file: xml-registry.rb
|
4
4
|
|
5
|
-
|
6
|
-
|
5
|
+
require 'rexle'
|
6
|
+
require 'kvx'
|
7
|
+
require 'ostruct'
|
7
8
|
require 'simple-config'
|
9
|
+
require 'rxfreadwrite'
|
8
10
|
|
9
11
|
|
10
12
|
module NumberCheck
|
@@ -20,6 +22,7 @@ end
|
|
20
22
|
|
21
23
|
class XMLRegistry
|
22
24
|
using NumberCheck
|
25
|
+
include RXFReadWriteModule
|
23
26
|
|
24
27
|
attr_reader :doc
|
25
28
|
|
@@ -27,7 +30,7 @@ class XMLRegistry
|
|
27
30
|
|
28
31
|
@debug = debug
|
29
32
|
super()
|
30
|
-
@template, _ =
|
33
|
+
@template, _ = RXFReader.read(template)
|
31
34
|
@doc = Rexle.new(@template)
|
32
35
|
end
|
33
36
|
|
@@ -144,14 +147,14 @@ class XMLRegistry
|
|
144
147
|
# load a new registry xml document replacing the existing registry
|
145
148
|
#
|
146
149
|
def load_xml(s='')
|
147
|
-
@doc = Rexle.new(
|
150
|
+
@doc = Rexle.new(RXFReader.read(s)[0].force_encoding("UTF-8"))
|
148
151
|
self
|
149
152
|
end
|
150
153
|
|
151
154
|
# save the registry to the specified file path
|
152
155
|
#
|
153
156
|
def save(s)
|
154
|
-
|
157
|
+
FileX.write s, @doc.xml(pretty: true)
|
155
158
|
end
|
156
159
|
|
157
160
|
# import a registry hive from a string in registry format
|
@@ -173,7 +176,7 @@ class XMLRegistry
|
|
173
176
|
#
|
174
177
|
def import(s)
|
175
178
|
|
176
|
-
r =
|
179
|
+
r = RXFReader.read(s)
|
177
180
|
reg_buffer = r.first
|
178
181
|
raise "read file error" unless reg_buffer
|
179
182
|
|
@@ -231,7 +234,7 @@ class XMLRegistry
|
|
231
234
|
def export(s=nil)
|
232
235
|
reg = print_scan(@doc.root).join("\n")
|
233
236
|
# jr 250118 File.open(s){|f| f.write reg} if s
|
234
|
-
|
237
|
+
FileX.write(s, reg) if s
|
235
238
|
reg
|
236
239
|
end
|
237
240
|
|
data.tar.gz.sig
CHANGED
Binary file
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: xml-registry
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.8.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- James Robertson
|
@@ -35,7 +35,7 @@ cert_chain:
|
|
35
35
|
qQ7EyBaXak1o/nkw5pybDKSbUjVOvQpzjla62Xe4FzHerw4+UYRKyq6OjeDckoJD
|
36
36
|
qwMwsoB0WJMRTqSZ4g1aEmfr
|
37
37
|
-----END CERTIFICATE-----
|
38
|
-
date: 2022-02-
|
38
|
+
date: 2022-02-22 00:00:00.000000000 Z
|
39
39
|
dependencies:
|
40
40
|
- !ruby/object:Gem::Dependency
|
41
41
|
name: simple-config
|
metadata.gz.sig
CHANGED
Binary file
|