summaryrefslogtreecommitdiff
path: root/lib/bundler/runtime.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/bundler/runtime.rb')
-rw-r--r--lib/bundler/runtime.rb17
1 files changed, 6 insertions, 11 deletions
diff --git a/lib/bundler/runtime.rb b/lib/bundler/runtime.rb
index 31e71388a6..ec772cfe7b 100644
--- a/lib/bundler/runtime.rb
+++ b/lib/bundler/runtime.rb
@@ -28,11 +28,11 @@ module Bundler
spec.load_paths.reject {|path| $LOAD_PATH.include?(path) }
end.reverse.flatten
- Bundler.rubygems.add_to_load_path(load_paths)
+ Gem.add_to_load_path(*load_paths)
setup_manpath
- lock(:preserve_unknown_sections => true)
+ lock(preserve_unknown_sections: true)
self
end
@@ -94,8 +94,8 @@ module Bundler
definition_method :requires
def lock(opts = {})
- return if @definition.nothing_changed? && !@definition.unlocking?
- @definition.lock(Bundler.default_lockfile, opts[:preserve_unknown_sections])
+ return if @definition.no_resolve_needed?
+ @definition.lock(opts[:preserve_unknown_sections])
end
alias_method :gems, :specs
@@ -125,7 +125,6 @@ module Bundler
specs_to_cache.each do |spec|
next if spec.name == "bundler"
next if spec.source.is_a?(Source::Gemspec)
- spec.source.send(:fetch_gem, spec) if Bundler.settings[:cache_all_platforms] && spec.source.respond_to?(:fetch_gem, true)
spec.source.cache(spec, custom_path) if spec.source.respond_to?(:cache)
end
@@ -265,7 +264,7 @@ module Bundler
return if manuals.empty?
Bundler::SharedHelpers.set_env "MANPATH", manuals.concat(
- ENV["MANPATH"].to_s.split(File::PATH_SEPARATOR)
+ ENV["MANPATH"] ? ENV["MANPATH"].to_s.split(File::PATH_SEPARATOR) : [""]
).uniq.join(File::PATH_SEPARATOR)
end
@@ -301,11 +300,7 @@ module Bundler
e = Gem::LoadError.new "You have already activated #{activated_spec.name} #{activated_spec.version}, " \
"but your Gemfile requires #{spec.name} #{spec.version}. #{suggestion}"
e.name = spec.name
- if e.respond_to?(:requirement=)
- e.requirement = Gem::Requirement.new(spec.version.to_s)
- else
- e.version_requirement = Gem::Requirement.new(spec.version.to_s)
- end
+ e.requirement = Gem::Requirement.new(spec.version.to_s)
raise e
end
end