remote_dwsregistry 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- checksums.yaml.gz.sig +0 -0
- data.tar.gz.sig +1 -0
- data/lib/remote_dwsregistry.rb +66 -0
- metadata +108 -0
- metadata.gz.sig +0 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 9e33bf863e548467f7b277b7ed6655c7d310371d
|
4
|
+
data.tar.gz: 7c78f19b6dda25a5f95bf9e6ef835e0559c96e00
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 814007ddbc347e89a7d07d58360cfa789298807ed01480a8aab1c104c86314325bff14a002cdecc90c2e34d8ec23837d2cd5c5c7685df9cf5ea86f9ce1524303
|
7
|
+
data.tar.gz: 7afb2a77b5c03be1e55b2c1c746dd76edc2d605446eb854c70e05a1316fa9cd20756f0c1bf8572370afcbe5708af714cdbd27cb73fc020b434473b65106260af
|
checksums.yaml.gz.sig
ADDED
Binary file
|
data.tar.gz.sig
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
x��c��ʶ������'�U�罌������~���@0�Y�ѣ����!S�˰l�l�t>qW{��Zs�
|
@@ -0,0 +1,66 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
# file: remote_dwsregistry.rb
|
4
|
+
# description: Used in conjunction with the rack_dwsregistry gem to remotely get and set keys from the XML based registry.
|
5
|
+
|
6
|
+
|
7
|
+
require 'json'
|
8
|
+
require 'rexle'
|
9
|
+
require 'gpd-request'
|
10
|
+
|
11
|
+
|
12
|
+
class RemoteDwsRegistry
|
13
|
+
|
14
|
+
def initialize(url_base='http://127.0.0.1:9292/')
|
15
|
+
|
16
|
+
@url_base = url_base
|
17
|
+
@url_base += '/' unless url_base[-1] == '/'
|
18
|
+
@req = GPDRequest.new
|
19
|
+
end
|
20
|
+
|
21
|
+
def get_key(key)
|
22
|
+
|
23
|
+
r = @req.get(@url_base + key)
|
24
|
+
|
25
|
+
case r.content_type
|
26
|
+
when 'application/xml'
|
27
|
+
|
28
|
+
doc = Rexle.new(r.body)
|
29
|
+
doc.root
|
30
|
+
|
31
|
+
when 'application/json'
|
32
|
+
|
33
|
+
r.body.to_json
|
34
|
+
|
35
|
+
else
|
36
|
+
|
37
|
+
r.body
|
38
|
+
|
39
|
+
end
|
40
|
+
|
41
|
+
end
|
42
|
+
|
43
|
+
def set_key(key, val)
|
44
|
+
|
45
|
+
url = @url_base + key
|
46
|
+
|
47
|
+
r = @req.post(url, 'v' => val)
|
48
|
+
|
49
|
+
case r.content_type
|
50
|
+
when 'application/xml'
|
51
|
+
|
52
|
+
doc = Rexle.new(r.body)
|
53
|
+
doc.root
|
54
|
+
|
55
|
+
when 'application/json'
|
56
|
+
|
57
|
+
r.body.to_json
|
58
|
+
|
59
|
+
else
|
60
|
+
|
61
|
+
r.body
|
62
|
+
|
63
|
+
end
|
64
|
+
|
65
|
+
end
|
66
|
+
end
|
metadata
ADDED
@@ -0,0 +1,108 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: remote_dwsregistry
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.1.0
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- James Robertson
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain:
|
11
|
+
- |
|
12
|
+
-----BEGIN CERTIFICATE-----
|
13
|
+
MIIDljCCAn6gAwIBAgIBATANBgkqhkiG9w0BAQUFADBIMRIwEAYDVQQDDAlnZW1t
|
14
|
+
YXN0ZXIxHjAcBgoJkiaJk/IsZAEZFg5qYW1lc3JvYmVydHNvbjESMBAGCgmSJomT
|
15
|
+
8ixkARkWAmV1MB4XDTE2MDQyNTEyMDgyN1oXDTE3MDQyNTEyMDgyN1owSDESMBAG
|
16
|
+
A1UEAwwJZ2VtbWFzdGVyMR4wHAYKCZImiZPyLGQBGRYOamFtZXNyb2JlcnRzb24x
|
17
|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WCGaWqJDQUWsCWU/JCK1qJiaqW3b1huhQG4B
|
32
|
+
yVeqpuJ0ke2PZQ==
|
33
|
+
-----END CERTIFICATE-----
|
34
|
+
date: 2016-04-25 00:00:00.000000000 Z
|
35
|
+
dependencies:
|
36
|
+
- !ruby/object:Gem::Dependency
|
37
|
+
name: rexle
|
38
|
+
requirement: !ruby/object:Gem::Requirement
|
39
|
+
requirements:
|
40
|
+
- - "~>"
|
41
|
+
- !ruby/object:Gem::Version
|
42
|
+
version: '1.3'
|
43
|
+
- - ">="
|
44
|
+
- !ruby/object:Gem::Version
|
45
|
+
version: 1.3.29
|
46
|
+
type: :runtime
|
47
|
+
prerelease: false
|
48
|
+
version_requirements: !ruby/object:Gem::Requirement
|
49
|
+
requirements:
|
50
|
+
- - "~>"
|
51
|
+
- !ruby/object:Gem::Version
|
52
|
+
version: '1.3'
|
53
|
+
- - ">="
|
54
|
+
- !ruby/object:Gem::Version
|
55
|
+
version: 1.3.29
|
56
|
+
- !ruby/object:Gem::Dependency
|
57
|
+
name: gpd-request
|
58
|
+
requirement: !ruby/object:Gem::Requirement
|
59
|
+
requirements:
|
60
|
+
- - "~>"
|
61
|
+
- !ruby/object:Gem::Version
|
62
|
+
version: '0.2'
|
63
|
+
- - ">="
|
64
|
+
- !ruby/object:Gem::Version
|
65
|
+
version: 0.2.6
|
66
|
+
type: :runtime
|
67
|
+
prerelease: false
|
68
|
+
version_requirements: !ruby/object:Gem::Requirement
|
69
|
+
requirements:
|
70
|
+
- - "~>"
|
71
|
+
- !ruby/object:Gem::Version
|
72
|
+
version: '0.2'
|
73
|
+
- - ">="
|
74
|
+
- !ruby/object:Gem::Version
|
75
|
+
version: 0.2.6
|
76
|
+
description:
|
77
|
+
email: james@r0bertson.co.uk
|
78
|
+
executables: []
|
79
|
+
extensions: []
|
80
|
+
extra_rdoc_files: []
|
81
|
+
files:
|
82
|
+
- lib/remote_dwsregistry.rb
|
83
|
+
homepage: https://github.com/jrobertson/remote_dwsregistry
|
84
|
+
licenses:
|
85
|
+
- MIT
|
86
|
+
metadata: {}
|
87
|
+
post_install_message:
|
88
|
+
rdoc_options: []
|
89
|
+
require_paths:
|
90
|
+
- lib
|
91
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
92
|
+
requirements:
|
93
|
+
- - ">="
|
94
|
+
- !ruby/object:Gem::Version
|
95
|
+
version: '0'
|
96
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
97
|
+
requirements:
|
98
|
+
- - ">="
|
99
|
+
- !ruby/object:Gem::Version
|
100
|
+
version: '0'
|
101
|
+
requirements: []
|
102
|
+
rubyforge_project:
|
103
|
+
rubygems_version: 2.4.8
|
104
|
+
signing_key:
|
105
|
+
specification_version: 4
|
106
|
+
summary: Used in conjunction with the rack_dwsregistry gem to remotely get and set
|
107
|
+
keys from the XML based registry.
|
108
|
+
test_files: []
|
metadata.gz.sig
ADDED
Binary file
|