Class: Plugins::Generators::ReportGenerator

Inherits:
Rails::Generators::Base
  • Object
show all
Defined in:
lib/generators/plugins/report_generator.rb

Instance Method Summary collapse

Instance Method Details

#report_initializer_fileObject



8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
# File 'lib/generators/plugins/report_generator.rb', line 8

def report_initializer_file
  filePath = File.expand_path(File.dirname(File.dirname(__FILE__)))
  currPath = File.expand_path("../../", filePath)
  reportPath = File.expand_path("../../plugins/report/", filePath)
  FileUtils.cp_r "#{reportPath}/db/migrate", "db/"
  FileUtils.cp_r "#{reportPath}/app/controllers", "app/"
  FileUtils.cp_r "#{reportPath}/app/models", "app/"
  FileUtils.cp_r "#{reportPath}/app/views", "app/"
  FileUtils.cp_r "#{reportPath}/app/views", "app/"
  FileUtils.cp_r "#{reportPath}/public/echarts2", "public/"
  FileUtils.cp_r "#{reportPath}/public/echarts3", "public/"
  FileUtils.cp_r "#{currPath}/lib/tasks/report_menu.rake", "lib/tasks/"
  puts "完成report模块构建"
  route("resources :connects")
  route("resources :dictionaries")
  route("resources :reports do resources :series and resources :requirements end")
  puts "report routes created!"
end