sup 0.16.0 → 0.17.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 58f12f8b8d3223e51c43fad6ebad16a8621992cb
4
- data.tar.gz: b5d08b2c0a7734cd83b4d0613ce209b2b81b757e
3
+ metadata.gz: e3a7c84961e495c61ffe169ec02add530f566ddd
4
+ data.tar.gz: f47dc9295a1b1b76a8237243a9e043908f090727
5
5
  SHA512:
6
- metadata.gz: 084e53c311359b9bcb0e97e57ebbb4d49b7a30a1697492522c8cd799fc86ce9b289c46ddc21a8b597a06f737923f2c6303c57bbf85343647f74e2c50fd68da85
7
- data.tar.gz: 307daf56455e61012cb480d5bed83781a395c38233cdc545b1bf58d0bfac3286b66f580d3e3880e96e5b5338013c65388f8b3950af1630f3ba2be9a29ad1a148
6
+ metadata.gz: 34f77536b3f04ac960ee9f2fc835f41ac7ca0f818941d25d74b61007660e373fa6b830a038e68c10fd97eb8f437b2f4d5bd9d399f1a1ffddc3424432e327b9a8
7
+ data.tar.gz: a501e2f21f8e76aa018deea70a0dd9a16014fa6546e996a0a1f7cca23a9993749d72737dec292f216806eb8888d900a343dd44d88f7bc0fa7f2b9d24000ca62a
checksums.yaml.gz.sig CHANGED
Binary file
data.tar.gz.sig CHANGED
Binary file
data/CONTRIBUTORS CHANGED
@@ -14,13 +14,14 @@ Eric Sherman <hyperbolist at the gmail dot coms>
14
14
  Tero Tilus <tero at the tilus dot nets>
15
15
  Ben Walton <bwalton at the artsci.utoronto dot cas>
16
16
  Mike Stipicevic <stipim at the rpi dot edus>
17
+ Martin Bähr <mbaehr at the societyserver dot orgs>
17
18
  Clint Byrum <clint at the ubuntu dot coms>
18
19
  Marcus Williams <marcus-sup at the bar-coded dot nets>
19
20
  Lionel Ott <white.magic at the gmx dot des>
20
21
  Gaudenz Steinlin <gaudenz at the soziologie dot chs>
21
22
  Matthieu Rakotojaona <matthieu.rakotojaona at the gmail dot coms>
22
- Ingmar Vanhassel <ingmar at the exherbo dot orgs>
23
23
  Mark Alexander <marka at the pobox dot coms>
24
+ Ingmar Vanhassel <ingmar at the exherbo dot orgs>
24
25
  Edward Z. Yang <ezyang at the mit dot edus>
25
26
  Timon Vonk <timonv at the gmail dot coms>
26
27
  julien@macbook <julien.stechele at the gmail dot coms>
@@ -30,49 +31,51 @@ Richard Brown <rbrown at the exherbo dot orgs>
30
31
  Anthony Martinez <pi+sup at the pihost dot uss>
31
32
  Marc Hartstein <marc.hartstein at the alum.vassar dot edus>
32
33
  Israel Herraiz <israel.herraiz at the gmail dot coms>
34
+ Christopher Corley <cscorley at the ua dot edus>
35
+ Markus Klinik <mkl at the lambdanaut dot nets>
33
36
  Bo Borgerson <gigabo at the gmail dot coms>
34
37
  Atte Kojo <atte.kojo at the reaktor dot fis>
35
38
  Michael Hamann <michael at the content-space dot des>
36
- William Erik Baxter <web at the superscript dot coms>
37
39
  Jonathan Lassoff <jof at the thejof dot coms>
38
- Markus Klinik <markus.klinik at the gmx dot des>
40
+ William Erik Baxter <web at the superscript dot coms>
39
41
  Grant Hollingworth <grant at the antiflux dot orgs>
40
- Ico Doornekamp <ico at the pruts dot nls>
41
42
  Adeodato Simó <dato at the net.com.org dot ess>
43
+ Ico Doornekamp <ico at the pruts dot nls>
42
44
  Daniel Schoepe <daniel.schoepe at the googlemail dot coms>
