From efb50506ac70a1fcc95052ea589aa08cd3ff91c5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Wojciech=20Wn=C4=99trzak?= Date: Fri, 26 Feb 2016 20:54:12 +0100 Subject: [PATCH] Use Gem.use_paths method for setting paths It fixes case for JRuby which returns a regexp from Gem.path_separator, but also improves code by using built in method instead of passing string that later is changed to array again. --- lib/spring/client/binstub.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/spring/client/binstub.rb b/lib/spring/client/binstub.rb index 77775c35..544b3e54 100644 --- a/lib/spring/client/binstub.rb +++ b/lib/spring/client/binstub.rb @@ -38,7 +38,7 @@ class Binstub < Command require 'bundler' if (match = Bundler.default_lockfile.read.match(/^GEM$.*?^ (?: )*spring \((.*?)\)$.*?^$/m)) - Gem.paths = { 'GEM_PATH' => [Bundler.bundle_path.to_s, *Gem.path].uniq.join(Gem.path_separator) } + Gem.use_paths Gem.dir, Bundler.bundle_path.to_s, *Gem.path gem 'spring', match[1] require 'spring/binstub' end