ruhl 0.10.1 → 0.11.0

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.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.10.1
1
+ 0.11.0
@@ -186,12 +186,14 @@ module Ruhl
186
186
  if code == '_render_'
187
187
  _render_
188
188
  else
189
- if block_object && block_object.respond_to?(code)
190
- block_object.send(code)
191
- elsif local_object && local_object.respond_to?(code)
192
- local_object.send(code)
189
+ args = code.strip.split(' ')
190
+
191
+ if block_object.respond_to?(code)
192
+ block_object.send(*args)
193
+ elsif local_object.respond_to?(code)
194
+ local_object.send(*args)
193
195
  else
194
- scope.send(code)
196
+ scope.send(*args)
195
197
  end
196
198
  end
197
199
  rescue NoMethodError => e
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{ruhl}
8
- s.version = "0.10.1"
8
+ s.version = "0.11.0"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Andrew Stone"]
12
- s.date = %q{2009-10-25}
12
+ s.date = %q{2009-10-26}
13
13
  s.description = %q{Make your HTML dynamic with the addition of a data-ruhl attribute.}
14
14
  s.email = %q{andy@stonean.com}
15
15
  s.extra_rdoc_files = [
@@ -38,6 +38,7 @@ Gem::Specification.new do |s|
38
38
  "spec/html/main_with_form.html",
39
39
  "spec/html/main_with_sidebar.html",
40
40
  "spec/html/medium.html",
41
+ "spec/html/parameters.html",
41
42
  "spec/html/seo.html",
42
43
  "spec/html/sidebar.html",
43
44
  "spec/html/use.html",
@@ -0,0 +1,22 @@
1
+ <html>
2
+ <head>
3
+ <title>This is a title template</title>
4
+ </head>
5
+ <body>
6
+ <div id="wrap">
7
+ <div id="sidebar" data-ruhl="_partial: partial sidebar">
8
+ <h3>Sidebar links</h3>
9
+ <ul>
10
+ <li><a href="#">Link 1</a></li>
11
+ <li><a href="#">Link 2</a></li>
12
+ <li><a href="#">Link 3</a></li>
13
+ <li><a href="#">Link 4</a></li>
14
+ </ul>
15
+ </div>
16
+ <div id="main">
17
+ <h1> My main content</h1>
18
+ <p>Text designers would put here to test their layout</p>
19
+ </div>
20
+ </div>
21
+ </body>
22
+ </html>
@@ -67,11 +67,7 @@ describe Ruhl do
67
67
  end
68
68
  end
69
69
 
70
- describe "main_with_sidebar.html" do
71
- before do
72
- @html = File.read html(:main_with_sidebar)
73
- end
74
-
70
+ shared_examples_for "having sidebar" do
75
71
  it "should replace sidebar with partial contents" do
76
72
  doc = create_doc
77
73
  doc.xpath('/html/body/div/div/div//h3')[0].inner_html.
@@ -82,6 +78,22 @@ describe Ruhl do
82
78
  end
83
79
  end
84
80
 
81
+ describe "main_with_sidebar.html" do
82
+ before do
83
+ @html = File.read html(:main_with_sidebar)
84
+ end
85
+
86
+ it_should_behave_like "having sidebar"
87
+ end
88
+
89
+ describe "parameters.html" do
90
+ before do
91
+ @html = File.read html(:parameters)
92
+ end
93
+
94
+ it_should_behave_like "having sidebar"
95
+ end
96
+
85
97
  shared_examples_for "if with no users" do
86
98
  it "table should not render" do
87
99
  nodes = @doc.xpath('/html/body//*')
@@ -61,6 +61,10 @@ class ContextObject
61
61
  "hello from my content."
62
62
  end
63
63
 
64
+ def partial(name)
65
+ html(name.to_sym)
66
+ end
67
+
64
68
  def sidebar_partial
65
69
  html(:sidebar)
66
70
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ruhl
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.10.1
4
+ version: 0.11.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andrew Stone
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2009-10-25 00:00:00 -04:00
12
+ date: 2009-10-26 00:00:00 -04:00
13
13
  default_executable:
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
@@ -63,6 +63,7 @@ files:
63
63
  - spec/html/main_with_form.html
64
64
  - spec/html/main_with_sidebar.html
65
65
  - spec/html/medium.html
66
+ - spec/html/parameters.html
66
67
  - spec/html/seo.html
67
68
  - spec/html/sidebar.html
68
69
  - spec/html/use.html