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, <<-ERROR.strip_heredoc An ORM must be set to install Kingsman in your application. Be sure to have an ORM like Active Record or Mongoid loaded in your app or configure your own at `config/application.rb`. config.generators do |g| g.orm :your_orm_gem end ERROR end template "kingsman.rb", "config/initializers/kingsman.rb" end |
#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 |