Ruby (5)

Include local file in Ruby

Yes, took me a while to find out i didn’t need “include” or “require” (coming from PHP), and so learned that all i needed was to simply use the File class and its open method… [code] f ="inc/some.html");; [/code]

HeartInternet Hostpay Error Logs Empty

Ok, so Heartinternet do some cool things, but they also do some stupidly annoying things too. Like when you are integrating hostpay, any glance at the error log will tell you nothing, because they are empty… Well. Extend shows the hostpay error logs empty. But they are not, hostpay just can’t open the log files […]

Get URL and parse query string using Ruby

As I’ve been learning Ruby, I’ve needed to do some of the simplest things, such as getting the current URL and parsing out the query string, things that are basic in the other languages i know. I was struggling to find out how to parse query string using ruby. Such as getting the current URL […]

show instance methods and variables in Ruby

as i am just learning Ruby (in at the deep end, the way we like it!), i needed to see what is available for certain objects (instances of) and variables methods etc, here’s what i know so far: to show methods: [code] <% puts thevar.methods.to_yaml %> [/code] and to see the instance variables: [code] <% […]

grouping packages in hostpay

By default, it’s not obvious how to grouping packages in hostpay – packages in hostpay are stored separately, i.e if you have a “hosting package” and then set multiple subscription periods, i.e monthly, yearly etc. then the default hostpay template will output them all as individual products. We actually want to display them as packages, […]