Close
Glad You're Ready. Let's Get Started!

Let us know how we can contact you.

Thank you!

We'll respond shortly.

PIVOTAL LABS
Standup Blog 11/23/2009: uneval in JavaScript shell, Keycastr, ruby-growl, Maglev and Rubinius

Ask for Help

‘How do I get growl output using ruby-growl in irb?’

Seen at a RubyConf lightning talk, ruby-growl (aka “g”) is a library that provides a global “g” method
that you can use to inspect objects much like Kernel#p. Instead of printing the output to console
the output goes to Growl, a popular OS X global notifications tool.

require 'ruby-growl'

g = Growl.new "localhost", "ruby-growl",
              ["ruby-growl Notification"]
g.notify "ruby-growl Notification", "It Came From Ruby-Growl",
         "Greetings!"

Trying this out we are seeing the following error message:

Errno::ECONNREFUSED: Connection refused - send(2)

Tried these instructions to enable incoming notifications but still doesn’t work. Anyone?

‘Keycastr’ not working

KeyCastr is a Mac OS X application that displays your keystrokes in a small floating window much like growl – useful for
overhead projection, and we use it around here for everyday pair programming to answer the question “What key did you just press?”

If you are having troubles getting this to work, try enabling the checkbox in System Preferences -> Universal Access in the “Seeing” tab called “Enable access for assistive devices”

Enable access for assistive devices

Interesting Things

Tweet from Chad Fowler

When you are doing development in JavaScript using js shell and you try to inspect an object, all you can see is [object Object]

js> x = {foo: 'bar', baz: 1}
[object Object]

A convenient if obscure way to see more detail is uneval()

js> x = {foo: 'bar', baz: 1}
js> uneval(x)
({foo:"bar", baz:1})

Comments
  1. John Pignata says:

    For g you need to ensure you not only allow remote applications to connect but that you also allow remote applications to register. Check Growl’s properties — specifically under the network tab.

  2. John Pignata says:

    You may also need to restart Growl after you follow those instructions.

  3. Josh Susser says:

    Thanks for the tip. Did some digging and found these instructions, which are nice and clear: < http://bbrinck.com/post/73830054/getting-ruby-growl-to-work>

Post a Comment

Your Information (Name required. Email address will not be displayed with comment.)

* Copy This Password *

* Type Or Paste Password Here *