5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
|
# File 'lib/embed_view/railtie.rb', line 5
def new(*args, &block)
source = args[0]
identifier = args[1]
while (matches = source.scan(SNIPPET_RE)).any? do
matches.each do |(a, b, c)|
path = File.expand_path(File.join(File.dirname(identifier), b.strip))
Rails.logger.debug " embed_view: #{b.strip}"
source.gsub!(Regexp.new("<%=.*embed_view.*#{a}#{b}#{c}.*%>"), File.binread(path))
identifier = path
end
end
args[0] = source
super(*args, &block)
end
|