Sha256: 9d542910266b59e5436e7749c40248cb1052e68efa940be30596da770880a05b

Contents?: true

Size: 578 Bytes

Versions: 3

Compression:

Stored size: 578 Bytes

Contents

# frozen_string_literal: true

require 'rails/generators/migration'

module SeoOptimizer
  class SetupsGenerator < Rails::Generators::Base
    source_root File.expand_path('templates', __dir__)
    desc 'Generates setup lines'

    def create_controller_files
      Rails.configuration.sitemap_config_variable
    rescue
      inject_into_file 'config/application.rb', :before => "  end" do
        "\n    config.sitemap_config_variable = {}" +
          "\n    config.sitemap_config_variable[:production_url] = 'https://YOUR-PRODUCTION-URL.com'\n\n"
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
seo_optimizer-0.1.2 lib/generators/seo_optimizer/setups/setups_generator.rb
seo_optimizer-0.1.1 lib/generators/seo_optimizer/setups/setups_generator.rb
seo_optimizer-0.1.0 lib/generators/seo_optimizer/setups/setups_generator.rb