Method: Bundler::Plugin::DSL#source

Defined in:
lib/bundler/plugin/dsl.rb

#source(source, *args, &blk) ⇒ Object

[View source]

39
40
41
42
43
44
45
46
47
48
49
50
# File 'lib/bundler/plugin/dsl.rb', line 39

def source(source, *args, &blk)
  options = args.last.is_a?(Hash) ? args.pop.dup : {}
  options = normalize_hash(options)
  return super unless options.key?("type")

  plugin_name = "bundler-source-#{options["type"]}"

  return if @dependencies.any? {|d| d.name == plugin_name }

  plugin(plugin_name)
  @inferred_plugins << plugin_name
end