Method: Tasker::Generators::AuthenticatorGenerator#create_authenticator_file

Defined in:
lib/generators/tasker/authenticator_generator.rb

#create_authenticator_fileObject



24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
# File 'lib/generators/tasker/authenticator_generator.rb', line 24

def create_authenticator_file
  ensure_directory_exists(options[:directory])

  case options[:type].downcase
  when 'jwt'
    template 'jwt_authenticator.rb.erb', File.join(options[:directory], "#{file_name}_authenticator.rb")
  when 'devise'
    template 'devise_authenticator.rb.erb', File.join(options[:directory], "#{file_name}_authenticator.rb")
  when 'api_token'
    template 'api_token_authenticator.rb.erb', File.join(options[:directory], "#{file_name}_authenticator.rb")
  when 'omniauth'
    template 'omniauth_authenticator.rb.erb', File.join(options[:directory], "#{file_name}_authenticator.rb")
  else
    template 'custom_authenticator.rb.erb', File.join(options[:directory], "#{file_name}_authenticator.rb")
  end
end