class Bundler::DirectorySource

def merge_defined_specs(specs)

def merge_defined_specs(specs)
  @specs.each do |path, spec|
    # Set the spec location
    spec.location = "#{location}/#{path}"
    if existing = specs.values.find { |s| s.name == spec.name }
      if existing.version != spec.version
        raise DirectorySourceError, "The version you specified for #{spec.name}" \
          " is #{spec.version}. The gemspec is #{existing.version}."
      # Not sure if this is needed
      # ====
      # elsif File.expand_path(existing.location) != File.expand_path(spec.location)
      #   raise DirectorySourceError, "The location you specified for #{spec.name}" \
      #     " is '#{spec.location}'. The gemspec was found at '#{existing.location}'."
      end
    elsif !validate_gemspec(spec.location, spec)
      raise "Your gem definition is not valid: #{spec}"
    else
      specs[spec.full_name] = spec
    end
  end
  specs
end