Class: SeoOptimizer::RobotsFilesGenerator

Inherits:
Rails::Generators::Base
  • Object
show all
Defined in:
lib/generators/seo_optimizer/robots_files/robots_files_generator.rb

Instance Method Summary collapse

Instance Method Details

#create_controller_filesObject



10
11
12
13
14
15
16
17
# File 'lib/generators/seo_optimizer/robots_files/robots_files_generator.rb', line 10

def create_controller_files
  prod_variable = Rails.configuration.sitemap_config_variable rescue raise(SeoOptimizer::Error, setup_error_message)
  url = prod_variable[:production_url]
  raise SeoOptimizer::Error, replace_url_error if !url || url == 'https://YOUR-PRODUCTION-URL.com'

  site_map_xml
  robots_text
end