require "bundler/gem_tasks" require "rspec/core/rake_task" RSpec::Core::RakeTask.new(:spec) task :default => :spec namespace :spec do [:cli, :command, :sub_command].each do |dir| desc "Run #{dir} spec" RSpec::Core::RakeTask.new(dir) do |t| t.pattern = "spec/#{dir}/*_spec.rb" end end end namespace :document do task :build do docpath = "../documents/parser" if Dir.exist? docpath pid = spawn("yard", "-o", docpath, STDERR => STDOUT) Process.waitpid pid else puts "You don't have #{docpath} directory." puts "Can't create a new document." end end end