lib/mastalk.rb in mastalk-0.1.2 vs lib/mastalk.rb in mastalk-0.2.0
- old
+ new
@@ -24,12 +24,13 @@
end
def preprocess(source)
extensions.map do |regex, block|
if source.match(regex)
- source.gsub!(regex, block.call(Regexp.last_match.captures.first))
+ source.sub!(regex, block.call(Regexp.last_match.captures.first))
end
end
+ preprocess(source) if extensions.any? {|regex, _| source.match(regex)}
source
end
end
end