test/fortune-dns.rb in rubydns-0.4.1 vs test/fortune-dns.rb in rubydns-0.5.0
- old
+ new
@@ -25,29 +25,29 @@
require 'rexec'
require 'rexec/daemon'
require 'rubygems'
+
require 'rubydns'
+# Provides String#chunked
+require 'rubydns/extensions/string'
+
require 'digest/md5'
# You might need to change the user name "daemon". This can be a user name or a user id.
RUN_AS = "daemon"
if RExec.current_user != "root"
$stderr.puts "Sorry, this command needs to be run as root!"
exit 1
end
+# To use, start the daemon and try:
# dig @localhost fortune CNAME
-#
-
-# HELLO = "こんいちは".force_encoding('ASCII-8BIT')
-
-# The Daemon itself
class FortuneDNS < RExec::Daemon::Base
- @@var_directory = File.dirname(__FILE__)
+ @@base_directory = File.dirname(__FILE__)
Name = Resolv::DNS::Name
IN = Resolv::DNS::Resource::IN
def self.run