43
45
  Jason Petsod <jason at the petsod dot orgs>
44
46
  James Taylor <james at the jamestaylor dot orgs>
45
- Steve Goldman <sgoldman at the tower-research dot coms>
46
47
  Robin Burchell <viroteck at the viroteck dot nets>
48
+ Steve Goldman <sgoldman at the tower-research dot coms>
47
49
  Peter Harkins <ph at the malaprop dot orgs>
48
50
  Decklin Foster <decklin at the red-bean dot coms>
49
51
  Cameron Matheson <cam+sup at the cammunism dot orgs>
50
- Carl Worth <cworth at the cworth dot orgs>
51
52
  Alex Vandiver <alex at the chmrr dot nets>
52
- Jeff Balogh <its.jeff.balogh at the gmail dot coms>
53
+ Carl Worth <cworth at the cworth dot orgs>
53
54
  Andrew Pimlott <andrew at the pimlott dot nets>
55
+ Jeff Balogh <its.jeff.balogh at the gmail dot coms>
54
56
  Matías Aguirre <matiasaguirre at the gmail dot coms>
55
57
  Kornilios Kourtis <kkourt at the cslab.ece.ntua dot grs>
56
58
  Lars Fischer <fischer at the wiwi.uni-siegen dot des>
57
59
  Giorgio Lando <patroclo7 at the gmail dot coms>
58
60
  Kevin Riggle <kevinr at the free-dissociation dot coms>
59
61
  Benoît PIERRE <benoit.pierre at the gmail dot coms>
60
- Alvaro Herrera <alvherre at the alvh.no-ip dot orgs>
61
62
  Steven Lawrance <stl at the koffein dot nets>
63
+ Alvaro Herrera <alvherre at the alvh.no-ip dot orgs>
62
64
  Jonah <Jonah at the GoodCoffee dot cas>
63
65
  ian <itaylor at the uark dot edus>
64
- MichaelRevell <mikearevell at the gmail dot coms>
65
- Per Andersson <avtobiff at the gmail dot coms>
66
- Todd Eisenberger <teisenbe at the andrew.cmu dot edus>
67
66
  Gregor Hoffleit <gregor at the sam.mediasupervision dot des>
67
+ Per Andersson <avtobiff at the gmail dot coms>
68
68
  Adam Lloyd <adam at the alloy-d dot nets>
69
+ Todd Eisenberger <teisenbe at the andrew.cmu dot edus>
70
+ MichaelRevell <mikearevell at the gmail dot coms>
69
71
  0xACE <0xACE at the users.noreply.github dot coms>
70
72
  Steven Walter <swalter at the monarch.(none)>
71
- Jon M. Dugan <jdugan at the es dot nets>
73
+ Steven Schmeiser <steven at the schmeiser dot orgs>
74
+ Stefan Lundström <lundst at the snabb.(none)>
75
+ William A. Kennington III <william at the wkennington dot coms>
76
+ akojo <atte.kojo at the gmail dot coms>
72
77
  Horacio Sanson <horacio at the skillupjapan.co dot jps>
73
78
  Matthias Vallentin <vallentin at the icir dot orgs>
74
- akojo <atte.kojo at the gmail dot coms>
75
- William A. Kennington III <william at the wkennington dot coms>
76
- Stefan Lundström <lundst at the snabb.(none)>
79
+ Jon M. Dugan <jdugan at the es dot nets>
77
80
  Johannes Larsen <johs.a.larsen at the gmail dot coms>
78
81
  Kirill Smelkov <kirr at the landau.phys.spbu dot rus>
data/History.txt CHANGED
@@ -1,3 +1,10 @@
1
+ == 0.17.0 / 2014-04-11
2
+
3
+ * add continuous scrolling to thread view
4
+ * add option for always editing in async mode
5
+ * bugfix: fix completion char
6
+ * bugfix: thread-view: dont close message when it is the first or last
7
+
1
8
  == 0.16.0 / 2014-03-21
2
9
 
3
10
  * sup-sync-back-mbox removed.
