10
11
12
13
14
15
16
17
18
19
20
21
22
|
# File 'lib/generators/bread/install_generator.rb', line 10
def inject_html
destination_path = 'app/views/layouts/application.html.erb'
template_path = File.join(File.expand_path('../templates', __FILE__), "view.html.erb")
html = open(template_path).read
after_regex = /<body(.*)>/i
inject_into_file destination_path, html, after: after_regex
rescue Errno::ENOENT
puts "\tGENERATOR HAS FAILED"
puts "\tINSERT THIS BLOCK ON #{destination_path}".red
puts html.green
end
|