From ed12112fe44da42eead22aeaeaa70d4c42596420 Mon Sep 17 00:00:00 2001 From: William Morgan Date: Wed, 9 Jan 2008 10:50:04 -0800 Subject: [PATCH] compare bin and lib versions, and error out on mismatch This should help the occasional bug reports that happen because someone runs bin/sup from development, but somehow picks up libraries from a pre-installed gem. To make "rake gem" still function when working from a checkout, we fake a version number of 999. (Gem versions must be dotted numerics.) It won't detect version mismatches against gems that have been installed via "rake gem" from a checkout, but that is typically a less common issue. --- Rakefile | 7 ++++++- bin/sup | 14 ++++++++++++++ lib/sup.rb | 2 +- 3 files changed, 21 insertions(+), 2 deletions(-) diff --git a/Rakefile b/Rakefile index 1932f62..33e9883 100644 --- a/Rakefile +++ b/Rakefile @@ -7,7 +7,12 @@ class Hoe def extra_deps; @extra_deps.reject { |x| Array(x).first == "hoe" } end end # thanks to "Mike H" -Hoe.new('sup', Redwood::VERSION) do |p| +## allow people who use development versions by running "rake gem" +## and installing the resulting gem it to be able to do this. (gem +## versions must be in dotted-digit notation only). +version = Redwood::VERSION == "git" ? 999 : Redwood::VERSION + +Hoe.new('sup', version) do |p| p.rubyforge_name = 'sup' p.author = "William Morgan" p.summary = 'A console-based email client with the best features of GMail, mutt, and emacs. Features full text search, labels, tagged operations, multiple buffers, recent contacts, and more.' diff --git a/bin/sup b/bin/sup index 0f48ab4..7314227 100644 --- a/bin/sup +++ b/bin/sup @@ -7,6 +7,20 @@ require 'fileutils' require 'trollop' require "sup" +BIN_VERSION = "git" + +unless Redwood::VERSION == BIN_VERSION + $stderr.puts <