module Bundler

def load_gemspec_uncached(file, validate = false)

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
    if contents[0..2] == "---" # YAML header
      spec = eval_yaml_gemspec(path, contents)
    else
      spec = eval_gemspec(path, contents)
    end
    Bundler.rubygems.validate(spec) if spec && validate
    spec
  end
rescue Gem::InvalidSpecificationException => e
  UI::Shell.new.warn "The gemspec at #{file} is not valid. " \
    "The validation error was '#{e.message}'"
  nil
end