Class: Bundler::Settings::MirrorConfig
Overview
Class used to parse one configuration line
Gets the configuration line and the value.
This object provides a `update_mirror` method
used to setup the given mirror value.
Instance Attribute Summary collapse
-
#uri ⇒ Object
Returns the value of attribute uri.
-
#value ⇒ Object
Returns the value of attribute value.
Instance Method Summary collapse
- #all? ⇒ Boolean
-
#initialize(config_line, value) ⇒ MirrorConfig
constructor
A new instance of MirrorConfig.
- #update_mirror(mirror) ⇒ Object
Constructor Details
#initialize(config_line, value) ⇒ MirrorConfig
Returns a new instance of MirrorConfig.
121 122 123 124 125 126 127 128 129 130 131 132 |
# File 'lib/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 |
Instance Attribute Details
#uri ⇒ Object
Returns the value of attribute uri.
119 120 121 |
# File 'lib/bundler/mirror.rb', line 119 def uri @uri end |
#value ⇒ Object
Returns the value of attribute value.
119 120 121 |
# File 'lib/bundler/mirror.rb', line 119 def value @value end |
Instance Method Details
#all? ⇒ Boolean
134 135 136 |
# File 'lib/bundler/mirror.rb', line 134 def all? @all end |