-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathRakefile
42 lines (35 loc) · 928 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
require 'rubygems'
require 'rake'
require 'rdoc'
$LOAD_PATH.unshift(File.join(File.dirname(__FILE__), *%w[lib]))
# Returns the name of the project
def name
@name ||= Dir['*.gemspec'].first.split('.').first
end
# Returns the version number of the project
def version
line = File.read("lib/#{name}/version.rb")[/^\s*VERSION\s*=\s*.*/]
line.match(/.*VERSION\s*=\s*['"](.*)['"]/)[1]
end
if ENV["TRAVIS"] == "true"
require 'coveralls/rake/task'
Coveralls::RakeTask.new
task :default => [:test, 'coveralls:push']
else
task :default => [:test]
end
# << test
require 'rake/testtask'
Rake::TestTask.new(:test) do |test|
test.libs << 'lib' << 'test'
test.pattern = 'test/**/test_*.rb'
test.verbose = true
end
# << rdoc
require 'rdoc/task'
Rake::RDocTask.new do |rdoc|
rdoc.rdoc_dir = 'rdoc'
rdoc.title = "#{name} #{version}"
rdoc.rdoc_files.include('README*')
rdoc.rdoc_files.include('lib/**/*.rb')
end