Method: Dependabot::Bundler::FileUpdater::GitPinReplacer::Rewriter#on_send

Defined in:
lib/dependabot/bundler/file_updater/git_pin_replacer.rb

#on_send(node) ⇒ Object



36
37
38
39
40
41
42
43
44
45
46
# File 'lib/dependabot/bundler/file_updater/git_pin_replacer.rb', line 36

def on_send(node)
  return unless declares_targeted_gem?(node)
  return unless node.children.last.type == :hash

  kwargs_node = node.children.last
  kwargs_node.children.each do |hash_pair|
    next unless PIN_KEYS.include?(key_from_hash_pair(hash_pair))

    update_value(hash_pair)
  end
end