About the author

Steven Harmansteven harman :: makes sweet software with computers!

For recent posts and more about me, scroll to the bottom.

Subscribe

  • Subscribe to my feed. via RSS
  • Subscribe via email via email

News

Badges

  • Subtext Project
  • Support Subtext

ruby

There are 10 entries for the tag ruby

OMG, Better Rake (for .net)!

If you ask me, when it comes tools for writing automated build scripts nothing packs more bang for the buck than Rake. Until recently, using Rake to build .net solutions required a magic concoction of hacked together scripts which rarely exhibited Ruby’s appreciation for beauty nor Rake’s spirit of simplicity. Luckily our buddy Derick Bailey decided it was time to bite the bullet and start building some real Rake tasks that were special suited for building .net code. The result is Albacore. Using Rake for .net IRL I’ve been using Rake to be lazy for a while. And we, the VersionOne dudes &...

Being Lazy with Rake

I’ve noticed Rake has been gaining some traction within the .net community as of late, or at least within a certain segment of that community. We’re currently using Rake to automate the great bulk of an entire deployment pipeline here at VersionOne, and I know of a few teams at Quick Solutions that are doing similar things. I believe Rake is a great tool for automating intensive processes and/or tasks and also find it to be great for handling some of the more mundane tasks we do on a daily basis. I spend a fair amount of...

Tab Completion and Syntax Coloring in IRB

Again, this is just another little reminder for myself since I keep forgetting how to do it. Anyhow… If you don’t have tab-completion and syntax coloring in your IRB sessions, you’re missing out! But thanks to both some kick-ass terminals and Ruby itself, you can get both in just a few simple steps. As easy as 1, 2, done! Assuming you’ve already got Ruby and RubyGems installed, fire up a terminal window and install the Wirble gem: gem install wirble Next, open (or create it if...

Installing RubyGems in Cygwin

This is as much a reminder for myself as anything else – as I’ve now had to do this about a dozen times between repaving my laptop, home workstation, and work machine(s). The How-To Don't try to install RubyGems for Cygwin using the gem that comes with the Ruby One-Click Installer for Windows. Instead, get the tarball, or zip file, and install it using the included installer script. Since RubyGems is pure Ruby you don't have to worry about having a compiler installed. It should just work with the default Cygwin install plus Ruby...

Ruby Has Ranges, and So Does C#

Creating a Range in Ruby is dead simple. 1: my_range = (1..10) 2:   3: my_range.each { |i| puts "My number is: #{i}." } Running that little snippet will do just what you think, push the numbers 1 through 10 out and shove them into the sentence my number is x. ...

On Geek Hero Worship

After last night's Columbus Ruby Brigade meeting several of us were over at a local watering hole soaking up some Guinness and a great conversation. Like all great conversations, at some point the conversation devolved into war stories, then then one-upsmanship, and finally a lot of hero worship. And no adulation is complete until some one points out that those folks we put up on pedestals are normal people, much like the rest of us. Of course being a bunch of Ruby enthusiasts, with several bordering on fanatics, that statement when something like They...

Expectation Based Testing with Mocks

Last week I talked about Rubifying your C# code by adding the .Each() extension method to the IEnumerable<T> interface. I was discussing that code with one of the guys at work and he asked a brilliant question So, how did you test that? I was floored. Being such a test-first fan boy I couldn’t believe that I had failed to write that little extension method in a TDD manner. Hell, I hadn’t even done TAD! So how do I test it? There are no doubt a plethora of ways to test this...

Get Ruby-esq Each Iterators in C# 3.0

Yes, Ruby and other dynamic languages are all the rage these days. Yes, using Extension Methods in C# 3.0 is overplayed. But you know what... I don’t care! So I’m going to show you an Extension Method that will bring a little Ruby-goodness to your hum-drum C# world. The Ruby goodness One of my favorite control structures in Ruby is the each method. This method can be used on any string, array, or hash to quickly iterate over each character of a string, item of an array, or key/value pair of a hash. That’s...

Value Type Parameters Are Still Value Types, Even in a Lambda Expression

Today I was refactoring some unit tests, trying to get rid of some funky smelling tests, I made the all to common mistake of trying to be too clever. The smell This particular project has several entities that have a Timestamp field, represented by a byte array in the domain objects - err, code... depending the semantics you use. What I found to be particularly stinky was the inline byte arrays that were scattered all through the test code. And what’s worse, most of the arrays weren’t even of the correct size! For the record, they should...

Sharp Tools for Sharp People

Today at CodeMash I had the opportunity to sit on Joe O'Brien's What makes Rails possible, an introduction to the Ruby language session. Let me just say... despite all of the hype, I'm really starting to get excited about the power (and other cool stuff) that dynamic languages like Ruby have to offer.  Joe did a really great job of giving us noobs a quick intro to not only the Ruby language, but also to why dynamic languages are so powerful, and how useful they can be. Naturally some of the attendees started to raise questions about Ruby's lack of static type checking...