-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathRakefile
77 lines (62 loc) · 1.78 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
#!/usr/bin/ruby
require 'rubygems'
require 'fileutils'
require 'spec'
require 'spec/rake/spectask'
GENPWD_VERSION='0.1'
directory 'test/genpwd'
########################################################################
# Installation and packaging tasks
desc %q{
Install genpwd to $HOME/bin; completion to /etc/bash_completion.d
}.gsub(/^\t/, '')
task :install do
FileUtils.cp "bin/genpwd", "#{ENV['HOME']}/bin/genpwd"
FileUtils.cp "lib/bash_completion.d/genpwd", "/etc/bash_completion.d/genpwd"
end
desc %Q{
Package the plugin as a tarball.
}.gsub(/^\t/, '')
task :tar do
FileUtils.rm "genpwd-#{GENPWD_VERSION}.tar.gz", :force => true
system %Q{
tar caf genpwd-#{GENPWD_VERSION}.tar.gz \
--transform='s,^(.*),genpwd-#{GENPWD_VERSION}/\\1,x' \
bin lib README.markdown
}
end
########################################################################
# Clean
task :clean do
sh "rm -fr report/ test/"
end
########################################################################
# Testing (incl. spec) tasks
Spec::Rake::SpecTask.new do |t|
t.ruby_opts = ['-Ibin -Ispec']
t.spec_opts = ['--color --format specdoc']
end
namespace :spec do
desc <<-EOS
Runs specs and produces an html report in report/report.html
EOS
Spec::Rake::SpecTask.new(:html) do |t|
FileUtils.mkdir_p 'report'
t.ruby_opts = ['-Ibin -Ispec']
t.spec_opts = ['--color --format html:report/report.html --format specdoc']
end
desc <<-EOS
Runs specs with backtraces shown
EOS
Spec::Rake::SpecTask.new(:trace) do |t|
t.ruby_opts = ['-Ibin -Ispec']
t.spec_opts = ['--color --backtrace --format specdoc']
end
desc <<-EOS
Runs specs with backtraces shown through rdebug
EOS
task :debug do |t|
system "rdebug rake -- spec:trace"
end
end
########################################################################