Sha256: c4d88dd68f58a1f7685e2a2c3f30617eab44c788295df94bc6184825f54c4b21
Contents?: true
Size: 1.13 KB
Versions: 11
Compression:
Stored size: 1.13 KB
Contents
namespace :db do desc "Bootstrap your database for Spree." task :bootstrap => :environment do # load initial database fixtures (in db/sample/*.yml) into the current environment's database ActiveRecord::Base.establish_connection(RAILS_ENV.to_sym) Dir.glob(File.join(FlatRateShippingExtension.root, "db", 'sample', '*.{yml,csv}')).each do |fixture_file| Fixtures.create_fixtures("#{FlatRateShippingExtension.root}/db/sample", File.basename(fixture_file, '.*')) end end end namespace :spree do namespace :extensions do namespace :flat_rate_shipping do desc "Copies public assets of the Flat Rate Shipping to the instance public/ directory." task :update => :environment do is_svn_or_dir = proc {|path| path =~ /\.svn/ || File.directory?(path) } Dir[FlatRateShippingExtension.root + "/public/**/*"].reject(&is_svn_or_dir).each do |file| path = file.sub(FlatRateShippingExtension.root, '') directory = File.dirname(path) puts "Copying #{path}..." mkdir_p RAILS_ROOT + directory cp file, RAILS_ROOT + path end end end end end
Version data entries
11 entries across 11 versions & 1 rubygems