Class: Spree::Generators::SiteGenerator
- Inherits:
-
Rails::Generators::Base
- Object
- Rails::Generators::Base
- Spree::Generators::SiteGenerator
- Defined in:
- lib/generators/spree/site_generator.rb
Instance Method Summary collapse
- #additional_tweaks ⇒ Object
- #config_middleware ⇒ Object
- #create_lib_files ⇒ Object
- #require_site ⇒ Object
Instance Method Details
#additional_tweaks ⇒ Object
12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 |
# File 'lib/generators/spree/site_generator.rb', line 12 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 |
#config_middleware ⇒ Object
34 35 36 37 |
# File 'lib/generators/spree/site_generator.rb', line 34 def config_middleware application 'config.middleware.use "SeoAssist"' application 'config.middleware.use "RedirectLegacyProductUrl"' end |
#create_lib_files ⇒ Object
8 9 10 |
# File 'lib/generators/spree/site_generator.rb', line 8 def create_lib_files template 'apispree_site.rb', "lib/apispree_site.rb" end |
#require_site ⇒ Object
39 40 41 |
# File 'lib/generators/spree/site_generator.rb', line 39 def require_site application "require 'apispree_site'" end |