Chris Umbel


for the last year i've somehow been avoiding doing any ruby work. been writing plenty of python for prototyping as and duct tape for work as well as hobby, but nothing in the way of ruby.

one of the reasons i've had the opportunity to write some python is because of ironpython. no matter how much diversity i would like in my professional development the truth is i work in a microsoft shop. it's just that simple. because ironpython lives in the .net runtime i only have to be slightly creative to get some professional use out of it.

with the advent of .net 3.5 microsoft (thanks in part to john lam) has introduced ironruby. much like ironpython the idea is simple. marry the .net runtime with the ruby programming language and its dynamic nature.

here's a simple example of creating a simple wpf interface in ironruby:

# load wpf
require 'PresentationFramework, Version=, Culture=neutral, 
require 'PresentationCore, Version=, 
  Culture=neutral, PublicKeyToken=31bf3856ad364e35'

# make a window
wnd =
# make a button
btn =
btn.Content = "Click me"

# assign a ruby block to a buttons click event do |sender, evt_args|
	System::Windows::MessageBox.Show("Hello from WPF in ruby.")

# slap the button on the window
wnd.Content = btn

# start the application
app = wnd

Fri Apr 11 2008 00:04:00 GMT+0000 (UTC)

Follow Chris
RSS Feed