luggage 1.2.2 → 1.2.3

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,15 @@
1
+ ---
2
+ !binary "U0hBMQ==":
3
+ metadata.gz: !binary |-
4
+ OWJmMTA3YjFhOWRhYWI1MTU1ZGU4NzY0MWRkZGQ1OGJmYzcxNjk5Mg==
5
+ data.tar.gz: !binary |-
6
+ Y2JhODA5N2EyYjU0ODIzOGFmNzEzYzZhMmIxZGI1YzNkYjZmNWU4Nw==
7
+ SHA512:
8
+ metadata.gz: !binary |-
9
+ ZThlYzE2MWE5OTMzM2Q3ZjkxYWE4M2QzYjFhYWUxOGYwYWY3NWVlOGRmY2Yy
10
+ Nzc3ODM4M2VlNzM0YjZiZmI3ZDMyMzZjMjRmZTg5N2JlNjZkM2E3Mzk2NTU0
11
+ YjQ4OWQ5OTBjZTljMjI5ZGQxM2FkMmJiNWQ4ZTIzZTgzZjEwOWQ=
12
+ data.tar.gz: !binary |-
13
+ MjNjZDcwMjk1NGY3MmVkNjZmOGRmYzVkMGVhMTA4MjQ2ZmQxZjRlYWM2NzZh
14
+ YTRiM2Y2YzcwMWVmMDI0MGY2MzZmMjQ5YWQ0OWViNWI4NWE2ZGFkMjMwNDE5
15
+ ZmI2NzIyYmEyMzk4YjUzOGUzZWQ1NDZjMmFhZTVlYWFhMjkxMDg=
@@ -49,7 +49,7 @@ module Luggage
49
49
  def exists?
50
50
  return @exists if instance_variable_defined?(:@exists)
51
51
 
52
- @exists = !connection.list("", name).empty?
52
+ @exists = !connection.list("", name).nil?
53
53
  end
54
54
 
55
55
  # Deletes this mailbox on the remote server
@@ -24,7 +24,12 @@ module Luggage
24
24
  args.each do |key, value|
25
25
  mail[key] = value if mail.respond_to?(key)
26
26
  end
27
- mail[:message_id] = message_id
27
+
28
+ if mail[:message_id] && !args.has_key?(:message_id)
29
+ @message_id = mail.message_id
30
+ else
31
+ mail[:message_id] = message_id
32
+ end
28
33
  end
29
34
 
30
35
  message.instance_eval &block if block_given?
@@ -1,3 +1,3 @@
1
1
  module Luggage
2
- VERSION = "1.2.2"
2
+ VERSION = "1.2.3"
3
3
  end
@@ -17,7 +17,7 @@ Gem::Specification.new do |gem|
17
17
  gem.test_files = gem.files.grep(%r{^(test|spec|features)/})
18
18
  gem.require_paths = ['lib']
19
19
 
20
- gem.add_dependency 'mail', '~> 2.5.0'
20
+ gem.add_dependency 'mail', '~> 2.5'
21
21
  gem.add_dependency 'uuidtools', '~> 2.1.3'
22
22
 
23
23
  gem.add_development_dependency 'bundler', '~> 1.0'
@@ -38,6 +38,18 @@ describe Luggage::Message do
38
38
 
39
39
  Luggage::Message.new_local(connection, :mailbox, :template =>"base")
40
40
  end
41
+
42
+ it "uses template's Message-ID if not specified" do
43
+ Mail.stub(:read).and_return(Mail.new("Message-ID: foo@bar.com"))
44
+
45
+ expect( Luggage::Message.new_local(connection, :mailbox, :template =>"base").message_id ).to eq("foo@bar.com")
46
+ end
47
+
48
+ it "respects message_id if passed (and template defines it too)" do
49
+ Mail.stub(:read).and_return(Mail.new("Message-ID: foo@bar.com"))
50
+
51
+ expect( Luggage::Message.new_local(connection, :mailbox, :template =>"base", :message_id => "other@bar.com").message_id ).to eq("other@bar.com")
52
+ end
41
53
  end
42
54
 
43
55
  context "with flags passed as argument" do
@@ -103,7 +115,7 @@ describe Luggage::Message do
103
115
 
104
116
  it "fetches raw email" do
105
117
  connection.should_receive(:uid_fetch).
