Class: Modulorails::ModuloprojectGenerator

Inherits:
Generators::Base
  • Object
show all
Defined in:
lib/generators/modulorails/moduloproject/moduloproject_generator.rb

Constant Summary collapse

VERSION =
2

Instance Method Summary collapse

Methods inherited from Generators::Base

base_root, #call

Instance Method Details

#create_configObject



11
12
13
14
15
16
17
18
19
20
21
22
23
24
# File 'lib/generators/modulorails/moduloproject/moduloproject_generator.rb', line 11

def create_config
  Modulorails.deprecator.warn(<<~MESSAGE)
    Modulorails::ModuloprojectGenerator is deprecated and will be removed in version 2.0.
    This generator will be moved to Moduloproject 3.0 (available later).
  MESSAGE

  remove_old_keepfile(".modulorails-#{generator_name}")
  template 'config/environments/production.rb', force: true
  copy_file('config/environments/production.rb', 'config/environments/staging.rb')
  update_application_rb
  create_file('config/locales/fr.yml', "fr: {}\n")
rescue StandardError => e
  warn("[Modulorails] Error: cannot generate Moduloproject configuration: #{e.message}")
end