Technology Agnostic Rubyist : Open Source Lights The Way

Tuesday, December 18, 2012

begin #dosomething rescue false end

I'm becoming a fan of the following Ruby code idiom, where a single line of code evaluates whether something is true or false.

def interrogative_function?(args)
    begin 1==1 rescue false end
end

Monday, December 3, 2012

Oracle Data Modeler, unsigned apps, and OSX Mountain Lion

I am loving this new macbook pro. As with any new computer, I've been installing most of the open source programs that I've gotten used to without a hitch. But today I came across an issue installing Oracle Data Modeler. The default security settings in OS/X 10.8 prevent installing unsigned apps and Oracle Data Modeler is one such unsigned app.

For all the noobs including me, the solution is to adjust the security settings in Apple's new Gatekeeper.

Here's a link to an explanation by that Jeff Smith => http://is.gd/Z8KuoO.

Saturday, June 23, 2012

Rails['2.0'..'3.x'].each do |learning|

I am porting an old RoR site I built in 2005/6 over to latest version of rails.

It took me days of effort to figure out why templates wouldn't render inside of the application layout.

It was b/c I was using <%= @content_for_layout %> in my application.html.erb file and it's been deprecated in favor of a simple <%= yield %>. #refactoring! hindsight is 20/20!

This script by John Nunemaker was useful for renaming my old view files from .erb to .html.erb.

Monday, February 22, 2010

reverse engineering and acts_as_state_machine

I started using railroad to help me understand (by way of reverse engineering) a complex system I'm working on.

I really like the fact that it generates .dot files which can be opened and manipulated using Omnigraffle, but it was failing on AASM due to complicated dependencies which I don't care to resolve.

Today I discovered that I can use ruby-graphviz to make pretty drawings of complex state machine events in my models. I highly recommend it.

Tuesday, November 3, 2009

Fresh Cucumber

I've been putting together a little project using Rspec and Cucumber. It's a way of coding called Behaviour Driven Development and I'm loving it.

Here is Aslak Hellesøy's excellent backgrounder on Cucumber: BDD that talks to domain experts first and code second

.

Thursday, September 10, 2009

API Changes

I decided to read the eBay API Developer Newsletter today and was reminded why this API can be difficult to work with. The reason is not because it is complex or difficult to master. It is because the API is constantly evolving (good), and often the evolutionary changes cause previous working code to fail (not good).

After glancing past the Developer Success Stories I found this valuable nugget:
The eBay API team is considering changing the case of the appinfo tags found in various wsdls—specifically, changing from upper to lowercase on the first letter only. For example, CallName could become callName, RequiredInput could become requiredInput, and MaxLength could become maxLength.
In stark contrast, a quote from the home page of rubyonrails.org:
Ruby on Rails is an open source web framework that's optimized for programmer happiness and sustainable productivity. It lets you write beautiful code by favoring convention over configuration.
Can an API be designed in such a way as to make programmers Happy and Productive?

.

Friday, July 31, 2009

country_select and my country of origin inflector method

Making use of the string class add-on that I developed at the recent Goruco conference.

I've put together a simple little app and a domain where some of the code is available to anyone who can use it.

Please contact me if you are interested any part of this.

Tweets

Contributors