Ruby Banter #009
In Smalltalk code and data are always kept together. In Ruby this isn’t the case. In this episode, Manfred looks at a poor man’s version of keeping your data with your code.
Comments
Add your comment
In order to fight spam on this blog, posting comments from a browser without javascript is currently not supported.

Subscribe
Juno Blaauw 10 minutes later: (delete)
I have absolutely no idea what you are talking about, but you sure look cute. :-) ¶
Andrei 40 minutes later: (delete | show email)
omgomg it's eloy ! \o/ ¶
Andre Foeken about 11 hours later: (delete)
OMG Eloy you have fans!
<!-- insert cheerleader smiley here --> ¶
Dr Nic about 13 hours later: (delete | show email)
Three cheers for Eloy! ¶
Eloy Duran about 24 hours later: (delete)
Note to self:
- Sleep and shave before recording.
- Buy beer for fan-squad!
:) ¶
Manfred Stienstra 1 day later: (delete)
I've been doing this for years and I never get messages from fans :( It's apparent who has the better looks, even unshaved. ¶
Steffen Hiller 4 days later: (delete | show email)
I was curious about the regular expression you are using, since I believed it can't work. (I mean the second version at the end of your video /\n^__END__.*$/m, since the first version was indeed not working. ;-))
Well, after a little investigating I found out that the caret is matching a string which is at the very beginning or behind a newline character \n. I believed it matches only at the very beginning. Also the dot is matching all characters including newline characters \n because you are using the multiline option, that means the $ gets useless (it matches a string before the very end and before each newline character \n). To make the long story short, /\n__END__.*/m (without ^ and $) should have the same result. :-)
P.S. I like the format of your videos! (I don't mean quicktime, I mean the camera view switching between screen and you, and the fact that there is always someone sitting next to you and looking more or less interested (with a coffee cup) at what you are doing.)
P.S 2. Are you both genetic brothers (with two different lastnames)? You look similar. ¶
Manfred Stienstra 4 days later: (delete)
Steffen, you're probably right. I haven't spent time to optimize the regular expression but stopped hacking when it 'worked'. In a production setting I would write tests and find a more optimal expression.
Eloy and I are merely brothers of the soul, he's from Bolivian descent and I'm pretty much entirely Dutch (: ¶