Sha256: 6e85f1efcdb98a5b5798859e20c7620d45c2878d1d13f75ccf3bac2fb2225223
Contents?: true
Size: 1.12 KB
Versions: 16
Compression:
Stored size: 1.12 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(<%= class_name %>.root, "db", 'sample', '*.{yml,csv}')).each do |fixture_file| Fixtures.create_fixtures("#{<%= class_name %>.root}/db/sample", File.basename(fixture_file, '.*')) end end end namespace :spree do namespace :extensions do namespace :<%= file_name %> do desc "Copies public assets of the <%= extension_name %> to the instance public/ directory." task :update => :environment do is_svn_git_or_dir = proc {|path| path =~ /\.svn/ || path =~ /\.git/ || File.directory?(path) } Dir[<%= class_name %>.root + "/public/**/*"].reject(&is_svn_git_or_dir).each do |file| path = file.sub(<%= class_name %>.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
16 entries across 16 versions & 3 rubygems