forked from twitter/twurl
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathRakefile
53 lines (43 loc) · 1.33 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
require 'rubygems'
require 'rake'
require 'rake/testtask'
require 'rake/gempackagetask'
require File.dirname(__FILE__) + '/lib/twurl'
library_root = File.dirname(__FILE__)
task :default => :test
Rake::TestTask.new do |test|
test.pattern = 'test/*_test.rb'
test.verbose = true
end
namespace :test do
desc "Analyze test coverage"
task :coverage do
system("rcov -x Library -x support --sort coverage #{File.join(library_root, 'test/*_test.rb')}")
system("open #{File.join(library_root, 'coverage/index.html')}") if PLATFORM['darwin']
end
namespace :coverage do
desc "Remove artifacts generated from coverage analysis"
task :clobber do
rm_r 'coverage' rescue nil
end
end
end
namespace :dist do
spec = Gem::Specification.load('twurl.gemspec')
Rake::GemPackageTask.new(spec) do |pkg|
pkg.need_tar_gz = true
pkg.package_files.include('{lib,bin,test}/**/*')
pkg.package_files.include('README')
pkg.package_files.include('COPYING')
pkg.package_files.include('INSTALL')
pkg.package_files.include('Rakefile')
end
task :spec do
puts spec.to_ruby
end
desc "Unpack current version of library into the twitter.com vendor directory"
task :unpack_to_vendor => :repackage do
cd 'pkg'
system("gem unpack '#{spec.name}-#{spec.version}.gem' --target=$TWITTER/vendor/gems")
end
end