Class: Kingsman::Generators::InstallGenerator
- Inherits:
-
Rails::Generators::Base
- Object
- Rails::Generators::Base
- Kingsman::Generators::InstallGenerator
- Defined in:
- lib/generators/kingsman/install_generator.rb
Instance Method Summary collapse
Instance Method Details
#copy_initializer ⇒ Object
16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 |
# File 'lib/generators/kingsman/install_generator.rb', line 16 def copy_initializer unless [:orm] raise MissingORMError, " An ORM must be set to install Kingsman in your application.\n\n Be sure to have an ORM like Active Record or Mongoid loaded in your\n app or configure your own at `config/application.rb`.\n\n config.generators do |g|\n g.orm :your_orm_gem\n end\n ERROR\n end\n\n template \"kingsman.rb\", \"config/initializers/kingsman.rb\"\nend\n".strip_heredoc |
#copy_locale ⇒ Object
33 34 35 |
# File 'lib/generators/kingsman/install_generator.rb', line 33 def copy_locale copy_file "../../../config/locales/en.yml", "config/locales/kingsman.en.yml" end |
#show_readme ⇒ Object
37 38 39 |
# File 'lib/generators/kingsman/install_generator.rb', line 37 def show_readme readme "README" if behavior == :invoke end |