Articles

SQlite3-Ruby Windows Builds

So, I’ve got a new sqlite3-ruby release pending (just a minor bug fix, is all), but I’ve learned my lesson about releasing a new version without a windows version pre-built.

The problem is, I’m not a Windows guy. My build environment for Windows is cobbled together and painful to use, when it works at all. I’ve decided that I won’t put myself through that pain anymore.

If you are a developer on Windows, and you have a sqlite3 build environment, and would be willing to compile the sqlite3-ruby extension for me, please do the following:

Red and Yellow And...

One of my last projects required me to spend a ridiculous amount of time categorising images into groups of colour. What a pain in the gluteus maximus.

Emacs? Emacs.

And with my handheld portable all-purpose lightweight doohickey I fuse thoughts and try not to be too picky. —Buck65

I’m personally offended that you enjoy the software you work with ;)—al3x

Update: Full 60-minute screencast now available at PeepCode!

Rails Database Connection with Block

I found myself needing to very quickly connect to an alternate database that was defined in my database.yml like so:

alternate_data:
    adapter: mysql
    database: alternate_database
    username: user
    password: pass
    host: localhost

I was accessing it with something similar to the following:

...And So Our Journey Begins!

It is with great pleasure and humility that I present to you, my new writings. I have decided to focus more on my real name and less on my dreamt up internet persona. Greetings everyone, for I am Jamie van Dyke a.k.a. fearoffish.

I have a new beginning. A new venture.

Testing views in RSpec with namespaced elements

We’ve been working on a Facebook app (yeah, I know, I’m sorry) and have had all kinds of fun challenges. We wanted to test FBML tags in the view, but the problem is that FBML uses namespaced elements.

Rails Caching: Dynamic Fragments

I am finally getting around to implementing caching on my Rails application that I’ve been working on adamantly for the past couple of months.  For the time being, I am using a memcached server with simple action and page caching.  I ran into a few problems with my first few attempts at fragment caching and decided it wasn’t really necessary for the time being.  I needed a simple method of including small sections of dynamic code in an otherwise static page.  I then wanted to use action caching on the resulting view.  I’ll outline a simple method I used to achieve this.

Rails templates

So now that Edge Rails got templates ( Thanks to Jeremy ) I just wanted to give a top level overview.

Templates are simple ruby files containing DSL for adding plugins/gems/initializers etc. to your freshly created Rails project. To apply the template, you need to provide rails generator with location of the template you wish to apply, using -m option :

Merging bug fixes

Greetings! I’ve been doing some maintenance work on Mephisto. The current development version now supports Ruby 1.8.7 and Rails 2.0.5. The unit tests all pass, and model_stubbing has been ripped out and replaced with machinist. I want to thank Rick Olson, Sven Fuchs and Peter Suschlik for all their help.

There are several things that we should probably do before making a Mephisto 0.8.1 release:

rejoice! rg is now part of rails

Just over a month ago, I posted a project named rg to my Github account.  It allows you to apply programmatic templates to your Rails applications so you can avoid all that monotonous setup every time you start a new app and avoid keeping it in Git where it tends to SCM rot.

Boson: A Next Generation Task Framework for Ruby | Rails Fire

Boson: A Next Generation Task Framework for Ruby

boson.pngBoson is a new command/task framework for Ruby by Gabriel Horner (of Hirb fame). Gabriel seems to be trying to supersede Rake, the Ruby "make" equivalent, and from first glance Boson seems to provide many benefits from the "reinvent the wheel" philosophy.

Anyone who's built a Rakefile knows it's not the most straightforward syntax, so Boson's approach of using regular Ruby code in the shape of methods added to a module is refreshing. Tasks are methods, methods are tasks - simple. Within these methods, you can use the options helper method and passed arguments to access command line options and other data. Another feature is that while, like with Rake (or Thor), Boson can execute commands from the command line, you can also do so from IRB (the Ruby "console").

It's always a bit of a crapshoot when new tools come out in the Ruby world. Some catch on, some don't. Gabriel has clearly put a lot of thought into Boson, though, so if enough people are fed up with using Rake for command launching, I think it could catch on. Gabriel's blog post outlines what Boson does perfectly. For those ready to shoot down Rake, though, don't forget to read John Barnette's awesome, recent On Rake post. Rake's not just about launching tasks - it's a killer dependency resolution engine at heart, and that can result in less code if you approach your problems the right way.

(Aside: Sorry for the slow week at Ruby Inside. Six days ago my wife gave birth to our daughter and since she had a C-section, I'm playing housewife. I have quickly discovered if you're a housewife - or husband! - you have about zero hours left at the end of the day to do any other work.. I shall try my best!)

rupho.png[ad] Mobile Orchard's from Rubyist to iPhone programmer in 2 days class is coming to Portland/OR Nov 12-13 and Los Angeles/CA Nov 19-20. $1200 $799 with early reg and "inside" discount code. Note that the early registration price ends tomorrow - 10/23!