html-to-css 0.1.4 → 0.1.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- checksums.yaml.gz.sig +3 -3
- data.tar.gz.sig +0 -0
- data/lib/html-to-css.rb +8 -3
- metadata +2 -2
- metadata.gz.sig +2 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5c92c0200e7312d8c99fc2526c4a6193c46fc0a9
|
4
|
+
data.tar.gz: 17138098f5955529a8ffb38e0394588462974baa
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7b76982fb7b99e4a593c9dc5adb0aacf0176169e8210048ca0987e0fc296b57d16621064ca62a866a0ae0f37e5cd4638ebb90554cf02b95238ae80968571fdb3
|
7
|
+
data.tar.gz: cea7491cb0a501326aada04427f88b4d3619b7b4d10e01a013aa6476c46c9bcc4bdd4e70cc17eb653ae52be46a5372d0ccd39d9a00bd7cf9c5d4c086661d6909
|
checksums.yaml.gz.sig
CHANGED
@@ -1,3 +1,3 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
��
|
1
|
+
3�n�@�T�JZ�U5�b�S�bJ�����h�&�2�lw�ɹ�O:D�57��"Z�ZD�ɱ�$�GM۠��L��b���?Ch�0����xr���r��:�I�L�K��+&�TII�>�
|
2
|
+
e���$�#�����,�<��2�
|
3
|
+
���Fv%j{"]��n��>V#����a;�(c�M�����bD��uмM�z�]�>_j/���C���ц��-4҅�&�
|
data.tar.gz.sig
CHANGED
Binary file
|
data/lib/html-to-css.rb
CHANGED
@@ -15,7 +15,11 @@ class HtmlToCss
|
|
15
15
|
|
16
16
|
attr_accessor :elements
|
17
17
|
|
18
|
-
def initialize(
|
18
|
+
def initialize(options={})
|
19
|
+
|
20
|
+
opt = {rand_color: true, filename: nil}.merge options
|
21
|
+
filename = opt[:filename]
|
22
|
+
@rand_color = opt[:rand_color]
|
19
23
|
|
20
24
|
if filename then
|
21
25
|
|
@@ -130,7 +134,8 @@ class HtmlToCss
|
|
130
134
|
@selectors << selector
|
131
135
|
|
132
136
|
if @elements.has_key?(e.name.to_sym) then
|
133
|
-
|
137
|
+
c = @rand_color ? "%06x" % (rand * 0xffffff) : 'a5f'
|
138
|
+
attributes = @elements[e.name.to_sym].strip.sub(':color','#' + c).to_h
|
134
139
|
else
|
135
140
|
attributes = {}
|
136
141
|
end
|
@@ -184,4 +189,4 @@ end
|
|
184
189
|
|
185
190
|
if __FILE__ == $0 then
|
186
191
|
css = HtmlToCss.new('index.html').to_css
|
187
|
-
end
|
192
|
+
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: html-to-css
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- James Robertson
|
@@ -31,7 +31,7 @@ cert_chain:
|
|
31
31
|
n9X5YRMwlJkR8AjTM6rhQpKsbN0jqpzYjglj02VuBO/YASqBM1gV6sKxMtAbdYam
|
32
32
|
6yGZgJtO0psElQ==
|
33
33
|
-----END CERTIFICATE-----
|
34
|
-
date: 2013-10-
|
34
|
+
date: 2013-10-11 00:00:00.000000000 Z
|
35
35
|
dependencies:
|
36
36
|
- !ruby/object:Gem::Dependency
|
37
37
|
name: rexle
|
metadata.gz.sig
CHANGED
@@ -1,3 +1,2 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
�k=�e�C��A0c����*8x���n�TDX�`�_ڰ�
|
1
|
+
x�d��X�j2�V/G��;.ct�ɭkK�i�_�SM���Ξ�99�$��rv`OS�M���^4�S���mc���9"�7t5
|
2
|
+
�O?w*
|