data/ReleaseNotes CHANGED
@@ -1,3 +1,8 @@
1
+ Release 0.17.0:
2
+
3
+ Bugfixes and new option for continous scrolling as well as an option for
4
+ always editing messages in async mode.
5
+
1
6
  Release 0.16.0:
2
7
 
3
8
  Removed unfinished and abandoned sup-sync-back-mbox.
data/bin/sup CHANGED
@@ -223,7 +223,7 @@ begin
223
223
  to = Person.from_address_list $opts[:compose]
224
224
  mode = ComposeMode.new :to => to, :subj => $opts[:subject]
225
225
  BufferManager.spawn "New Message", mode
226
- mode.edit_message
226
+ mode.default_edit_message
227
227
  end
228
228
 
229
229
  unless $opts[:no_threads]
@@ -337,7 +337,7 @@ begin
337
337
  Index.each_id_by_date(:label => :draft) { |mid, builder| m = builder.call }
338
338
  r = ResumeMode.new(m)
339
339
  BufferManager.spawn "Edit message", r
340
- r.edit_message
340
+ r.default_edit_message
341
341
  else
342
342
  b, new = BufferManager.spawn_unless_exists("All drafts") { LabelSearchResultsMode.new [:draft] }
343
343
  b.mode.load_threads :num => b.content_height if new
data/bin/sup-tweak-labels CHANGED
@@ -85,7 +85,7 @@ begin
85
85
 
86
86
  parsed_query = index.parse_query query
87
87
  parsed_query.merge! :load_spam => true, :load_deleted => true, :load_killed => true
88
- ids = Enumerator.new(index, :each_id, parsed_query)
88
+ ids = index.to_enum(:each_id, parsed_query)
89
89
  num_total = index.num_results_for parsed_query
90
90
 
91
91
  $stderr.puts "Found #{num_total} documents across #{source_ids.length} sources. Scanning..."
data/lib/sup.rb CHANGED
@@ -2,7 +2,6 @@
2
2
 
3
3
  require 'rubygems'
4
4
  require 'yaml'
5
- YAML::ENGINE.yamler = 'psych'
6
5
  require 'zlib'
7
6
  require 'thread'
8
7
  require 'fileutils'
@@ -333,7 +332,9 @@ EOM
333
332
  :slip_rows => 0,
334
333
  :col_jump => 2,
335
334
  :stem_language => "english",
336
- :sync_back_to_maildir => false
335
+ :sync_back_to_maildir => false,
336
+ :continuous_scroll => false,
337
+ :always_edit_async => false,
337
338
  }
338
339
  if File.exists? filename
339
340
  config = Redwood::load_yaml_obj filename
data/lib/sup/account.rb CHANGED
@@ -25,7 +25,7 @@ class Account < Person
25
25
  end
26
26
 
27
27
  class AccountManager
28
- include Singleton
28
+ include Redwood::Singleton
29
29
 
30
30
  attr_accessor :default_account
31
31
 
data/lib/sup/buffer.rb CHANGED
@@ -99,7 +99,7 @@ class Buffer
99
99
  end
100
100
 
101
101
  class BufferManager
102
- include Singleton
102
+ include Redwood::Singleton
103
103
 
104
104
  attr_reader :focus_buf
105
105
 
@@ -547,7 +547,7 @@ EOS
547
547
  kill_buffer completion_buf if completion_buf
548
548
 
549
549
  shorts = tf.completions.map { |full, short| short }
550
- prefix_len = shorts.shared_prefix.length
550
+ prefix_len = shorts.shared_prefix(caseless=true).length
551
551
 
552
552
  mode = CompletionMode.new shorts, :header => "Possible completions for \"#{tf.value}\": ", :prefix_len => prefix_len
553
553
  completion_buf = spawn "<completions>", mode, :height => 10
data/lib/sup/contact.rb CHANGED
@@ -3,7 +3,7 @@
3
3
  module Redwood
4
4
 
5
5
  class ContactManager
6
- include Singleton
6
+ include Redwood::Singleton
7
7
 
8
8
  def initialize fn
9
9
  @fn = fn
data/lib/sup/crypto.rb CHANGED
@@ -6,7 +6,7 @@ end
6
6
  module Redwood
