Category Archives: ruby

ruby

create folders & download files :: ruby

Again, another very small post. I’ve been tending to use ruby lately to perform little repetitive jobs. Currently I’m downloading files from one of our web servers. The requirement was to download multiple files and place them in their corresponding folders.

read more »

loadurnner qtp ruby

random numbers & words

The random function is extremely useful, no matter the language or application. I personally utilise it a lot, between many different languages. I have found, however, that it is one of those functions I always seem to forget how to do, and find myself re-learning it again.
I find the issue when I change from, be it, ruby, to qtp to loadrunner to winrunner. do while loops, counters, and arrays are all quite standard, but random, well, it gets me every time.

read more »

ruby watir

automation made easy::irb

I’ve used many automation tools, and have always faced many complex problems that often required solutions which needed much effort to maintain. There has never really been an automation solution that made life easy, quite ironic, considering the purpose of automation.

I found the most time consuming part of writing an automated script was shaking out the script during development. Normally I find that the culprit lies in the 7th or 8th screen, and thats when my script falls over…normally because of an invalid object or object name. So I fix it, and re run it, then the script falls over on the next screen…fix it, re run it….until I feel like I am an infinite loop that has no <break> statement…But now, I can write a script, without having to run it 50 times, and I can be confident that it will run, first time. How? you ask, with watir and irb….

read more »

ruby

ruby, oracle and excel

Databases exist everywhere, they normally contain gigabytes of valuable historical information that can be pulled by a simple sql query….or a not so simple one.

Either way, data is data, and its useless if its not being presented in a fashion that can be read and understood by the intended party. Excel spreadsheets are ever so popular in the presentation of data, and I’ve found that management prefer a spreadsheet in their inbox rather than a complicated sql query that I cooked up. Let’s face it, running an sql query in sql developer or toad every morning , pasting the results into a spreadsheet and emailing isn’t exactly fun…Sounds like a job for our old friend ruby.

read more »

ruby

reading a pdf with ruby

I’ll begin by admitting my new found love for ruby. A colleague of mine introduced me to ruby a few weeks ago, and at first, it seemed too good to be true…and I still think it is. Ruby offers a simple, efficient and ‘easy to maintain’ language, that can do the impossible in the least amount of lines I have ever seen…Being able to build scripts that take care of tedious tasks quickly, has never been easier, so to you ruby, I take my hat off.

Recently, I came across a question that was asked on the watir general google group. Watir stands for “web application testing in ruby”, but more on that later. The user wanted to know how to read a pdf file in ruby. So I took it upon myself to work it out.

read more »