erb_parser 0.0.1 → 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/erb_parser.rb +2 -2
- metadata +1 -1
data/lib/erb_parser.rb
CHANGED
@@ -9,13 +9,13 @@ module ErbParser
|
|
9
9
|
def self.parse(str, options = {})
|
10
10
|
result = ParsedErb.new TreetopRunner.run(str)
|
11
11
|
|
12
|
-
if options[:transform]
|
12
|
+
if options[:transform] or options[:map]
|
13
13
|
result.tokens.map do |elem|
|
14
14
|
case elem
|
15
15
|
when String
|
16
16
|
elem
|
17
17
|
when ErbTag
|
18
|
-
options[:transform].call(elem)
|
18
|
+
(options[:transform] || options[:map]).call(elem)
|
19
19
|
end
|
20
20
|
end.join
|
21
21
|
else
|