shul 0.4.0 → 0.4.1
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 +4 -4
- checksums.yaml.gz.sig +3 -2
- data.tar.gz.sig +0 -0
- data/lib/shul.rb +24 -16
- metadata +2 -22
- 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: 766fa69c042ef007c10d67ba207b3974c74c0ad4
|
4
|
+
data.tar.gz: 73ff83befba7784543a13e2faf9e812fbf6c5126
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 502e3a4c174f3bb3de66c370524966772df13e070ace02897035e9a550dd617d6c5d4c633291bd387eb60db54df5cc5d06bc6877de503afc39b9321a9dd2a050
|
7
|
+
data.tar.gz: c2b7a8f1c3f1858f9d56cce010109345ff0b69abaa4d2dd47354c1ffe987e56dd374de725612a70079ffab8d757a15dff0b9cb331e5fb6535af670af7b7f2ffc
|
checksums.yaml.gz.sig
CHANGED
@@ -1,2 +1,2 @@
|
|
1
|
-
|
1
|
+
PQ*�g�\�����+s$�FR贡�K�9��Oz;��G��q
|
2
|
-
|
2
|
+
�pCG����:[�Ig�g�5f�%l�'Œ��Gm�a�Qcm�+"s��vG��%��ۃ�{�����y}�.� ʥe�?��%Ɇn�D/��o�H\
|
3
|
+
���Zp"�W�ˇ�:������&g�RX��8�@��+�@�6��W�jƘՖф���hI+I
|
data.tar.gz.sig
CHANGED
Binary file
|
data/lib/shul.rb
CHANGED
@@ -11,6 +11,7 @@
|
|
11
11
|
#
|
12
12
|
=begin
|
13
13
|
require 'shul'
|
14
|
+
require 'green_shoes'
|
14
15
|
|
15
16
|
xml =<<XML
|
16
17
|
<app title="Hello World" width='500' height='200'>
|
@@ -18,8 +19,8 @@ xml =<<XML
|
|
18
19
|
</app>
|
19
20
|
XML
|
20
21
|
|
21
|
-
|
22
|
-
Shul::Main.new Shoes,
|
22
|
+
doc = Shul::Shule.new xml
|
23
|
+
Shul::Main.new Shoes, doc
|
23
24
|
|
24
25
|
=end
|
25
26
|
|
@@ -40,6 +41,7 @@ Shul::Main.new Shoes, xml
|
|
40
41
|
|
41
42
|
# modifications
|
42
43
|
#
|
44
|
+
# 22-May-2017: feature: The font size for a label can now be set
|
43
45
|
# 21-May-2017: Added a Document Object Model (DOM) class called Shule
|
44
46
|
# 23-Jan-2017: A Vbox or Hbox width can now be set
|
45
47
|
# 13-Jan-2017: The script tag is now executed only after the
|
@@ -59,17 +61,8 @@ Shul::Main.new Shoes, xml
|
|
59
61
|
# * tested using the green_shoes gem.
|
60
62
|
|
61
63
|
require 'domle'
|
62
|
-
require 'rxfhelper'
|
63
|
-
|
64
64
|
|
65
|
-
module RexleObject
|
66
|
-
refine Rexle::Element do
|
67
65
|
|
68
|
-
def obj() @obj end
|
69
|
-
def obj=(obj) @obj = obj end
|
70
|
-
|
71
|
-
end
|
72
|
-
end
|
73
66
|
|
74
67
|
DEFAULT_SHUL_CSS = <<CSS
|
75
68
|
|
@@ -143,7 +136,7 @@ module Shul
|
|
143
136
|
|
144
137
|
def initialize(shoes, source)
|
145
138
|
|
146
|
-
if source.is_a?
|
139
|
+
if source.is_a? Shule then
|
147
140
|
|
148
141
|
doc = source
|
149
142
|
|
@@ -151,10 +144,8 @@ module Shul
|
|
151
144
|
|
152
145
|
xml, type = RXFHelper.read(source)
|
153
146
|
# is the first line an XML processing instruction?
|
154
|
-
|
147
|
+
|
155
148
|
doc = Shule.new(xml)
|
156
|
-
#doc = Rexle.new(xml)
|
157
|
-
puts 'doc: ' + doc.xml.inspect
|
158
149
|
|
159
150
|
end
|
160
151
|
|
@@ -375,6 +366,13 @@ module Shul
|
|
375
366
|
flow = @shoes.flow h2 do
|
376
367
|
@shoes.background h[:bgcolor] if h[:bgcolor]
|
377
368
|
|
369
|
+
if e.text then
|
370
|
+
para_style = {}
|
371
|
+
|
372
|
+
para_style = {size: e.style[:'font-size'].to_f} if e.style[:'font-size']
|
373
|
+
@shoes.para e.text.strip, para_style
|
374
|
+
end
|
375
|
+
|
378
376
|
if e.style.has_key? :'background-color' then
|
379
377
|
@shoes.background e.style[:'background-color']
|
380
378
|
end
|
@@ -444,11 +442,13 @@ module Shul
|
|
444
442
|
h.merge!({width: e.attributes[:width]}) if e.attributes[:width]
|
445
443
|
h.merge!({margin: e.attributes[:margin].to_i}) if e.attributes[:margin]
|
446
444
|
h.merge!({stroke: e.attributes[:color]}) if e.attributes[:color]
|
445
|
+
h.merge!({size: e.style[:'font-size'].to_f}) if e.style[:'font-size']
|
447
446
|
|
448
447
|
# setting the para bgcolor doesn't work
|
449
448
|
#h.merge!({fill: e.attributes[:bgcolor]}) if e.attributes[:bgcolor]
|
450
449
|
|
451
|
-
e.obj = @shoes.para e.attributes[:value] , h
|
450
|
+
e.obj = @shoes.para e.attributes[:value] || e.text.strip , h
|
451
|
+
|
452
452
|
|
453
453
|
|
454
454
|
def e.value()
|
@@ -531,6 +531,13 @@ module Shul
|
|
531
531
|
h2.merge!({width: h[:width].to_i}) if h[:width]
|
532
532
|
|
533
533
|
stack = @shoes.stack h2 do
|
534
|
+
|
535
|
+
if e.text then
|
536
|
+
para_style = {}
|
537
|
+
|
538
|
+
para_style = {size: e.style[:'font-size'].to_f} if e.style[:'font-size']
|
539
|
+
@shoes.para e.text.strip, para_style
|
540
|
+
end
|
534
541
|
|
535
542
|
@shoes.background h[:bgcolor] if h[:bgcolor]
|
536
543
|
|
@@ -538,6 +545,7 @@ module Shul
|
|
538
545
|
@shoes.background e.style[:'background-color']
|
539
546
|
end
|
540
547
|
e.elements.each {|x| method(x.name.sub(':','_').to_sym).call(x) }
|
548
|
+
|
541
549
|
end
|
542
550
|
|
543
551
|
e.obj = stack
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: shul
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.4.
|
4
|
+
version: 0.4.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- James Robertson
|
@@ -31,7 +31,7 @@ cert_chain:
|
|
31
31
|
t8eGazfn6KO3ECwm0DI6ZG6K+/TPPHv8HXfONWq0oGmvwamHXWjcz3hCa5hZw0Vt
|
32
32
|
+vU993j3UFViMQ==
|
33
33
|
-----END CERTIFICATE-----
|
34
|
-
date: 2017-05-
|
34
|
+
date: 2017-05-22 00:00:00.000000000 Z
|
35
35
|
dependencies:
|
36
36
|
- !ruby/object:Gem::Dependency
|
37
37
|
name: domle
|
@@ -53,26 +53,6 @@ dependencies:
|
|
53
53
|
- - ">="
|
54
54
|
- !ruby/object:Gem::Version
|
55
55
|
version: 0.1.7
|
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.4'
|
63
|
-
- - ">="
|
64
|
-
- !ruby/object:Gem::Version
|
65
|
-
version: 0.4.2
|
66
|
-
type: :runtime
|
67
|
-
prerelease: false
|
68
|
-
version_requirements: !ruby/object:Gem::Requirement
|
69
|
-
requirements:
|
70
|
-
- - "~>"
|
71
|
-
- !ruby/object:Gem::Version
|
72
|
-
version: '0.4'
|
73
|
-
- - ">="
|
74
|
-
- !ruby/object:Gem::Version
|
75
|
-
version: 0.4.2
|
76
56
|
description:
|
77
57
|
email: james@jamesrobertson.eu
|
78
58
|
executables: []
|
metadata.gz.sig
CHANGED
Binary file
|