forked from Shopify/active_shipping
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Rakefile
59 lines (48 loc) · 1.36 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
require 'rubygems'
require 'rake'
require 'rake/testtask'
require 'rake/rdoctask'
require 'rake/gempackagetask'
require 'rake/contrib/rubyforgepublisher'
PKG_VERSION = "0.0.1"
PKG_NAME = "activeshipping"
PKG_FILE_NAME = "#{PKG_NAME}-#{PKG_VERSION}"
PKG_FILES = FileList[
"lib/**/*", "examples/**/*", "[A-Z]*", "Rakefile"
].exclude(/\.svn$/)
desc "Default Task"
task :default => 'test:units'
task :test => ['test:units','test:remote']
# Run the unit tests
namespace :test do
Rake::TestTask.new(:units) do |t|
t.pattern = 'test/unit/**/*_test.rb'
t.ruby_opts << '-rubygems'
t.verbose = true
end
Rake::TestTask.new(:remote) do |t|
t.pattern = 'test/remote/*_test.rb'
t.ruby_opts << '-rubygems'
t.verbose = true
end
namespace :remote do
['ups', 'usps', 'fedex', 'shipwire', 'endicia'].each do |name|
Rake::TestTask.new(name.to_sym) do |t|
t.pattern = "test/remote/#{name}_test.rb"
t.ruby_opts << '-rubygems'
t.verbose = true
end
end
end
end
# Genereate the RDoc documentation
Rake::RDocTask.new do |rdoc|
rdoc.rdoc_dir = 'doc'
rdoc.title = "ActiveShipping library"
rdoc.options << '--line-numbers' << '--inline-source'
rdoc.rdoc_files.include('README', 'CHANGELOG')
rdoc.rdoc_files.include('lib/**/*.rb')
end
task :install => [:package] do
`gem install pkg/#{PKG_FILE_NAME}.gem`
end