Class: Helios::Sitemap::Generators::InstallGenerator

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

Instance Method Summary collapse

Instance Method Details

#add_routeObject



23
24
25
# File 'lib/generators/helios/sitemap/install/install_generator.rb', line 23

def add_route
  route 'get "sitemap.xml", to: "sitemap#show"'
end

#copy_controllerObject



19
20
21
# File 'lib/generators/helios/sitemap/install/install_generator.rb', line 19

def copy_controller
  template "sitemap_controller.rb", "app/controllers/sitemap_controller.rb"
end

#copy_initializerObject



11
12
13
# File 'lib/generators/helios/sitemap/install/install_generator.rb', line 11

def copy_initializer
  template "initializer.rb", "config/initializers/helios_sitemap.rb"
end

#copy_jobObject



15
16
17
# File 'lib/generators/helios/sitemap/install/install_generator.rb', line 15

def copy_job
  template "sitemap_refresh_job.rb", "app/jobs/sitemap_refresh_job.rb"
end


27
28
29
30
31
32
33
34
35
36
# File 'lib/generators/helios/sitemap/install/install_generator.rb', line 27

def print_next_steps
  say ""
  say "Helios::Sitemap installed!", :green
  say ""
  say "Next steps:"
  say "  1. Edit config/initializers/helios_sitemap.rb to configure your host and sitemap entries"
  say "  2. Set these ENV vars: AWS_REGION, AWS_SITEMAP_BUCKET, AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY"
  say "  3. Schedule SitemapRefreshJob in your job runner (e.g. sidekiq-scheduler)"
  say ""
end