ruby

VerseLogic » WordPress OpenID Plugin

Posted in ruby on January 7th, 2007 by Hamish Rickerby – View Comments

I just installed the VerseLogic wordpress OpenID plugin. This means that you guys (if you have an OpenID already) don’t have to explicitly register on my site to comment. You can just log in with your OpenID, and an account will be created here for you. No more passwords!

You can get a free OpenID at http://myopenid.com/

To find out more about OpenID, check it all out here.

Scope, creep. Part 2.

Posted in business, ruby, software on January 14th, 2006 by Hamish Rickerby – View Comments
Ah. The satisfying feeling of knowing you’ve created some elegant and functional code. That piece of functionality took a bit longer than I expected. Now to make it more robust. I’ve got a bit of error checking and feedback to insert, then we’re ready to roll.
See more progress on: Start my own business

wtf is racc?

Posted in ruby on January 10th, 2006 by Hamish Rickerby – View Comments

racc is the rubyised implementation of lex/yacc. I want to learn this as I’ve got some file parsing that needs doing, and this is the proper way to parse files. It’s a lot of guesswork at the moment…
Check http://i.loveruby.net/en/projects/racc/ to see what I’m on about.

See more progress on: learn to use racc

Scope, creep.

Posted in business, ruby, software on January 9th, 2006 by Hamish Rickerby – View Comments
It’s getting the better of me. I thought of a feature today that the application really should have. Now, I just have to build it in. Shouldn’t take me too long, I’ve just completed my design, now onto the coding.
See more progress on: Start my own business

Product Development

Posted in business, ruby, software on January 8th, 2006 by Hamish Rickerby – View Comments
Yesterday on the plane back from my holiday in Christchurch, I finished the functional aspects of my application that I’m developing.Today, I made it aesthetically pleasing. The application is ready for testing. I’m going to ask my friend Yanti who works for Unisys as a tester in Wellington to test the application out. 

There are some things I need to do as well.

  • Go see an accountant about company structures
  • Go and get a terms of service statement from a lawyer
  • Find a CMS to help me maintain a “business” web site
  • Find a product name.

That’s about it really. Shouldn’t be too hard to finish this off.

See more progress on: Start my own business

select with value – rubyonrails

Posted in ruby on December 29th, 2005 by Hamish Rickerby – View Comments

Grrr, just spent a little while playing with the “select” form tag in rails. Pain in the ass. The issue I was having is that I want to give users an option of 2 values with a default selected value on the “new” form. I also have a edit form that I want to let users update their objects with, and again, only 2 values. These values are static, and I didn’t want to have the pain of creating a db table, and an object to represent it. That would result in unnecessary code, and unnecessary database hits.

The issue with the “select” tag is that I cannot determine how to set the selected value, without using a collection of objects. I had a look for a solution for this problem, and found this site. This gave me a helper that lets me put in an object, with some methods to get the value and text options for my option set. that was alright. But, I didn’t want the full object model to be supported. I was after a very simple implementation with using a hash, and a string as the selected value.

I hacked around with the code, and this is what I came up with. Please feel free to pillage this.

def hash_select_with_current(object, method, hash, current_value)
result = “


return result
end
[/source]

Hope that’s useful for someone.

Go PayPal!

Posted in business, ruby, software on December 19th, 2005 by Hamish Rickerby – View Comments

Woohoo! I got PayPal IPN integration working. Now you can register with my application, make a payment via PayPal, and PayPal will come back to my web app and let me know that you’ve registered. Clever stuff.

I used the PayPal IPN GEM from http://dist.leetsoft.com, and integrated it with my own Payment object. I don’t really have the need for a full “ordering”-type system with my application. There is only ever 1 line item per order, so only a single payment object is required. I could have implemented an order, with order_line_items, and shipping and billing addresses, and tax and handling calculations, but I don’t need them.

I need to look into the IPN integration a little more tho. When I say I’ve got it working, I mean I’ve had 1 payment through that successfully updated a users registration details. PayPal seem to be pushing the transaction to me twice – I handle that correctly (checking for unique transaction IDs), but I think I need to respond to them in some other way. I better re-read those docs.

I’m quite pleased. Maybe a congratulatory coffee & and an apple are in order.

Money, Ruby on Rails and AUD

Posted in ruby on December 17th, 2005 by Hamish Rickerby – View Comments

I had a bit of a play with the Money and Paypal GEMs available at http://dist.leetsoft.com . The Money API only supports Euro, US and Canadian dollars. For my paypal integration, I need to support Australian dollar (as dirty old paypal don’t support NZD). So, I’ve extended the Money class to create an AUD implementation. There’s nothing special about it, but if you’re too lazy to write the couple of lines of code yourself, here it is.

Also, I’ve been having a bit of trouble getting the Money and Paypal GEMs to work. The issue is that from within a rails controller it doesn’t recognise the Money or Paypal classes. It can’t find them. This is the only GEM that I’m having troubles with. My solution was to import the .rb files into the /vendor directory. If anyone has this problem, or has a solution for this problem – or even tips, please let me know. It’s annoying me now.

If I can get this working, I won’t bother with my own IPN implementation. Why reinvent the wheel?