dominate 0.6.2 → 0.6.3
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/lib/dominate/html.rb +2 -2
- data/lib/dominate/inflectors.rb +2 -0
- data/lib/dominate/version.rb +1 -1
- data/lib/dominate/widget/helper.rb +8 -5
- data/lib/dominate/widget.rb +16 -10
- 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: d7f63715cf73f28c3124306141fd51b42132e15a
|
4
|
+
data.tar.gz: 7458532248d77685e6c936d27690e78140e6064f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: dc51e52664773dc29afd1f434762bb1e9dc1bbd5feb86d50b5fdea4a93b2c82ce1e117cf0f7e62b9be56b20ffda805fce77dff4a466e71b8d73e6f726b9ee292
|
7
|
+
data.tar.gz: b9f652270fa9cc1bb9b574fb7767f00cbfda9808a65723d8ecae4f9d981404bed64aa24286b468e45ab55ab4433bb3f85fed9a911fa551b3972fd949ce9fe95c
|
data/lib/dominate/html.rb
CHANGED
@@ -19,7 +19,7 @@ module Dominate
|
|
19
19
|
dom
|
20
20
|
end
|
21
21
|
|
22
|
-
def load_file path,
|
22
|
+
def load_file path, c, instance
|
23
23
|
html = _cache.fetch(path) {
|
24
24
|
template = false
|
25
25
|
|
@@ -38,7 +38,7 @@ module Dominate
|
|
38
38
|
end
|
39
39
|
|
40
40
|
template
|
41
|
-
}.render instance,
|
41
|
+
}.render instance, c.to_h
|
42
42
|
|
43
43
|
html
|
44
44
|
end
|
data/lib/dominate/inflectors.rb
CHANGED
@@ -34,9 +34,11 @@ class DeepOpenStruct < OpenStruct
|
|
34
34
|
|
35
35
|
if v.is_a? Array
|
36
36
|
@table[k.to_sym] ||= []
|
37
|
+
@hash_table[k.to_sym] ||= []
|
37
38
|
|
38
39
|
v.each { | entry |
|
39
40
|
@table[k.to_sym] << entry
|
41
|
+
@hash_table[k.to_sym] << entry
|
40
42
|
}
|
41
43
|
else
|
42
44
|
@table[k.to_sym] = (v.is_a?(Hash) ? self.class.new(v) : v)
|
data/lib/dominate/version.rb
CHANGED
@@ -44,11 +44,14 @@ module Dominate
|
|
44
44
|
resp = widget.send state
|
45
45
|
end
|
46
46
|
|
47
|
-
if resp.is_a? Dominate::Dom
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
47
|
+
# if resp.is_a? Dominate::Dom
|
48
|
+
# html = "<div id='#{widget.id_for(state)}'>#{resp.html}</div>"
|
49
|
+
# resp.reset_html
|
50
|
+
# resp.doc.inner_html = html
|
51
|
+
# resp.html
|
52
|
+
if resp.is_a? String
|
53
|
+
html = "<div id='#{widget.id_for(state)}'>#{resp}</div>"
|
54
|
+
html
|
52
55
|
else
|
53
56
|
resp
|
54
57
|
end
|
data/lib/dominate/widget.rb
CHANGED
@@ -60,11 +60,14 @@ module Dominate
|
|
60
60
|
resp = send(state)
|
61
61
|
end
|
62
62
|
|
63
|
-
if resp.is_a? Dominate::Dom
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
63
|
+
# if resp.is_a? Dominate::Dom
|
64
|
+
# html = "<div id='#{id_for(state)}'>#{resp.html}</div>"
|
65
|
+
# resp.doc.inner_html = html
|
66
|
+
# resp.reset_html
|
67
|
+
# resp.html
|
68
|
+
if resp.is_a? String
|
69
|
+
html = "<div id='#{id_for(state)}'>#{resp}</div>"
|
70
|
+
html
|
68
71
|
else
|
69
72
|
resp
|
70
73
|
end
|
@@ -132,11 +135,14 @@ module Dominate
|
|
132
135
|
resp = send(e)
|
133
136
|
end
|
134
137
|
|
135
|
-
if resp.is_a? Dominate::Dom
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
138
|
+
# if resp.is_a? Dominate::Dom
|
139
|
+
# html = "<div id='#{id_for(e)}'>#{resp.html}</div>"
|
140
|
+
# resp.doc.inner_html = html
|
141
|
+
# resp.reset_html
|
142
|
+
# res.write resp.html
|
143
|
+
if resp.is_a? String
|
144
|
+
html = "<div id='#{id_for(e)}'>#{html}</div>"
|
145
|
+
res.write html
|
140
146
|
else
|
141
147
|
resp
|
142
148
|
end
|