by adrian on May 18, 2012
Dash, by one man software shop Kapeli, is a nice little documentation browser and snippet manager for OSX. You can quickly look up methods by typing the method name in the little search field. But one thing that had me stumped for a bit was listing all available class instance methods.
Now this software is very new, it’s still currently a free release, but it will be priced once it gets it’s formal release. I assume there will also be some docs for it then, but in the meantime here’s a quick explanation through discovery.
I wanted to view all the instance methods for the Ruby String class. I tried to search for Ruby: String, which gave me a big list of methods that return a String. I tried a known String instance method, downcase, clicked the search result, and got the listing of Ruby’s String instance methods. Success, but in an ugly way.
A much better way is to just enter string in the search field, you then get a list of class names and methods on the top left. The top result should be the String class, but not necessarily from the documentation set you want. Click the little icon to the left of the class name, or hit <enter>. You’ll see a lit of docsets popup. Select the one you want. And that’s it. Simple, but hung me up for 10 minutes, I hope this saves someone else the trouble.

And a follow up. Steve Ringo (@stevenringo) pointed out that I was sooo close with ‘Ruby: String’, ‘Ruby:String’ (no space) would have given me what I wanted straight up… Doh!
by adrian on May 16, 2012
When I first started on this path I was a Windows user. Since my main interest was Rails, and the best Rails tools were all Mac based, I swapped over to Mac. One thing this has led to is that in addition to learning all the required web dev stuff, I also had to learn the console in OSX. Here’s one thing I’d seen ages ago and thought was usefull, but promptly forgot as I had more important things to remember at the time. Today I was watching a Destroy All Software screencast awas reminded of the terminal directory stack.
pushd and popd
If you’re traversing directories a fair bit in the terminal window, these commands are great for moving around and remembering where you were. It’s a mini stack that you can store directories in, or drop back to the previous directory path. For instance, if you’re in the following directory
and want to do something in another directory. You could just cd into the new directory, or you could push the current directory into the stack with
navigate to your new directory, do whatever you want there, then to go back to your stored directory
Of course, this can be expanded multiple times, and the stack can store many directories. If you want to just work with two directories, there’s a different option.
Toggling between directories
This is a real simple one. If you are in one directory, and you swap into another directory, you can toggle back to the previous directory using
issuing the same command again will toggle back, and so on. Here’s a quick example showing all three.
[~]$ cd play/wedisagree/
[wedisagree (master)]$ cd ../madelucky/app/
[app (master)]$ cd -
/Users/adrian/play/wedisagree
[wedisagree (master)]$ pushd .
~/play/wedisagree ~/play/wedisagree
[wedisagree (master)]$ cd ~/org
[org]$ popd
~/play/wedisagree
[wedisagree (master)]$ cd -
/Users/adrian/org
[org]$ cd -
/Users/adrian/play/wedisagree
[wedisagree (master)]$