hoodwink.d enhanced
RSS
2.0
XHTML
1.0

RedHanded

Tuesday

2005.07.26

Windows Ruby? #

by why in cult

Tom’s Hardware is reporting that Microsoft registered a handful of domain names along with its intended Microsoft Vista domain. One of these domains is windowsruby.com! Seriously, that can’t happen. It’ll wash the one-click installer out of the ranks. (And confuse the entire Earth.) Also note: MS has used the name before.

Oh and they also registered windowssapphire.com. So it looks like Windows is going the Pokemon route. (Many coats to Andrew for sending this in!)

YAML's Merge Key #

by why in bits

Some of you might find YAML’s merge key convenient, especially in your database.yml files within Rails. The merge key basically mixes two hashes together, just like the Hash#merge method. You just place a << key in a hash with a value which is a hash or an array of hashes.

 death masks are?:
   sad: 2
   <<: {magnificent: 4}

Is just like:

 death masks are?:
   sad: 2
   magnificent: 4

So, if you are using the same login for different databases (which is likely very common):

 login: &login
   adapter: mysql
   host: localhost
   username: portly
   password: 666HELL666

 development:
   database: rails_dev
   <<: *login

 test:
   database: rails_test
   <<: *login

 production:
   database: rails_prod
   <<: *login

The login anchor is set up first and then its anchor is used throughout. I don’t think having a login entry in the file does any harm, does it?