-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathRakefile
54 lines (43 loc) · 1.32 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
require 'rake'
require 'rake/testtask'
require 'rbconfig'
desc 'Install the rack-auth-cheat library (non-gem)'
task :install do
dir = File.join(CONFIG['sitelibdir'], 'rack', 'auth')
FileUtils.mkdir_p(dir) unless File.exists?(dir)
file = 'lib/rack/auth/cheat.rb'
FileUtils.cp_r(file, dir, :verbose => true)
end
desc 'Build the gem'
task :gem do
spec = eval(IO.read('rack-auth-cheat.gemspec'))
Gem::Builder.new(spec).build
end
desc 'Install the rack-auth-cheat library as a gem'
task :install_gem => [:gem] do
file = Dir["*.gem"].first
sh "gem install #{file}"
end
desc 'Export the git archive to a .zip, .gz and .bz2 file in your home directory'
task :export, :output_file do |t, args|
file = args[:output_file]
sh "git archive --prefix #{file}/ --output #{ENV['HOME']}/#{file}.tar master"
Dir.chdir(ENV['HOME']) do
sh "gzip -f #{ENV['HOME']}/#{file}.tar"
end
sh "git archive --prefix #{file}/ --output #{ENV['HOME']}/#{file}.tar master"
Dir.chdir(ENV['HOME']) do
sh "bzip2 -f #{ENV['HOME']}/#{file}.tar"
end
sh "git archive --prefix #{file}/ --output #{ENV['HOME']}/#{file}.zip --format zip master"
Dir.chdir(ENV['HOME']) do
sh "unzip #{file}.zip"
Dir.chdir(file) do
sh "rake gem"
end
end
end
Rake::TestTask.new do |t|
t.verbose = true
t.warning = true
end