106
- with([1], ["FLAGS", "INTERNALDATE.PEEK", "BODY.PEEK[]"]).
118
+ with([1], ["FLAGS", "INTERNALDATE", "BODY.PEEK[]"]).
107
119
  and_return( [{:attr => {"BODY[]" => "raw_body", "FLAGS" => [], "INTERNALDATE" => (Time.now - 60 * 60 * 24).to_s}}] )
108
120
 
109
121
  message.reload
@@ -111,7 +123,7 @@ describe Luggage::Message do
111
123
 
112
124
  it "fetches flags" do
113
125
  connection.should_receive(:uid_fetch).
114
- with([1], ["FLAGS", "INTERNALDATE.PEEK", "BODY.PEEK[]"]).
126
+ with([1], ["FLAGS", "INTERNALDATE", "BODY.PEEK[]"]).
115
127
  and_return( [{:attr => {"BODY[]" => "raw_body", "FLAGS" => [], "INTERNALDATE" => (Time.now - 60 * 60 * 24).to_s}}] )
116
128
 
117
129
  message.reload
@@ -139,7 +151,7 @@ describe Luggage::Message do
139
151
  message.stub(:flags).and_return([:Seen])
140
152
  message.stub(:date).and_return(message_date)
141
153
 
142
- connection.should_receive(:append).with("Inbox", "Random Content", [:SEEN], message_date)
154
+ connection.should_receive(:append).with("Inbox", "Random Content", [:Seen], message_date)
143
155
  message.save!
144
156
  end
145
157
  end
metadata CHANGED
@@ -1,8 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: luggage
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.2
5
- prerelease:
4
+ version: 1.2.3
6
5
  platform: ruby
7
6
  authors:
8
7
  - Ryan Michael
@@ -10,28 +9,25 @@ authors:
10
9
  autorequire:
11
10
  bindir: bin
12
11
  cert_chain: []
13
- date: 2013-03-19 00:00:00.000000000 Z
12
+ date: 2014-11-25 00:00:00.000000000 Z
14
13
  dependencies:
15
14
  - !ruby/object:Gem::Dependency
16
15
  name: mail
17
16
  requirement: !ruby/object:Gem::Requirement
18
- none: false
19
17
  requirements:
20
18
  - - ~>
21
19
  - !ruby/object:Gem::Version
22
- version: 2.5.0
20
+ version: '2.5'
23
21
  type: :runtime
24
22
  prerelease: false
25
23
  version_requirements: !ruby/object:Gem::Requirement
26
- none: false
27
24
  requirements:
28
25
  - - ~>
29
26
  - !ruby/object:Gem::Version
30
- version: 2.5.0
27
+ version: '2.5'
31
28
  - !ruby/object:Gem::Dependency
32
29
  name: uuidtools
33
30
  requirement: !ruby/object:Gem::Requirement
34
- none: false
35
31
  requirements:
36
32
  - - ~>
37
33
  - !ruby/object:Gem::Version
@@ -39,7 +35,6 @@ dependencies:
39
35
  type: :runtime
40
36
  prerelease: false
41
37
  version_requirements: !ruby/object:Gem::Requirement
42
- none: false
43
38
  requirements:
44
39
  - - ~>
45
40
  - !ruby/object:Gem::Version
@@ -47,7 +42,6 @@ dependencies:
47
42
  - !ruby/object:Gem::Dependency
48
43
  name: bundler
49
44
  requirement: !ruby/object:Gem::Requirement
50
- none: false
51
45
  requirements:
52
46
  - - ~>
53
47
  - !ruby/object:Gem::Version
@@ -55,7 +49,6 @@ dependencies:
55
49
  type: :development
56
50
  prerelease: false
57
51
  version_requirements: !ruby/object:Gem::Requirement
58
- none: false
59
52
  requirements:
60
53
  - - ~>
61
54
  - !ruby/object:Gem::Version
@@ -63,7 +56,6 @@ dependencies:
63
56
  - !ruby/object:Gem::Dependency
64
57
  name: rake
65
58
  requirement: !ruby/object:Gem::Requirement
66
- none: false
67
59
  requirements:
68
60
  - - ~>
69
61
  - !ruby/object:Gem::Version
@@ -71,7 +63,6 @@ dependencies:
71
63
  type: :development
72
64
  prerelease: false
73
65
  version_requirements: !ruby/object:Gem::Requirement
74
- none: false
75
66
  requirements:
76
67
  - - ~>
77
68
  - !ruby/object:Gem::Version
@@ -79,7 +70,6 @@ dependencies:
79
70
  - !ruby/object:Gem::Dependency
80
71
  name: rdoc
81
72
  requirement: !ruby/object:Gem::Requirement
82
- none: false
83
73
  requirements:
84
74
  - - ~>
85
75
  - !ruby/object:Gem::Version
@@ -87,7 +77,6 @@ dependencies:
87
77
  type: :development
88
78
  prerelease: false
89
79
  version_requirements: !ruby/object:Gem::Requirement
90
- none: false
91
80
  requirements:
92
81
  - - ~>
93
82
  - !ruby/object:Gem::Version
@@ -95,7 +84,6 @@ dependencies:
95
84
  - !ruby/object:Gem::Dependency
96
85
  name: rspec
97
86
  requirement: !ruby/object:Gem::Requirement
98
- none: false
99
87
  requirements:
100
88
  - - ~>
101
89
  - !ruby/object:Gem::Version
@@ -103,7 +91,6 @@ dependencies:
103
91
  type: :development
104
92
  prerelease: false
105
93
  version_requirements: !ruby/object:Gem::Requirement
106
- none: false
107
94
  requirements:
108
95
  - - ~>
109
96
  - !ruby/object:Gem::Version
@@ -111,7 +98,6 @@ dependencies:
111
98
  - !ruby/object:Gem::Dependency
112
99
  name: activesupport
113
100
  requirement: !ruby/object:Gem::Requirement
114
- none: false
115
101
  requirements:
116
102
  - - ~>
117
103
  - !ruby/object:Gem::Version
@@ -119,7 +105,6 @@ dependencies:
119
105
  type: :development
120
106
  prerelease: false
121
107
  version_requirements: !ruby/object:Gem::Requirement
122
- none: false
123
108
  requirements:
124
109
  - - ~>
125
110
  - !ruby/object:Gem::Version
@@ -127,7 +112,6 @@ dependencies:
127
112
  - !ruby/object:Gem::Dependency
128
113
  name: fuubar
129
114
  requirement: !ruby/object:Gem::Requirement
130
- none: false
131
115
  requirements:
132
116
  - - ~>
133
117
  - !ruby/object:Gem::Version
@@ -135,7 +119,6 @@ dependencies:
135
119
  type: :development
136
120
  prerelease: false
137
121
  version_requirements: !ruby/object:Gem::Requirement
138
- none: false
139
122
  requirements:
140
123
  - - ~>
141
124
  - !ruby/object:Gem::Version
@@ -143,7 +126,6 @@ dependencies:
143
126
  - !ruby/object:Gem::Dependency
144
127
  name: pry
145
128
  requirement: !ruby/object:Gem::Requirement
146
- none: false
147
129
  requirements:
148
130
  - - ~>
149
131
  - !ruby/object:Gem::Version
@@ -151,7 +133,6 @@ dependencies:
151
133
  type: :development
152
134
  prerelease: false
153
135
  version_requirements: !ruby/object:Gem::Requirement
154
- none: false
155
136
  requirements:
156
137
  - - ~>
157
138
  - !ruby/object:Gem::Version
@@ -188,27 +169,26 @@ files:
188
169
  homepage: https://github.com/otherinbox/luggage
189
170
  licenses:
190
171
  - MIT
172
+ metadata: {}
191
173
  post_install_message:
192
174
  rdoc_options: []
193
175
  require_paths:
194
176
  - lib
195
177
  required_ruby_version: !ruby/object:Gem::Requirement
196
- none: false
197
178
  requirements:
198
179
  - - ! '>='
199
180
  - !ruby/object:Gem::Version
200
181
  version: '0'
201
182
  required_rubygems_version: !ruby/object:Gem::Requirement
202
- none: false
203
183
  requirements:
204
184
  - - ! '>='
205
185
  - !ruby/object:Gem::Version
206
186
  version: '0'
207
187
  requirements: []
208
188
  rubyforge_project:
209
- rubygems_version: 1.8.23
189
+ rubygems_version: 2.4.2
210
190
  signing_key:
211
- specification_version: 3
191
+ specification_version: 4
212
192
  summary: Net::IMAP DSL
213
193
  test_files:
214
194
  - spec/luggage/factory_spec.rb
@@ -218,4 +198,3 @@ test_files:
218
198
  - spec/luggage_spec.rb
219
199
  - spec/net_imap.rb
220
200
  - spec/spec_helper.rb
221
- has_rdoc: