Class: DeviseOmniauth::Generators::InstallGenerator

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

Instance Method Summary collapse

Instance Method Details

#add_devise_routesObject

TODO should be able to customize the :as option (also will have to change in views)



25
26
27
28
# File 'lib/generators/devise_omniauth/install_generator.rb', line 25

def add_devise_routes
  devise_route = "mount DeviseOmniauth::Engine => '/', :as => 'devise_omniauth'"
  route devise_route
end

#copy_initializerObject

TODO the source should come from devise and not duplicated in this gem



15
16
17
# File 'lib/generators/devise_omniauth/install_generator.rb', line 15

def copy_initializer
  template "config/initializers/devise.rb", "config/initializers/devise.rb"
end

#copy_localeObject

TODO the source should come from devise and not duplicated in this gem



20
21
22
# File 'lib/generators/devise_omniauth/install_generator.rb', line 20

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

#copy_viewsObject

TODO is there a way for these to come from devise even with the changes?



10
11
12
# File 'lib/generators/devise_omniauth/install_generator.rb', line 10

def copy_views
  directory 'views/devise/', 'app/views/devise'
end

#show_readmeObject



30
31
32
# File 'lib/generators/devise_omniauth/install_generator.rb', line 30

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