class Bundler::Settings::MirrorConfig
用于解析一个配置行的类
获取配置行和值。
This object provides a `update_mirror` method used to setup the given mirror value.
属性
uri[RW]
value[RW]
公共类方法
new(config_line, value) 点击以切换源代码
# File bundler/mirror.rb, line 121 def initialize(config_line, value) uri, fallback = config_line.match(%r{\Amirror\.(all|.+?)(\.fallback_timeout)?\/?\z}).captures @fallback = !fallback.nil? @all = false if uri == "all" @all = true else @uri = Gem::URI(uri).absolute? ? Settings.normalize_uri(uri) : uri end @value = value end
公共实例方法
all?() 点击以切换源代码
# File bundler/mirror.rb, line 134 def all? @all end
update_mirror(mirror) 点击以切换源代码
# File bundler/mirror.rb, line 138 def update_mirror(mirror) if @fallback mirror.fallback_timeout = @value else mirror.uri = Settings.normalize_uri(@value) end end