luggage 1.1.0 → 1.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGES.md +5 -0
- data/lib/luggage/factory.rb +1 -1
- data/lib/luggage/mailbox.rb +0 -3
- data/lib/luggage/message.rb +0 -4
- data/lib/luggage/version.rb +1 -1
- data/spec/luggage/factory_spec.rb +5 -0
- data/spec/luggage/mailbox_spec.rb +0 -4
- data/spec/luggage/message_spec.rb +0 -8
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 05ff8f011e4e73d7be9c891dac56c206f28d9fc4
|
4
|
+
data.tar.gz: 92a3d1845a0de22df435c7f3e78eec6150a69f24
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 00a3930bf00f7376a0b43f8f25b857b7f44b1c3b68d5fe80e9bcde1127914eb546cb80b2692d6580d270c15966246a01157948621914725d63107ec0f395f6cd
|
7
|
+
data.tar.gz: 2c8fed78b22756f2a80d26f1bbd558c75faba9161a3b3b624688c4cdb2dcf91fbd1d9401987fabebb28a1b8d9b3396ff771f9d31cd0b41099442885fb9912f0f
|
data/CHANGES.md
CHANGED
data/lib/luggage/factory.rb
CHANGED
@@ -27,7 +27,7 @@ module Luggage
|
|
27
27
|
|
28
28
|
elsif args.has_key?(:server) && args.has_key?(:xoauth)
|
29
29
|
@connection = Net::IMAP.new(*Array(args[:server]))
|
30
|
-
@connection.
|
30
|
+
@connection.send(:send_command, "AUTHENTICATE XOAUTH #{Array(args[:xoauth]).join(' ')}")
|
31
31
|
|
32
32
|
elsif args.has_key?(:server) && args.has_key?(:login)
|
33
33
|
@connection = Net::IMAP.new(*Array(args[:server]))
|
data/lib/luggage/mailbox.rb
CHANGED
@@ -11,9 +11,6 @@ module Luggage
|
|
11
11
|
# `name` is the name of the remote mailbox
|
12
12
|
#
|
13
13
|
def initialize(connection, name, &block)
|
14
|
-
raise ArgumentError, "Net::IMAP connection required" unless connection.kind_of?(Net::IMAP)
|
15
|
-
raise ArgumentError, "name required" unless name.present?
|
16
|
-
|
17
14
|
@connection = connection
|
18
15
|
@name = name
|
19
16
|
|
data/lib/luggage/message.rb
CHANGED
@@ -40,8 +40,6 @@ module Luggage
|
|
40
40
|
# `args[:message_id]` use this as for the Message-ID header. This header is used to identify messages across requests
|
41
41
|
#
|
42
42
|
def initialize(connection, mailbox, args = {}, &block)
|
43
|
-
raise ArgumentError, "Net::IMAP connection required" unless connection.kind_of?(Net::IMAP)
|
44
|
-
|
45
43
|
@connection = connection
|
46
44
|
@mailbox = mailbox.kind_of?(Mailbox) ? mailbox : Mailbox.new(connection, mailbox)
|
47
45
|
@flags = []
|
@@ -49,8 +47,6 @@ module Luggage
|
|
49
47
|
@template = args[:template]
|
50
48
|
@message_id = args[:message_id] || "<#{UUIDTools::UUID.random_create}@test.oib.com>"
|
51
49
|
|
52
|
-
raise ArgumentError, "mailbox requried" unless @mailbox.present?
|
53
|
-
|
54
50
|
instance_eval &block if block_given?
|
55
51
|
end
|
56
52
|
|
data/lib/luggage/version.rb
CHANGED
@@ -18,6 +18,11 @@ describe Luggage::Factory do
|
|
18
18
|
expect(Luggage.new(:server => :foo, :xoauth => "token").connection).to be_a(Net::IMAP)
|
19
19
|
end
|
20
20
|
|
21
|
+
it "accepts :server and :login, and creates a connection" do
|
22
|
+
Net::IMAP.any_instance.stub(:login).and_return(true)
|
23
|
+
expect(Luggage.new(:server => :foo, :login => %w(username password)).connection).to be_a(Net::IMAP)
|
24
|
+
end
|
25
|
+
|
21
26
|
it "requires a way to build a connection" do
|
22
27
|
expect { Luggage.new }.to raise_error(ArgumentError)
|
23
28
|
end
|
@@ -15,10 +15,6 @@ describe Luggage::Mailbox do
|
|
15
15
|
expect(Luggage::Mailbox.new(connection, :mailbox).connection).to eq(connection)
|
16
16
|
end
|
17
17
|
|
18
|
-
it "requires a connection" do
|
19
|
-
expect { Luggage::Mailbox.new(:foo, :mailbox).connection }.to raise_error(ArgumentError)
|
20
|
-
end
|
21
|
-
|
22
18
|
it "sets the name" do
|
23
19
|
expect(Luggage::Mailbox.new(connection, :mailbox).name).to eq(:mailbox)
|
24
20
|
end
|
@@ -15,10 +15,6 @@ describe Luggage::Message do
|
|
15
15
|
expect(Luggage::Message.new_local(connection, "Inbox")).to be_a(Luggage::Message)
|
16
16
|
end
|
17
17
|
|
18
|
-
it "raises ArgumentError if Luggage::Mailbox isn't passed" do
|
19
|
-
expect{ Luggage::Message.new_local() }.to raise_error(ArgumentError)
|
20
|
-
end
|
21
|
-
|
22
18
|
[:subject, :body, :to].each do |method|
|
23
19
|
context "with #{method} passed as argument" do
|
24
20
|
it "sets #{method} on Mail object" do
|
@@ -57,10 +53,6 @@ describe Luggage::Message do
|
|
57
53
|
expect(Luggage::Message.new(connection, :mailbox).connection).to eq(connection)
|
58
54
|
end
|
59
55
|
|
60
|
-
it "requires a connection" do
|
61
|
-
expect { Luggage::Message.new(:not_a_connection, :mailbox).connection }.to raise_error(ArgumentError)
|
62
|
-
end
|
63
|
-
|
64
56
|
it "sets mailbox if Mailbox passed" do
|
65
57
|
expect(Luggage::Message.new(connection, mailbox).mailbox).to eq(mailbox)
|
66
58
|
end
|