10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
|
# File 'lib/generators/modulorails/healthcheck/health_check_generator.rb', line 10
def create_config_file
template 'config/initializers/health_check.rb'
unless File.read(Rails.root.join('config/routes.rb')).match?('health_check_routes')
inject_into_file 'config/routes.rb', after: "Rails.application.routes.draw do\n" do
<<~'RUBY'
health_check_routes
RUBY
end
end
system('bundle install')
create_keep_file
rescue StandardError => e
warn("[Modulorails] Error: cannot generate health_check configuration: #{e.message}")
end
|