Showing posts with label ruby. Show all posts
Showing posts with label ruby. Show all posts

Saturday, 18 September 2010

A new look for bawdo.com - soon


Around 5 years ago I wrote www.bawdo.com in PHP, this week I rewrote the site using Ruby on Rails. I have one more thing to do before I make it go live, and that is to migrate old posts over to the new site. Maybe tomorrow :-)



Here is a sneak preview. There are some missing elements such as a way to contact me from the site, my Mystery Tour page, and 150_002 Linux which is so old now it should probably be taken down.



The iPhone version of the site can currently display comments, but I have not hacked up the required form to add a new comment. Leave that for another day.

Sunday, 4 April 2010

Ruby syntax highlighting within websvn

I'm assuming you are using GNU Enscript for syntax highlighting with your websvn install.

It seems that enscript does not come with a ruby syntax highlighting rules file by default.So the first thing to do is find one. This one works for me:

http://support.rubyforge.org/svn/trunk/support/ruby.st?ref=darwinports.com

Now copy this into your enscript highlight rules directory. e.g.

cp ./ruby.st /usr/share/enscript/hl/

OPTIONAL: Test if highlighting is working or not:

enscript --color --language=html -Eruby --output=hello_ruby.html ./hello_world.rb

Now for the websvn side of things:

First off edit the websvn setup.php file and add rb and erb extensions to the $extEnscript array

e.g.
vim /usr/share/websvn/include/setup.php
# SNIP - find the extEnscript array
$extEnscript = array
# SNIP - and add these two
'.rb' => 'ruby',
'.erb' => 'ruby',
# SNIP

Next, edit websvn's config.inc file. e.g.

vim /etc/websvn/config.inc
# SNIP - search for extEnscript and add the following two lines.
$extEnscript[".rb"] = "ruby";
$extEnscript[".erb"] = "ruby";

This should be enough to get ruby syntax highlighting working. You can also edit your enscript.st to include naming and start rules for ruby if you'd like. e.g.

vim /usr/share/enscript/hl/enscript.st
# SNIP - Search for namerules and add the following:
/\.(rb|erb)$/ ruby;
# SNIP - Search for startrules and add the following:
/-\*- [Rr][Uu][Bb][Yy] -\*-/ ruby;