Category Archives: Ruby

Adding Books to Coda

Coda Books

I spend a lot of my day (and night [and dreams]) in Panic’s Coda doing web development voodoo stuff. So I found Coda’s built-in reference library to be quite handy, but I felt like it was missing something by only including HTML, CSS, JavaScript and PHP. So I added Ruby on Rails documentation, quite pissed that the book’s “cover” didn’t look as much like a book as the rest, which are clearly designed to appear as such.

Well I just quit my whining, when I came across Ray Brown’s Coda Book Cover Template PSD. With it, you can make as many new books of documentation as you’d like, and their covers will finally have a nice polished look to them. Just open the PSD, customize and drag the image into Coda when you create a new book. Have fun!

Coda Clips

Looking for some more ways to gear up your Coda editor? Look no further than Coda Clips. It’ll save you time! Browse and submit your own code clips, with one-click download to your Coda clips collection. Clips available for: HTML, CSS, PHP, JavaScript/jQuery, WordPress and others. Nice!

Tools for Rails Development on Linux

Hello again! Lately I’ve been learning to use the Ruby language as well as the Rails framework for building web apps. Ruby/Rails are a lot of fun, as are the tools I’ve been using throughout my projects. I’d like to share a few of these tools/tips.

For Rails work, either a simple text editor or a full-blown IDE will do. I’m usually doing something in between. I noticed all over the web in photos and screencasts that many who work on Rails use a Mac-only text editor called TextMate. TextMate seems like a great app–and it’s also enormously popular for that–but I’m just fine using gEdit, the GNOME text editor. That is, after a little tweaking. If you’re able to use gEdit (and that’s anybody now that there are Windows and Mac binaries), try these out:

gEdit Tweaks/Plugins

  • You might want to start by getting all the low-hanging fruit out of the way, like Line Numbering and the dark theme. Context coloring of code will happen on its own when you open/edit a file with the proper extension. Don’t forget about Find & Replace right on your main toolbar.
  • The default set of plugins that come with gEdit are a great start for making the editor work harder for you. Among these defaults (toggled in the Preferences > Plugins menu) are External Tools, which adds to your standard Tools menu, allowing the user to pipe output to a shell command or script, as well as the “Open a Terminal Here” feature and so on. This tool is easily extensible by you.
  • A very essential default plugin is the File Browser panel. When you enable it in the plugins menu and make the left panel visible, this makes navigating the file tree of your Rails project effortless. This tool is huge for productivity. I also think having the file browser open at the left provides a very useful mental reference as you move through your Rails project and focus on making adjustments in the Model, View, Controller framework. The ubiquitous TextMate also offers the same.
  • The Indent tool allows you to quickly indent/un-indent lines of code with either <Ctrl>T  or  <Ctrl><Shift>T. Quite useful.
  • Another tweak that adds TextMate-like functionality is the Snippets plugin. After entering a short tag you specify and using Tab completion (like bash tab-completion), gEdit will insert lines of code you often enter, saving you time and your hands the typing. Even higher productivity, less carpal tunnel.
  • Session Saver helps you be more productive and efficient in editing your Rails project, by saving all open files as a session. You can even name the sessions and keep track of many, as your workload increases.
  • And finally, the indispensable Terminal. This tool sits at the bottom of your gEdit window, completing your Ruby on Rails work environment. The terminal is great for running Ruby scripts, generating app components, debugging, and starting the application server–all without moving away from the file tree on your left and any open text files.

You will find all of the plugins I mentioned in gEdit by default, or with the addition of the “gedit-plugins” package from the repositories.

Firefox Add-Ons

Of course, no web developer’s arsenal would be complete without a few very effective Firefox Add-ons. Here’s what I’m using…

  • Firebug (but you probably have this already) to edit, debug, and monitor CSS, HTML, and JavaScript live in any web page. ‘Right-click > Inspect Element’ is probably the fastest way to find out what I’m working with in unfamiliar code.
  • YSlow for diagnosing performance problems in your web apps. Note that this requires the Firebug Add-on.
  • SQLite Manager for working with the SQLite databases created and used by my Rails apps. This is an excellent tool for quickly examining data you are working with on pages in your browser. You can view and update records in a snap with the SQLite Manager.
  • Screengrab lets you take screen shots of entire web pages or just a certain section, and save it to a file or your clipboard. This is nice for storing and sharing a snapshot of your Rails App, without worrying about cutting off the bottom as with a regular screenshot.

I hope you find some or all of these tools to be helpful in your Ruby on Rails development. They only add to the fun and ease of use that Rails provides. If you have any questions or something to add, please leave a comment or use other methods. Good luck!