forked from boj/ruby-perlin
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathRakefile
More file actions
51 lines (37 loc) · 1.04 KB
/
Rakefile
File metadata and controls
51 lines (37 loc) · 1.04 KB
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
require 'rake/clean'
require 'rspec/core/rake_task'
require 'rake/extensiontask'
require 'yard'
require 'redcloth'
require 'launchy'
begin
require 'devkit' # only used on windows
rescue LoadError
end
CLOBBER << "coverage"
spec = Gem::Specification.load Dir["*.gemspec"][0]
Gem::PackageTask.new spec do
end
Rake::ExtensionTask.new 'perlin', spec do |ext|
RUBY_VERSION =~ /(\d+.\d+)/
ext.lib_dir = "lib/perlin/#{$1}"
end
YARD::Rake::YardocTask.new
task :default => :spec
task :spec => :compile
RSpec::Core::RakeTask.new do |t|
end
desc "Generate SimpleCov test coverage and open in your browser"
task :coverage do
rm_r "coverage" rescue nil
sh %q<ruby -rsimplecov -e "SimpleCov.command_name 'spec'; SimpleCov.start">
Launchy.open "coverage/index.html" rescue nil
end
desc "Open yard docs in browser"
task :browse_yard => :yard do
Launchy.open "doc/index.html" rescue nil
end
desc "Run benchmarks"
task :bench => :compile do
require File.expand_path("../bench/benchmarks.rb", __FILE__)
end