More Alternative Languages for WSH - Ruby
(Page 4 of 5 )
Ruby, created in Japan, is quickly emerging as a leader in the web development community. Its scriptable counterpart is ActiveScriptRuby, sometimes called RubyScript. Its functionality is similar to Java and its syntax is as simple as VBScript. These two qualities have helped to increase Ruby's popularity. While it has the power to operate as a system scripting solution, due to its web-dev nature, I highly recommend it for use in HTML applications.
Ruby boasts simplicity and ease-of-use. It uses a very natural syntax that makes it very easy to learn. Ruby is also very well documented. Keep in mind that most of this documentation was originally written in Japanese and painstakingly translated to English. Better written English documentation is emerging as Ruby is quickly gaining popularity in Europe and the Americas.
require 'win32ole'
Begin your Ruby script with this line if you want to connect to standard COM objects.
fso = WIN32OLE.new('Scripting.FileSystemObject')
A connection can then be made using the Win32OLE class.
folder = fso.GetFolder('C:temp')
for file in folder do
puts file.name
end
Ruby then uses a common object dot syntax to access an object’s properties and methods along with a simple for structure for iterating through the elements of a collection.
Next: Tips and Other Languages >>
More Windows Scripting Articles
More By Nilpo