Class: BotChallengePage::InstallGenerator
- Inherits:
-
Rails::Generators::Base
- Object
- Rails::Generators::Base
- BotChallengePage::InstallGenerator
- Defined in:
- lib/generators/bot_challenge_page/install_generator.rb
Instance Method Summary collapse
Instance Method Details
#add_controller_mixin ⇒ Object
16 17 18 |
# File 'lib/generators/bot_challenge_page/install_generator.rb', line 16 def add_controller_mixin inject_into_class "app/controllers/application_controller.rb", "ApplicationController", " include BotChallengePage::Controller\n" end |
#copy_initializer_file ⇒ Object
20 21 22 |
# File 'lib/generators/bot_challenge_page/install_generator.rb', line 20 def copy_initializer_file template "initializer.rb.erb", "config/initializers/bot_challenge_page.rb" end |
#generate_routes ⇒ Object
8 9 10 11 12 13 14 |
# File 'lib/generators/bot_challenge_page/install_generator.rb', line 8 def generate_routes route 'post "/challenge", to: "bot_challenge_page/bot_challenge_page#verify_challenge", as: :bot_detect_challenge' if [:redirect_for_challenge] route 'get "/challenge", to: "bot_challenge_page/bot_challenge_page#challenge"' end end |