Warning, /education/kturtle/Rakefile is written in an unsupported language. File is not indexed.

0001 require 'rubygems'
0002 require 'rake'
0003 require 'rake/testtask'
0004 require 'fileutils'
0005 include FileUtils
0006 
0007 desc "Find all TODO's"
0008 task :todo do
0009   FileList['**/*.rb'].egrep(/TODO/)
0010 end
0011 
0012 require 'spec/rake/spectask'
0013 
0014 desc "Run all specs"
0015 Spec::Rake::SpecTask.new('spectask') do |t|
0016   t.spec_opts = ["--colour"]
0017   t.spec_files = FileList['spec/**/*.rb']
0018 end
0019 
0020 task :spec do
0021   # this is not too nice as we hide all the nice features of SpecTask
0022   # yet i really wanted to take the starting and stopping of the
0023   # interpreter out of the spec files and in to the Rakefile.
0024   puts "Staring the KTurtle interpreter in DBUS mode..."
0025   k = IO.popen './src/kturtle --dbus'
0026   sleep 1.5  # give it some time to start
0027   ENV['KTURTLE_INTERPRETER_DBUS_PID'] = k.pid.to_s
0028   puts "started with pid: #{k.pid}"
0029   begin
0030     Rake::Task[:spectask].execute
0031   rescue
0032     # this is necessary for otherwise the spectask aborts rake alltogether...
0033   end
0034   puts "Killing interpreter process."
0035   Process.kill('TERM', k.pid)
0036 end
0037 
0038 
0039 task :default => 'spec'