/
Rakefile
52 lines (42 loc) · 1.28 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
$:.unshift(File.dirname(__FILE__) + '/lib')
require 'rubygems'
require 'rake'
require 'rdoc/task'
require 'httpng'
#############################################################################
#
# Standard tasks
#
#############################################################################
Rake::RDocTask.new do |rdoc|
rdoc.rdoc_dir = 'rdoc'
rdoc.title = "HTTPNG #{Httpng::VERSION}"
rdoc.rdoc_files.include('README*')
rdoc.rdoc_files.include('lib/**/*.rb')
end
task :console do
sh "irb -rubygems -r ./lib/httpng.rb"
end
#############################################################################
#
# Packaging tasks
#
#############################################################################
task :release do
puts ""
print "Are you sure you want to relase httpng #{Httpng::VERSION}? [y/N] "
exit unless STDIN.gets.index(/y/i) == 0
unless `git branch` =~ /^\* master$/
puts "You must be on the master branch to release!"
exit!
end
# Build gem and upload
sh "gem build httpng.gemspec"
sh "gem push httpng-#{Httpng::VERSION}.gem"
sh "rm httpng-#{Httpng::VERSION}.gem"
# Commit
sh "git commit --allow-empty -a -m 'v#{Httpng::VERSION}'"
sh "git tag v#{Httpng::VERSION}"
sh "git push origin master"
sh "git push origin v#{Httpng::VERSION}"
end