]> git.cworth.org Git - sup/commitdiff
Merge branch 'master' into next
authorWilliam Morgan <wmorgan-sup@masanjin.net>
Thu, 10 Jan 2008 17:44:16 +0000 (09:44 -0800)
committerWilliam Morgan <wmorgan-sup@masanjin.net>
Thu, 10 Jan 2008 17:44:16 +0000 (09:44 -0800)
Rakefile
bin/sup
lib/sup.rb

index 1932f62c3a7204cc4bdbd82aa84eb300e31b8b3e..69f0b687bdbc60febe3cf3f55bb3b8e9a122e362 100644 (file)
--- 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 0f48ab445ad0de2a540ec1a79ed61ecd2eaf09fe..7314227859aadb65cbfbe1297aec45e29754fd85 100644 (file)
--- 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}"
index 25809ddbe760bfb5ca2648713251bea77c528748..d34dec306a54322d0a7926fbaca2a150e2a48100 100644 (file)
@@ -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")
@@ -49,16 +49,6 @@ module Redwood
   YAML_DOMAIN = "masanjin.net"
   YAML_DATE = "2006-10-01"
 
-## determine encoding and character set
-## probably a better way to do this
-  $ctype = ENV["LC_CTYPE"] || ENV["LANG"] || "en-US.utf-8"
-  $encoding =
-    if $ctype =~ /\.(.*)?/
-      $1
-    else
-      "utf-8"
-    end
-
 ## record exceptions thrown in threads nicely
   def reporting_thread name
     if $opts[:no_threads]
@@ -235,6 +225,16 @@ module Redwood
   module_function :log
 end
 
+## determine encoding and character set. there MUST be a better way to
+## do this.
+  $encoding = `locale -c LC_CTYPE|head -6|tail -1`.chomp
+  if $encoding
+    Redwood::log "using character set encoding #{$encoding.inspect}"
+  else
+    Redwood::log "warning: can't find character set by using locale, defaulting to utf-8"
+    $encoding = "utf-8"
+  end
+
 ## now everything else (which can feel free to call Redwood::log at load time)
 require "sup/update"
 require "sup/suicide"