dominate 0.5.1 → 0.5.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/lib/dominate/dom.rb +2 -1
- data/lib/dominate/version.rb +1 -1
- data/lib/dominate.rb +10 -5
- data/test/dominate_test.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: eb406d2542020af78ec7fa5410828484f54663ae
|
4
|
+
data.tar.gz: e1931bd044daecb7c27bd0f48a573eaa1503c86b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3560002bf681a6f8e3dd19fccd84c04df20c9939669334066475fbb45e118698ffff7e74999db60fd63e6848d44ae61abb08176fe3d2313a033d3267143eafb6
|
7
|
+
data.tar.gz: 3961637f04483f8990e2320e333cc2eb7f7c4936e0914399821ee365bfa843b7bdaa335d85176d4f451cf15b6e82a940f45ea3ae65d2968de5603a154bc5641f
|
data/lib/dominate/dom.rb
CHANGED
@@ -37,7 +37,8 @@ module Dominate
|
|
37
37
|
end
|
38
38
|
|
39
39
|
def load_layout
|
40
|
-
|
40
|
+
path = "#{config.view_path}/#{config.layout}"
|
41
|
+
html = HTML.load path, config, instance
|
41
42
|
inner_html = doc.inner_html
|
42
43
|
set_doc html.gsub YIELD_REGEX, inner_html
|
43
44
|
end
|
data/lib/dominate/version.rb
CHANGED
data/lib/dominate.rb
CHANGED
@@ -3,14 +3,16 @@ require "nokogiri-styles"
|
|
3
3
|
require "tilt"
|
4
4
|
require "dominate/version"
|
5
5
|
require "dominate/inflectors"
|
6
|
-
require "dominate/instance"
|
7
|
-
require "dominate/html"
|
8
|
-
require "dominate/scope"
|
9
|
-
require "dominate/dom"
|
10
6
|
|
11
7
|
module Dominate
|
12
8
|
extend self
|
13
9
|
|
10
|
+
autoload :Instance, "dominate/instance"
|
11
|
+
autoload :HTML, "dominate/html"
|
12
|
+
autoload :Scope, "dominate/scope"
|
13
|
+
autoload :Dom, "dominate/dom"
|
14
|
+
|
15
|
+
|
14
16
|
attr_accessor :config, :reset_config
|
15
17
|
|
16
18
|
def setup
|
@@ -23,7 +25,10 @@ module Dominate
|
|
23
25
|
|
24
26
|
# Resets the configuration to the default (empty hash)
|
25
27
|
def reset_config!
|
26
|
-
@config = OpenStruct.new
|
28
|
+
@config = OpenStruct.new({
|
29
|
+
view_path: './views',
|
30
|
+
layout: 'app'
|
31
|
+
})
|
27
32
|
end
|
28
33
|
|
29
34
|
def HTML html, instance = false, options = {}
|
data/test/dominate_test.rb
CHANGED