Skip to content

Instantly share code, notes, and snippets.

@maxjacobson
Created November 3, 2021 16:15
Show Gist options
  • Save maxjacobson/52caef52ee99b958eba573e485c1db21 to your computer and use it in GitHub Desktop.
Save maxjacobson/52caef52ee99b958eba573e485c1db21 to your computer and use it in GitHub Desktop.
#!/usr/bin/env ruby
# frozen_string_literal: true
require 'shellwords'
require 'logger'
logger = Logger.new($stdout)
command = ARGV.join(" ")
logger.info "Examining #{command.inspect}"
fails = 0
runs = 0
10.times do
success = system(command)
runs += 1
if success
logger.info "Passed! So far has failed #{fails} out of #{runs} times"
else
fails += 1
logger.info "Failed! So far has failed #{fails} out of #{runs} times"
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment