summaryrefslogtreecommitdiffhomepage
path: root/Rakefile
blob: e513ad5a590934c4d2e42d85a9ad7e45a8e7ad4d (plain)
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
require 'rspec/core/rake_task'

task default: 'all'

def run_test(file)
  Rake::Task['build'].invoke
  Rake::Task['spec'].invoke
  system "( cd tests/ ; ruby #{file}.rb )"
end

desc "Run the specs"
RSpec::Core::RakeTask.new do |t|
  t.pattern = "spec/*spec.rb"
end

desc "Build Gem"
task :build do
  puts "==> uninstall gem"
  system "gem uninstall ruby2d --executables"

  puts "==> build gem"
  system "gem build ruby2d.gemspec --verbose"

  puts "==> install gem"
  system "gem install ruby2d-0.0.0.gem --local"  # --verbose
end


desc "Run Testcard"
task :testcard do
  Rake::Task['build'].invoke
  system '( cd tests/ ; ruby testcard.rb )'
end


desc "Test and build"
task :all do
  Rake::Task['build'].invoke
  Rake::Task['spec'].invoke
end