xmlregistry_objects 0.1.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 ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 617c355f443a3804be6220e2c8b1c4ff56d147c7
4
+ data.tar.gz: 3da106e336c6ded540a4981e30e433f8d81620bd
5
+ SHA512:
6
+ metadata.gz: d435d116cd01d0c2bcd8a727ae1492cc65ee1edba84aa08c5f66621ae88b3a013fa2e3e802d59e3280ce6ef7d9defdd4aabb952ca821f222fde583b78f6af2c9
7
+ data.tar.gz: c77b0b61f217e138fec81a32011eb8e94c0cd3a7c01e7fac9823add60f4567d51d94caebbe8a8a189647dc725c1b7c395b0083891cb3b63aa4c703e99ee99ae2
checksums.yaml.gz.sig ADDED
@@ -0,0 +1,2 @@
1
+ x~拠 t�%�k���%S/Wj�Snm�D�䧇Ju=A�� �W��ؿ��3��/҂޸8�}�(7E�pب��Z�����U���������J?@��%��Q�:�kw�� �;�k�HY}�E
2
+ �L`�7��er�u���.�� ��ǀaN�$�K!z(��/4�� �j���Ij�I ��P��E�Ɇ��f���E���Wߛͦ/5c�>�b߲k&w�E�
data.tar.gz.sig ADDED
@@ -0,0 +1,2 @@
1
+ 7�L�����B�ҩ�/d�q�}��k�3�&&�
2
+ �P� ��\��o�m����D��\��zF6�w�K���!>���B�w�5*)�\���� ���o��; ��U�o����4^c;��]� �P@��u#gC�]�|��2�@���f�p��կZI���'X[nB`�8�w�P���إì���â�R)��b����9PL��B���5R��Tg
@@ -0,0 +1,67 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ # file: xmlregistry_objects.rb
4
+
5
+
6
+ require 'lineparser'
7
+ require 'xml-registry'
8
+
9
+
10
+ class XMLRegistryObjects
11
+
12
+
13
+ attr_reader :to_h
14
+
15
+
16
+ def initialize(reg, list)
17
+
18
+
19
+ patterns = [
20
+ [:root, /(\w+)\s+=\s+\[([^\]]+)\]/, :object],
21
+ [:object, /([\w\?]+)\s+=\s+(.*)/, :attribute]
22
+ ]
23
+
24
+
25
+ lp = LineParser.new patterns
26
+ r = lp.parse list
27
+
28
+
29
+ @to_h = r.inject({}) do |rtn, row|
30
+
31
+ name, path = row[1][:captures]
32
+ class_name = name.capitalize
33
+ klass = Object.const_set(class_name,Class.new)
34
+
35
+
36
+ row[3].each do |attr|
37
+
38
+ attr_name, x = attr[1][:captures]
39
+
40
+ subkey, type = x.split(/\s/).reverse
41
+
42
+ s = "
43
+
44
+ def initialize(reg)
45
+
46
+ @reg = reg
47
+
48
+ end
49
+
50
+ def #{attr_name}
51
+
52
+ text = @reg.get_key('#{[path, attr_name].join('/')}/text()')
53
+ #{'text == %q(true) ? true : false' if type == 'Bool'}
54
+ end
55
+ "
56
+
57
+ klass.class_eval s
58
+
59
+ end
60
+
61
+ rtn.merge name.to_sym => klass.new(reg)
62
+
63
+ end
64
+
65
+ end
66
+
67
+ end
metadata ADDED
@@ -0,0 +1,109 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: xmlregistry_objects
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
+ 8ixkARkWAmV1MB4XDTE0MDgyMDE3MTAwMFoXDTE1MDgyMDE3MTAwMFowSDESMBAG
16
+ A1UEAwwJZ2VtbWFzdGVyMR4wHAYKCZImiZPyLGQBGRYOamFtZXNyb2JlcnRzb24x
17
+ EjAQBgoJkiaJk/IsZAEZFgJldTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoC
18
+ ggEBAMFQ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em::Dependency
37
+ name: xml-registry
38
+ requirement: !ruby/object:Gem::Requirement
39
+ requirements:
40
+ - - "~>"
41
+ - !ruby/object:Gem::Version
42
+ version: '0.2'
43
+ - - ">="
44
+ - !ruby/object:Gem::Version
45
+ version: 0.2.3
46
+ type: :runtime
47
+ prerelease: false
48
+ version_requirements: !ruby/object:Gem::Requirement
49
+ requirements:
50
+ - - "~>"
51
+ - !ruby/object:Gem::Version
52
+ version: '0.2'
53
+ - - ">="
54
+ - !ruby/object:Gem::Version
55
+ version: 0.2.3
56
+ - !ruby/object:Gem::Dependency
57
+ name: line-tree
58
+ requirement: !ruby/object:Gem::Requirement
59
+ requirements:
60
+ - - "~>"
61
+ - !ruby/object:Gem::Version
62
+ version: '0.3'
63
+ - - ">="
64
+ - !ruby/object:Gem::Version
65
+ version: 0.3.17
66
+ type: :runtime
67
+ prerelease: false
68
+ version_requirements: !ruby/object:Gem::Requirement
69
+ requirements:
70
+ - - "~>"
71
+ - !ruby/object:Gem::Version
72
+ version: '0.3'
73
+ - - ">="
74
+ - !ruby/object:Gem::Version
75
+ version: 0.3.17
76
+ description:
77
+ email: james@r0bertson.co.uk
78
+ executables: []
79
+ extensions: []
80
+ extra_rdoc_files: []
81
+ files:
82
+ - lib/xmlregistry_objects.rb
83
+ homepage: https://github.com/jrobertson/xmlregistry_objects
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.2.2
104
+ signing_key:
105
+ specification_version: 4
106
+ summary: Query the registry using objects built dynamically from a string which maps
107
+ each object to a registry key.
108
+ test_files: []
109
+ has_rdoc:
metadata.gz.sig ADDED
Binary file