Permalink
Browse files

not being so retarded

  • Loading branch information...
tenderlove committed Jun 5, 2008
1 parent 6be2c6c commit 52e122e43a6a82000c2f40a0e9035e484bf6264e
Showing with 11 additions and 7 deletions.
  1. +11 −7 lib/dejour.rb
View
@@ -5,15 +5,19 @@
Thread.abort_on_exception = true
module Dejour
- KNOWN_SERVICES = {
- 'git' => lambda { |reply, rr|
- [ "git repository", "git clone #{reply.name}" ]
- },
- 'pastejour' => lambda { |reply, rr|
- (from, to) = *reply.name.split('-')
- ['pastejour', "Paste from #{from} to #{to}"]
+ KNOWN_SERVICES = Hash.new { |h,k|
+ h[k] = lambda { |reply, rr|
+ [k, k]
}
}
+ KNOWN_SERVICES['git'] = lambda { |reply, rr|
+ [ "git repository", "git clone #{reply.name}" ]
+ }
+ KNOWN_SERVICES['pastejour'] = lambda { |reply, rr|
+ (from, to) = *reply.name.split('-')
+ ['pastejour', "Paste from #{from} to #{to}"]
+ }
+
NOTIFICATION_NAME = 'ruby-growl Notification'
def self.find(*names)
g = Growl.new('localhost', 'ruby-growl', [NOTIFICATION_NAME])

0 comments on commit 52e122e

Please sign in to comment.