7
7
 
8
8
  class CryptoManager
9
- include Singleton
9
+ include Redwood::Singleton
10
10
 
11
11
  class Error < StandardError; end
12
12
 
data/lib/sup/draft.rb CHANGED
@@ -1,7 +1,7 @@
1
1
  module Redwood
2
2
 
3
3
  class DraftManager
4
- include Singleton
4
+ include Redwood::Singleton
5
5
 
6
6
  attr_accessor :source
7
7
  def initialize dir
data/lib/sup/hook.rb CHANGED
@@ -69,7 +69,7 @@ class HookManager
69
69
  end
70
70
  end
71
71
 
72
- include Singleton
72
+ include Redwood::Singleton
73
73
 
74
74
  @descs = {}
75
75
 
data/lib/sup/idle.rb CHANGED
@@ -3,7 +3,7 @@ require 'thread'
3
3
  module Redwood
4
4
 
5
5
  class IdleManager
6
- include Singleton
6
+ include Redwood::Singleton
7
7
 
8
8
  IDLE_THRESHOLD = 60
9
9
 
data/lib/sup/index.rb CHANGED
@@ -55,7 +55,7 @@ EOS
55
55
  def method_missing m; @h[m.to_s] end
56
56
  end
57
57
 
58
- include Singleton
58
+ include Redwood::Singleton
59
59
 
60
60
  def initialize dir=BASE_DIR
61
61
  @dir = dir
@@ -98,9 +98,9 @@ EOS
98
98
  end
99
99
  end
100
100
 
101
- def load
101
+ def load failsafe=false
102
102
  SourceManager.load_sources
103
- load_index
103
+ load_index failsafe
104
104
  end
105
105
 
106
106
  def save
@@ -110,7 +110,11 @@ EOS
110
110
  save_index
111
111
  end
112
112
 
113
- def load_index
113
+ def get_xapian
114
+ @xapian
115
+ end
116
+
117
+ def load_index failsafe=false
114
118
  path = File.join(@dir, 'xapian')
115
119
  if File.exists? path
116
120
  @xapian = Xapian::WritableDatabase.new(path, Xapian::DB_OPEN)
@@ -329,7 +333,7 @@ EOS
329
333
  synchronize { get_entry(id)[:source_id] }
330
334
  end
331
335
 
332
- ## Yields each tearm in the index that starts with prefix
336
+ ## Yields each term in the index that starts with prefix
333
337
  def each_prefixed_term prefix
334
338
  term = @xapian._dangerous_allterms_begin prefix
335
339
  lastTerm = @xapian._dangerous_allterms_end prefix
data/lib/sup/label.rb CHANGED
@@ -3,7 +3,7 @@
3
3
  module Redwood
4
4
 
5
5
  class LabelManager
6
- include Singleton
6
+ include Redwood::Singleton
7
7
 
8
8
  ## labels that have special semantics. user will be unable to
9
9
  ## add/remove these via normal label mechanisms.
data/lib/sup/logger.rb CHANGED
@@ -8,7 +8,7 @@ module Redwood
8
8
  ## also keeps a record of all messages, so that adding a new sink will send all
9
9
  ## previous messages to it by default.
10
10
  class Logger
11
- include Singleton
11
+ include Redwood::Singleton
12
12
 
13
13
  LEVELS = %w(debug info warn error) # in order!
14
14
 
data/lib/sup/message.rb CHANGED
@@ -1,3 +1,5 @@
1
+ # encoding: UTF-8
2
+
1
3
  require 'time'
2
4
 
3
5
  module Redwood
@@ -1,3 +1,5 @@
1
+ # encoding: UTF-8
2
+
1
3
  require 'tempfile'
2
4
  require 'rbconfig'
3
5
  require 'shellwords'
@@ -16,7 +16,7 @@ class ComposeMode < EditMessageMode
16
16
  super :header => header, :body => (opts[:body] || [])
17
17
  end
18
18
 
19
- def edit_message
19
+ def default_edit_message
20
20
  edited = super
21
21
  BufferManager.kill_buffer self.buffer unless edited
22
22
  edited
