Skip to content

Instantly share code, notes, and snippets.

@semipermeable
Last active August 29, 2015 14:02
Show Gist options
  • Save semipermeable/5dffc6e6275ff589a63f to your computer and use it in GitHub Desktop.
Save semipermeable/5dffc6e6275ff589a63f to your computer and use it in GitHub Desktop.
solano-runner
#!/usr/bin/env ruby
require 'optparse'
options = {}
OptionParser.new do |opts|
opts.banner = "Usage: #{$0} [options]"
opts.on("-d PREFIX", String, "Prefix") do |v|
options[:prefix] = v
end
end.parse!
classes = ARGV.map{|f| File.basename(f).split('.')[0]}
cmd = "("
if options[:prefix]
cmd += "cd #{options[:prefix]} && "
end
cmd += "mvn -Dtest=#{classes.join(",")} test"
cmd += ")"
puts cmd
system(cmd)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment