Skip to content

Instantly share code, notes, and snippets.

@gmgent
Created March 8, 2011 20:40
Show Gist options
  • Save gmgent/860995 to your computer and use it in GitHub Desktop.
Save gmgent/860995 to your computer and use it in GitHub Desktop.
desc 'Checkins.'
task :ci do
comment = ""
while comment.blank?
$stdout.write "comment: "
comment = $stdin.gets
end
puts "Running tests..."
`rake test`
if $? != 0
puts "Tests failed."
#rerun test within system command to output meaningful err message
system("rake test")
exit(1)
else
puts "you may check in."
system("git commit -m '#{comment}'")
system("git push origin master")
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment