From c1e343c69e98cf6ebf562d33e18dca920dbae49d Mon Sep 17 00:00:00 2001 From: Adam Sanderson Date: Thu, 5 Jun 2008 22:18:54 -0700 Subject: [PATCH] allowing the executable to be run without loading the gem, makes it easier to test. --- bin/ruby_diff | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/bin/ruby_diff b/bin/ruby_diff index 09484f8..24b155a 100755 --- a/bin/ruby_diff +++ b/bin/ruby_diff @@ -1,8 +1,19 @@ #!/usr/bin/env ruby require 'rubygems' -require 'ruby_diff' require 'optparse' +# If we're loading ruby_diff directly for development, +# don't require it through rubygems. Is there a better +# way to do this? + +if $0 == __FILE__ + # loaded directly (dev) + require File.dirname(__FILE__)+"/../lib/ruby_diff" +else + # loaded via ruby_gems + require 'ruby_diff' +end + @options = {} feeder_mapping = {