bin/probe in utils-0.9.0 vs bin/probe in utils-0.10.0
- old
+ new
@@ -26,26 +26,22 @@
EOT
exit 1
end
def cmd(*args)
+ if ENV.key?('BUNDLE_GEMFILE')
+ args.unshift 'bundle', 'exec'
+ end
puts args * ' '
system(*args) or exit $?.exitstatus
end
def find_cmd(*cmds)
cmds.map { |c| `which #{c}`.full?(:chomp) }.compact.first or
raise fail "no #{cmds * '|'} command found"
end
-def zeus?
- !`which zeus`.empty? && test(?S, '.zeus.sock')
-end
-singleton_class.class_eval do
- memoize_function :zeus?
-end
-
def spring?
`bin/spring status`.lines.first =~ /^Spring is running:/
rescue Errno::ENOENT
false
end
@@ -56,13 +52,10 @@
def start_server
Thread.abort_on_exception = $DEBUG
spring? and
puts "Found spring running, I'll try to use it for running tests."
- zeus? and
- puts "Found a zeus socket file, I'll try to use it for running tests."
-
begin
DRb.start_service
DRbObject.new_with_uri($uri).shutdown
rescue DRb::DRbConnError
end
@@ -119,37 +112,26 @@
case ($opts[?t] || $config.probe.test_framework).to_sym
when :rspec
case
when spring?
- rspec = %w[bin/spring rspec -rutils -f Utils::LineFormatter ]
- when zeus?
- rspec = %w[-S zeus rspec -rutils -f Utils::LineFormatter ]
+ rspec = %w[ bin/spring rspec ]
else
- rspec = [ find_cmd('rspec', 'spec') ] << '-rutils' << '-f' <<
- 'Utils::LineFormatter'
+ rspec = [ find_cmd('rspec', 'spec') ]
end
- if linenumber = $opts[?n]
- cmd 'ruby', '-I', $config.probe.include_dirs_argument, *rspec, '-l',
- linenumber, *($args + testrunner_args)
- else
- $args = $args.map do |a|
- if Utils::Editor::FILE_LINENUMBER_REGEXP =~ a
- $~.captures * ':'
- else
- a
- end
+ rspec << '-rutils' << '-f' << 'Utils::LineFormatter'
+ $args = $args.map do |a|
+ if Utils::Editor::FILE_LINENUMBER_REGEXP =~ a
+ $~.captures.compact * ':'
+ else
+ a
end
- cmd 'ruby', '-I', $config.probe.include_dirs_argument, *rspec,
- *($args + testrunner_args)
end
+ cmd 'ruby', '-I', $config.probe.include_dirs_argument, *rspec,
+ *($args + testrunner_args)
when :'test-unit'
- if zeus?
- testrb = %w[-S zeus testrb]
- else
- testrb = find_cmd('testrb')
- end
+ testrb = find_cmd('testrb')
if testname = $opts[?n]
cmd 'ruby', '-I', $config.probe.include_dirs_argument, *testrb,
'-n', testname, *($args + testrunner_args)
else
for filename in $args
@@ -174,10 +156,10 @@
cmd 'ruby', cucumber, '-r', $config.probe.include_dirs_argument, '-l',
linenumber, *($args + testrunner_args)
else
$args = $args.map do |a|
if Utils::Editor::FILE_LINENUMBER_REGEXP =~ a
- $~.captures * ':'
+ $~.captures.compact * ':'
else
a
end
end
cmd 'ruby', cucumber, '-r', $config.probe.include_dirs_argument,