]> git.cworth.org Git - sup/blobdiff - lib/sup/source.rb
add #pipe-to-process to text-mode
[sup] / lib / sup / source.rb
index d21faf70eb5452ca33f9d1177d436df00a1886e4..6510aae8a738dba0b3d81acb617312a1e1334bec 100644 (file)
@@ -1,6 +1,11 @@
 module Redwood
 
-class SourceError < StandardError; end
+class SourceError < StandardError
+  def initialize *a
+    raise "don't instantiate me!" if SourceError.is_a?(self.class)
+    super
+  end
+end
 class OutOfSyncSourceError < SourceError; end
 class FatalSourceError < SourceError; end
 
@@ -31,7 +36,7 @@ class Source
   ## - load_header offset
   ## - load_message offset
   ## - raw_header offset
-  ## - raw_full_message offset
+  ## - raw_message offset
   ## - check
   ## - next (or each, if you prefer): should return a message and an
   ##   array of labels.
@@ -78,7 +83,7 @@ class Source
   def reset!; seek_to! start_offset; end
   def == o; o.uri == uri; end
   def done?; start_offset.nil? || (self.cur_offset ||= start_offset) >= end_offset; end
-  def is_source_for? uri; uri == URI(uri); end
+  def is_source_for? uri; uri == @uri; end
 
   ## check should throw a FatalSourceError or an OutOfSyncSourcError
   ## if it can detect a problem. it is called when the sup starts up