-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathRakefile
63 lines (54 loc) · 1.2 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
# -*- coding: utf-8 -*-
require 'rubygems'
gem 'rdoc'
require 'rdoc'
require 'rake'
require 'rake/rdoctask'
begin
require 'rspec/core/rake_task'
rescue LoadError
puts "no rspec"
else
RSpec::Core::RakeTask.new(:spec) do |t|
t.ruby_opts="-w"
t.rcov = false
end
RSpec::Core::RakeTask.new('spec:rcov') do |t|
t.ruby_opts="-w"
t.rcov = true
end
task :default => :spec
end
Rake::RDocTask.new do |rdoc|
begin
version = File.read('VERSION').chomp
rescue
version = "0.0.0"
puts "No version is set in file VERSION. Set by default to #{version}"
end
rdoc.rdoc_dir = 'rdoc'
rdoc.title = "rwsc #{version}"
rdoc.rdoc_files.include('README*')
rdoc.rdoc_files.include('lib/**/*.rb')
rdoc.options += [
'-H' , '-a', '-t', '-d',
'-f', 'darkfish', # This is the important bit
]
end
# gem task
def gemspec
@gemspec ||= begin
file = File.expand_path('../rwsc.gemspec', __FILE__)
eval(File.read(file), binding, file)
end
end
begin
require 'rake/gempackagetask'
rescue LoadError
task(:gem) { $stderr.puts '`gem install rake` to package gems' }
else
Rake::GemPackageTask.new(gemspec) do |pkg|
pkg.gem_spec = gemspec
end
task :gem => :gemspec
end