7
8
9
10
11
12
13
14
15
16
17
18
19
20
|
# File 'lib/generators/treport/install_generator.rb', line 7
def treport_initializer_file
filePath = File.expand_path(File.dirname(File.dirname(__FILE__)))
migrationPath = File.expand_path("../../db/migrate", filePath)
publicPath = File.expand_path("../../public", filePath)
layoutPath = File.expand_path("../../app/views/layouts", filePath)
FileUtils.cp_r("#{publicPath}/treport", "public")
FileUtils.cp_r("#{layoutPath}/report_admin.html.erb", "app/views/layouts")
Dir.foreach(migrationPath) do |filename|
if (filename!="." && filename!="..")
FileUtils.cp_r("#{migrationPath}/#{filename}", "db/migrate/#{Time.now.strftime("%Y%m%d%H%M%S")}#{filename}")
end
end
system("rake db:migrate")
end
|