@@ -31,7 +31,7 @@ class ComposeMode < EditMessageMode
31
31
 
32
32
  mode = ComposeMode.new :from => from, :to => to, :cc => cc, :bcc => bcc, :subj => subj
33
33
  BufferManager.spawn "New Message", mode
34
- mode.edit_message
34
+ mode.default_edit_message
35
35
  end
36
36
  end
37
37
 
@@ -71,7 +71,7 @@ class ContactListMode < LineCursorMode
71
71
  when :regular
72
72
  mode = ComposeMode.new :to => people
73
73
  BufferManager.spawn "new message", mode
74
- mode.edit_message
74
+ mode.default_edit_message
75
75
  end
76
76
  end
77
77
 
@@ -29,11 +29,12 @@ EOS
29
29
  @orig_mtime = File.mtime @file_path
30
30
 
31
31
  @text = ["ASYNC MESSAGE EDIT",
32
- "", "Your message with subject:", msg_subject, "is saved in a file:", "", @file_path, "",
32
+ "", "Your message with subject:", msg_subject, "is saved in a file:", "", @file_path, "",
33
33
  "You can edit your message in the editor of your choice and continue to",
34
34
  "use sup while you edit your message.", "",
35
35
  "Press <Enter> to have the file path copied to the clipboard.", "",
36
36
  "When you have finished editing, select this buffer and press 'E'.",]
37
+ run_async_hook()
37
38
  super()
38
39
  end
39
40
 
@@ -79,8 +79,8 @@ EOS
79
79
  k.add :edit_to, "Edit To:", 't'
80
80
  k.add :edit_cc, "Edit Cc:", 'c'
81
81
  k.add :edit_subject, "Edit Subject", 's'
82
- k.add :edit_message, "Edit message", :enter
83
- k.add :edit_message_async, "Edit message asynchronously", 'E'
82
+ k.add :default_edit_message, "Edit message (default)", :enter
83
+ k.add :alternate_edit_message, "Edit message (alternate, asynchronously)", 'E'
84
84
  k.add :save_as_draft, "Save as draft", 'P'
85
85
  k.add :attach_file, "Attach a file", 'a'
86
86
  k.add :delete_attachment, "Delete an attachment", 'd'
@@ -105,7 +105,7 @@ EOS
105
105
  begin
106
106
  hostname = File.open("/etc/mailname", "r").gets.chomp
107
107
  rescue
108
- nil
108
+ nil
109
109
  end
110
110
  hostname = Socket.gethostname if hostname.nil? or hostname.empty?
111
111
 
@@ -182,7 +182,7 @@ EOS
182
182
  if lines > curpos
183
183
  return
184
184
  elsif (curpos - lines) >= @header_lines.length
185
- edit_message
185
+ default_edit_message
186
186
  else
187
187
  edit_field @header_lines[curpos - lines]
188
188
  end
@@ -226,6 +226,22 @@ EOS
226
226
  end
227
227
  end
228
228
 
229
+ def default_edit_message
230
+ if $config[:always_edit_async]
231
+ return edit_message_async
232
+ else
233
+ return edit_message
234
+ end
235
+ end
236
+
237
+ def alternate_edit_message
238
+ if $config[:always_edit_async]
239
+ return edit_message
240
+ else
241
+ return edit_message_async
242
+ end
243
+ end
244
+
229
245
  def edit_message
230
246
  old_from = @header["From"] if @account_selector
231
247
 
@@ -59,7 +59,7 @@ class ForwardMode < EditMessageMode
59
59
  end
60
60
 
61
61
  BufferManager.spawn title, mode
62
- mode.edit_message
62
+ mode.default_edit_message
63
63
  end
64
64
 
65
65
  protected
@@ -94,7 +94,17 @@ protected
94
94
  call_load_more_callbacks buffer.content_height if @curpos >= lines - [buffer.content_height/2,1].max
95
95
  return false unless @curpos < lines - 1
96
96
 
