method
source

v2_6_3 -
Show latest stable
-
0 notes -
Class: Dsl
- 1_8_6_287
- 1_8_7_72
- 1_8_7_330
- 1_9_1_378
- 1_9_2_180
- 1_9_3_125
- 1_9_3_392
- 2_1_10
- 2_2_9
- 2_4_6
- 2_5_5
- 2_6_3 (0)
- What's this?
source(source, *args, &blk)
public
Hide source
# File lib/bundler/dsl.rb, line 148 def source(source, *args, &blk) options = args.last.is_a?(Hash) ? args.pop.dup : {} options = normalize_hash(options) source = normalize_source(source) if options.key?("type") options["type"] = options["type"].to_s unless Plugin.source?(options["type"]) raise InvalidOption, "No plugin sources available for #{options["type"]}" end unless block_given? raise InvalidOption, "You need to pass a block to #source with :type option" end source_opts = options.merge("uri" => source) with_source(@sources.add_plugin_source(options["type"], source_opts), &blk) elsif block_given? with_source(@sources.add_rubygems_source("remotes" => source), &blk) else check_primary_source_safety(@sources) @sources.global_rubygems_source = source end end