bin/probe in utils-0.48.0 vs bin/probe in utils-0.49.0

- old
+ new

@@ -1,40 +1,38 @@ #!/usr/bin/env ruby -# encoding: UTF-8 require 'tins/xt' require 'tins/lines_file' include Tins::GO require 'utils' include Utils require 'drb' +require 'shellwords' def usage - puts <<-EOT -Usage: #{File.basename($0)} [OPTS] [FILENAME[:LINENO]] + puts <<~EOT + Usage: #{File.basename($0)} [OPTS] [FILENAME[:LINENO]] -Options are + Options are - -n TESTNAME run the test TESTNAME in file FILENAME - -t FRAMEWORK use test framework FRAMEWORK (rspec, test-unit or cucumber) - -c start probe as a client - -C FOO[=BAR] set/get env variable on probe server - -l start probe as a server - -u URI use this DRb URI communication - -f FORMATTER use FORMATTER to display rspec output - -h display this help + -n TESTNAME run the test TESTNAME in file FILENAME + -t FRAMEWORK use test framework FRAMEWORK (rspec, test-unit or cucumber) + -c start probe as a client + -C FOO[=BAR] set/get env variable on probe server + -l start probe as a server + -u URI use this DRb URI communication + -h display this help -Version is #{File.basename($0)} #{Utils::VERSION}. + Version is #{File.basename($0)} #{Utils::VERSION}. EOT exit 1 end def cmd(*args) if ENV.key?('BUNDLE_GEMFILE') args.unshift 'bundle', 'exec' end - p args - puts args * ' ' + puts Shellwords.join(args) system(*args) or exit $?.exitstatus end def find_cmd(*cmds, on_fail: -> *cmds { raise fail "no #{cmds * '|'} command found" }) cmds.map { |c| `which #{c}`.full?(:chomp) }.compact.first or on_fail.(*cmds)