class ZabbixVhost::CLI

Public Instance Methods

autodiscover(path) click to toggle source
# File lib/zabbix_vhost/cli.rb, line 10
def autodiscover(path)


  configurations = ZabbixVhost::Config.dir_reader(path)


  data = configurations.collect do |c|

    unless c.server_name.nil?
      {
        "{#DOMAIN}" => c.server_name,
        "{#CONFIG_FILE}" => c.file_path
      }
    end
  end.compact

  print JSON.generate({data: data})


end
get_domain_data(config_file, function) click to toggle source
# File lib/zabbix_vhost/cli.rb, line 34
def get_domain_data(config_file, function)

  c = ZabbixVhost::Config.new(config_file)

  print c.send(function)
end
version() click to toggle source
# File lib/zabbix_vhost/cli.rb, line 43
def version
  puts ZabbixVhost::VERSION
end