Skip to content
Browse files

nil も出力するようにした

  • Loading branch information...
1 parent 90c5972 commit 7db7b84d5105281bd1136fb84ffceec8dd87ff64 @jugyo committed
Showing with 9 additions and 1 deletion.
  1. +9 −1 lib/g.rb
View
10 lib/g.rb
@@ -5,7 +5,15 @@
module Kernel
GROWL = Growl.new "localhost", $0, ["Kernel.g"]
def g(*args)
- args.each { |i| GROWL.notify "Kernel.g", $0, i.pretty_inspect }
+ messages =
+ if args.empty?
+ [nil.pretty_inspect]
+ else
+ args.map { |i| i.pretty_inspect }
+ end
+
+ messages.each { |i| GROWL.notify "Kernel.g", $0, i }
+
if args.empty?
nil
elsif args.size == 1

0 comments on commit 7db7b84

Please sign in to comment.
Something went wrong with that request. Please try again.