Class: CspReport::InstallGenerator

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

Instance Method Summary collapse

Instance Method Details

#installObject



12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
# File 'lib/generators/csp_report/install_generator.rb', line 12

def install

  puts "Running the install procedure with mount point #{mount_point}"
  puts "\n"

  # If it's not the first run, the generator will ask to overwrite the
  # existing initializer
  generate "csp_report:initializer_install" , "#{mount_point}"
  # If it is not the first run but the mount point was not change, nothing
  # happens
  generate "csp_report:mount"               , "#{mount_point}"
  # Adds the JS include
  generate "csp_report:highcharts_include"
  # If this is not the first run, only the delta is copied.
  generate "csp_report:migration"

  if options.add_declaration?
    generate "csp_report:csp_declaration"
  end
end