-
Notifications
You must be signed in to change notification settings - Fork 1
/
Rakefile
85 lines (69 loc) · 2.31 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
78
79
80
81
82
83
84
85
require 'rubygems'
require 'rake'
Dir[ 'lib/tasks/**/*' ].each{ |l| require l }
begin
require 'jeweler'
Jeweler::Tasks.new do |gem|
gem.name = "autotest-screen"
gem.summary = %Q{Update Gnu Screen caption with autotest results.}
gem.description = %Q{
Update Gnu Screen caption with autotest results.
Specifically, when autotest is running with an ancestor [Gnu] screen
process, have that screen's caption set when autotest runs tests.
Conceptually similar to autotest-growl but with a different notification system.
}
gem.email = "autotest-screen@hjdivad.com"
gem.homepage = "http://github.com/hjdivad/autotest-screen"
gem.authors = ["David J. Hamilton"]
if File.exists? 'Gemfile'
require 'bundler'
bundler = Bundler.load
bundler.dependencies_for( :runtime ).each do |dep|
gem.add_dependency dep.name, dep.requirement.to_s
end
bundler.dependencies_for( :development ).each do |dep|
gem.add_development_dependency dep.name, dep.requirement.to_s
end
end
# gem is a Gem::Specification... see http://www.rubygems.org/read/chapter/20 for additional settings
end
Jeweler::GemcutterTasks.new
rescue LoadError
puts "Jeweler (or a dependency) not available. Install it with: gem install jeweler"
end
desc "Write out build version. You must supply BUILD."
task 'version:write:build' do
unless ENV.has_key? 'BUILD'
abort "Must supply BUILD=<build> to write out build version number."
end
y = YAML::load_file( "VERSION.yml" )
v = {
:major => 0, :minor => 0, :patch => 0, :build => 0
}
v.merge!( y ) if y.is_a? Hash
v[ :build ] = ENV['BUILD']
File.open( "VERSION.yml", "w" ){|f| f.puts YAML::dump( v )}
end
task 'version:bump:build' do
y = YAML::load_file( "VERSION.yml" )
v = {
:major => 0, :minor => 0, :patch => 0, :build => 0
}
v.merge!( y ) if y.is_a? Hash
raise "Can't bump build: not a number" unless v[:build].is_a? Numeric
v[ :build ] += 1
v.each{|k,v| ENV[ k.to_s.upcase ] = v.to_s}
Rake::Task["version:write"].invoke
end
desc "Run all specs."
task :spec do
sh "rspec spec"
end
begin
require 'yard'
YARD::Rake::YardocTask.new
rescue LoadError
task :yardoc do
abort "YARD is not available. In order to run yardoc, you must: sudo gem install yard"
end
end