Generating CHM Documentation for RSpec on Rails

Programming, Ruby on Rails No Comments »

RSpec is the king of the BDD hill when it comes to Rails, and the learning curve is quite steep. For Windows developers hooked on CHM documentation, it’s very easy to generate RSpec CHM files by running the command

rdoc -f chm -o chm_folder rspec*

in the

/vendor/plugins

directory of your RoR project where you have installed the RSpec and RSpec on Rails plugins using

ruby script/plugin install http://rspec.rubyforge.org/svn/tags/CURRENT/rspec
ruby script/plugin install http://rspec.rubyforge.org/svn/tags/CURRENT/rspec_on_rails

as described on the RSpec home page.

The resulting CHM is not the prettiest but it’s fully searchable and easier to use than sifting through the online rdocs in your browser.

Update December 5, 2008: RSpec is under heavy development, and installation instructions change frequently, so you should always refer to the rspec home page for details.

RSpec and RSpec for Rails are now gems only so to generate the chm file cd to your gems directory (usually C:\ruby\lib\ruby\gems\1.8\gems), which you can determine by running

gem env

at the command prompt, and then run

rdoc -f chm -o chm_folder rspec* -x helper_spec.rb

helper_rspec.rb has to be excluded as it causes the rdoc generation to hang. Here’s the updated resulting chm file for rspec, raw and unedited.

P.S.: This only works on Windows as it depends on HTML Help Workshop but the chm file can be viewed with other chm viewers. I recommend xCHM for Linux.

[Slashdot] [Digg] [Reddit] [del.icio.us] [Facebook] [Technorati] [Google] [StumbleUpon]

The Dark Side Revisited – Darkish Color Themes for Visual Studio

Programming, Visual Studio 8 Comments »

Developers have been experimenting with darker color schemes for Visual Studio, aiming to port their beloved Textmate or Vim environment to other IDEs including VS.

The Textmate Vibrant Ink theme was ported for Visual Studio and recently improved. Zenburn was ported from Vim to Visual Studio.

Collections of other dark color themes can be found here, here, and here. Some like them, some don’t.

I was in the latter group until recently. That was when I came across the Aloha scheme for Netbeans 6, which is based on the work of Carmelyne Thompson inspired by the RubyRobot scheme for Textmate.

I find the colors very enchanting so I went ahead and created an approximation of the Aloha theme for Visual Studio. I made the following changes:

  • Changed the font to Consolas 10 from Monaco 12. You can download the “original” Monaco font for Windows here.
  • Changed the green (102,153,51) strings to a light blue (191,191,255).

Please note that this a just and approximation and not an exact port for every language. Then again, why should it be? You can tweak the settings yourself quite easily in Options>Environment>Fonts and Colors.

Here’s a screen shot:

image

You can download the vssettings file and import it in Tools>Import and Export Settings…

In Visual Studio 2005 you will get a message similar to this:

The file x.vssettings was created with an unsupported version of this application and cannot be added to the settings file list.

Simply open the file in Notepad and replace

<ApplicationIdentity version=”9.0″/>

with

<ApplicationIdentity version=”8.0″/>

and it should import just fine.

One more thing: When you export the font and color settings, deselect all settings first and then just select Options>Environment>Fonts and Colors, so that the Export dialog looks like so:

image

Enjoy!

[Slashdot] [Digg] [Reddit] [del.icio.us] [Facebook] [Technorati] [Google] [StumbleUpon]

Internet Explorer Script Error / Library not registered with Visual Studio 2005

Programming, Visual Studio No Comments »

If you get an error like the above using MSDN help in Visual Studio (or in any other situation) you might try the following:

Go to “Add/Remove Programs”, locate “Microsoft Document Explorer 2005″ and repair it. You will have to restart your computer. Kudos to Steven Cheng for this info posted here.

The issue might be due to a failed or removed Orcas (Visual Studio 2008) Beta installation which corrupted the Document Explorer component on your machine. It’s still advisable to install Orcas Betas on virtual machines only.

[Slashdot] [Digg] [Reddit] [del.icio.us] [Facebook] [Technorati] [Google] [StumbleUpon]

"Unable to find the requested .NET Framework Data provider" with MySQL Connector/Net and Orcas

Programming, Visual Studio No Comments »

If you have MySQL Connector/Net installed and then install Orcas (Visual Studio 2008) Beta 2 (and probably earlier versions), your machine.config file will be changed so that it does not include the MySQL Connector/Net data provider information anymore. This can lead to problems with the DataSet designer, first complaining about the MySQL Connector/Net and then with the message quoted in title of this post. The simple solution is to reinstall the MySQL Connector/Net which will put the necessary provider information back in the <system.data><DbProviderFactories> section of your machine.config and your designers should start working normally again. Hope it helps.

[Slashdot] [Digg] [Reddit] [del.icio.us] [Facebook] [Technorati] [Google] [StumbleUpon]

Best-Practices Sample Application for Ruby on Rails

Programming, Ruby on Rails No Comments »

One of the most (in)famous marketing ploys of the not-so-recent past was the .NET pet store, where Microsoft showcased the new .NET framework in an ASP.NET web application with similar functionality as the erstwhile Java PetStore, using vastly less code. It also performed and scaled much better on all benchmarks conducted by Microsoft.

Sure enough, there’s a pet store done in Ruby on Rails as part of the ThoughtWorks Commons project, used mainly for scalability “shootouts”. Check it out and poke around to learn how things are can be done. There are actually two pet stores with PetStore2 more of an AJAX/Web 2.0  site. As complete sample rails apps for free download seem to be hard to come by here’s one option that can be used for learning as well as for speed tests. Hope it helps.

[Slashdot] [Digg] [Reddit] [del.icio.us] [Facebook] [Technorati] [Google] [StumbleUpon]