lib/bundler.rb in bundler-1.14.6 vs lib/bundler.rb in bundler-1.15.0.pre.1
- old
+ new
@@ -53,10 +53,11 @@
autoload :SourceList, "bundler/source_list"
autoload :SpecSet, "bundler/spec_set"
autoload :StubSpecification, "bundler/stub_specification"
autoload :UI, "bundler/ui"
autoload :URICredentialsFilter, "bundler/uri_credentials_filter"
+ autoload :VersionRanges, "bundler/version_ranges"
class << self
attr_writer :bundle_path
def configure
@@ -410,24 +411,24 @@
@gemspec_cache[key].dup if @gemspec_cache[key]
end
def load_gemspec_uncached(file, validate = false)
path = Pathname.new(file)
- # Eval the gemspec from its parent directory, because some gemspecs
- # depend on "./" relative paths.
- SharedHelpers.chdir(path.dirname.to_s) do
- contents = path.read
- spec = if contents[0..2] == "---" # YAML header
- eval_yaml_gemspec(path, contents)
- else
+ contents = path.read
+ spec = if contents.start_with?("---") # YAML header
+ eval_yaml_gemspec(path, contents)
+ else
+ # Eval the gemspec from its parent directory, because some gemspecs
+ # depend on "./" relative paths.
+ SharedHelpers.chdir(path.dirname.to_s) do
eval_gemspec(path, contents)
end
- return unless spec
- spec.loaded_from = path.expand_path.to_s
- Bundler.rubygems.validate(spec) if validate
- spec
end
+ return unless spec
+ spec.loaded_from = path.expand_path.to_s
+ Bundler.rubygems.validate(spec) if validate
+ spec
end
def clear_gemspec_cache
@gemspec_cache = {}
end
@@ -440,21 +441,27 @@
def feature_flag
@feature_flag ||= FeatureFlag.new(VERSION)
end
def reset!
+ reset_paths!
+ Plugin.reset!
+ reset_rubygems!
+ end
+
+ def reset_paths!
@root = nil
@settings = nil
@definition = nil
@setup = nil
@load = nil
@locked_gems = nil
@bundle_path = nil
@bin_path = nil
@user_home = nil
+ end
- Plugin.reset!
-
+ def reset_rubygems!
return unless defined?(@rubygems) && @rubygems
rubygems.undo_replacements
rubygems.reset
@rubygems = nil
end