97
- if @curpos >= botline - 1
97
+ if $config[:continuous_scroll] and (@curpos == botline - 3 and @curpos < lines - 3)
98
+ # load more lines, one at a time.
99
+ jump_to_line topline + 1
100
+ @curpos += 1
101
+ unless buffer.dirty?
102
+ draw_line @curpos - 1
103
+ draw_line @curpos
104
+ set_status
105
+ buffer.commit
106
+ end
107
+ elsif @curpos >= botline - 1
98
108
  page_down
99
109
  set_cursor_pos topline
100
110
  else
@@ -111,7 +121,17 @@ protected
111
121
 
112
122
  def cursor_up
113
123
  return false unless @curpos > @cursor_top
114
- if @curpos == topline
124
+
125
+ if $config[:continuous_scroll] and (@curpos == topline + 2)
126
+ jump_to_line topline - 1
127
+ @curpos -= 1
128
+ unless buffer.dirty?
129
+ draw_line @curpos + 1
130
+ draw_line @curpos
131
+ set_status
132
+ buffer.commit
133
+ end
134
+ elsif @curpos == topline
115
135
  old_topline = topline
116
136
  page_up
117
137
  set_cursor_pos [old_topline - 1, topline].max
@@ -180,5 +200,4 @@ private
180
200
  @load_more_q.push size if $config[:load_more_threads_when_scrolling]
181
201
  end
182
202
  end
183
-
184
203
  end
@@ -1,5 +1,3 @@
1
- require 'shellwords'
2
-
3
1
  module Redwood
4
2
 
5
3
  class ThreadViewMode < LineCursorMode
@@ -354,7 +352,7 @@ EOS
354
352
  m = @message_lines[curpos] or return
355
353
  mode = ComposeMode.new(:body => m.quotable_body_lines, :to => m.to, :cc => m.cc, :subj => m.subj, :bcc => m.bcc, :refs => m.refs, :replytos => m.replytos)
356
354
  BufferManager.spawn "edit as new", mode
357
- mode.edit_message
355
+ mode.default_edit_message
358
356
  end
359
357
 
360
358
  def save_to_disk
@@ -363,12 +361,12 @@ EOS
363
361
  when Chunk::Attachment
364
362
  default_dir = $config[:default_attachment_save_dir]
365
363
  default_dir = ENV["HOME"] if default_dir.nil? || default_dir.empty?
366
- default_fn = File.expand_path File.join(default_dir, Shellwords.escape(chunk.filename))
364
+ default_fn = File.expand_path File.join(default_dir, chunk.filename)
367
365
  fn = BufferManager.ask_for_filename :filename, "Save attachment to file or directory: ", default_fn, true
368
366
 
369
367
  # if user selects directory use file name from message
370
368
  if fn and File.directory? fn
371
- fn = File.join(fn, Shellwords.escape(chunk.filename))
369
+ fn = File.join(fn, chunk.filename)
372
370
  end
373
371
 
374
372
  save_to_file(fn) { |f| f.print chunk.raw_content } if fn
@@ -392,7 +390,7 @@ EOS
392
390
  num_errors = 0
393
391
  m.chunks.each do |chunk|
394
392
  next unless chunk.is_a?(Chunk::Attachment)
395
- fn = File.join(folder, Shellwords.escape(chunk.filename))
393
+ fn = File.join(folder, chunk.filename)
396
394
  num_errors += 1 unless save_to_file(fn, false) { |f| f.print chunk.raw_content }
397
395
  num += 1
398
396
  end
@@ -423,7 +421,7 @@ EOS
423
421
  mode = ResumeMode.new m
424
422
  BufferManager.spawn "Edit message", mode
425
423
  BufferManager.kill_buffer self.buffer
426
- mode.edit_message
424
+ mode.default_edit_message
427
425
  else
428
426
  BufferManager.flash "Not a draft message!"
429
427
  end
@@ -456,13 +454,15 @@ EOS
456
454
  m = (curpos ... @message_lines.length).argfind { |i| @message_lines[i] }
457
455
  return unless m
458
456
 
457
+ nextm = @layout[m].next
458
+ return unless nextm
459
+
459
460
  if @layout[m].toggled_state == true
460
461
  @layout[m].state = :closed
461
462
  @layout[m].toggled_state = false
462
463
  update
463
464
  end
