lib/sup.rb in sup-0.7 vs lib/sup.rb in sup-0.8

- old
+ new

@@ -4,23 +4,10 @@ require 'thread' require 'fileutils' require 'gettext' require 'curses' -## the following magic enables wide characters when used with a ruby -## ncurses.so that's been compiled against libncursesw. (note the w.) why -## this works, i have no idea. much like pretty much every aspect of -## dealing with curses. cargo cult programming at its best. - -require 'dl/import' -module LibC - extend DL::Importable - dlload Config::CONFIG['arch'] =~ /darwin/ ? "libc.dylib" : "libc.so.6" - extern "void setlocale(int, const char *)" -end -LibC.setlocale(6, "") # LC_ALL == 6 - class Object ## this is for debugging purposes because i keep calling #id on the ## wrong object and i want it to throw an exception def id raise "wrong id called on #{self.inspect}" @@ -44,18 +31,17 @@ end end end module Redwood - VERSION = "0.7" + VERSION = "0.8" BASE_DIR = ENV["SUP_BASE"] || File.join(ENV["HOME"], ".sup") CONFIG_FN = File.join(BASE_DIR, "config.yaml") COLOR_FN = File.join(BASE_DIR, "colors.yaml") SOURCE_FN = File.join(BASE_DIR, "sources.yaml") LABEL_FN = File.join(BASE_DIR, "labels.txt") - PERSON_FN = File.join(BASE_DIR, "people.txt") CONTACT_FN = File.join(BASE_DIR, "contacts.txt") DRAFT_DIR = File.join(BASE_DIR, "drafts") SENT_FN = File.join(BASE_DIR, "sent.mbox") LOCK_FN = File.join(BASE_DIR, "lock") SUICIDE_FN = File.join(BASE_DIR, "please-kill-yourself") @@ -113,26 +99,25 @@ end end end def start - Redwood::PersonManager.new Redwood::PERSON_FN Redwood::SentManager.new Redwood::SENT_FN Redwood::ContactManager.new Redwood::CONTACT_FN Redwood::LabelManager.new Redwood::LABEL_FN Redwood::AccountManager.new $config[:accounts] Redwood::DraftManager.new Redwood::DRAFT_DIR Redwood::UpdateManager.new Redwood::PollManager.new Redwood::SuicideManager.new Redwood::SUICIDE_FN Redwood::CryptoManager.new + Redwood::UndoManager.new end def finish Redwood::LabelManager.save if Redwood::LabelManager.instantiated? Redwood::ContactManager.save if Redwood::ContactManager.instantiated? - Redwood::PersonManager.save if Redwood::PersonManager.instantiated? Redwood::BufferManager.deinstantiate! if Redwood::BufferManager.instantiated? end ## not really a good place for this, so I'll just dump it here. ## @@ -280,9 +265,10 @@ require "sup/contact" require "sup/tagger" require "sup/draft" require "sup/poll" require "sup/crypto" +require "sup/undo" require "sup/horizontal-selector" require "sup/modes/line-cursor-mode" require "sup/modes/help-mode" require "sup/modes/edit-message-mode" require "sup/modes/compose-mode"