class Bundler::Settings::MirrorConfig - bundler-1.15.4 Documentation

# class Bundler::Settings::MirrorConfig

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.

### Attributes

uri[RW]
value[RW]

### Public Class Methods

new(config_line, value) click to toggle source

    # File lib/bundler/mirror.rb, line 117
    def initialize(config_line, value)
      uri, fallback =
        config_line.match(%r{^mirror\.(all|.+?)(\.fallback_timeout)?\/?$}).captures
      @fallback = !fallback.nil?
      @all = false
      if uri == "all"
        @all = true
      else
        @uri = URI(uri).absolute? ? Settings.normalize_uri(uri) : uri
      end
      @value = value
    end

### Public Instance Methods

all?() click to toggle source

    # File lib/bundler/mirror.rb, line 130
    def all?
      @all
    end

update_mirror(mirror) click to toggle source

    # File lib/bundler/mirror.rb, line 134
    def update_mirror(mirror)
      if @fallback
        mirror.fallback_timeout = @value
      else
        mirror.uri = Settings.normalize_uri(@value)
      end
    end