My Life As A Blog

Archive for the ‘Ruby’ Category

MSDN eBook available

with one comment

Eric has posted the lowdown on the MSDN eBook that’s just been made available.  It includes a short article I wrote about the DLR along with another 12 bite size articles that cover everything (well, nearly everything) from IronPython to developing games with XNA.

Written by remark

April 21, 2009 at 6:04 pm

Ruby Tuesday #27 : IronRuby, Silverlight, Bacon and Eggs

leave a comment »

I watched John Lam’s talk at Mix 09 the other day – it’s worth watching.  During the talk John shows how to test Silverlight applications in a BDD style using IronRuby, and a gem called Bacon.  Part of the setup includes a small library to run Bacon in Silverlight.  It’s called, as you may have guessed by now, Eggs.  If you want to try Bacon and Eggs for yourself, Jimmy Schementi has posted a how-to here.  Happy frying!

Written by remark

March 31, 2009 at 8:57 pm

Posted in .NET, Ruby, silverlight, Software

Ruby Tuesday #26 : Round Up

leave a comment »

Time to share a few Ruby related links I’ve been following recently.

A Ruby Guide – a handy and concise guide to Ruby, great for beginners and useful for everyone else.

Automate Acceptance Testing with Iron RubyBen Hall’s article in MSDN magazine is worth reading.

How closures behave in Ruby – may need reading more than once.

Try IronRuby in AzureSimon Davies has combined Azure with the DLR.

Towards Ruby 1.9.1 – useful info about Ruby versions.

Written by remark

February 24, 2009 at 11:03 pm

Posted in .NET, Ruby

Ruby Tuesday #25 : Automating Office

with one comment

OK, so technically it’s not Tuesday.  But I took Monday off, so today feels like Tuesday.

Getting back to Ruby, I wondered if you could use it to script tasks in Office.  A quick search not only revealed that you can, but there’s a blog that covers using Ruby on Windows that has a lot of examples and information about automating Office with Ruby.  Unfortunately, I haven’t had a chance to try any of the code out yet.  I’ll have to remedy that.

Written by remark

January 14, 2009 at 8:08 pm

Posted in Ruby, Windows

Ruby Tuesday #24 : When to use Ruby

leave a comment »

At Oredev last week, Holmesy and I had an interesting chat with Charles Nutter about Ruby, JRuby, IronRuby and, well, all things Ruby.  Marc’s posted some video of it here.  One of the topics we discussed after the bit we filmed is when you should use a dynamic language versus a static language.  I’ve heard a variety of opinions on this topic before, so I was interested to hear Charles’ suggestion that you should build your frameworks in a static language and your applications in a dynamic language – at least I think that’s what he said.  Great to get different thoughts and perspectives on this topic.

Written by remark

November 25, 2008 at 6:32 pm

Posted in .NET, Development, Ruby, Software

Ruby Tuesday #23 : Ruby at PDC 2008

leave a comment »

I mentioned yesterday that I went to an outstanding Dynamic Language session given by Jim Huginin.  This session used IronRuby and IronPython as example languages and is well worth viewing.  John Lam ran a session about IronRuby – I didn’t make his session, but I’ve watched the recording and it’s well worth a look. 

Another thing worth looking at is a Ruby gem that allows you to interact with .NET ServicesThoughtworks have developed it and you can find it here.

Written by remark

November 4, 2008 at 7:17 pm

Posted in .NET, Azure, Development, Ruby

Ruby Tuesday #22 : First steps with IronRuby and Silverlight

with one comment

With the recent release of Silverlight 2 and the latest version of the Dynamic Languages SDK, now seemed like a good time to write a simple Silverlight application in Ruby.  Once you’ve got all the bits downloaded, installed and extracted, find yourself a fresh new folder and open a command prompt.  I should note that I put the scripts folder of the Dynamic Languages SDK on my path variable before opening the command prompt.  At the prompt type:

sl ruby <application_name>

replacing <application_name> with the name of your application.  To see it running type:

server /b

Navigate to index.html and there’s the app running.

Right – time to fiddle.  Open the app.xaml file and add a button.  Here’s my xaml file:

<UserControl x:Class="System.Windows.Controls.UserControl"
  <Grid x:Name="layout_root" Background="White">
      <ColumnDefinition Width="*"/>
      <ColumnDefinition Width="100"/>
      <RowDefinition Height="100"/>
      <RowDefinition Height="*"/>
    <TextBlock x:Name="message" FontSize="30" Grid.Column="0" Grid.Row="0" />
    <Button Margin="4,4,4,4" FontFamily="Verdana" FontSize="18" Grid.Column="1" Grid.Row="0" 
Content="Push Me!" x:Name="rubyButton" />

Now, we just need to do something when the button is clicked.  Open the app.rb file and update the initialise method so it looks like this:

def initialize 
  message.text = "Welcome to Ruby and Silverlight!" do |sender, e| 
    message.text = "Hello World!" 

Reload your app, click the button and whoop with delight.  Worth looking at index.html in an editor – the documentation will prove helpful.

Written by remark

October 21, 2008 at 6:07 pm