Category Archive for 'Ruby'

Moving Up on Mini-Scripting

Monday, September 10th, 2007

After my previous post on ad hoc scripting I had an example come up in my own work. I needed to search through some web logs for all hits in August to three servers from a pair of IP addresses. Below is the actual command line script I used, except I changed some [...]

Method Aliasing and Aspect-Oriented Programming

Thursday, August 30th, 2007

One of the things that I have recently played with in Ruby is a sort of aspect-oriented programming. I say “sort of” because Ruby is not really an aspect-oriented language out of the box, but with some inconvenient constructs one can approach problems in this manner, using this mindset. I touched this because [...]

From Vim to TextMate

Saturday, August 25th, 2007

Yesterday I switched from using Vim for all my code editing to TextMate. It is Mac only and costs €39 when I decide to register, but I really like how much easier it is to switch between more than two files and how it auto-terminates parentheses, logical statements, and HTML tags. This latter [...]

Why Use a Language-Powered Domain Specific Language?

Thursday, August 16th, 2007

Following my previous post on Domain Specific Languages (DSL), I had the pleasure of reading some responses.
Aristotle does not like using eval (source):
I mean, evaluating another source file every time you instantiate an object in that class? Awesome! If I had to maintain his code I’d refactor that part out of existence with a quickness!
Ovid [...]

Parsing Dates in Unix with Ruby

Saturday, August 11th, 2007

Ever need to write a script that can read a human readable date and turn it into something a computer can use? How often do you have “August 10, 2007″ in a string and need that converted to a number of seconds since January 1, 1970?
As it turns out, Ruby includes an excellent module [...]