Permalink
Browse files

Fix up default paste names.

  • Loading branch information...
1 parent bfbdb4b commit 95fa8dd3ad2fe3d3308e1a26a2143f0485888d30 @jbarnette committed Jun 3, 2008
Showing with 1 addition and 4 deletions.
  1. +0 −1 bin/pastejour
  2. +1 −3 lib/pastejour.rb
View
@@ -10,7 +10,6 @@ if $stdin.tty?
$stdout.write(Pastejour.get(name))
$stdout.flush
else
- name = "paste" if name.nil? || name.empty?
name = [ENV["USER"], name].compact.join("-")
Pastejour.serve(name, $stdin.read)
end
View
@@ -16,12 +16,10 @@ module Pastejour
def self.find(name, first=true)
hosts = Set.new
- name = /^#{name}$/ unless Regexp == name
-
waiting = Thread.current
service = DNSSD.browse(SERVICE) do |reply|
- if name.match(reply.name)
+ if name === reply.name
DNSSD.resolve(reply.name, reply.type, reply.domain) do |rr|
hosts << Paste.new(reply.name, rr.target, rr.port)
waiting.run if first

0 comments on commit 95fa8dd

Please sign in to comment.