remote_dwsregistry 0.2.5 → 0.2.6
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 +2 -1
- data.tar.gz.sig +0 -0
- data/lib/remote_dwsregistry.rb +30 -2
- metadata +3 -3
- metadata.gz.sig +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: db8dfc24ca0b60b9bab93cce22c033e89700b6ec
|
4
|
+
data.tar.gz: a9d35b5e627a554bfaecf503845f99cb1e39ed6c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9af1f264652b9eba0ea816b190d8ae7d8152451410c11b9170f1101fd426024dca22f18f9f9d9fb06278df4fbafdc91e8bc0c75766512231f5f395384b1845c0
|
7
|
+
data.tar.gz: 3b6536c17e8348b6c9d189bf691378cee69269e84d47afc9459969ebe00c627a49604361470a92eb700ff58e04d98e68770a610eb19da39a0c761039c0ae4b3d
|
checksums.yaml.gz.sig
CHANGED
@@ -1 +1,2 @@
|
|
1
|
-
|
1
|
+
câ8����;+��uo�>�|�8`PH��TMѯ�A��>B�+]��C�Ƙ�i��tX�x'#�)�����w���Y2��n�̗��1�%x���)�b��K)c�6FߋU���~
|
2
|
+
(X�)|� ���>��S���N��c1�����I�9&��CĮrF�����GKf��#�<��:��9qM�F���IX�{�(��� ��Lޥ��=$�a������m����zf5}{��ܬ��,��7?P��i�R
|
data.tar.gz.sig
CHANGED
Binary file
|
data/lib/remote_dwsregistry.rb
CHANGED
@@ -38,7 +38,7 @@ class RemoteDwsRegistry
|
|
38
38
|
|
39
39
|
end
|
40
40
|
|
41
|
-
def get_key(key='')
|
41
|
+
def get_key(key='', auto_detect_type: false)
|
42
42
|
|
43
43
|
r = @req.get(@url_base + key)
|
44
44
|
|
@@ -46,7 +46,33 @@ class RemoteDwsRegistry
|
|
46
46
|
when 'application/xml'
|
47
47
|
|
48
48
|
doc = Rexle.new(r.body)
|
49
|
-
doc.root
|
49
|
+
e = doc.root
|
50
|
+
|
51
|
+
return e unless auto_detect_type
|
52
|
+
|
53
|
+
c = e.attributes[:type]
|
54
|
+
s = e.text
|
55
|
+
|
56
|
+
return e if e.elements.length > 0 or s.nil?
|
57
|
+
return s unless c
|
58
|
+
|
59
|
+
h = {
|
60
|
+
string: ->(x) {x},
|
61
|
+
boolean: ->(x){
|
62
|
+
case x
|
63
|
+
when 'true' then true
|
64
|
+
when 'false' then false
|
65
|
+
when 'on' then true
|
66
|
+
when 'off' then false
|
67
|
+
else x
|
68
|
+
end
|
69
|
+
},
|
70
|
+
number: ->(x){ x[/^[0-9]+$/] ? x.to_i : x.to_f },
|
71
|
+
time: ->(x) {Time.parse x},
|
72
|
+
json: ->(x) {JSON.parse x}
|
73
|
+
}
|
74
|
+
|
75
|
+
h[c.to_sym].call s
|
50
76
|
|
51
77
|
when 'application/json'
|
52
78
|
|
@@ -57,6 +83,8 @@ class RemoteDwsRegistry
|
|
57
83
|
r.body
|
58
84
|
|
59
85
|
end
|
86
|
+
|
87
|
+
|
60
88
|
|
61
89
|
end
|
62
90
|
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: remote_dwsregistry
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- James Robertson
|
@@ -31,7 +31,7 @@ cert_chain:
|
|
31
31
|
8Evvq+W0ctr3ipWi/bs/c2vbptk+WCGaWqJDQUWsCWU/JCK1qJiaqW3b1huhQG4B
|
32
32
|
yVeqpuJ0ke2PZQ==
|
33
33
|
-----END CERTIFICATE-----
|
34
|
-
date: 2016-
|
34
|
+
date: 2016-11-18 00:00:00.000000000 Z
|
35
35
|
dependencies:
|
36
36
|
- !ruby/object:Gem::Dependency
|
37
37
|
name: rexle
|
@@ -100,7 +100,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
100
100
|
version: '0'
|
101
101
|
requirements: []
|
102
102
|
rubyforge_project:
|
103
|
-
rubygems_version: 2.
|
103
|
+
rubygems_version: 2.5.1
|
104
104
|
signing_key:
|
105
105
|
specification_version: 4
|
106
106
|
summary: Used in conjunction with the rack_dwsregistry gem to remotely get and set
|
metadata.gz.sig
CHANGED
Binary file
|