Sha256: 5771bc6eda61d3e9413cb4e506584a70cf7d041f9e836ac0388caefdf6e49f62

Contents?: true

Size: 1.11 KB

Versions: 36

Compression:

Stored size: 1.11 KB

Contents

module Spree
  module Generators
    class SiteGenerator < Rails::Generators::Base
      source_root File.expand_path("../../templates", __FILE__)

      desc "Configures an existing Rails application to use Spree."

      def create_lib_files
        template 'spree_site.rb', "lib/spree_site.rb"
      end

      def additional_tweaks
        remove_file "public/index.html"

        append_file "public/robots.txt", <<-ROBOTS
        User-agent: *
        Disallow: /checkouts
        Disallow: /orders
        Disallow: /countries
        Disallow: /line_items
        Disallow: /password_resets
        Disallow: /states
        Disallow: /user_sessions
        Disallow: /users
        ROBOTS

        append_file "db/seeds.rb", <<-SEEDS
        \n
        Rake::Task["db:load_dir"].invoke( "default" )
        puts "Default data has been loaded"
        SEEDS
      end

      def config_middleware
        application 'config.middleware.use "SeoAssist"'
        application 'config.middleware.use "RedirectLegacyProductUrl"'
      end

      def require_site
        application "require 'spree_site'"
      end

    end
  end
end

Version data entries

36 entries across 36 versions & 7 rubygems

Version Path
My-Commerce-1.1.0 lib/generators/spree/site_generator.rb
MyCommerceapi-1.0.0 lib/generators/spree/site_generator.rb
MyCommerce-0.0.3 lib/generators/spree/site_generator.rb
rfcommerce-0.0.3 lib/generators/spree/site_generator.rb
spree-0.60.6 lib/generators/spree/site_generator.rb
spree-0.60.5 lib/generators/spree/site_generator.rb
spree-0.30.2 lib/generators/spree/site_generator.rb
spree-0.40.4 lib/generators/spree/site_generator.rb
spree-0.50.4 lib/generators/spree/site_generator.rb
spree-0.60.4 lib/generators/spree/site_generator.rb
spree-0.50.3 lib/generators/spree/site_generator.rb
spree-0.60.3 lib/generators/spree/site_generator.rb
spree-0.60.2 lib/generators/spree/site_generator.rb
spree_bushido-0.80.28 lib/generators/spree/site_generator.rb
spree_bushido-0.80.27 lib/generators/spree/site_generator.rb
spree_bushido-0.80.26 lib/generators/spree/site_generator.rb
spree_bushido-0.80.25 lib/generators/spree/site_generator.rb
spree_bushido-0.80.24 lib/generators/spree/site_generator.rb
spree_bushido-0.80.23 lib/generators/spree/site_generator.rb
spree_bushido-0.80.22 lib/generators/spree/site_generator.rb