代码拉取完成,页面将自动刷新
require 'rake'
require 'rubygems/package_task'
require 'thor/group'
begin
require 'spree/testing_support/common_rake'
rescue LoadError
raise "Could not find spree/testing_support/common_rake. You need to run this command using Bundler."
end
SPREE_GEMS = %w(core api cmd backend frontend sample).freeze
task default: :test
desc "Runs all tests in all Spree engines"
task test: :test_app do
SPREE_GEMS.each do |gem_name|
Dir.chdir("#{File.dirname(__FILE__)}/#{gem_name}") do
sh 'rspec'
end
end
end
desc "Generates a dummy app for testing for every Spree engine"
task :test_app do
SPREE_GEMS.each do |gem_name|
Dir.chdir("#{File.dirname(__FILE__)}/#{gem_name}") do
sh 'rake test_app'
end
end
end
desc "clean the whole repository by removing all the generated files"
task :clean do
rm_f "Gemfile.lock"
rm_rf "sandbox"
rm_rf "pkg"
SPREE_GEMS.each do |gem_name|
rm_f "#{gem_name}/Gemfile.lock"
rm_rf "#{gem_name}/pkg"
rm_rf "#{gem_name}/spec/dummy"
end
end
namespace :gem do
def version
require 'spree/core/version'
Spree.version
end
def for_each_gem
SPREE_GEMS.each do |gem_name|
yield "pkg/spree_#{gem_name}-#{version}.gem"
end
yield "pkg/spree-#{version}.gem"
end
desc "Build all spree gems"
task :build do
pkgdir = File.expand_path("../pkg", __FILE__)
FileUtils.mkdir_p pkgdir
SPREE_GEMS.each do |gem_name|
Dir.chdir(gem_name) do
sh "gem build spree_#{gem_name}.gemspec"
mv "spree_#{gem_name}-#{version}.gem", pkgdir
end
end
sh "gem build spree.gemspec"
mv "spree-#{version}.gem", pkgdir
end
desc "Install all spree gems"
task install: :build do
for_each_gem do |gem_path|
Bundler.with_clean_env do
sh "gem install #{gem_path}"
end
end
end
desc "Release all gems to rubygems"
task release: :build do
sh "git tag -a -m \"Version #{version}\" v#{version}"
for_each_gem do |gem_path|
sh "gem push '#{gem_path}'"
end
end
end
desc "Creates a sandbox application for simulating the Spree code in a deployed Rails app"
task :sandbox do
Bundler.with_clean_env do
exec("bin/sandbox.sh")
end
end
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。