ruhl 0.11.0 → 0.11.1

Sign up to get free protection for your applications and to get access to all the features.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.11.0
1
+ 0.11.1
data/lib/ruhl/engine.rb CHANGED
@@ -186,7 +186,7 @@ module Ruhl
186
186
  if code == '_render_'
187
187
  _render_
188
188
  else
189
- args = code.strip.split(' ')
189
+ args = code.strip.split('|').collect{|p| p.strip}
190
190
 
191
191
  if block_object.respond_to?(code)
192
192
  block_object.send(*args)
data/ruhl.gemspec CHANGED
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{ruhl}
8
- s.version = "0.11.0"
8
+ s.version = "0.11.1"
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-26}
12
+ s.date = %q{2009-10-27}
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 = [
@@ -4,7 +4,7 @@
4
4
  </head>
5
5
  <body>
6
6
  <div id="wrap">
7
- <div id="sidebar" data-ruhl="_partial: partial sidebar">
7
+ <div id="sidebar" data-ruhl="_partial: partial|sidebar">
8
8
  <h3>Sidebar links</h3>
9
9
  <ul>
10
10
  <li><a href="#">Link 1</a></li>
@@ -14,7 +14,7 @@
14
14
  </ul>
15
15
  </div>
16
16
  <div id="main">
17
- <h1> My main content</h1>
17
+ <h1 data-ruhl="page_title|Home page">My main content</h1>
18
18
  <p>Text designers would put here to test their layout</p>
19
19
  </div>
20
20
  </div>
data/spec/ruhl_spec.rb CHANGED
@@ -69,11 +69,10 @@ describe Ruhl do
69
69
 
70
70
  shared_examples_for "having sidebar" do
71
71
  it "should replace sidebar with partial contents" do
72
- doc = create_doc
73
- doc.xpath('/html/body/div/div/div//h3')[0].inner_html.
72
+ @doc.xpath('/html/body/div/div/div//h3')[0].inner_html.
74
73
  should == "Real Sidebarlinks"
75
74
 
76
- doc.xpath('/html/body/div/div/div/ul/li//a')[0].inner_html.
75
+ @doc.xpath('/html/body/div/div/div/ul/li//a')[0].inner_html.
77
76
  should == "Real Link 1"
78
77
  end
79
78
  end
@@ -81,6 +80,7 @@ describe Ruhl do
81
80
  describe "main_with_sidebar.html" do
82
81
  before do
83
82
  @html = File.read html(:main_with_sidebar)
83
+ @doc = create_doc
84
84
  end
85
85
 
86
86
  it_should_behave_like "having sidebar"
@@ -89,9 +89,15 @@ describe Ruhl do
89
89
  describe "parameters.html" do
90
90
  before do
91
91
  @html = File.read html(:parameters)
92
+ @doc = create_doc
92
93
  end
93
94
 
94
95
  it_should_behave_like "having sidebar"
96
+
97
+ it "should update the h1" do
98
+ puts @doc.xpath("//div[@id='main']").first.children[1].
99
+ inner_html.should == "Welcome to the Home page"
100
+ end
95
101
  end
96
102
 
97
103
  shared_examples_for "if with no users" do
data/spec/spec_helper.rb CHANGED
@@ -65,6 +65,10 @@ class ContextObject
65
65
  html(name.to_sym)
66
66
  end
67
67
 
68
+ def page_title(page)
69
+ "Welcome to the #{page}"
70
+ end
71
+
68
72
  def sidebar_partial
69
73
  html(:sidebar)
70
74
  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.11.0
4
+ version: 0.11.1
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-26 00:00:00 -04:00
12
+ date: 2009-10-27 00:00:00 -04:00
13
13
  default_executable:
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency