I face various types of applications (web-based, GUI-based, command-line, etc.) on various platforms (Windows, Linux, etc.) to operate everyday. There is a great opportunity for me to automate tasks by scripting. But almost every type of application and platform has its native scripting language or tools (such as VBScript and PowerShell for Windows, Bash scripts for Linux, Selenium for web applications, and AutoIt for GUI applications, etc.). It kills me to learn and maintain so many scripting languages.
I have a feeling that Ruby can interoperate with various platforms easily, and it is very expressive. So my question is:
-
It is possible to use Ruby to script everything?
-
If it is, what are the main disadvantages compared to the native scripting language of each platform?
Best Answer
Ruby is a fine choice for a general purpose scripting language on Linux, OS X, etc. But I recently needed to write some scripts that would work on every version of Windows from 2000 through 7. VBScript didn't have the functionality I needed (talking to SOAP web services for example) and PowerShell isn't available for Windows 2000, so I looked outside the Microsoft toolkit and decided to give Ruby a shot (having used it on Linux in the past). I don't exactly regret the decision, but I do wonder if there might've been a better choice. My main complaints about Ruby on Windows were:
Still, things basically work the way you'd expect and I like working with Ruby about a thousand times better than anything built into the OS, so at a minimum, I'd say you could do worse than Ruby for general purpose scripting on Windows.