imap_processor 1.0.1 → 1.1

Sign up to get free protection for your applications and to get access to all the features.
data.tar.gz.sig CHANGED
Binary file
data/History.txt CHANGED
@@ -1,3 +1,9 @@
1
+ === 1.1 / 2009-05-18
2
+
3
+ * 1 minor enhancement
4
+ * IMAPProcessor#each_message allows messages to be omitted from the returned
5
+ uid list (skipped)
6
+
1
7
  === 1.0.1 / 2009-05-15
2
8
 
3
9
  * 2 bug fix
@@ -19,7 +19,7 @@ class IMAPProcessor
19
19
  ##
20
20
  # The version of IMAPProcessor you are using
21
21
 
22
- VERSION = '1.0.1'
22
+ VERSION = '1.1'
23
23
 
24
24
  ##
25
25
  # A Connection Struct that has +imap+ and +capability+ accessors
@@ -336,6 +336,9 @@ Example ~/.#{opts_file_name}:
336
336
  # If there's an exception raised during handling a message the subject,
337
337
  # message-id and inspected body are logged.
338
338
  #
339
+ # If the block returns nil or false, the message is considered skipped and
340
+ # its uid is not returned in the uid list. (Hint: next false unless ...)
341
+ #
339
342
  # Returns the uids of successfully handled messages.
340
343
 
341
344
  def each_message(uids, type) # :yields: TMail::Mail
@@ -344,12 +347,14 @@ Example ~/.#{opts_file_name}:
344
347
  uids = []
345
348
 
346
349
  each_part parts, true do |uid, message|
350
+ skip = false
351
+
347
352
  mail = TMail::Mail.parse message
348
353
 
349
354
  begin
350
- yield uid, mail
355
+ skip = yield uid, mail
351
356
 
352
- uids << uid
357
+ uids << uid unless skip
353
358
  rescue => e
354
359
  log e.message
355
360
  puts "\t#{e.backtrace.join "\n\t"}" unless $DEBUG # backtrace at bottom
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: imap_processor
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.1
4
+ version: "1.1"
5
5
  platform: ruby
6
6
  authors:
7
7
  - Eric Hodel
@@ -30,7 +30,7 @@ cert_chain:
30
30
  x52qPcexcYZR7w==
31
31
  -----END CERTIFICATE-----
32
32
 
33
- date: 2009-05-15 00:00:00 -07:00
33
+ date: 2009-05-18 00:00:00 -07:00
34
34
  default_executable:
35
35
  dependencies:
36
36
  - !ruby/object:Gem::Dependency
metadata.gz.sig CHANGED
Binary file