dominate 0.5.0 → 0.5.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: 5250f7b20a0370a8f8bbcc6f1c23567edfb01b49
4
- data.tar.gz: b20458793cbdcd7601e64b36f664cbdea55aed32
3
+ metadata.gz: 2f827934d3184c2cc1f35c87e58d88db39edf2e8
4
+ data.tar.gz: af80a4305e74ea566d54664d02a1705926ee7f0e
5
5
  SHA512:
6
- metadata.gz: daa9476cfb24b1b1b96a8868b847bb049e295e0f98c3a8325d5e099a041f5c94f7557880838f105c785debfe76d53b350c12644032fa3ca4a278307867c7a252
7
- data.tar.gz: b082ab2449e445033f1c31195b41352c025bb6abacda3624126ab583012dd3a79e9ae0a68521c12938d7067affe6c928f4f258c1ae70f000ed37ac0af68db40a
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 = template.render
28
+ html = template.render Instance.new(instance, config)
29
29
  break
30
30
  end
31
31
  end
@@ -1,3 +1,3 @@
1
1
  module Dominate
2
- VERSION = "0.5.0"
2
+ VERSION = "0.5.1"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dominate
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.0
4
+ version: 0.5.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - cj