2 ms·
Coding in Ruby all day using Sublime Text 2 has been totally awesome for a little while now. Debugging is not as slick as in Visual Studio-land but... that's w
by lectrick 15y ago
Coding in Ruby all day using Sublime Text 2 has been totally awesome for a little while now.
Debugging is not as slick as in Visual Studio-land but... that's what test coverage is for! (and it's super easy to do...)
Here, I wrote a class today which subclassed Delegator (https://gist.github.com/2305169 https://gist.github.com/2305169) that will let you return a value from a function that looks like a typical single scalar value but actually has "hidden" attributes riding along with it. Smoke and mirrors :) This is the first time I used this class or the Delegate pattern for that matter. (I came at programming from a Psych major.)
Notice the test inline with the class definition itself at the bottom that is only run when the file itself is run (not when it's merely included by another file). A simple Command-B (for Build) in Sublime Text 2 and I get the tests passing in a split second and know I didn't break anything.