Category Archives: Automation

Rake tasks, arguments, and external scripts

I’ve previously covered how to use an external script from within a Rake task. This time, we want to be able to pass an optional argument to our task, that will be used within our external script, too.

Posted in Automation, Rails | Comments Off on Rake tasks, arguments, and external scripts

Automating web site interactions with Selenium

Dannon currently has a “promotion” called Cups of Hope where you can enter codes into their web page to donate money to breast cancer research. Entering data repeatedly gets old real fast, so I figured this would be a great … Continue reading

Posted in Automation, Ruby | Comments Off on Automating web site interactions with Selenium

Selecting an option from dropdown form fields with Mechanize

Mechanize works great for uploading data through forms: it has great support for manipulating text fields, check boxes, and so on. Selecting the appropriate option from a dropdown is slightly more roundabout.

Posted in Automation, Mechanize, Ruby | Comments Off on Selecting an option from dropdown form fields with Mechanize

Uploading data using Mechanize

In this post, I’ll briefly describe a Mechanize script I wrote to update data in a web application. We’ll see how to navigate using Mechanize, and finding HTML elements with XPath. The goal was simple: open a CSV file containing … Continue reading

Posted in Automation, Mechanize, Ruby | Comments Off on Uploading data using Mechanize

Data wrangling and Ruby metaprogramming

I needed to combine customer data from 2 separate sources (a homebrew warehouse and CRM) and output a report. Given I’d be dealing with similar objects with overlapping attributes, it would be really easy to make a gigantic mess with … Continue reading

Posted in Automation, Ruby, SugarCRM Ruby gem | Comments Off on Data wrangling and Ruby metaprogramming

Win32OLE and Ruby: working with cells and data

This post is part of a series. If you can’t understand what is detailed below, or can’t find the information you’re looking for, take a look at the index page. As explained previously, each Worksheet object Win32OLE uses contains many … Continue reading

Posted in Automation, Ruby | Tagged , , | 5 Comments

Win32OLE and Ruby: formatting worksheets

This post is part of a series. If you can’t understand what is detailed below, or can’t find the information you’re looking for, take a look at the index page. Now that we’ve crunched numbers and otherwise manipulated the data … Continue reading

Posted in Automation, Ruby | Tagged , , | Comments Off on Win32OLE and Ruby: formatting worksheets

Win32OLE and Ruby: working with worksheets

This post is part of a series. If you can’t understand what is detailed below, or can’t find the information you’re looking for, take a look at the index page. First things first Naturally, before you can use Win32OLE, you’ll … Continue reading

Posted in Automation, Ruby | Tagged , , | 4 Comments

Using Ruby and Win32OLE to manipulate Excel

In today’s business world, most data is presented in Excel format. However, working with Excel by hand can quickly become mind numbingly boring when it is reduced to repetitive actions such as copy and pasting, formatting, etc. This time would … Continue reading

Posted in Automation, Ruby | Tagged , , | Comments Off on Using Ruby and Win32OLE to manipulate Excel