htmle 0.1.0 → 0.1.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: d980bce6ca9cfce03ebe3a62efc74707be06eded
4
- data.tar.gz: 1d042f9270d9dbfc620191a2fd4d5a1fc8f06f7f
3
+ metadata.gz: ceb65888a6f70db63a990e4f1a0149d2e339b9b6
4
+ data.tar.gz: 5fa58616d7ae8c0a027c4a4d396edc90cdac2e12
5
5
  SHA512:
6
- metadata.gz: 6e0db1fb74c1db9343b146412658e3c5350b61178ea858683f43eb321fdb96b80a4667e7bf7b0787b9cc4fe28e990f0c686239b18373ac5f2fbadde07ffef8e1
7
- data.tar.gz: f4b439ae1acbf42de6056d38094582a37db81fdfa61a4720cea0fe4f175169b3091e5067fdb670208047a2035c3d4e143fc322b5304bbe7a2d6d40086c538b09
6
+ metadata.gz: f669cf0bb68f5371eb573014f3b9aed5e6ad3f43492b70a6409a6120af7cb581f43860b91e56b411b77989459c98f83121cc69e8d069761ecf06d1b80dc56989
7
+ data.tar.gz: d645bf0f8c0b71600cbc59aaddcfe43f57cea5793c6ab10e948cab88fac1834f623b4fddbeb49ba3d368da6bb0003d7e566dff9ef42553a72b2b5e827bb31bfb
checksums.yaml.gz.sig CHANGED
Binary file
data.tar.gz.sig CHANGED
Binary file
data/lib/htmle.rb CHANGED
@@ -6,9 +6,12 @@ require 'svgle'
6
6
 
7
7
 
8
8
 
9
- DEFAULT_CSS = <<CSS
10
-
11
- html {background-color: white}
9
+ DEFAULT_HTML_CSS = <<CSS
10
+ * {
11
+ margin: 5 5; padding: 10 10;
12
+ font-size: 16; color: red;
13
+ }
14
+ html {background-color: white;}
12
15
  div {background-color: green; padding: 30 10; margin: 5 5;}
13
16
 
14
17
  CSS
@@ -16,7 +19,7 @@ CSS
16
19
  class Htmle < Domle
17
20
 
18
21
  class Box < Element
19
- attr2_accessor *%i(class width height)
22
+ attr2_accessor *%i(class width height background-color)
20
23
  end
21
24
 
22
25
  class Html < Box
@@ -33,29 +36,11 @@ class Htmle < Domle
33
36
 
34
37
  private
35
38
 
36
- def fetch_style(attribute)
37
-
38
- h = super attribute
39
-
40
- %i(margin padding).each do |x|
41
-
42
- if h.has_key? x then
43
-
44
- a = expand_shorthand(h[x])
45
- h[x] = ([(sym.to_s + '-')] * 4).zip.%w(top right bottom left).zip(a)
46
-
47
- end
48
-
49
- end
50
-
51
-
52
- end
53
39
 
54
40
  def find_add_css()
55
41
 
56
42
  # add the default CSS
57
- add_css DEFAULT_CSS
58
-
43
+ add_css DEFAULT_HTML_CSS
59
44
 
60
45
  @doc.root.xpath('//style').each {|e| add_css e.text }
61
46
 
@@ -76,4 +61,4 @@ class Htmle < Domle
76
61
  }
77
62
  end
78
63
 
79
- end
64
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: htmle
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - James Robertson
metadata.gz.sig CHANGED
Binary file