forked from brynary/rack-bug
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathRakefile
49 lines (40 loc) · 1.39 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
require "rubygems"
require "rake/gempackagetask"
require "rake/clean"
require "spec/rake/spectask"
$LOAD_PATH.unshift File.dirname(__FILE__) + '/lib'
require "rack/bug"
Spec::Rake::SpecTask.new do |t|
t.spec_opts = ['--options', "\"#{File.dirname(__FILE__)}/spec/spec.opts\""]
end
desc "Run the specs"
task :default => :spec
desc "Run all specs in spec directory with RCov"
Spec::Rake::SpecTask.new(:rcov) do |t|
t.spec_opts = ['--options', "\"#{File.dirname(__FILE__)}/spec/spec.opts\""]
t.rcov = true
t.rcov_opts = lambda do
IO.readlines(File.dirname(__FILE__) + "/spec/rcov.opts").map {|l| l.chomp.split " "}.flatten
end
end
spec = Gem::Specification.new do |s|
s.name = "rack-bug"
s.version = Rack::Bug::VERSION
s.author = "Bryan Helmkamp"
s.email = "bryan" + "@" + "brynary.com"
s.homepage = "http://github.com/brynary/rack-bug"
s.summary = "Debugging toolbar for Rack applications implemented as middleware"
s.description = s.summary
s.files = %w[History.txt Rakefile README.rdoc] + Dir["lib/**/*"]
# rdoc
s.has_rdoc = true
s.extra_rdoc_files = %w(README.rdoc MIT-LICENSE.txt)
end
Rake::GemPackageTask.new(spec) do |package|
package.gem_spec = spec
end
desc 'Install the package as a gem.'
task :install => [:clean, :package] do
gem = Dir['pkg/*.gem'].first
sh "sudo gem install --no-rdoc --no-ri --local #{gem}"
end