-
Notifications
You must be signed in to change notification settings - Fork 39
/
Rakefile
42 lines (35 loc) · 1.14 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
#-*- mode: ruby; -*-
#
# Release Engineering
# 1. edit the "s.version = " and "s.date = " "line of fuzzy-string-match.gemspec
# 2. rake && rake build
# to generate pkg/fuzzy-string-match-x.x.x.gem
# 3. install fuzzy-string-match-x.x.x.gem to clean environment and test
# 4. rake release
#
# for Development
# rake test_dev
# rake benchmark
require 'rake'
require 'bundler/gem_tasks'
task :default => [:test] do
end
task :test => [:fallback_test] do
sh "ruby -I ./lib `which rspec` -b ./test/basic_native_spec.rb" if File.exist?( "./test/basic_native_spec.rb" )
sh "ruby -I ./lib `which rspec` -b ./test/basic_pure_spec.rb"
sh "ruby -I ./lib `which rspec` -b ./test/mutibyte_spec.rb"
end
task :fallback_test => [:clean_dot_rubyinline] do
sh "/bin/mkdir -p /tmp/fake_gcc/"
sh "/bin/cp ./fake_gcc /tmp/fake_gcc/gcc"
sh "export PATH=\"/tmp/fake_gcc:${PATH}\" ; rspec -I ./lib ./test/fallback_pure_spec.rb"
end
task :test_dev do
sh "ruby -I ./lib `which rspec` -b ./test/verify_with_amatch_spec.rb"
end
task :bench do
sh "ruby ./benchmark/vs_amatch.rb"
end
task :clean_dot_rubyinline do
sh "/bin/rm -rf ~/.ruby_inline"
end