Class: R10K::Settings::URIDefinition

Inherits:
Definition show all
Defined in:
lib/r10k/settings/uri_definition.rb

Constant Summary

Constants included from Logging

Logging::LOG_LEVELS

Instance Attribute Summary

Attributes inherited from Definition

#desc, #name, #value

Instance Method Summary collapse

Methods inherited from Definition

#assign, #evaluate, #initialize, #resolve

Methods included from Logging

debug_formatter, default_formatter, default_outputter, #logger, #logger_name, parse_level

Methods included from Helpers

included

Constructor Details

This class inherits a constructor from R10K::Settings::Definition

Instance Method Details

#validateObject



7
8
9
10
11
12
13
14
15
16
# File 'lib/r10k/settings/uri_definition.rb', line 7

def validate
  if @value
    begin
      URI.parse(@value)
    rescue URI::Error
      raise ArgumentError, _("Setting %{name} requires a URL but '%{value}' could not be parsed as a URL") % {name: @name, value: @value}
    end
  end
  super
end