Skip to content

Commit

Permalink
Remove sandbox_generator, replace with Rails template
Browse files Browse the repository at this point in the history
The rails template's code is much simpler and allows us to enforce specific gem requirements that the dummy application should never have.

This fixes the sandbox's requirement of spree_signup_path as pointed out by BDQ here: spree#1512 (comment)
  • Loading branch information
radar committed Jun 20, 2012
1 parent 47e8226 commit a03fa68
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 55 deletions.
9 changes: 3 additions & 6 deletions Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -96,10 +96,7 @@ end

desc "Creates a sandbox application for simulating the Spree code in a deployed Rails app"
task :sandbox do
require 'spree_core'

Spree::SandboxGenerator.start ["--lib_name=spree"]
Spree::InstallGenerator.start ["--auto-accept"]

cmd = "bundle exec rake assets:precompile:nondigest"; puts cmd; system cmd
FileUtils.rm_r("sandbox")
puts "Running Sandbox generator..."
exec("rails new sandbox -m sandbox.rb")
end
45 changes: 0 additions & 45 deletions core/lib/generators/spree/sandbox/sandbox_generator.rb

This file was deleted.

3 changes: 0 additions & 3 deletions core/lib/generators/spree/sandbox/templates/rails/routes.rb

This file was deleted.

1 change: 0 additions & 1 deletion core/lib/spree/core.rb
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,6 @@ def self.config(&block)

require 'spree/core/engine'
require 'generators/spree/dummy/dummy_generator'
require 'generators/spree/sandbox/sandbox_generator'

ActiveRecord::Base.class_eval do
include Spree::Core::CalculatedAdjustments
Expand Down
10 changes: 10 additions & 0 deletions sandbox.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# Used in the sandbox rake task in Rakefile
gem('spree', :path => "..")
gem('spree_auth_devise', :path => "~/Sites/gems/spree_auth_devise")
gem('devise-encryptable', '0.1.1')
puts "Running Spree installer..."
generate("spree:install --auto-accept")
puts "Precompilign assets..."
rake("assets:precompile:nondigest")
puts "Done!"

0 comments on commit a03fa68

Please sign in to comment.