Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Fix up default paste names.

  • Loading branch information...
commit 95fa8dd3ad2fe3d3308e1a26a2143f0485888d30 1 parent bfbdb4b
@jbarnette authored
Showing with 1 addition and 4 deletions.
  1. +0 −1  bin/pastejour
  2. +1 −3 lib/pastejour.rb
View
1  bin/pastejour
@@ -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
4 lib/pastejour.rb
@@ -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
Please sign in to comment.
Something went wrong with that request. Please try again.