464
465
 
465
- nextm = @layout[m].next
466
466
  if @layout[nextm].state == :closed
467
467
  @layout[nextm].state = :open
468
468
  @layout[nextm].toggled_state = true
@@ -493,13 +493,15 @@ EOS
493
493
  m = (0 .. curpos).to_a.reverse.argfind { |i| @message_lines[i] }
494
494
  return unless m
495
495
 
496
+ nextm = @layout[m].prev
497
+ return unless nextm
498
+
496
499
  if @layout[m].toggled_state == true
497
500
  @layout[m].state = :closed
498
501
  @layout[m].toggled_state = false
499
502
  update
500
503
  end
501
504
 
502
- nextm = @layout[m].prev
503
505
  if @layout[nextm].state == :closed
504
506
  @layout[nextm].state = :open
505
507
  @layout[nextm].toggled_state = true
data/lib/sup/person.rb CHANGED
@@ -119,7 +119,7 @@ class Person
119
119
 
120
120
  def self.from_address_list ss
121
121
  return [] if ss.nil?
122
- ss.split_on_commas.map { |s| self.from_address s }
122
+ ss.dup.split_on_commas.map { |s| self.from_address s }
123
123
  end
124
124
 
125
125
  ## see comments in self.from_address
data/lib/sup/poll.rb CHANGED
@@ -3,7 +3,7 @@ require 'thread'
3
3
  module Redwood
4
4
 
5
5
  class PollManager
6
- include Singleton
6
+ include Redwood::Singleton
7
7
 
8
8
  HookManager.register "before-add-message", <<EOS
9
9
  Executes immediately before a message is added to the index.
data/lib/sup/search.rb CHANGED
@@ -3,7 +3,7 @@
3
3
  module Redwood
4
4
 
5
5
  class SearchManager
6
- include Singleton
6
+ include Redwood::Singleton
7
7
 
8
8
  class ExpansionError < StandardError; end
9
9
 
data/lib/sup/sent.rb CHANGED
@@ -1,7 +1,7 @@
1
1
  module Redwood
2
2
 
3
3
  class SentManager
4
- include Singleton
4
+ include Redwood::Singleton
5
5
 
6
6
  attr_reader :source, :source_uri
7
7
 
data/lib/sup/source.rb CHANGED
@@ -187,7 +187,7 @@ module SerializeLabelsNicely
187
187
  end
188
188
 
189
189
  class SourceManager
190
- include Singleton
190
+ include Redwood::Singleton
191
191
 
192
192
  def initialize
193
193
  @sources = {}
data/lib/sup/thread.rb CHANGED
@@ -1,3 +1,5 @@
1
+ # encoding: UTF-8
2
+ #
1
3
  ## Herein lies all the code responsible for threading messages. It's
2
4
  ## basically an online version of the JWZ threading algorithm:
3
5
  ## http://www.jwz.org/doc/threading.html
data/lib/sup/undo.rb CHANGED
@@ -8,7 +8,7 @@ module Redwood
8
8
  ## undo the archival action
9
9
 
10
10
  class UndoManager
11
- include Singleton
11
+ include Redwood::Singleton
12
12
 
13
13
  def initialize
14
14
  @@actionlist = []
data/lib/sup/update.rb CHANGED
@@ -12,7 +12,7 @@ module Redwood
12
12
  ## single "view". Luckily, that's true.)
13
13
 
14
14
  class UpdateManager
15
- include Singleton
15
+ include Redwood::Singleton
16
16
 
17
17
  def initialize
18
18
  @targets = {}
data/lib/sup/util.rb CHANGED
@@ -632,39 +632,41 @@ end
632
632
  ## classes that inherit this can define initialize. however, you cannot call
633
633
  ## .new on the class. To get the instance of the class, call .instance;
634
634
  ## to create the instance, call init.
