Adding DRYML syntax highlighting support (NetBeans 6.0 with Ruby)
Hobo is an amazing extension to Ruby on Rails that allows for very rapid web application development. An integral part of what makes it such a productivity boost is its template language: DRYML.
As the Hobo project is still quite young, it is seldom supported by the widely used Ruby on Rails IDE's like Aptana, TextMate, Emacs - and more recently - NetBeans. As far as IDE's need be concerned, DRYML is little more than XML with embedded Ruby (ERb). As NetBeans already supports Ruby on Rails (fantastically!), it shouldn't be too difficult to get the RHTML rendering engine to be on the lookout for files bearing the *.dryml extension that signifies a DRYML file. Surprisingly, this is an odious task in many of the other IDE's, most notably those of the Eclipse family (RadRails, Aptana).
What follows is a short tutorial on how to get your RHTML syntax highlighting applied to your DRYML files:
In your installation directory, you should see a _ruby1/_ directory. If you don't you evidently do not have Ruby support enabled. Do this first.
- Browse to: installation_directory/ruby1/modules/org-netbeans-modules-ruby-rhtml.jar/org/netbeans/modules/ruby/rhtml/resources/
- Open the RhtmlResolver.xml config file for editing
- Edit the contents by duplicating the <ext name="rhtml"/> line, and change the second line's 'name' attribute to "dryml"
- The file should now look something like this:
<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE MIME-resolver PUBLIC "-//NetBeans//DTD MIME Resolver 1.0//EN" "http://www.netbeans.org/dtds/mime-resolver-1_0.dtd"> <MIME-resolver> <file> <ext name="rhtml"/> <ext name="erb"/> <ext name="dryml" /> <resolver mime="application/x-httpd-eruby"/> </file> </MIME-resolver>
5. That should do the trick! Restart your NetBeans IDE, open a *.dryml file and verify that your RHTML syntax highlighting is working as it should.