Shane Sveller

:interests => [:ruby, :rails, :punk_rock, :heavy_metal, :linux]

Local Gem Documentation With YARD, Pow and Alfred 2

I love rubydoc.info, but I was curious how hard it might be to run a local copy. The site is powered by the YARD gem.

You can use YARD to generate documentation for your installed gems, even if you use --no-rdoc when running gem install (or have included it in your .gemrc, as I have). This can be done by running yard server --gems and browsing to http://localhost:8808/.

I already run Pow on my MacBook, so I set up the yard server command to run in the background via OSX LaunchAgents:

’~/Library/LaunchAgents/YardDocs.plist’ (YardDocs.plist) download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
  <key>KeepAlive</key>
  <true/>
  <key>Label</key>
  <string>Yard Docs</string>
  <key>ProgramArguments</key>
  <array>
      <string>/opt/boxen/rbenv/shims/yard</string>
      <string>server</string>
      <string>--gems</string>
  </array>
  <key>RunAtLoad</key>
  <true/>
</dict>
</plist>
1
$ launchctl load -w ~/Library/LaunchAgents/YardDocs.plist

and then used the following to connect it up with Pow and visit it in my browser:

1
2
$ echo '8808' > ~/.pow/gemdocs
$ open http://gemdocs.dev/

This uses Pow’s port forwarding functionality rather than the more common Rack app usage. There was probably a way to implement this with a Rackup file but the last time I investigated this, I was not able to find a Rack configuration to run YARD’s gem docs server.

Next, I set up a custom search in Alfred 2 that allows me to look at the docs for any gem by pressint Alt+Space, then typing “gemd <gem name>”:

Alfred 2 Custom Search

If you have Alfred 2 installed, you can click here to add this search to your custom searches automatically.

Avoid Pow DNS Collisions on *.dev Through /etc/resolver

At work, we use the .dev TLD for some internal services, staging servers, etc. But I already use pow. What am I to do?

Turns out there’s a super easy fix for my scenario. All our stuff at work is a subdomain in the format of foo.<company>.dev, so this was all I had to do:

1
$ echo 'nameserver <DNS IP>' | sudo tee /etc/resolver/<company>.dev

Now Pow still works, but so do our internal services.

Ambition Gets the Best of Me

Recently I splashed on a RubyMotion license, and I’ve been itching to put it to good use as soon as I got my grubby little hands on it.

I’ve got a use-case I might be able to work with at my job for an internal service, but since our VPN client keeps crashing my Mac Mini due to a Mountain Lion incompatibility, I’m searching for something I can do at home.

So, I’m seriously considering setting out on the journey of developing a Ruby on Rails-powered blog engine and its accompanying read-write iOS client app in parallel, as a learning experience only.

Given my track record, I wouldn’t hold my breath on the results showing polish, or you know, completion.

AT&T iPhone 3G Versus Verizon Blackberry Curve

Having used a Blackberry Curve 8330 on Verizon’s network for many months, I feel I can provide a fairly deep comparison between that and my new iPhone 3G. Let me preface the following by saying I am neither a Mac nor a PC. I am both, and neither. I use OSX Leopard just as often as I do XP SP3 and Vista x64 SP1, along with Ubuntu 8.10 and Fedora 10. I am an OS-aholic. So I have no strong ties to any given platform.

What inspired the change was this: Up until the last month or so of my Verizon service, e-mail delivery on my Curve was nigh instantaneous. We’re talking 5-10 seconds average. I would get a little “ding!” out of my phone quicker than on my desktop e-mail client at my desk at work, and I should point that I am wired to the server by a single switch and a physical distance of perhaps 30 feet. That should clue you in. It was fast.

For the last 3-4 weeks, however, deliveries to my phone have been going slower and slower. I can verify that yes, e-mails are arriving in a timely fashion, as my desktop client is still showing work e-mail arrivals in the time you would expect. Same with Gmail. But my phone was frequently 10-15 minutes behind, and getting worse. I had full signal, according to my phone’s indicators, at all times.

More OSX Apps I Love

  • TextMate - Programmer’s text editor
  • 1Password - secure password and information manager that integrates into your browser(s)
  • AppZapper - clean up behind software you decide to axe
  • Boot Camp - Yeah, there’s still some Windows apps I use. (built into OSX)
  • Camouflage - hide those pesky desktop icons for focus and clarity
  • CoverSutra - iTunes tool for keyboard shortcuts, album artwork, Spotlight-like search, and Last.FM integration
  • Cyberduck - FTP/SFTP client with drag-and-drop and Growl notifications
  • Firefox 3.0 - only in release candidate status, but already a contender to finally replace Safari
  • Fluid - turn any website into a .app
  • Handbrake - DVD-ripping tool for converting DVDs to digital video files for your iPod, AppleTV, XBMC, etc.
  • iStat Menus - monitor your CPU, memory, and network usage in your menu bar
  • MacPorts - install Unix/linux tools using a tool similar to apt-get
  • NeoOffice - good, free replacement for the ****slow and bloated MS Office
  • Parallels Desktop - run Windows or Linux inside OSX
  • SquidMan - run the Squid HTTP caching proxy on OSX
  • SuperDuper / Carbon Copy Cloner - great backup tool
  • ted - Torrent episode downloader - track your favorite TV shows!
  • Time Machine - great, simple, configure-and-forget backup solution (built into OSX)
  • Twitterific - Twitter client
  • WhatSize / GrandPerspective - a graphical overview of what’s eating up all your harddrive space (hint: pr0n.)

OSX Apps I Can’t Live Without

  • Adium Multi-protocol IM client; supports AIM, Yahoo, MSN, MySpace, Google Talk, and loads more.
  • Growl pop-up notifications for anything and everything
  • Safari - included with OSX
  • Mail and Address Book- included with OSX
  • Quicksilver keyboard-based launcher; hard to explain what it does, but useful as all hell
  • Firefox browser, though I don’t use it nearly as much on OSX because of Safari
  • Schoolhouse homework manager or iProcrastinate
  • Colloquy IRC chat client
  • Google Mail notifier
  • iBackup
  • NetNewsWire RSS reader
  • Skim PDF reader (Preview is good, Skim is better)
  • The Unarchiver for zips, rars, aces, etc.
  • Transmission bittorrent client
  • VLC media player for files Quicktime won’t handle

Quick Tip: Ubuntu Default Runlevel

If you, like me, use sysv-rc-conf to change the services that run a particular runlevel, i.e. so that runlevel 2 is actually only networked and not GUI as tradition holds, you can set the default runlevel to boot in Ubuntu by editing:

/etc/inittab
1
id:3:initdefault

The number in the middle is the runlevel to start by default.

All Kinds of New Stuff

I got the idea for this post from Robby on Rails

Things I’ve been using/playing with lately:

Things I’d really like to learn more about:

Things that sound cool but I know nothing about:

  • StrokeDB - an embeddable distributed document database written in Ruby.
  • Using gmail with linux daemons - anyone have any good tutorials? I’m specifically looking for using something like exim, sendmail, fetchmail, what have you with a Google Apps domain