Permalink
Browse files

changed to able to specify some options

$g_host, $g_priority, $g_sticky
  • Loading branch information...
1 parent 6f8245a commit 87a5b20630eb880bddf568419bfc59137223a036 @jugyo committed Nov 6, 2009
Showing with 9 additions and 4 deletions.
  1. +1 −1 Rakefile
  2. +1 −1 g.gemspec
  3. +7 −2 lib/g.rb
View
2 Rakefile
@@ -13,7 +13,7 @@ task :gemspec do |t|
file << <<-EOS
Gem::Specification.new do |s|
s.name = 'g'
- s.version = '1.1.0'
+ s.version = '1.2.0'
s.summary = "The Kernel.g that works like Kernel.p on growl :)"
s.description = "The Kernel.g that works like Kernel.p on growl :)"
s.files = %w( #{Dir['lib/**/*.rb'].join(' ')}
View
2 g.gemspec
@@ -1,6 +1,6 @@
Gem::Specification.new do |s|
s.name = 'g'
- s.version = '1.1.0'
+ s.version = '1.2.0'
s.summary = "The Kernel.g that works like Kernel.p on growl :)"
s.description = "The Kernel.g that works like Kernel.p on growl :)"
s.files = %w( lib/g.rb
View
9 lib/g.rb
@@ -2,17 +2,22 @@
require 'ruby-growl'
require 'pp'
+$g_host ||= "localhost"
+$g_priority ||= 0
+$g_sticky ||= true
+
module Kernel
- GROWL = Growl.new "localhost", $0, ["Kernel.g"]
def g(*args)
+ growl = Growl.new $g_host, $0, ["Kernel.g"]
+
messages =
if args.empty?
[nil.pretty_inspect]
else
args.map { |i| i.pretty_inspect }
end
- messages.each { |i| GROWL.notify "Kernel.g", $0, i }
+ messages.each { |i| growl.notify "Kernel.g", $0, i, $g_priority, $g_sticky }
if args.empty?
nil

0 comments on commit 87a5b20

Please sign in to comment.