xmlregistry_objects 0.7.5 → 0.8.0
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 +5 -5
- checksums.yaml.gz.sig +0 -0
- data/lib/xmlregistry_objects.rb +41 -40
- data.tar.gz.sig +0 -0
- metadata +36 -32
- metadata.gz.sig +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: cc95b8fd15a36a13fc93bd48f1bc0840cfadd1ff5cc9f0735e6bd65b2bc94ec6
|
4
|
+
data.tar.gz: 2bffbe5094f477efaf7a67eb734ad16f9a46314eeac3b3c85ac63a98e95dc8d4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 546866da99885b618030623ea8c5069cdabc2a24fd2ab5fd549eabbbd34d4a53b6898df666991cfe2f43247b1646e44ae3248d105cd2575d091f36cde623b2af
|
7
|
+
data.tar.gz: 0a9206005c018a091301ddfc90b72a0ddd842c3e0e8ab9b29df632594a531d7203d53449e14d65d951d8a59333a062c80ab3fa52d7f95dba47e7d9779b97becb
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
data/lib/xmlregistry_objects.rb
CHANGED
@@ -5,6 +5,7 @@
|
|
5
5
|
|
6
6
|
require 'polyrex'
|
7
7
|
require 'dws-registry'
|
8
|
+
require 'rxfreader'
|
8
9
|
|
9
10
|
|
10
11
|
class XMLRegistryObjects
|
@@ -15,14 +16,14 @@ class XMLRegistryObjects
|
|
15
16
|
|
16
17
|
@log = log
|
17
18
|
log.info 'XMLRegistryObjects/initialize: active' if log
|
18
|
-
|
19
|
-
polyrexdoc = if obj.is_a? Polyrex then
|
20
|
-
|
19
|
+
|
20
|
+
polyrexdoc = if obj.is_a? Polyrex then
|
21
|
+
|
21
22
|
obj
|
22
|
-
|
23
|
+
|
23
24
|
elsif obj.is_a? String then
|
24
|
-
|
25
|
-
buffer, type =
|
25
|
+
|
26
|
+
buffer, type = RXFReader.read obj
|
26
27
|
|
27
28
|
if type == :url then
|
28
29
|
Polyrex.new buffer
|
@@ -31,9 +32,9 @@ class XMLRegistryObjects
|
|
31
32
|
"methodx[name,subkeyname]' delimiter=' = '?>\n" + obj
|
32
33
|
end
|
33
34
|
end
|
34
|
-
|
35
|
+
|
35
36
|
log.info 'XMLRegistryObjects/initialize: before @to_h' if log
|
36
|
-
|
37
|
+
|
37
38
|
@to_h = polyrexdoc.records.inject({}) do |rtn, row|
|
38
39
|
|
39
40
|
name, path = row.name, row.regkey[1..-2]
|
@@ -44,23 +45,23 @@ class XMLRegistryObjects
|
|
44
45
|
def initialize(reg)
|
45
46
|
@reg = reg
|
46
47
|
end
|
47
|
-
|
48
|
+
|
48
49
|
def last_modified()
|
49
50
|
lm = @reg.get_key('#{path}').attributes[:last_modified]
|
50
51
|
Time.parse(lm) if lm
|
51
52
|
end
|
52
|
-
|
53
|
-
def set(h)
|
54
|
-
|
53
|
+
|
54
|
+
def set(h)
|
55
|
+
|
55
56
|
h.each {|key,value| self.method((key.to_s + '=').to_sym).call value }
|
56
|
-
|
57
|
+
|
57
58
|
end
|
58
59
|
"
|
59
60
|
|
60
61
|
s = if row.records.any? then
|
61
62
|
|
62
63
|
row.records.inject(base_methods) do |r, attr|
|
63
|
-
|
64
|
+
|
64
65
|
attr_name, subkey = attr.name, attr.subkeyname[/\w+$/]
|
65
66
|
key = path + '/' + subkey
|
66
67
|
|
@@ -72,60 +73,60 @@ class XMLRegistryObjects
|
|
72
73
|
else
|
73
74
|
|
74
75
|
a = reg.xpath("#{path}/*")
|
75
|
-
|
76
|
-
a.inject(base_methods) do |r, x|
|
76
|
+
|
77
|
+
a.inject(base_methods) do |r, x|
|
77
78
|
|
78
79
|
methods_name = subkey = x.name
|
79
80
|
|
80
|
-
type = x.attributes[:type]
|
81
|
+
type = x.attributes[:type]
|
81
82
|
key = path + '/' + subkey
|
82
|
-
|
83
|
-
r << make_setdef(key, method_name=subkey)
|
84
83
|
|
85
|
-
|
84
|
+
r << make_setdef(key, method_name=subkey)
|
85
|
+
|
86
|
+
method_name += '?' if type and type == 'boolean'
|
86
87
|
r << make_def(key, method_name)
|
87
88
|
|
88
89
|
end
|
89
90
|
end
|
90
|
-
|
91
|
+
|
91
92
|
log.info 'XMLRegistryObjects/initialize: before class_eval ' + klass.to_s if log
|
92
|
-
|
93
|
+
|
93
94
|
klass.class_eval s
|
94
95
|
rtn.merge name.to_sym => klass.new(reg)
|
95
96
|
|
96
97
|
end
|
97
|
-
|
98
|
+
|
98
99
|
log.info 'XMLRegistryObjects/initialize: completed' if log
|
99
100
|
end
|
100
|
-
|
101
|
+
|
101
102
|
def define_methods()
|
102
103
|
@to_h.each.map {|k,v| "define_method :#{k.to_s}, ->{h[:#{k}]}"}.join("\n")
|
103
104
|
end
|
104
|
-
|
105
|
-
# to use this method the client is expect to fetch the
|
106
|
-
# hash object from the registry object e.g.
|
105
|
+
|
106
|
+
# to use this method the client is expect to fetch the
|
107
|
+
# hash object from the registry object e.g.
|
107
108
|
# xro = XMLRegistryObjects.new(reg,list)
|
108
109
|
# @h = xro.to_h
|
109
|
-
|
110
|
+
|
110
111
|
def define_methods2(obj=nil)
|
111
|
-
|
112
|
+
|
112
113
|
a = @to_h.each.map {|k,v| [k.to_s.to_sym, ->{@h[k.to_sym]} ] }
|
113
|
-
|
114
|
+
|
114
115
|
if obj then
|
115
|
-
|
116
|
+
|
116
117
|
a.each {|name, blk| obj.class.send(:define_method, name, blk) }
|
117
|
-
|
118
|
+
|
118
119
|
else
|
119
|
-
|
120
|
+
|
120
121
|
return a
|
121
|
-
|
122
|
+
|
122
123
|
end
|
123
|
-
|
124
|
-
end
|
124
|
+
|
125
|
+
end
|
125
126
|
|
126
127
|
private
|
127
128
|
|
128
|
-
def make_def(key, method_name)
|
129
|
+
def make_def(key, method_name)
|
129
130
|
<<-EOF
|
130
131
|
def #{method_name}()
|
131
132
|
@reg.get_key('#{key}', auto_detect_type: true)
|
@@ -133,9 +134,9 @@ end
|
|
133
134
|
|
134
135
|
EOF
|
135
136
|
end
|
136
|
-
|
137
|
-
def make_setdef(key, method_name)
|
137
|
+
|
138
|
+
def make_setdef(key, method_name)
|
138
139
|
"def #{method_name}=(v) @reg.set_key '#{key}', v end\n"
|
139
|
-
end
|
140
|
+
end
|
140
141
|
|
141
142
|
end
|
data.tar.gz.sig
CHANGED
Binary file
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: xmlregistry_objects
|
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
|
@@ -10,27 +10,32 @@ bindir: bin
|
|
10
10
|
cert_chain:
|
11
11
|
- |
|
12
12
|
-----BEGIN CERTIFICATE-----
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
13
|
+
MIIEXjCCAsagAwIBAgIBATANBgkqhkiG9w0BAQsFADAsMSowKAYDVQQDDCFnZW1t
|
14
|
+
YXN0ZXIvREM9amFtZXNyb2JlcnRzb24vREM9ZXUwHhcNMjIwMjIyMjAzMzQwWhcN
|
15
|
+
MjMwMjIyMjAzMzQwWjAsMSowKAYDVQQDDCFnZW1tYXN0ZXIvREM9amFtZXNyb2Jl
|
16
|
+
cnRzb24vREM9ZXUwggGiMA0GCSqGSIb3DQEBAQUAA4IBjwAwggGKAoIBgQDjoLXS
|
17
|
+
JY+GeI0u2RX39kso2JcNAsJ6/nlvNKRbADfUhw/J67b65yUVFYyUx/5bp3h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tyOLvFmUcQZnGwLAlpDT/GoEF71Mt3Ncnt9Z2Qt5gkr
|
33
|
+
p0+dnQ2LSGJRkn/RkGz3HM7aJcEV/nZO5b/7h61JbQ6Sg9p6Ailmub27VF6YUsO5
|
34
|
+
fAZEEr9vu8+K5z8LD0W7sdGbUMiz6qLKYzL5A1ERYZBqlY7J6Bo0alRRclzDpcJV
|
35
|
+
xxskbsrcVBnIBOJst+8ciwIklNVWeyO9DgHgc7XczsjNVAwtBywJ2OqePLHwzypv
|
36
|
+
j1b+b2ovUi70hCFO+BJGE3t0
|
32
37
|
-----END CERTIFICATE-----
|
33
|
-
date:
|
38
|
+
date: 2022-02-22 00:00:00.000000000 Z
|
34
39
|
dependencies:
|
35
40
|
- !ruby/object:Gem::Dependency
|
36
41
|
name: dws-registry
|
@@ -38,42 +43,42 @@ dependencies:
|
|
38
43
|
requirements:
|
39
44
|
- - "~>"
|
40
45
|
- !ruby/object:Gem::Version
|
41
|
-
version: '0.
|
46
|
+
version: '0.5'
|
42
47
|
- - ">="
|
43
48
|
- !ruby/object:Gem::Version
|
44
|
-
version: 0.
|
49
|
+
version: 0.5.0
|
45
50
|
type: :runtime
|
46
51
|
prerelease: false
|
47
52
|
version_requirements: !ruby/object:Gem::Requirement
|
48
53
|
requirements:
|
49
54
|
- - "~>"
|
50
55
|
- !ruby/object:Gem::Version
|
51
|
-
version: '0.
|
56
|
+
version: '0.5'
|
52
57
|
- - ">="
|
53
58
|
- !ruby/object:Gem::Version
|
54
|
-
version: 0.
|
59
|
+
version: 0.5.0
|
55
60
|
- !ruby/object:Gem::Dependency
|
56
61
|
name: polyrex
|
57
62
|
requirement: !ruby/object:Gem::Requirement
|
58
63
|
requirements:
|
59
64
|
- - "~>"
|
60
65
|
- !ruby/object:Gem::Version
|
61
|
-
version: '1.
|
66
|
+
version: '1.4'
|
62
67
|
- - ">="
|
63
68
|
- !ruby/object:Gem::Version
|
64
|
-
version: 1.
|
69
|
+
version: 1.4.0
|
65
70
|
type: :runtime
|
66
71
|
prerelease: false
|
67
72
|
version_requirements: !ruby/object:Gem::Requirement
|
68
73
|
requirements:
|
69
74
|
- - "~>"
|
70
75
|
- !ruby/object:Gem::Version
|
71
|
-
version: '1.
|
76
|
+
version: '1.4'
|
72
77
|
- - ">="
|
73
78
|
- !ruby/object:Gem::Version
|
74
|
-
version: 1.
|
79
|
+
version: 1.4.0
|
75
80
|
description:
|
76
|
-
email:
|
81
|
+
email: digital.robertson@gmail.com
|
77
82
|
executables: []
|
78
83
|
extensions: []
|
79
84
|
extra_rdoc_files: []
|
@@ -98,8 +103,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
98
103
|
- !ruby/object:Gem::Version
|
99
104
|
version: '0'
|
100
105
|
requirements: []
|
101
|
-
|
102
|
-
rubygems_version: 2.6.13
|
106
|
+
rubygems_version: 3.2.22
|
103
107
|
signing_key:
|
104
108
|
specification_version: 4
|
105
109
|
summary: Query the registry using objects built dynamically from a string which maps
|
metadata.gz.sig
CHANGED
Binary file
|