Class: DeviseFidoUsf::Generators::InstallGenerator

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

Instance Method Summary collapse

Instance Method Details

#copy_initializerObject



13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
# File 'lib/generators/devise_fido_usf/install_generator.rb', line 13

def copy_initializer
  unless options[:orm]
    raise MissingORMError, <<-ERROR.strip_heredoc
    An ORM must be set to install Devise 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

end

#copy_localeObject



29
30
31
# File 'lib/generators/devise_fido_usf/install_generator.rb', line 29

def copy_locale
  copy_file "../../../config/locales/en.yml", "config/locales/fido_usf.en.yml"
end

#run_migrationObject



33
34
35
# File 'lib/generators/devise_fido_usf/install_generator.rb', line 33

def run_migration
  invoke("devise_fido_usf:migrate", ["FidoUsfDevices"])
end

#show_readmeObject



37
38
39
# File 'lib/generators/devise_fido_usf/install_generator.rb', line 37

def show_readme
  readme("README") if behavior == :invoke
end