dominate 0.5.0 → 0.5.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
- data/lib/dominate/dom.rb +3 -3
- data/lib/dominate/html.rb +3 -3
- data/lib/dominate/version.rb +1 -1
- 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: 2f827934d3184c2cc1f35c87e58d88db39edf2e8
|
4
|
+
data.tar.gz: af80a4305e74ea566d54664d02a1705926ee7f0e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b46ec998b0d5de702de69f7030016f80fe397504ed9de5fe625c61fade72c92e7357ff04468471e9411d2775325dae42867a9ba86de11f41bc12d40bd7673673
|
7
|
+
data.tar.gz: 2a7be692f926464b9294d2490a504f5c2dfad374d847a3045ffb409a5e515696c96510cb16e95f4ffff139875ce75e6e29f6ba1cd336a698198721e06eb58d26
|
data/lib/dominate/dom.rb
CHANGED
@@ -21,7 +21,7 @@ module Dominate
|
|
21
21
|
updated_html = doc.inner_html.gsub(PARTIAL_REGEX_WITHIN) do |m|
|
22
22
|
match = m.strip.match(PARTIAL_REGEX)
|
23
23
|
partial = match[1]
|
24
|
-
HTML.load "#{view_path}/#{partial}"
|
24
|
+
HTML.load "#{view_path}/#{partial}", config, instance
|
25
25
|
end
|
26
26
|
|
27
27
|
set_doc updated_html if updated_html
|
@@ -30,14 +30,14 @@ module Dominate
|
|
30
30
|
if match = e.to_html.strip.match(PARTIAL_REGEX)
|
31
31
|
partial = match[1]
|
32
32
|
e.swap Nokogiri::HTML.fragment(
|
33
|
-
HTML.load "#{view_path}/#{partial}"
|
33
|
+
HTML.load "#{view_path}/#{partial}", config, instance
|
34
34
|
)
|
35
35
|
end
|
36
36
|
end
|
37
37
|
end
|
38
38
|
|
39
39
|
def load_layout
|
40
|
-
html = HTML.load config.layout
|
40
|
+
html = HTML.load config.layout, config, instance
|
41
41
|
inner_html = doc.inner_html
|
42
42
|
set_doc html.gsub YIELD_REGEX, inner_html
|
43
43
|
end
|
data/lib/dominate/html.rb
CHANGED
@@ -7,7 +7,7 @@ module Dominate
|
|
7
7
|
def file file, instance = false, config = {}
|
8
8
|
c = (Dominate.config.to_h.merge config).to_deep_ostruct
|
9
9
|
path = "#{c.view_path}/#{file}"
|
10
|
-
html = load path
|
10
|
+
html = load path, c, instance
|
11
11
|
dom = Dom.new html, instance, config
|
12
12
|
|
13
13
|
if File.file? path + '.dom'
|
@@ -17,7 +17,7 @@ module Dominate
|
|
17
17
|
dom
|
18
18
|
end
|
19
19
|
|
20
|
-
def load path
|
20
|
+
def load path, config, instance
|
21
21
|
html = false
|
22
22
|
|
23
23
|
VIEW_TYPES.each do |type|
|
@@ -25,7 +25,7 @@ module Dominate
|
|
25
25
|
|
26
26
|
if File.file? file
|
27
27
|
template = Tilt.new file
|
28
|
-
html
|
28
|
+
html = template.render Instance.new(instance, config)
|
29
29
|
break
|
30
30
|
end
|
31
31
|
end
|
data/lib/dominate/version.rb
CHANGED