forked from utahstreetlabs/active_shipping
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Rakefile
64 lines (51 loc) · 1.63 KB
/
Rakefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
require 'rake'
require 'rake/clean'
require 'rake/testtask'
require 'rake/gempackagetask'
desc 'Run unit tests by default (and not remote tests)'
task :default => 'test:units'
desc 'Run all tests, including remote tests'
task :test => ['test:units','test:remote']
gemspec = eval(File.read('active_shipping.gemspec'))
Rake::GemPackageTask.new(gemspec) do |pkg|
pkg.gem_spec = gemspec
end
desc "Default Task"
task :default => 'test:units'
task :test => ['test:units','test:remote']
namespace :test do
Rake::TestTask.new(:units) do |t|
t.libs << "test"
t.pattern = 'test/unit/**/*_test.rb'
t.verbose = true
end
Rake::TestTask.new(:remote) do |t|
t.libs << "test"
t.pattern = 'test/remote/*_test.rb'
t.verbose = true
end
end
desc "Validate the gemspec"
task :gemspec do
gemspec.validate
end
desc "Update common files from active_merchant directory"
task :update_common do
STDERR.puts "Updating common include from ../active_merchant. Please make sure this is up-to-date"
system("diff -u lib/active_merchant/common.rb ../active_merchant/lib/active_merchant/common.rb | patch -p0")
system("diff -ur lib/active_merchant/common ../active_merchant/lib/active_merchant/common | patch -p0")
STDERR.puts "done.."
end
task :package => :gemspec
desc "Build and install the gem"
task :install => :package do
sh %{gem install pkg/#{gemspec.name}-#{gemspec.version}}
end
desc "Uninstall gem"
task :uninstall => [ :clean ] do
sh %{gem uninstall #{gemspec.name}}
end
desc "Release #{gemspec.name} gem (#{gemspec.version})"
task :release => [ :test, :package ] do
sh %{gem push pkg/#{gemspec.name}-#{gemspec.version}.gem}
end