-
Notifications
You must be signed in to change notification settings - Fork 3
/
Rakefile
39 lines (30 loc) · 918 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
require_relative './lib/toychain-node/version.rb'
test_files = Dir.glob('./test/*/*_test.rb') + Dir.glob('./test/*_test.rb')
gem_name = 'toychain-node'
gem_version = ToyChain::Node::VERSION
task :default => :test
desc "Test individual file or all files"
task :test, :file_name do |t, args|
test_files
.grep(/#{args[:file_name]}/)
.each { |file| require file}
end
desc "Watch individual file or all files"
task :watch, :file_name do |t, args|
require 'rerun'
options = Rerun::Options.parse
options[:clear] = true
Rerun::Runner.keep_running("rake test[#{args[:file_name]}]", options)
end
desc "Reinstall Gem"
task :reinstall do
system "gem uninstall #{gem_name}"
begin
FileUtils.remove_file "#{gem_name}-#{gem_version}.gem"
rescue
end
system "gem build #{gem_name}.gemspec"
system "gem install #{gem_name}-#{gem_version}.gem"
end
desc "Install Gem"
task :install => :reinstall