drb_reg_client 0.1.0 → 0.2.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.tar.gz.sig +0 -0
- data/lib/drb_reg_client.rb +68 -17
- metadata +31 -28
- metadata.gz.sig +2 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 630edfba92b374d8933dc085dcd98b373cc682ad95c23b891e57366a1d44b953
|
4
|
+
data.tar.gz: ecae0ef882e657b676506cc05e6b80bb0ab5bb48cdcc09cb5b5e51f36c1fc30a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: dae2da72692772cdf1653037deb323c4c0751df9503f8658bea5672959b15136b052083cf6c013f3a9c1f965bb0944e823f370c18d4c78725d64d314ee527e85
|
7
|
+
data.tar.gz: ad76f8e7bef8fc7b1f3c37fe64bfbcf6f8423dc5c9dbdf8e6337dd5e10b0085066caf6b9634db9ecff78b1a173e1c1950a96be893e472b21629693f04c60e885
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
data.tar.gz.sig
CHANGED
Binary file
|
data/lib/drb_reg_client.rb
CHANGED
@@ -10,20 +10,61 @@ require 'rexle'
|
|
10
10
|
class DRbRegClient
|
11
11
|
|
12
12
|
|
13
|
-
def initialize(host:
|
13
|
+
def initialize(host: nil, port: '59500', debug: false)
|
14
|
+
|
15
|
+
@port, @debug = port, debug
|
14
16
|
DRb.start_service
|
15
17
|
|
16
18
|
# attach to the DRb server via a URI given on the command line
|
17
|
-
@reg = DRbObject.new nil, "druby://#{host}:#{port}"
|
19
|
+
@reg = DRbObject.new nil, "druby://#{host}:#{port}" if host
|
18
20
|
end
|
19
21
|
|
20
22
|
def delete_key(path)
|
21
23
|
@reg.delete_key path
|
24
|
+
end
|
25
|
+
|
26
|
+
def get(s)
|
27
|
+
|
28
|
+
raw_uri, raw_path = s[/(?<=reg:\/\/).*/].split('/',2)
|
29
|
+
host, port = raw_uri.split(':')
|
30
|
+
port ||= @port
|
31
|
+
|
32
|
+
if @debug
|
33
|
+
puts 'host:' + host.inspect
|
34
|
+
puts 'port:' + port.inspect
|
35
|
+
end
|
36
|
+
|
37
|
+
@reg = DRbObject.new nil, "druby://#{host}:#{port}"
|
38
|
+
|
39
|
+
path, raw_q = raw_path.split('?',2)
|
40
|
+
|
41
|
+
r = get_key(path, auto_detect_type: true)
|
42
|
+
|
43
|
+
if raw_q then
|
44
|
+
|
45
|
+
q = raw_q[/(?<=q\=)[^$]+/]
|
46
|
+
|
47
|
+
if q then
|
48
|
+
attr_val = r.attributes[q.to_sym]
|
49
|
+
Time.parse(attr_val) if q.to_sym == :last_modified
|
50
|
+
end
|
51
|
+
|
52
|
+
else
|
53
|
+
|
54
|
+
return r
|
55
|
+
|
56
|
+
end
|
57
|
+
|
58
|
+
|
59
|
+
|
22
60
|
end
|
23
61
|
|
24
62
|
def get_key(key='', auto_detect_type: false)
|
25
|
-
|
26
|
-
|
63
|
+
|
64
|
+
puts 'inside get_key' if @debug
|
65
|
+
r = @reg.get_key(key)
|
66
|
+
|
67
|
+
puts 'r: ' + r.inspect if @debug
|
27
68
|
|
28
69
|
return unless r
|
29
70
|
|
@@ -59,15 +100,30 @@ class DRbRegClient
|
|
59
100
|
end
|
60
101
|
|
61
102
|
|
62
|
-
def get_keys(
|
103
|
+
def get_keys(key)
|
104
|
+
|
63
105
|
recordset = @reg.get_keys(key)
|
106
|
+
return unless recordset
|
64
107
|
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
108
|
+
doc = Rexle.new(recordset)
|
109
|
+
doc.root.elements ? doc.root.elements.to_a : []
|
110
|
+
|
111
|
+
end
|
112
|
+
|
113
|
+
def import(s)
|
114
|
+
@reg.import s
|
70
115
|
end
|
116
|
+
|
117
|
+
def set(s, value)
|
118
|
+
|
119
|
+
raw_uri, path = s[/(?<=reg:\/\/).*/].split('/',2)
|
120
|
+
host, port = raw_uri.split(':')
|
121
|
+
port ||= @port
|
122
|
+
|
123
|
+
@reg = DRbObject.new nil, "druby://#{host}:#{port}"
|
124
|
+
set_key(path, value)
|
125
|
+
|
126
|
+
end
|
71
127
|
|
72
128
|
def set_key(key, value)
|
73
129
|
|
@@ -84,13 +140,8 @@ class DRbRegClient
|
|
84
140
|
|
85
141
|
return [] if r.empty?
|
86
142
|
|
87
|
-
doc = Rexle.new(r)
|
88
|
-
|
89
|
-
if doc.root.elements then
|
90
|
-
doc.root.elements.to_a
|
91
|
-
else
|
92
|
-
[]
|
93
|
-
end
|
143
|
+
doc = Rexle.new(r)
|
144
|
+
doc.root.elements ? doc.root.elements.to_a : []
|
94
145
|
end
|
95
146
|
|
96
147
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: drb_reg_client
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- James Robertson
|
@@ -10,28 +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
|
-
|
32
|
-
|
13
|
+
MIIEXjCCAsagAwIBAgIBATANBgkqhkiG9w0BAQsFADAsMSowKAYDVQQDDCFnZW1t
|
14
|
+
YXN0ZXIvREM9amFtZXNyb2JlcnRzb24vREM9ZXUwHhcNMjAwNjA4MjEyNzM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v95l0Yf7pISC3ilLGo/gEPdeA7qnkJdnIaeJ074pr2y1knSw1
|
30
|
+
Z9nWeB5g7w85acc0ihyWHc86bQkAXjQh/ebkhLdMBSX6+mdx6jctKmXKDu6bcN/5
|
31
|
+
3WgFtr5rp3V4mptZ8hdjRUbUNaZnGkqyphZXrJ9xGEi9iSk/EN9MZlKFNdUl1+qR
|
32
|
+
p2tGsE04OqRZ2PA28CUbR1CsskMl67a8Cq32icD1gynVKW4C4fObUAlH5CTFMLR6
|
33
|
+
XZ/t2+RsBFLhQU5TV3ZYcNskfBswHmGcS7at3nIBSgGFgbG1yDBgeJIbhQ8al0Aj
|
34
|
+
ZnYTHMKVpGEKGRaaciz01qan67D75sxQaQbJzMJ8o9P5FFBz5SnPIZAGtrVQVbwk
|
35
|
+
Q8EYGbOAqtb0phUBPLNTXJ8ToIk7zuFB7wu7K3L9gLHolnbnZ6fZOLsmhHuOAXue
|
36
|
+
w7VTDsV1LRF3S+/km8Tt5tpO
|
33
37
|
-----END CERTIFICATE-----
|
34
|
-
date:
|
38
|
+
date: 2020-09-02 00:00:00.000000000 Z
|
35
39
|
dependencies:
|
36
40
|
- !ruby/object:Gem::Dependency
|
37
41
|
name: rexle
|
@@ -39,20 +43,20 @@ dependencies:
|
|
39
43
|
requirements:
|
40
44
|
- - "~>"
|
41
45
|
- !ruby/object:Gem::Version
|
42
|
-
version: '1.
|
46
|
+
version: '1.5'
|
43
47
|
- - ">="
|
44
48
|
- !ruby/object:Gem::Version
|
45
|
-
version: 1.
|
49
|
+
version: 1.5.8
|
46
50
|
type: :runtime
|
47
51
|
prerelease: false
|
48
52
|
version_requirements: !ruby/object:Gem::Requirement
|
49
53
|
requirements:
|
50
54
|
- - "~>"
|
51
55
|
- !ruby/object:Gem::Version
|
52
|
-
version: '1.
|
56
|
+
version: '1.5'
|
53
57
|
- - ">="
|
54
58
|
- !ruby/object:Gem::Version
|
55
|
-
version: 1.
|
59
|
+
version: 1.5.8
|
56
60
|
description:
|
57
61
|
email: james@jamesrobertson.eu
|
58
62
|
executables: []
|
@@ -79,8 +83,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
79
83
|
- !ruby/object:Gem::Version
|
80
84
|
version: '0'
|
81
85
|
requirements: []
|
82
|
-
|
83
|
-
rubygems_version: 2.6.8
|
86
|
+
rubygems_version: 3.0.3
|
84
87
|
signing_key:
|
85
88
|
specification_version: 4
|
86
89
|
summary: Provides a DWS_registry service using DRb; Requires a drb_reg_server to be
|
metadata.gz.sig
CHANGED
@@ -1,4 +1,2 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
J$�U<S���+�&9R.�Uqų��
|
4
|
-
m�g�ڳe>�\L�NFe��&��+�^����O'bhP͚���6��gqP1����(:���n0L�qo����x�A��U�M�r�����K�L�ޯ���'�<D=t�b���o�=X>�ܟ(��Gt�I��.M�����}�_��.�*���
|
1
|
+
$�"3"hs����b��T�cuM����T��!�Xҝ@�]h{�5����[Qc�+6a�8K}��uO#1��EI)QP�d%q�/���J�k���e�JR��i�֫:ooM� �qc�Τ�����S����
|
2
|
+
R���(J~x�Lմp_S�omé&:�t�Ms
|