6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
|
# File 'lib/elklogger/generator/install_config.rb', line 6
def self.install
src_root = File.dirname(__FILE__)
dst_root = FileUtils.pwd
src = "#{src_root}/template/custom_log.conf"
dst = "#{dst_root}/config/elklogger"
FileUtils.mkdir_p(dst) unless File.directory?(dst)
dst += '/custom_log.conf'
FileUtils.copy_file(src, dst)
contents = File.read(dst)
contents.gsub!('your_ruby_project_absolute_path', dst_root)
File.open(dst, 'w') { |f| f.write contents }
puts "Created config file: #{File.expand_path(dst)}"
end
|