SapphireSteel Software

 

  -  
     
     
     
  -  
     
     
     
  -  
     
     
     
  -  
     
     
     
  -  
     
     
     
     

 

  rss
RSS (SITE)
 
  rss
RSS (BLOG ONLY)
 
   
 
 
     

 

Section :: Ruby In Steel Archives
- Format For Printing...
Start Here...

Two Minute Guide To Steel

by Huw Collingbourne
Learn how to create a first Ruby In Steel Project
Wednesday 5 July 2006.
 

First download and install Steel

Create A New Steel Project

You can start a new Steel project just as you would start any other Visual Studio project: Select File, New, Project...

When the New Project dialog appears (shown above), select the Steel branch in the left-hand pane. Steel supports Ruby and Rails projects - and more alternatives may be available in later releases of Steel. For now, select the Ruby project type in the right hand window. Give the project a name by filling out the Name: field at the bottom of the dialog and, if you wish, click the Browse button to select a directory. Then click OK.

Add A New Item

Here I’ve create a project named TestProject. Before you can start programming you need to add a barebones Ruby program to the Project. In the Solution Explorer right-click the Project branch (not the Solution itself) and select Add, then New Item...

Note: if you want to load an existing ruby program file from disk, select Add, Existing Item...

Select An Item Template

In the Add New Item dialog, select an item type and give it a name in the field at the bottom of the dialog. The items set up some very basic syntax for a Ruby module or class. Alternatively you can start with an empty file. Then click Add.

Start Coding

Now start writing your program. Note that Steel has Ruby syntax-sensitive features including automatic code colouring and code collapsing.

Fix Errors

To run the program , press CTRL+F5 or click the Green ‘Run’ arrow in the Visual Studio toolbar. Syntax error messages will be shown in the Visual Studio Error List panel or (as seen here) in the console. Click the error message to locate the problem code in the editor.

Run Inside the Integrated Console

When any syntax errors are fixed, press CTRL+F5 again and your program will run inside the interactive console window, seen here docked beneath the code editor.

AddThis Social Bookmark Button

Forum

  • Two Minute Guide To Steel
    25 September 2006, by Thomas
    What are the chances of smart indenting getting added in the near future?
    • Two Minute Guide To Steel
      25 September 2006, by Huw

      Very good indeed!

      Not everything will be in the free edition, however...

      best wishes Huw

  • Two Minute Guide To Steel
    20 September 2006, by Ivan
    Ruby in Steel sure looks great, but I just installed it and I’ve got a problem when i create a new Rails project and i try to load the solution i get an error message from visual studio saying that "Value cannot be null. Parameter name: type" and then the solution is unavailable, i can’t do anything with it. Is there a way to fix this problem ?
    • Two Minute Guide To Steel
      20 September 2006, by Huw

      This message occurs if you fail to install a required Microsoft file called ProjectAggregator2.msi. This file is installed automatically when you run our setup.exe program. However, if you installed Ruby In Steel by running RubyInSteel.msi instead of setup.exe, you will need to install ProjectAggregator2.msi as a separate step. This file is included in our installation Zip and you just double-click it to install. That should fix your problem.

      best wishes

      Huw

      • Two Minute Guide To Steel
        21 September 2006, by Ivan
        Ok, my bad, didn’t even try the setup.exe. Thank you very much for the fast answer.
  • Two Minute Guide To Steel
    20 September 2006, by JohnR

    Am I missing something or were there a few typos? I am just starting out in Ruby so I could be wrong...

    1. return "Goodbye from #@mydata" the ’@’ was missing
    2. ob.setData should be ob.myMethod ?

    Anyway, had a look at the tool....works better than RadRails which I tested the code on too. Thanks, John

    • Two Minute Guide To Steel
      20 September 2006, by Huw

      The typo was intentional - honest ;-)

      I think you are referring to the screenshot in which I show how syntax errors are handled. The code shown has two errors - the class name on line 1 and the embedded variable missing the @ on line 16. Once you fix the first error, you can trap the next one and double-click either the error message in the console (shown in pic) or in the Visual Studio Error List. I think ob.setData comes from a different source file (at least, it must work as the output shows the code running).

      The Two Minute Guide was written a few months ago and quite a bit has changed since then (for the better, I hope). The next version of the free personal edition will be online in a couple of weeks. It will incorporate several features suggested by beta testers. Glad you like it so far. Naturally, I hope you’ll like the next version even more!

      best wishes

      Huw

 

© 2008 SapphireSteel Software. All rights reserved