task :release do version = RSpec::Core::VERSION.split('.')[0,2].join('.') docs_dir = "docs/#{version}" sh "yard -o pages-tmp" sh "git checkout gh-pages" rm_rf docs_dir mv pages-tmp, docs_dir sh "git add #{docs_dir}" sh "git commit -m 'Update docs for #{version}'" sh "git push" end