Skip to content

Instantly share code, notes, and snippets.

@LBRapid
Created May 2, 2011 20:15
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save LBRapid/952268 to your computer and use it in GitHub Desktop.
Save LBRapid/952268 to your computer and use it in GitHub Desktop.
Rakefile for spree extensions
desc "Regenerates a rails 3 app for testing"
task :test_app do
SPREE_PATH = ENV['SPREE_PATH']
raise "SPREE_PATH should be specified" unless SPREE_PATH
require File.join(SPREE_PATH, 'lib/generators/spree/test_app_generator')
class FlagPromotionTestAppGenerator < Spree::Generators::TestAppGenerator
def tweak_gemfile
append_file 'Gemfile' do
<<-gems
gem 'spree_core', :path => '#{File.join(SPREE_PATH, 'core')}'
gem 'spree_auth', :path => '#{File.join(SPREE_PATH, 'auth')}'
gem 'flag_promotions', :path => '#{File.dirname(__FILE__)}'
gems
end
end
def install_gems
inside "test_app" do
run 'rake spree_core:install'
run 'rake spree_auth:install'
end
end
def migrate_db
run_migrations
end
end
FlagPromotionTestAppGenerator.start
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment