luggage 1.2.0 → 1.2.1

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: d26e7a17d30fe62e65aebba3677c9947be2129f0
4
- data.tar.gz: 02e19e80be8b1fceee116f1b6b683c9d98ff2ac7
3
+ metadata.gz: 56d02cbdf3e91765d32a9e9e31d1044f3bc2205f
4
+ data.tar.gz: 39548bc74936a200a7b63c8c8ddaad8b59e1119a
5
5
  SHA512:
6
- metadata.gz: 41fd1f37fe4d66a1e206e9dca496fcdc6b64cac0676dd71ae1d54d27cfd76046584374fcfbc0013fa6fdcc1514094928a71e7adf05c4b6e0361634524d8ba7fb
7
- data.tar.gz: 46ddd62da10c99c667c00d17e8040bc1a0fac974d6399cf9ab0dbe85050456962158c4ce30d358c615766d98a8f92fd8a57407f0d539c080d00efb3057b9cc27
6
+ metadata.gz: 84ee01e2b3bd73119fddf71f3cc4b8ef0ea3a7cc0dbf5935867e7128b5974af1363627c5c24dcd497c9f9de5f3f0fa40220797fbaa0baf4dd2429c981c24b690
7
+ data.tar.gz: 1eb4a73055793e3b0fd091586d5887ac628e1165cef0b0cd4c0bb5e409bc744fb5af27cc7fe6b21b39f076c9b62ce9cf1f42692e64768605314b1c28b97d882a
data/CHANGES.md CHANGED
@@ -1,6 +1,10 @@
1
1
  #Changes
2
2
 
3
- ## Unreleased
3
+ ## 1.2.1
4
+
5
+ * Protect against trying to UID FETCH an empty list of UIDs. - Ben Hamill
6
+
7
+ ## 1.2.0
4
8
 
5
9
  * Add `Message#copy_to!`. - Ben Hamill
6
10
 
@@ -51,7 +51,7 @@ module Luggage
51
51
  def messages
52
52
  @messages ||= message_ids.map {|message_id| Message.new(connection, mailbox, :message_id => message_id)}
53
53
  end
54
-
54
+
55
55
  def inspect
56
56
  "#<Luggage::MailboxQueryBuilder server: \"#{host}\", mailbox: \"#{mailbox.name}\", query: #{query}>"
57
57
  end
@@ -68,10 +68,17 @@ module Luggage
68
68
  end
69
69
 
70
70
  def message_ids
71
- field = "BODY[HEADER.FIELDS (Message-ID)]"
72
- @message_ids ||= connection.uid_fetch(uids, field).map do |resp|
73
- $1 if resp[:attr][field] =~ /(<\S*@\S*>)/
74
- end.compact
71
+ @message_ids ||= begin
72
+ field = "BODY[HEADER.FIELDS (Message-ID)]"
73
+
74
+ if uids.empty?
75
+ []
76
+ else
77
+ connection.uid_fetch(uids, field).map do |resp|
78
+ $1 if resp[:attr][field] =~ /(<\S*@\S*>)/
79
+ end.compact
80
+ end
81
+ end
75
82
  end
76
83
  end
77
84
  end
@@ -1,3 +1,3 @@
1
1
  module Luggage
2
- VERSION = "1.2.0"
2
+ VERSION = "1.2.1"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: luggage
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.0
4
+ version: 1.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ryan Michael
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-03-14 00:00:00.000000000 Z
12
+ date: 2013-03-15 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: mail