shul 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (6) hide show
  1. checksums.yaml +7 -0
  2. checksums.yaml.gz.sig +1 -0
  3. data.tar.gz.sig +0 -0
  4. data/lib/shul.rb +57 -0
  5. metadata +107 -0
  6. metadata.gz.sig +0 -0
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 208f7e75dab24cdac5a5264ded861c5e4f9c80f1
4
+ data.tar.gz: 9dfa43f97dbb76204ca05b8c42daa3deca472589
5
+ SHA512:
6
+ metadata.gz: 963aefc64948bb05146bce3534fac95e5ae9d58dcd15198f7c1e815e021c72d8d6173dd31d7f26628713c9455187596a763ec5e7e95ba8a0a45de9eabbbd58a9
7
+ data.tar.gz: 5ba5d7ffd9ab838e7f369f7b7c94b5bed9485b18c900bf7ef22fc9744a17fbadd67d9d0e476497a376f5d6be49383b5bba0ecc50d01c9becd0ddc00fbe545eaf
@@ -0,0 +1 @@
1
+ +�f�nM����0G�p���4,��Si.�
Binary file
@@ -0,0 +1,57 @@
1
+
2
+ # author: James Robertson
3
+ # license: MIT
4
+ # summary: Shoes + XUL = SHUL
5
+
6
+ # -----------------------------------------------------------------
7
+ #
8
+ # This code is designed to be executed from a Shoes app
9
+ # e.g.
10
+ #
11
+ =begin
12
+
13
+ xml =<<XML
14
+ <app>
15
+ <button id="yes1" label="Yes" oncommand="alert 'hello world'"/>
16
+ </app>
17
+ XML
18
+
19
+ Shoes.app {Shul.new self, xml}
20
+
21
+ =end
22
+
23
+ # resources:
24
+ # https://en.wikipedia.org/wiki/Shoes_%28GUI_toolkit%29
25
+ # https://developer.mozilla.org/en-US/docs/Mozilla/Tech/XUL
26
+ #
27
+ #------------------------------------------------------------------
28
+
29
+ require 'rexle'
30
+ require 'rxfhelper'
31
+
32
+
33
+ class Shul
34
+
35
+ def initialize(shoes, source)
36
+
37
+ @shoes = shoes
38
+ xml, _ = RXFHelper.read(source)
39
+ doc = Rexle.new(xml)
40
+
41
+ doc.root.traverse do |x|
42
+ method(x.name.to_sym).call(x.attributes)
43
+ end
44
+ end
45
+
46
+ def button(h)
47
+
48
+ label = h[:label]
49
+ command = h[:oncommand]
50
+
51
+ @shoes.button 'label' do
52
+ eval command if command
53
+ end
54
+
55
+ end
56
+
57
+ end
metadata ADDED
@@ -0,0 +1,107 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: shul
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
+ 8ixkARkWAmV1MB4XDTE1MDEwNTEyNTgwMFoXDTE2MDEwNTEyNTgwMFowSDESMBAG
16
+ A1UEAwwJZ2VtbWFzdGVyMR4wHAYKCZImiZPyLGQBGRYOamFtZXNyb2JlcnRzb24x
17
+ EjAQBgoJkiaJk/IsZAEZFgJldTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoC
18
+ ggEBAPFK8PZMEtiKKXBCVXCCkfB7ynzuFVoi6LhYkpVYf+c8ClTe9GxO1tkWU580
19
+ pop+gwUeG2H4CLATMY/KvjpQ4HYp6d98Ch1UYkWaK1kaCadm9FZnaR/Up5ds1srN
20
+ jN3B1M2OduA8v49EDUnz2osxlkcY/BhBNNzNFTDLcm4EMgpgT5Sy55xx7SYuZXGy
21
+ 3114f9qD4lIFKe5//520cz2BBERVB7lO+N2IHPNEMRVREv4kVHGqxwcY+E0nL2V9
22
+ U1tUpEJBOUHjQ1XOTTk21r9QGRwSO4SYONfZkITCcj4DaBSFrvCRcEyr5UTzb7L+
23
+ 0RlH5FBK0ZA66bEF7AtNYm6z1EcCAwEAAaOBijCBhzAJBgNVHRMEAjAAMAsGA1Ud
24
+ DwQEAwIEsDAdBgNVHQ4EFgQUe5bHePCK4ydOvO0d9q5oig0POA8wJgYDVR0RBB8w
25
+ HYEbZ2VtbWFzdGVyQGphbWVzcm9iZXJ0c29uLmV1MCYGA1UdEgQfMB2BG2dlbW1h
26
+ c3RlckBqYW1lc3JvYmVydHNvbi5ldTANBgkqhkiG9w0BAQUFAAOCAQEAQfG2EjcE
27
+ 5dYHdouEW2kc3Gn7+6nw0gZOdrDdSCf8RnqwX2wLA/EFq5Q485ustdYymQ8wU8mL
28
+ E9093fuukufDAX4DEWLQyJLmqc7rLw608Qo+AZLoqrOkH9IO4WaYRbLpj1edJACe
29
+ F178MCwHO2DPU5ZOVwOrH+Aa5J1oXd1/MmGm8VUhPMGxOsmcIfRyzxy55F/Hc0hv
30
+ zxp4c2CWFxMO8s8vxtj6ZNAMCZCxhccdswXwHhRYGhB1RcK5wgotzAh9CIArMVjR
31
+ CSB6YC7R4MuzLLfKDKuieOHOjOv/zR9wSroOCiiBFE5Fms858+Xl1JiDVBAr8XDi
32
+ vMjispBjplwPqA==
33
+ -----END CERTIFICATE-----
34
+ date: 2015-01-05 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.0'
43
+ - - ">="
44
+ - !ruby/object:Gem::Version
45
+ version: 1.0.39
46
+ type: :runtime
47
+ prerelease: false
48
+ version_requirements: !ruby/object:Gem::Requirement
49
+ requirements:
50
+ - - "~>"
51
+ - !ruby/object:Gem::Version
52
+ version: '1.0'
53
+ - - ">="
54
+ - !ruby/object:Gem::Version
55
+ version: 1.0.39
56
+ - !ruby/object:Gem::Dependency
57
+ name: rxfhelper
58
+ requirement: !ruby/object:Gem::Requirement
59
+ requirements:
60
+ - - "~>"
61
+ - !ruby/object:Gem::Version
62
+ version: '0.1'
63
+ - - ">="
64
+ - !ruby/object:Gem::Version
65
+ version: 0.1.13
66
+ type: :runtime
67
+ prerelease: false
68
+ version_requirements: !ruby/object:Gem::Requirement
69
+ requirements:
70
+ - - "~>"
71
+ - !ruby/object:Gem::Version
72
+ version: '0.1'
73
+ - - ">="
74
+ - !ruby/object:Gem::Version
75
+ version: 0.1.13
76
+ description:
77
+ email: james@r0bertson.co.uk
78
+ executables: []
79
+ extensions: []
80
+ extra_rdoc_files: []
81
+ files:
82
+ - lib/shul.rb
83
+ homepage: https://github.com/jrobertson/shul
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: Shoes + XUL = SHUL
107
+ test_files: []
Binary file