635
- module Singleton
636
- module ClassMethods
637
- def instance; @instance; end
638
- def instantiated?; defined?(@instance) && !@instance.nil?; end
639
- def deinstantiate!; @instance = nil; end
640
- def method_missing meth, *a, &b
641
- raise "no #{name} instance defined in method call to #{meth}!" unless defined? @instance
642
-
643
- ## if we've been deinstantiated, just drop all calls. this is
644
- ## useful because threads that might be active during the
645
- ## cleanup process (e.g. polling) would otherwise have to
646
- ## special-case every call to a Singleton object
647
- return nil if @instance.nil?
648
-
649
- # Speed up further calls by defining a shortcut around method_missing
650
- if meth.to_s[-1,1] == '='
651
- # Argh! Inconsistency! Setters do not work like all the other methods.
652
- class_eval "def self.#{meth}(a); @instance.send :#{meth}, a; end"
653
- else
654
- class_eval "def self.#{meth}(*a, &b); @instance.send :#{meth}, *a, &b; end"
655
- end
635
+ module Redwood
636
+ module Singleton
637
+ module ClassMethods
638
+ def instance; @instance; end
639
+ def instantiated?; defined?(@instance) && !@instance.nil?; end
640
+ def deinstantiate!; @instance = nil; end
641
+ def method_missing meth, *a, &b
642
+ raise "no #{name} instance defined in method call to #{meth}!" unless defined? @instance
643
+
644
+ ## if we've been deinstantiated, just drop all calls. this is
645
+ ## useful because threads that might be active during the
646
+ ## cleanup process (e.g. polling) would otherwise have to
647
+ ## special-case every call to a Singleton object
648
+ return nil if @instance.nil?
649
+
650
+ # Speed up further calls by defining a shortcut around method_missing
651
+ if meth.to_s[-1,1] == '='
652
+ # Argh! Inconsistency! Setters do not work like all the other methods.
653
+ class_eval "def self.#{meth}(a); @instance.send :#{meth}, a; end"
654
+ else
655
+ class_eval "def self.#{meth}(*a, &b); @instance.send :#{meth}, *a, &b; end"
656
+ end
656
657
 
657
- @instance.send meth, *a, &b
658
- end
659
- def init *args
660
- raise "there can be only one! (instance)" if instantiated?
661
- @instance = new(*args)
658
+ @instance.send meth, *a, &b
659
+ end
660
+ def init *args
661
+ raise "there can be only one! (instance)" if instantiated?
662
+ @instance = new(*args)
663
+ end
662
664
  end
663
- end
664
665
 
665
- def self.included klass
666
- klass.private_class_method :allocate, :new
667
- klass.extend ClassMethods
666
+ def self.included klass
667
+ klass.private_class_method :allocate, :new
668
+ klass.extend ClassMethods
669
+ end
668
670
  end
669
671
  end
670
672
 
@@ -116,7 +116,7 @@ module Ncurses
116
116
  # Empty singleton that
117
117
  # keeps GC from going crazy.
118
118
  class Empty < CharCode
119
- include Singleton
119
+ include Redwood::Singleton
120
120
 
121
121
  ## Wrap methods that may change us
122
122
  ## and generate new object instead.
data/lib/sup/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Redwood
2
- VERSION = "0.16.0"
2
+ VERSION = "0.17.0"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sup
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.16.0
4
+ version: 0.17.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - William Morgan
@@ -32,7 +32,7 @@ cert_chain:
32
32
  +JMuDs+iWefpF4R3BySoOc1Q4WoES3+oc0qo37MsAZyfnQIPTZkyLZCMxeL6Mha4
33
33
  hFc2yANBj8voaY5C74Cg2VqExtcnSaxUtW9wC4w5hOlg0AVfb1JWzg==
34
34
  -----END CERTIFICATE-----
35
- date: 2014-03-21 00:00:00.000000000 Z
35
+ date: 2014-04-11 00:00:00.000000000 Z
36
36
  dependencies:
37
37
  - !ruby/object:Gem::Dependency
38
38
  name: xapian-ruby
@@ -365,7 +365,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
365
365
  requirements:
366
366
  - - ">="
367
367
  - !ruby/object:Gem::Version
368
- version: 1.9.2
368
+ version: 1.9.3
369
369
  required_rubygems_version: !ruby/object:Gem::Requirement
370
370
  requirements:
371
371
  - - ">="
metadata.gz.sig CHANGED
Binary file