ruhl 0.10.0 → 0.10.1
Sign up to get free protection for your applications and to get access to all the features.
- data/VERSION +1 -1
- data/lib/ruhl/engine.rb +9 -14
- data/lib/ruhl/rails.rb +3 -5
- data/ruhl.gemspec +2 -2
- metadata +2 -2
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.10.
|
1
|
+
0.10.1
|
data/lib/ruhl/engine.rb
CHANGED
@@ -120,26 +120,15 @@ module Ruhl
|
|
120
120
|
process_results
|
121
121
|
else
|
122
122
|
if attribute =~ /^_/
|
123
|
-
|
123
|
+
send("ruhl#{attribute}")
|
124
124
|
else
|
125
125
|
current_tag[attribute] = call_result.to_s
|
126
126
|
end
|
127
127
|
end
|
128
128
|
end
|
129
129
|
|
130
|
-
def
|
131
|
-
|
132
|
-
when "_use_if"
|
133
|
-
ruhl_if { ruhl_use }
|
134
|
-
when "_use", "_collection"
|
135
|
-
ruhl_use
|
136
|
-
when "_partial"
|
137
|
-
current_tag.inner_html = render_partial
|
138
|
-
when "_if"
|
139
|
-
ruhl_if
|
140
|
-
when "_unless"
|
141
|
-
ruhl_unless
|
142
|
-
end
|
130
|
+
def ruhl_use_if
|
131
|
+
ruhl_if {ruhl_use }
|
143
132
|
end
|
144
133
|
|
145
134
|
def ruhl_use
|
@@ -150,6 +139,8 @@ module Ruhl
|
|
150
139
|
current_tag.inner_html = render_block
|
151
140
|
end
|
152
141
|
end
|
142
|
+
|
143
|
+
alias_method :ruhl_collection, :ruhl_use
|
153
144
|
|
154
145
|
def ruhl_if
|
155
146
|
if stop_processing?
|
@@ -173,6 +164,10 @@ module Ruhl
|
|
173
164
|
end
|
174
165
|
end
|
175
166
|
|
167
|
+
def ruhl_partial
|
168
|
+
current_tag.inner_html = render_partial
|
169
|
+
end
|
170
|
+
|
176
171
|
def process_results
|
177
172
|
if call_result.is_a?(Hash)
|
178
173
|
call_result.each do |key, value|
|
data/lib/ruhl/rails.rb
CHANGED
@@ -27,12 +27,10 @@ module Ruhl
|
|
27
27
|
class Engine
|
28
28
|
private
|
29
29
|
|
30
|
-
def render_partial
|
31
|
-
|
30
|
+
def render_partial
|
31
|
+
template = scope.view_paths.find_template(call_result)
|
32
32
|
|
33
|
-
|
34
|
-
|
35
|
-
raise PartialNotFoundError.new(file) unless template
|
33
|
+
raise PartialNotFoundError.new(call_result) unless template
|
36
34
|
|
37
35
|
render_nodes Nokogiri::HTML.fragment( template.source )
|
38
36
|
end
|
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.10.
|
8
|
+
s.version = "0.10.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-
|
12
|
+
s.date = %q{2009-10-25}
|
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 = [
|
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.
|
4
|
+
version: 0.10.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-
|
12
|
+
date: 2009-10-25 00:00:00 -04:00
|
13
13
|
default_executable:
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|