The mind is like a parachute. If it doesn't open, you're meat.

ForgetMeNot: SublimeText, jekyll and rake

19 Sep 2013

One more in the series of let-me-jot-this-down-cause-I-forget-easily articles

In the blog’s hiatus time I managed to switch from Textmate to SublimeText.

The reason for switching has to do with SublimeText’s availability on all platforms I work with (namely I can get it to work on Windows). I’ve come to really like this editor with it’s simple JSON configuration and the lightning fast search facilities it offers. And I find increasingly annoying the need to switch outside the editor to perform tasks on the console.

Luckily SublimeText has a nice and simple (again JSON based) batch execution system (called a Build System). Instead of duplicating knowledge I myself have found somewhere else, go check this article by Addy Osmani which explains things very well.

Now, switching the blog to jekyll also means I spent a lot more time within SublimeText when I write blogs. In typically lazy fashion I switched to the terminal for jekyll build. This got old very fast, so I was looking for a way to get a build system to work.

The first thing was to call jekyll build directly, which went south pretty fast since I use rvm. The default OS X Ruby installation has actually never been used on my current machine.

Using Addy’s article I figured out how to set the environment to set the rvm path. Now, instead of using rvm-auto-ruby I just set the rvm default to the ruby version I use for my personal projects. All other installations don’t have the jekyll gem anyway.

And instead of creating a build system for jekyll I just created a rakefile that calls jekyll build and used the following as a build system

  "cmd": ["rake"],
  "file_regex": "^(...*?):([0-9]*):?([0-9]*)"

That “LC_CTYPE”:”UTF-8” is crucial, especially with the various greek, german and spanish UTF-8 characters loose on this blog. Jekyll chokes very fast (article number 3 to be exact) if it’s not set.

The beauty of it is that the standard Ruby regex for errors still works and stacktraces are clickable and open the correct file within the editor. Sweet!

blog comments powered by Disqus