Articles

Ruby – Variables

Scenario 1: Local variable

class Ordin
def first
a=10
puts a
end
def second
puts a
end
end

obj=Ordin.new
obj.first
obj.second

output:

variable_explanation.rb:11:in `second’: undefined local variable or method `a’ for # (NameError)
from variable_explanation.rb:17

10

Description:
a –> works only inside of first method

———————————————-

Better Ruby Idioms

Carl and I have been working on the plugins system over the past few days. As part of that process, we read through the Rails Plugin Guide. While reading through the guide, we noticed a number of idioms presented in the guide that are serious overkill for the task at hand.

Car Finder Becomes a Hit Application for iPhone

We released Car Finder just over a week ago and the amount of attention we’ve received is much more than we could have ever anticipated. For those of you who don’t know, Car Finder is an iPhone application that utilizes augmented reality to help you find where you parked your car.

show_response to help debugging functional tests

While writing functional tests, I use assert_tag a lot. Many times the assertion fails and debugging with ‘response text’ dump on terminal is not easy. It would be much easier to debug if the response text is opened in a browser. This is how that can be done.

In your test/test_helper.rb add a new method called show_response.

Consuming XMPP PubSub in Ruby

XMPP is a very versatile protocol with well over several hundred proposed and working extensions, which has also proven itself in production (ex: Google Talk). Presence, roster management, federated and server to server (S2S) messaging are all examples of features that you get for free, which make it a very appealing platform for messaging applications.

#347 | “Rails Rake Tasks Reference” in Category: Cheat Sheets

»Synchronizing Core Data With Rails 3.0.0.pre«

Config So Simple Your Mama Could Use It

In which I clog a bit of code for simple application configuration.

Tonight, Kastner asked me if I had anything to do some simple configuration for something he was working on. I’ve got a simple module and yaml file that I’ve been using so I gist’d it. It then occurred to me that I might as well share it here too.

The Yaml

Below is an example of the yaml file. Basically, I setup some defaults and then customize each environment as needed.

The Ruby Show 99: Here's a YouTube link (NSFW) for those that haven't heard it and don't get the joke.

Episode #99 Like a Boss edition. Here's a YouTube link (NSFW) for those that haven't heard it and don't get the joke.

Rails Envy Podcast – Episode #099

Episode #99 Like a Boss edition. Here’s a YouTube link (NSFW) for those that haven’t heard it and don’t get the joke.

#346 | “Teach Me To Code” in Category: Blogs/Podcasts

»Synchronizing Core Data With Rails 3.0.0.pre«

huberry.com | Rails Fire

huberry.com