Feed items

Ruby’s Implementation Does Not Define its Semantics

When I was first getting started with Ruby, I heard a lot of talk about blocks, and how you could “cast” them to Procs by using the & operator when calling methods. Last week, in comments about my last post (Ruby is NOT a Callable Oriented Language (It’s Object Oriented)), I heard that claim again.

Ruby is NOT a Callable Oriented Language (It’s Object Oriented)

I recently ran across a presentation entitled Python vs. Ruby: A Battle to the Death. I didn’t consider it to be a particularly fair battle, and may well reply in more detail in a later post.

However, what struck me as most worthy of explanation was the presenter’s concern about the fact that Procs are not callable via parens.

AbstractQueryFactoryFactories and alias_method_chain: The Ruby Way

In the past week, I read a couple of posts that made me really want to respond with a coherent explanation of how I build modular Ruby code.

The Blind Men and the Elephant: A Story of Noobs

If you will indulge me, I’d like to paraphrase a familiar tale:

Once upon a time, deep in the forest, there was a tribe of elephant curators. The elders of this tribe kept sophisticated, detailed notes about the proper care and feeding of elephants, and the villagers tended to follow along.

Eventually, they dedicated a large section of the local library to books and articles on the care and feeding of elephants.

Using Bundler in Real Life

A lot of people have asked me what the recommended workflows for bundler are. Turns out, they’re quite simple.

Let’s step through a few use-cases.

You Get a Repo for the First Time

You’ve just checked out a git (or other) repository for an application that uses bundler. Regardless of any other features of bundler in use, just run:

bundle install

This will resolve all dependencies and install the ones that aren’t already installed in system gems or in your system’s bundler cache.

The Building Blocks of Ruby

When showing off cool features of Ruby to the uninitiated (or to a language sparring partner), the excited Rubyist often shows off Ruby’s “powerful block syntax”. Unfortunately, the Rubyist uses “powerful block syntax” as shorthand for a number of features that the Pythonista or Javaist simply has no context for.

To start, we usually point at Rake, Rspec or Sinatra as examples of awesome usage of block syntax:

Bundler 0.9: Heading Toward 1.0

Over the past two years, Carl and I have been working on-again off-again on the problem of dependency resolution. Fabien Franzen implemented the first partial solution for Merb, with thor merb:gem:install.

When we started working on Rails, we knew we wanted to finally crack the nut, making it possible for Rails itself to have some of its own dependencies, and solving some persistent, long-term problems with gem plugins.

SafeBuffers and Rails 3.0

As you may have read, Rails adds XSS protection by default in Rails 3. This means that you no longer have to manually escape user input with the h helper, because Rails will automatically escape it for you.

However, it’s not as simple as all that. Consider the following:

Corporations Cannot Have Natural Rights… Duh

When I first read through the Citizens United decision that essentially made it illegal to “discriminate” against corporate political speech, I found myself very torn. On the one hand, I’m an extremely avid supporter of free speech rights, and Kennedy wrote the majority decision to tug at my heartstrings:

Premised on mistrust of governmental power, the First Amendment stands against attempts to disfavor certain subjects or viewpoints or to distinguish among different speakers, which may be a means to control content.

The Irony of the iPad: A GREAT Day for Open Technologies

With the announcement of the iPad, the usual suspects have come out decrying a closed, proprietary, fully locked down system.

For instance, a story on the top of Hacker News today says:

This is what I asked in January 2007 on this site, shortly after the original iPhone was launched:

“1. Will Apple lock down the iPhone, blocking Flash, Java, custom widgets, and open development from its new platform?