lib/do_dyndns/updater.rb
# Try all the commands until one of them works
Try all the commands until one of them works
Try all the commands until one of them works
def resolve(commands)
      _ip = nil
      commands.each do |service|
        _ip = `#{service}`.chomp.gsub(/[^a-z0-9\:\.]/i, '')
        _ip = _ip and break unless _ip.empty?
      end
      _ip.empty? ? nil : _ip
    end
def resolve ( commands ) _ip = nil commands . each do | service | _ip = ` #{ service } ` . chomp . gsub ( / [^a-z0-9 \: \. ] /i , '' ) _ip = _ip and break unless _ip . empty? end _ip . empty? ? nil : _ip end
Try all the commands until one of them works
Try all the commands until one of them works
commands
<not_specific>