Sha256: 8df20906d20ce39d9d66f969fadd879054ac353c1893a160e863fb346d72f870

Contents?: true

Size: 1.9 KB

Versions: 3

Compression:

Stored size: 1.9 KB

Contents

#!/usr/bin/env ruby
# encoding: utf-8
#
# This file is part of the devdnsd gem. Copyright (C) 2012 and above Shogun <shogun_panda@me.com>.
# Licensed under the MIT license, which can be found at http://www.opensource.org/licenses/mit-license.php.
#

require "rubygems"
require "devdnsd"

Mamertes.App do
  name "DevDNSd"
  description "A small DNS server to enable local domain resolution."
  version DevDNSd::Version::STRING

  option "configuration", [], {:type => String, :help => "The configuration file to use. Default is \"~/.devdnsd_config\".", :default => "~/.devdnsd_config", :meta => "FILE"}
  option "tld", [], {:type => String, :help => "The TLD to handle. Default is \"dev\".", :default => "dev", :meta => "DOMAIN"}
  option "port", [], {:type => Integer, :help => "The port to bind. Default is 7771", :default => 7771}
  option "log-file", [], {:type => String, :help => "The default log file. Not used if run in foreground. Default is \"/var/log/devdnsd.log\"", :default => "/var/log/devdnsd.log", :meta => "FILE"}
  option "log-level", [:L], {:type => Integer, :help => "The default log level. Valid values are from 0 to 5 where 0 means \"all messages\". Default is 1.", :default => 1, :meta => "LEVEL"}

  command :start do
    description "Starts the server."
    option "foreground", [:n], {:help => "Do not daemonize."}
    action { |command| DevDNSd::Application.instance(command).action_start() }
  end

  command :stop do
    description "Stops the server."
    action { |command| DevDNSd::Application.instance(command).action_stop() }
  end

  command :install do
    description "Installs the server."
    action { |command| DevDNSd::Application.instance(command).action_install() }
  end

  command :uninstall do
    description "Uninstalls the server."
    action { |command| DevDNSd::Application.instance(command).action_uninstall() }
  end

  action do |command|
    self.commands["start"].execute(ARGV)
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
devdnsd-1.5.2 bin/devdnsd
devdnsd-1.5.1 bin/devdnsd
devdnsd-1.5.0 bin/devdnsd