forked from nbudin/google4r-checkout
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Rakefile
104 lines (86 loc) · 2.67 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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
# google4r-checkout Rakefile
require 'rake'
require 'rake/testtask'
require 'rake/gempackagetask'
require 'rake/rdoctask'
desc 'Default: run all tests tests.'
task :default => :'test:all'
desc 'Runs all tests (alias of test:all)'
task :test => :'test:all'
#
# File sets
#
RUBY_FILES = FileList['lib/**/*.rb', 'lib/**/vendor/**']
RDOC_EXTRA = FileList['README.md','LICENSE', 'CHANGES']
EXTRA_FILES = FileList['var/cacert.pem']
#
# Documentation
#
desc 'Generate documentation for the google4r library.'
Rake::RDocTask.new(:rdoc) do |rdoc|
rdoc.rdoc_dir = 'docs'
rdoc.title = 'google4r/checkout'
rdoc.main = 'README.md'
rdoc.options << '--line-numbers' << '--inline-source'
rdoc.rdoc_files = RUBY_FILES + RDOC_EXTRA
end
#
# Test, test, test! I love saying the word "test"!
#
desc 'Run all tests on the Google4R::Checkout::* classes.'
task :test => ["test:all"]
namespace :test do
desc 'Run all tests on the Google4R::Checkout::* classes.'
task :all do
errors = %w(unit integration system).collect do |task|
begin
Rake::Task["test:#{task}"].invoke
nil
rescue => e
task
end
end.compact
abort "Errors running #{errors.join(", ")}!" if errors.any?
end
desc 'Run unit tests on the Google4R::Checkout::* classes.'
Rake::TestTask.new(:unit) do |t|
t.libs << 'lib'
t.test_files = FileList['test/unit/*_test.rb']
t.verbose = true
end
desc 'Run integration tests on the Google4R::Checkout::* classes.'
Rake::TestTask.new(:integration) do |t|
t.libs << 'lib'
t.test_files = FileList['test/integration/*_test.rb']
t.verbose = true
end
desc 'Run system tests on the Google4R::Checkout::* classes.'
Rake::TestTask.new(:system) do |t|
t.libs << 'lib'
t.test_files = FileList['test/system/*_test.rb']
t.verbose = true
end
end
#
# Rubygem creation.
#
version = "1.1.beta5"
spec = Gem::Specification.new do |spec|
spec.platform = Gem::Platform::RUBY
spec.name = "google4r-checkout"
spec.summary = "Ruby library to access the Google Checkout service and implement notification handlers."
spec.description = spec.summary
spec.version = version
spec.author = "Tony Chan"
spec.homepage = "http://code.google.com/p/google-checkout-ruby-sample-code"
spec.test_files = FileList['test/**/*_test.rb', 'test/test_helper.rb', 'test/frontend_configuration_example.rb']
spec.files = RUBY_FILES + EXTRA_FILES
spec.extra_rdoc_files = RDOC_EXTRA
spec.files.reject! { |str| str =~ /^\./ }
spec.require_path = 'lib'
spec.required_ruby_version = '>= 1.8.4'
spec.add_dependency('money', '>= 2.3.0')
end
Rake::GemPackageTask.new(spec) do |pkg|
pkg.need_tar = true
end