dominate 0.5.1 → 0.5.2

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: 2f827934d3184c2cc1f35c87e58d88db39edf2e8
4
- data.tar.gz: af80a4305e74ea566d54664d02a1705926ee7f0e
3
+ metadata.gz: eb406d2542020af78ec7fa5410828484f54663ae
4
+ data.tar.gz: e1931bd044daecb7c27bd0f48a573eaa1503c86b
5
5
  SHA512:
6
- metadata.gz: b46ec998b0d5de702de69f7030016f80fe397504ed9de5fe625c61fade72c92e7357ff04468471e9411d2775325dae42867a9ba86de11f41bc12d40bd7673673
7
- data.tar.gz: 2a7be692f926464b9294d2490a504f5c2dfad374d847a3045ffb409a5e515696c96510cb16e95f4ffff139875ce75e6e29f6ba1cd336a698198721e06eb58d26
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
- html = HTML.load config.layout, config, instance
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
@@ -1,3 +1,3 @@
1
1
  module Dominate
2
- VERSION = "0.5.1"
2
+ VERSION = "0.5.2"
3
3
  end
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 = {}
@@ -6,7 +6,7 @@ setup do
6
6
  Dominate.reset_config!
7
7
  Dominate.setup do |c|
8
8
  c.view_path = './test/dummy'
9
- c.layout = "#{c.view_path}/app"
9
+ c.layout = "app"
10
10
  end
11
11
 
12
12
  inline_html = File.read './test/dummy/index.html'
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.1
4
+ version: 0.5.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - cj