Excerpts from Giorgio Lando's message of Tue Jan 08 09:32:54 -0800 2008:
> The version of gem is 0.9.4. May be I should clarify the scenario
> where the exception happened. I had sup-0.3 in the standard gems
> system directory ans sup-git in a folder in my home directory. I cd to
> the sup-git folder and did ruby -Ilib -w sup.
That was my setup too. Weird that I no longer seem to have this problem.
I've committed the following patch to next, which explicitly versions
bin/sup and lib/sup.rb and compares the two upon startup. Hopefully this
should detect this type of situation. For those of you who like to play
with sup via "rake gem", gems built from your checkout will have version
999. (This was a suggestion Ian Taylor made a long time ago.)
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 <<EOS
+
+Error: version mismatch!
+The sup executable is at version #{BIN_VERSION.inspect}.
+The sup libraries are at version #{Redwood::VERSION.inspect}.
+
+Is your development environment conflicting with rubygems?
+EOS
+ exit(-1)
+end
+
$exceptions = []
$opts = Trollop::options do
version "sup v#{Redwood::VERSION}"
diff --git a/lib/sup.rb b/lib/sup.rb
index 5bb27ba..d34dec3 100644
--- a/lib/sup.rb
+++ b/lib/sup.rb
@@ -32,7 +32,7 @@ class Module
end
module Redwood
- VERSION = "0.3"
+ VERSION = "git"
BASE_DIR = ENV["SUP_BASE"] || File.join(ENV["HOME"], ".sup")
CONFIG_FN = File.join(BASE_DIR, "config.yaml")
--
William <[EMAIL PROTECTED]>
_______________________________________________
sup-talk mailing list
[email protected]
http://rubyforge.org/mailman/listinfo/sup-talk