Articles

Metaprogramming in Ruby: It’s All About the Self

After writing my last post on Rails plugin idioms, I realized that Ruby metaprogramming, at its core, is actually quite simple.

It comes down to the fact that all Ruby code is executed code–there is no separate compile or runtime phase. In Ruby, every line of code is executed against a particular self. Consider the following five snippets:

Rails-like console for any Rack based ruby web app

I always miss script/console from Rails while developing my Sinatra apps, especially ones built with DataMapper where I need to auto-migrate my db. Sinatra doesn't come with any comparable solution as it's not a full framework, but rather library for creating simple web apps. Recently I tried Heroku platform and their "heroku console" command inspired me to create something similar - racksh aka Rack::Shell.

#348 | “Ruby HTTP clients” in Category: Plugins/Gems/Code Snippets

»Synchronizing Core Data With Rails 3.0.0.pre«

The Ruby Show 100: And hey, it's episode 100!

Episode #100: Mustache edition. And hey, it's episode 100!

Episode 100

Episode #100: Mustache edition. And hey, it’s episode 100!

Passionate Programmer Video Online

Aloha!

Thanks to Panopto and ThinkTech Hawaii, we are pleased to offer video streaming of nearly all of the Aloha on Rails sessions. We will release the videos about once a week, and will announce each video here on our blog.

Want to go to RubyConf?

If you’d like to go to RubyConf next week, but you don’t have a ticket, you’re in luck! Sadly, I can’t go, so I have a ticket available for sale for $250. Drop me a line at ben at this domain if you’re interested.

Update: Sold!

Subdomain shared cookies in Merb's specs

I’m currently working on Merb app which makes use of subdomains for user accounts. In order to have user authenticated on both base domain and subdomains I set cookie domain like this in init.rb:

RubyConf Schedule

The RubyConf 2009 schedule was just posted. As a public service, I have fixed it to be readable and to use, you know, hyperlinks and stuff. Enjoy.

http://hasmanythrough.com/rubyconf2009/schedule.html

(Apparently my planning for GoGaRuCo 2010 has me thinking it's 2010 already. Fixed the year. Sorry about that. Sigh.)

Hashie: The Hash Toolkit

One of my earliest gems was Mash, a useful tool for creating mocking objects as a Hash. One of the most common problems people had with Mash was a simple one: it conflicted with another class of the same name in extlib! To address this problem as well as give the project some room to grow, Mash is now part of a new toolkit called Hashie. Hashie is available now via Gemcutter and the source, as always, is available on GitHub.

Shoes Piano v0.4 | Rails Fire

Shoes Piano v0.4

Send to friend

I realized a trivial tip about Shoes animate() / every() methods.Look at Shoes Tutorial Note 00540. I used that in the piano v0.4.# piano_snapshot_v0.4.pngNow can change the keyboard color to the sound. :)Have fun,ashbb

Images: