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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: e5b8e6299a00d76b3bc1eb4ed219c2baea76d4c6
4
- data.tar.gz: 836c4a9c74f7588a6c561ac1264ce6c568859afc
3
+ metadata.gz: 05ff8f011e4e73d7be9c891dac56c206f28d9fc4
4
+ data.tar.gz: 92a3d1845a0de22df435c7f3e78eec6150a69f24
5
5
  SHA512:
6
- metadata.gz: 6659b895e186f99a30049b9daeab543cb0f7b9f060b0ed22d8255bad2fb37234fddc89d4b8039a7d1d5c1a05459bf81154dba66290a69bbd0572ad2d7bd5d544
7
- data.tar.gz: d87f9515631498aa341f1c378169e9590fd174fedcc07daadb648e08dd9450869a40ff0329e24d30340f4c026f161e065363c3e4b7b6e1b8b81e58d4b04044e0
6
+ metadata.gz: 00a3930bf00f7376a0b43f8f25b857b7f44b1c3b68d5fe80e9bcde1127914eb546cb80b2692d6580d270c15966246a01157948621914725d63107ec0f395f6cd
7
+ data.tar.gz: 2c8fed78b22756f2a80d26f1bbd558c75faba9161a3b3b624688c4cdb2dcf91fbd1d9401987fabebb28a1b8d9b3396ff771f9d31cd0b41099442885fb9912f0f
data/CHANGES.md CHANGED
@@ -1,5 +1,10 @@
1
1
  #Changes
2
2
 
3
+ ## 1.1.1
4
+
5
+ * Fix bug when trying to use XOAUTH to authenticate. - Ben Hamill
6
+ * Remove several cases of excessive argument type checking. - Ben Hamill
7
+
3
8
  ## 1.1.0
4
9
 
5
10
  * Added `:login` authentication method to `Luggage.new`. - Ben Hamill
@@ -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.authenticate('XOAUTH', *Array(args[:xoauth]))
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]))
@@ -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
 
@@ -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
 
@@ -1,3 +1,3 @@
1
1
  module Luggage
2
- VERSION = "1.1.0"
2
+ VERSION = "1.1.1"
3
3
  end
@@ -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
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.1.0
4
+ version: 1.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ryan Michael