lib/bundler.rb in bundler-1.2.3 vs lib/bundler.rb in bundler-1.2.4
- old
+ new
@@ -97,13 +97,13 @@
# Returns absolute location of where binstubs are installed to.
def bin_path
@bin_path ||= begin
path = settings[:bin] || "bin"
- path = Pathname.new(path).expand_path(root)
+ path = Pathname.new(path).expand_path(root).expand_path
FileUtils.mkdir_p(path)
- Pathname.new(path).expand_path
+ path
end
end
def setup(*groups)
# Just return if all groups are already loaded
@@ -289,11 +289,11 @@
path = Pathname.new(file)
# Eval the gemspec from its parent directory
Dir.chdir(path.dirname.to_s) do
contents = File.read(path.basename.to_s)
- if contents =~ /\A---/ # try YAML
+ if contents[0..2] == "---" # YAML header
begin
Gem::Specification.from_yaml(contents)
rescue ArgumentError, YamlSyntaxError, Gem::EndOfYAMLException, Gem::Exception
eval_gemspec(path, contents)
end
@@ -324,10 +324,9 @@
raise GemspecError, msg
end
def configure_gem_home_and_path
blank_home = ENV['GEM_HOME'].nil? || ENV['GEM_HOME'].empty?
-
if settings[:disable_shared_gems]
ENV['GEM_PATH'] = ''
configure_gem_home
elsif blank_home || Bundler.rubygems.gem_dir != bundle_path.to_s
possibles = [Bundler.rubygems.gem_dir, Bundler.rubygems.gem_path]