/
Rakefile
89 lines (77 loc) · 2.23 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
require 'rubygems'
require 'rake/gempackagetask'
require 'rubygems/specification'
require 'rake/rdoctask'
require 'rspec/core/rake_task'
require File.join(File.dirname(__FILE__), 'lib', 'service_proxy', 'base')
NAME = "serviceproxy"
AUTHOR = "Jeremy Durham"
EMAIL = "jeremydurham@gmail.com"
HOMEPAGE = ""
SUMMARY = "Lightweight SOAP library for Ruby"
# Used by release task
GEM_NAME = NAME
PROJECT_URL = HOMEPAGE
PROJECT_SUMMARY = SUMMARY
PROJECT_DESCRIPTION = SUMMARY
PKG_BUILD = ENV['PKG_BUILD'] ? '.' + ENV['PKG_BUILD'] : ''
GEM_VERSION = ServiceProxy::Base::VERSION + PKG_BUILD
RELEASE_NAME = "REL #{GEM_VERSION}"
#
# ==== Gemspec and installation
#
spec = Gem::Specification.new do |s|
s.name = NAME
s.version = ServiceProxy::Base::VERSION
s.platform = Gem::Platform::RUBY
s.has_rdoc = true
s.extra_rdoc_files = ["README", "LICENSE"]
s.summary = SUMMARY
s.description = s.summary
s.author = AUTHOR
s.email = EMAIL
s.homepage = HOMEPAGE
s.require_path = 'lib'
s.executables = ['wsdl2proxy']
s.files = %w(LICENSE README Rakefile) + Dir.glob("{lib,spec}/**/*")
s.add_dependency "nokogiri"
s.add_dependency "hpricot"
end
Rake::GemPackageTask.new(spec) do |pkg|
pkg.gem_spec = spec
end
desc "install the gem locally"
task :install => [:clean, :package] do
sh %{sudo gem install pkg/#{NAME}-#{ServiceProxy::Base::VERSION} --no-update-sources}
end
desc "create a gemspec file"
task :make_spec do
File.open("#{GEM_NAME}.gemspec", "w") do |file|
file.puts spec.to_ruby
end
end
desc "Run coverage suite"
task :rcov do
require 'fileutils'
FileUtils.rm_rf("coverage") if File.directory?("coverage")
FileUtils.mkdir("coverage")
path = File.expand_path(Dir.pwd)
files = Dir["spec/**/*_spec.rb"]
files.each do |spec|
puts "Getting coverage for #{File.expand_path(spec)}"
command = %{rcov #{File.expand_path(spec)} --aggregate #{path}/coverage/data.data}
command += " --no-html" unless spec == files.last
`#{command} 2>&1`
end
end
desc "Run all examples"
RSpec::Core::RakeTask.new(:spec) do |t|
end
namespace :spec do
desc "Run all examples with RCov"
RSpec::Core::RakeTask.new(:rcov) do |t|
t.rcov = true
end
end
desc 'Default: run unit tests.'
task :default => 'spec'