Class: Trackdown::Generators::InstallGenerator
- Inherits:
-
Rails::Generators::Base
- Object
- Rails::Generators::Base
- Trackdown::Generators::InstallGenerator
- Defined in:
- lib/generators/trackdown/install_generator.rb
Instance Method Summary collapse
- #add_mmdb_to_gitignore ⇒ Object
- #create_database_refresh_job ⇒ Object
- #create_initializer ⇒ Object
- #display_post_install_message ⇒ Object
Instance Method Details
#add_mmdb_to_gitignore ⇒ Object
14 15 16 17 18 19 20 |
# File 'lib/generators/trackdown/install_generator.rb', line 14 def add_mmdb_to_gitignore if File.exist?('.gitignore') append_to_file '.gitignore', "\n\n# Trackdown\n*.mmdb" else create_file '.gitignore', "# Trackdown\n*.mmdb" end end |
#create_database_refresh_job ⇒ Object
10 11 12 |
# File 'lib/generators/trackdown/install_generator.rb', line 10 def create_database_refresh_job template 'trackdown_database_refresh_job.rb', 'app/jobs/trackdown_database_refresh_job.rb' end |
#create_initializer ⇒ Object
6 7 8 |
# File 'lib/generators/trackdown/install_generator.rb', line 6 def create_initializer template 'trackdown.rb', 'config/initializers/trackdown.rb' end |
#display_post_install_message ⇒ Object
22 23 24 25 26 27 28 29 |
# File 'lib/generators/trackdown/install_generator.rb', line 22 def say "\tThe `trackdown` gem has been successfully installed!", :green say "\nTo complete the setup:" say " 1. Configure your MaxMind credentials in `config/initializers/trackdown.rb`" say " 2. Run 'Trackdown.update_database' to get a fresh MaxMind IP database." say " 3. Make sure you configure your queueing system to run the TrackdownDatabaseRefreshJob regularly so the IP database is updated regularly." say "\nEnjoy `trackdown`!", :green end |