class GraphqlAuthorizer::Generators::InstallGenerator

Add GraphQLAuthorizer to a Rails app with `rails g graphql_authorizer:install`.

Setup a initializer file Rack Attack and GraphQLAuhtorizer

“`

“`

Public Instance Methods

copy_graphql_authorizer() click to toggle source
# File lib/generators/graphql_authorizer/install_generator.rb, line 20
def copy_graphql_authorizer
  file = "graphql_authorizer.rb"
  template(file, "config/initializers/#{file}")
end
copy_rack_attack() click to toggle source
# File lib/generators/graphql_authorizer/install_generator.rb, line 30
def copy_rack_attack
  file = "rack_attack.rb"
  template(file, "config/initializers/#{file}")
end
inject_rack_attack_in_gemfile() click to toggle source
# File lib/generators/graphql_authorizer/install_generator.rb, line 25
def inject_rack_attack_in_gemfile
  gem("rack-attack")
  print "\nGemfile has been modified, make sure you `bundle install\n`"
end

Private Instance Methods

gem(*args) click to toggle source
Calls superclass method
# File lib/generators/graphql_authorizer/install_generator.rb, line 37
def gem(*args)
  print "\nAdding Gem into Gemfile\n"
  super(*args)
end