require 'patch_server' require 'fileutils' DIST_FILE_BASENAME = "patch_server-#{PatchServer::VERSION}" def tag_match_exp(version) if version %Q('exact "TAG #{version}"') else %Q('name "TAG "') end end task :dist do |t| sh "darcs dist -d '#{DIST_FILE_BASENAME}'" end task :changelog do |t| from_version = ENV['FROM_VERSION'] to_version = ENV['TO_VERSION'] from_tag_parameter = "--from-match #{tag_match_exp(from_version)}" to_tag_parameter = to_version ? "--to-match #{tag_match_exp(to_version)}" : "" sh "darcs changes #{from_tag_parameter} #{to_tag_parameter}" end