renshi 0.2.1 → 0.2.2
Sign up to get free protection for your applications and to get access to all the features.
- data/README +2 -0
- data/lib/renshi/attribute_expressions/elsif.rb +1 -1
- data/lib/renshi.rb +1 -1
- data/spec/data/elsif2.ren +13 -0
- data/spec/elsif_spec.rb +11 -0
- metadata +3 -2
data/README
CHANGED
@@ -165,6 +165,8 @@ Thus, n requests for the template mean 1 call to Renshi to generate the necessar
|
|
165
165
|
|
166
166
|
When integrating this feature with other frameworks, simply use a delegate object to hold the compiled code and evaluate it against the binding you want to use. See the Rails and Sinatra bridges to get you started.
|
167
167
|
|
168
|
+
If you're curious to see the source it creates, add an environment variable called RENSHI_SHOW_SRC.
|
169
|
+
|
168
170
|
Development
|
169
171
|
===========
|
170
172
|
Please report any bugs at the http://renshi.lighthouseapp.com .
|
data/lib/renshi.rb
CHANGED
data/spec/elsif_spec.rb
CHANGED
@@ -16,4 +16,15 @@ describe Renshi::Parser do
|
|
16
16
|
doc = N(out)
|
17
17
|
(doc/"div[@id='content']").text.strip.should =~ /neither/
|
18
18
|
end
|
19
|
+
|
20
|
+
it "should evaluate many of them" do
|
21
|
+
foo = 1
|
22
|
+
out = interpret("data/elsif2.ren", binding)
|
23
|
+
doc = N(out)
|
24
|
+
(doc/"div[@id='content']").text.strip.should =~ /1/
|
25
|
+
foo = 3
|
26
|
+
out = interpret("data/elsif2.ren", binding)
|
27
|
+
doc = N(out)
|
28
|
+
(doc/"div[@id='content']").text.strip.should =~ /3/
|
29
|
+
end
|
19
30
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: renshi
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Nicholas Faiz
|
@@ -9,7 +9,7 @@ autorequire: renshi
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date: 2009-09-
|
12
|
+
date: 2009-09-22 00:00:00 +10:00
|
13
13
|
default_executable:
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
@@ -78,6 +78,7 @@ specification_version: 3
|
|
78
78
|
summary: Renshi is a templating language for Ruby which is versatile and cooperative with HTML.
|
79
79
|
test_files:
|
80
80
|
- spec/data/attribute_values_parsed.ren
|
81
|
+
- spec/data/elsif2.ren
|
81
82
|
- spec/data/example1.ren
|
82
83
|
- spec/data/for.ren
|
83
84
|
- spec/data/hello_world1.ren
|