Method: Bundler::Index#merge!

Defined in:
lib/bundler/index.rb

#merge!(other) ⇒ Object

Combines indexes proritizing specs from ‘other`, like `Hash#merge!` Duplicate specs found in `self` are saved in `@duplicates`.

[View source]

130
131
132
133
134
135
136
137
138
139
# File 'lib/bundler/index.rb', line 130

def merge!(other)
  return unless other
  other.each do |spec|
    if existing = find_by_spec(spec)
      add_duplicate(existing)
    end
    add spec
  end
  self
end