Sha256: a3017bf3aa132527d8a489f9dea3076519473edf8bbf210020672c7ff3baf7b3
Contents?: true
Size: 628 Bytes
Versions: 12
Compression:
Stored size: 628 Bytes
Contents
require 'guignol/commands/base' require 'guignol/models/instance' Guignol::Shell.class_eval do desc 'dns [PATTERNS]', 'Prints the DNS mappings for servers matching PATTERNS' def dns(*patterns) patterns.push('.*') if patterns.empty? Guignol::Commands::DNS.new(patterns).run end end module Guignol::Commands class DNS < Base def run_on_server(instance, options = {}) synchronize do shell.say instance.name.ljust(@max_width + 1) shell.say instance.dns_name end end def before_run(configs, options = {}) @max_width = configs.keys.map(&:size).max end end end
Version data entries
12 entries across 12 versions & 1 rubygems