forked from gmodarelli/ruby-deepclone
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathRakefile
More file actions
39 lines (31 loc) · 852 Bytes
/
Rakefile
File metadata and controls
39 lines (31 loc) · 852 Bytes
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
require 'rake'
require 'rspec/core/rake_task'
require 'rake/extensiontask'
# RSpec
RSpec::Core::RakeTask.new('spec') do |t|
t.verbose = true
end
# Extension building
def gemspec
@clean_gemspec ||= eval(File.read("#{ File.dirname(__FILE__) }/deep_clone.gemspec"))
end
Rake::ExtensionTask.new('deep_clone', gemspec) do |ext|
ext.lib_dir = 'lib/deep_clone'
end
Rake::Task[:spec].prerequisites << :compile
# Benchmarks
BENCHMARKS = Dir["#{ File.dirname(__FILE__) }/benchmark/*.rb"].map do |path|
File.basename(path, '.rb')
end
namespace :bench do
BENCHMARKS.each do |feature|
desc "Run #{ feature } benchmarks"
task(feature => :compile) { ruby "benchmark/#{ feature }.rb" }
end
task all: :compile do
BENCHMARKS.each do |feature|
ruby "benchmark/#{ feature }.rb"
end
end
end
task default: [:spec, :'bench:all']