www_app 2.0.1 → 2.0.2
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
- data/VERSION +1 -1
- data/lib/www_app.rb +4 -0
- data/lib/www_app/CSS.rb +5 -3
- data/specs/server-side/0030-style.rb +33 -12
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0b68703439f6af0d7c3b856f92d150e0f4fa667f
|
4
|
+
data.tar.gz: 973a336ae0fa58aef0150adf455bb1b645126726
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 820e2f0f4d93552d3d047fc9ea9a63df4301186a2a7778d33043f1caec7ed537ba90c1ac6feffbdc87b50d6c4abb241d174997652b10ba762d8c78ebe3d2ed16
|
7
|
+
data.tar.gz: cd154c9fba1e546a97b638f0619fe6d4d8618e621491a201fc854f3e565891f8d631fc3b8592c7c31367ffd52484bf349a89bc7294dac11f6d9a7f1e4f1dd241
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
2.0.
|
1
|
+
2.0.2
|
data/lib/www_app.rb
CHANGED
data/lib/www_app/CSS.rb
CHANGED
@@ -257,7 +257,7 @@ class WWW_App
|
|
257
257
|
# _link {
|
258
258
|
#
|
259
259
|
create :group
|
260
|
-
create :_
|
260
|
+
create :_, :closed! => true
|
261
261
|
|
262
262
|
when ancestor?(:groups) && @tag[:closed]
|
263
263
|
#
|
@@ -268,7 +268,7 @@ class WWW_App
|
|
268
268
|
# _link { ... }
|
269
269
|
#
|
270
270
|
create :group
|
271
|
-
create :_!
|
271
|
+
create :_!, :closed! => true
|
272
272
|
|
273
273
|
when (tag?(:_) || tag?(:_!)) && @tag[:pseudo]
|
274
274
|
# WHEN:
|
@@ -276,7 +276,7 @@ class WWW_App
|
|
276
276
|
# _link / _visited
|
277
277
|
tag_name = @tag[:tag_name]
|
278
278
|
go_up
|
279
|
-
create tag_name
|
279
|
+
create tag_name, :closed! => true
|
280
280
|
|
281
281
|
when @tag[:pseudo] && !@tag[:closed]
|
282
282
|
puts @tag
|
@@ -295,12 +295,14 @@ class WWW_App
|
|
295
295
|
def alter_css_property name, *args
|
296
296
|
if !@tag
|
297
297
|
self._
|
298
|
+
@tag[:closed!] = true
|
298
299
|
end
|
299
300
|
|
300
301
|
if tag?(:style)
|
301
302
|
create :group
|
302
303
|
create :_
|
303
304
|
go_up
|
305
|
+
@tag[:closed!] = true
|
304
306
|
end
|
305
307
|
|
306
308
|
@tag[:css] ||= {}
|
@@ -1,37 +1,37 @@
|
|
1
1
|
|
2
2
|
describe ":style block" do
|
3
3
|
|
4
|
-
|
4
|
+
%w[link visited hover].each { |name|
|
5
|
+
it "adds :#{name} pseudo-class" do
|
5
6
|
target :style, <<-EOF
|
6
|
-
|
7
|
+
a:#{name} {
|
7
8
|
color: #fff;
|
8
9
|
}
|
9
10
|
EOF
|
10
11
|
|
11
12
|
actual do
|
12
13
|
style {
|
13
|
-
|
14
|
+
a {
|
15
|
+
send("_#{name}".to_sym) { color '#fff' }
|
16
|
+
}
|
14
17
|
}
|
15
18
|
end
|
16
|
-
|
19
|
+
end # === it
|
20
|
+
}
|
17
21
|
|
18
|
-
|
19
|
-
it "adds :#{name} pseudo-class" do
|
22
|
+
it "does not render empty style classes: div { }" do
|
20
23
|
target :style, <<-EOF
|
21
|
-
a
|
24
|
+
div a {
|
22
25
|
color: #fff;
|
23
26
|
}
|
24
27
|
EOF
|
25
28
|
|
26
29
|
actual do
|
27
30
|
style {
|
28
|
-
a {
|
29
|
-
send("_#{name}".to_sym) { color '#fff' }
|
30
|
-
}
|
31
|
+
div { a { color '#fff' } }
|
31
32
|
}
|
32
33
|
end
|
33
|
-
|
34
|
-
}
|
34
|
+
end
|
35
35
|
|
36
36
|
it "the default selector is the parent of :style" do
|
37
37
|
target :style, <<-EOF
|
@@ -57,6 +57,27 @@ describe ":style block" do
|
|
57
57
|
}
|
58
58
|
end # === it
|
59
59
|
|
60
|
+
it "does not add elements on default selector" do
|
61
|
+
target :style, <<-EOF
|
62
|
+
body {
|
63
|
+
border: 1px solid #000;
|
64
|
+
}
|
65
|
+
|
66
|
+
a:link, a:visited {
|
67
|
+
color: #fff;
|
68
|
+
}
|
69
|
+
EOF
|
70
|
+
|
71
|
+
actual {
|
72
|
+
style {
|
73
|
+
border '1px solid #000'
|
74
|
+
a._link / a._visited {
|
75
|
+
color '#fff'
|
76
|
+
}
|
77
|
+
}
|
78
|
+
}
|
79
|
+
end # === it does not add elements on default selector
|
80
|
+
|
60
81
|
it "does not add anything to :body" do
|
61
82
|
target :body, <<-EOF
|
62
83
|
<p>empty</p>
|