Permalink
Browse files

Minor cleanup, removed vestigal gitjour code.

  • Loading branch information...
1 parent 1500023 commit 62290542ed63249d38fe577d6b4e9f9b945a2e58 @jbarnette committed Jun 4, 2008
Showing with 8 additions and 5 deletions.
  1. +8 −5 lib/pastejour.rb
View
@@ -1,7 +1,8 @@
require "dnssd"
+require "set"
require "socket"
require "webrick"
-require "set"
+
require "pastejour/version"
Thread.abort_on_exception = true
@@ -55,7 +56,7 @@ def self.get(name)
def self.serve(name, multiple, contents)
tr = DNSSD::TextRecord.new
- tr['description'] = File.read("#{path}/.git/description") rescue "a git project"
+ tr["description"] = "A paste."
DNSSD.register(name, SERVICE, "local", PORT, tr.encode) do |reply|
puts "Pasting #{name}..."
@@ -66,9 +67,11 @@ def log.log(*anything); end # send it to the abyss
server = WEBrick::GenericServer.new(:Port => PORT, :Logger => log)
- trap "INT" do
- server.shutdown
- exit!
+ %w(INT TERM).each do |signal|
+ trap signal do
+ server.shutdown
+ exit!
+ end
end
server.start do |socket|

0 comments on commit 6229054

Please sign in to comment.