#!/usr/bin/env ruby # encoding: utf-8 # # This file is part of the devdnsd gem. Copyright (C) 2013 and above Shogun . # 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 localizer = Lazier::Localizer.new(:devdnsd, ::File.absolute_path(::Pathname.new(::File.dirname(__FILE__)).to_s + "/../locales/")).i18n name "DevDNSd" description localizer.application_description version DevDNSd::Version::STRING option :configuration, [], {:type => String, :help => localizer.application_help_configuration, :default => "~/.devdnsd_config", :meta => localizer.application_meta_file} option :tld, [], {:type => String, :help => localizer.application_help_tld, :default => "dev", :meta => localizer.application_meta_domain} option :port, [], {:type => Integer, :help => localizer.application_help_port, :default => 7771, :meta => localizer.application_meta_port} option :pid_file, [:P, "pid-file"], {:type => String, :help => localizer.application_help_pid_file, :default => "/var/run/devdnsd.pid", :meta => localizer.application_meta_file} option :log_file, [:l, "log-file"], {:type => String, :help => localizer.application_help_log_file, :default => "/var/log/devdnsd.log", :meta => localizer.application_meta_file} option :log_level, [:L, "log-level"], {:type => Integer, :help => localizer.application_help_log_level, :default => 1, :meta => localizer.application_meta_level} command :start do description localizer.command_start option "foreground", [:n], {:help => localizer.application_help_foreground} action { |command| DevDNSd::Application.instance(command).action_start() } end command :stop do description localizer.command_stop action { |command| DevDNSd::Application.instance(command).action_stop() } end command :install do description localizer.command_install action { |command| DevDNSd::Application.instance(command).action_install() } end command :uninstall do description localizer.command_uninstall action { |command| DevDNSd::Application.instance(command).action_uninstall() } end action do |command| self.commands["start"].execute(ARGV) end end