Class: Socialite::Generators::InstallGenerator

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

Overview

:nodoc:

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#identity_class_nameObject (readonly)

Returns the value of attribute identity_class_name


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

def identity_class_name
  @identity_class_name
end

#use_omniauth_identityObject (readonly)

Returns the value of attribute use_omniauth_identity


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

def use_omniauth_identity
  @use_omniauth_identity
end

#user_class_nameObject (readonly)

Returns the value of attribute user_class_name


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

def user_class_name
  @user_class_name
end

Instance Method Details

#copy_initializerObject


12
13
14
15
16
17
18
19
20
21
22
23
24
# File 'lib/generators/socialite/install_generator.rb', line 12

def copy_initializer
  @user_class_name     = Socialite.user_class_name     = ask_about_user_model
  @identity_class_name = Socialite.identity_class_name = ask_about_identity_model

  if use_omniauth_identity?
    gem('omniauth-identity')
    gem('bcrypt-ruby', '>=3')
  end

  generate('socialite:entities', "#{@user_class_name} #{@identity_class_name}")

  template 'socialite.rb.tt', 'config/initializers/socialite.rb'
end