Skip navigation

Category Archives: Ruby

Ruby scripting, including Rails

It is a truth universally acknowledged that not everyone is comfortable working with a command line. Let’s face it, some of our coworkers will never get over their desire for a good 5-cent GUI.

We’re a Ruby (and Java) shop here at work, so after I learned Ruby and started writing some serious scripts, I looked for a GUI toolkit for Ruby. Sadly, I found the available alternatives lacking for one reason or another.

Shoes looked good at first glance, but when its creator dropped out of programming, the Shoes project grew stale.. More recently, according the The Ruby Way (3rd edition), work has resumed on Shoes, but in JRuby. Maybe it would be worth taking a new look at Shoes, since we use JRuby here.

I also looked at Tk, but when I last checked, there were holes in the Ruby implementation (the Python implementation was more complete).

Qt is another popular toolkit used in Ruby, but the licensing (for commercial entities) caused me to pass on it.

One of the things I looked for was support built-in — either built-in to the programming language (so it’s all part of the same install), or built-in to the operating system itself (Windows, in our case). For a while, I played with the idea of scripting in Python, so I could use its superior implementation of Tk — but the needs of the many (possible users of any scripts I might write) outweighed the needs of the few (programmers who could maintain Python scripts in a Ruby shop).

Lately, my inclination has been to use PowerShell to run Ruby scripts, and this extends to writing GUIs. PowerShell can build GUIs using either Windows Forms (the old and busted way) or Windows Presentation Foundation (WPF).

Here are a couple of links to building GUIs using WPF:

Of course, when using PowerShell, it’s also a good idea to remember the Out-GridView cmdlet, which might be all the GUI some scripts need.

It’s been a long 3 1/2 weeks here.

The same day that I wrote my last post (Saturday, August 13), we discovered that one of our large web data servers was missing…everything.

This started a couple of weeks of time-consuming data restores. We were clocking overtime hours for the first time in months.

Now that the server is back to normal, we’re able to sit back and reassess processes here, which has led me to reassess my approach to scripting.

Over the past couple of months, I’ve been interested in testing PowerShell using Pester. However, after the past month, I think a better approach would be to use Ruby for applications that need testing (for example, scripts that delete data) and restrict PowerShell to building GUIs (since Ruby has been backward with regard to standalone GUIs) and read-only applications (for example, identifying incomplete data processing jobs)

I’m still planning to use version control (Git) with PowerShell. I’m not CRAZY.

 

 

 

I just discovered that RubyConf 2015 will be just down the road in San Antonio, a short drive away. (see what you miss when you don’t attend user group meetings?!)