-
Notifications
You must be signed in to change notification settings - Fork 273
/
Rakefile
56 lines (46 loc) · 896 Bytes
/
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
require 'rake/testtask'
task :default => :test
def command?(command)
system("type #{command} > /dev/null 2>&1")
end
#
# Tests
#
if command? :turn
desc "Run tests"
task :test do
suffix = "-n #{ENV['TEST']}" if ENV['TEST']
sh "turn -Ilib:. test/*.rb #{suffix}"
end
else
Rake::TestTask.new do |t|
t.libs << 'lib'
t.libs << '.'
t.pattern = 'test/**/*_test.rb'
t.verbose = false
end
end
#
# Development
#
desc "Drop to irb."
task :console do
exec "irb -I lib -rkss"
end
#
# Gems
#
begin
require 'mg'
MG.new("kss.gemspec")
rescue LoadError
warn "mg not available."
warn "Install it with: gem install mg"
end
desc "Push a new version to Gemcutter and publish docs."
task :publish => "gem:publish" do
require File.dirname(__FILE__) + '/lib/kss/version'
sh "git tag v#{Kss::VERSION}"
sh "git push origin master --tags"
sh "git clean -fd"
end