gmail-api-ruby 0.0.5 → 0.0.6

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: ddd910aaa7588db1a4e5c11e8987373c7a5ec105
4
- data.tar.gz: d0bff8547f5c158b11b27bdc1b8850b3a9b6ab41
3
+ metadata.gz: 4dc872b455aa318e9635be5a436b3b1d6b825c66
4
+ data.tar.gz: 0fda002fcc083dd943c581c0c7f2a28f5dcf59ee
5
5
  SHA512:
6
- metadata.gz: 02b011d121cf6f8479f526ea45df0d89d2b04487eb0fdb0e20e9f22d2fabbc3cf78d5f5eea716caea16035958b4a588951f4074ae95dcde7485cb5e49b891093
7
- data.tar.gz: 1d4a289c6f538b19426b5baa5bd7682ab34e00cd96621236351673bf93de7621f4076dde1b4b5e6db9e4b6b17b59fd0d7322430da458aaf96f58522550138fca
6
+ metadata.gz: 7a2ff33db280a9f8d309312a5199f62816d2299b0ffc069fc34d33f0dd90a7541b99808e06e70a0e61a8a7e3a19d889135de8f48df79d4b72af3a5ce64c8dc89
7
+ data.tar.gz: e62fdebe6717a1c19f41bb3756008153e3591988634133d37608d5a7a00ac68ff55a803b32673c95b1e536f71c94a517ddab5a19d6271a0a78048e78dbc93554
data/CHANGELOG.md CHANGED
@@ -15,3 +15,7 @@
15
15
 
16
16
  * updated dependencies
17
17
 
18
+ ## 0.0.6 / 2015-01-16
19
+
20
+ * Added insert method for Message and some minor improvements
21
+
data/README.md CHANGED
@@ -100,12 +100,18 @@ From this you can create a Draft in Gmail
100
100
  m.create_draft
101
101
  ```
102
102
 
103
- or just send the Message
103
+ or send the Message
104
104
 
105
105
  ```ruby
106
106
  m.deliver
107
107
  ```
108
108
 
109
+ or simply insert the message in the user mailbox
110
+
111
+ ```ruby
112
+ m.insert
113
+ ```
114
+
109
115
  Notice that the Message object can use from, to, cc, bcc, threadId, labelIds, text, html, body
110
116
 
111
117
  If you need to send Message or create draft with custom headers or set other headers.
data/gmail.gemspec CHANGED
@@ -14,7 +14,8 @@ Gem::Specification.new do |s|
14
14
  s.platform = Gem::Platform::RUBY
15
15
  s.authors = ["Julien Hobeika"]
16
16
  s.homepage = "http://github.com/jhk753/gmail-ruby-api"
17
-
17
+ s.licenses = ['MIT']
18
+
18
19
  # runtime dependencies
19
20
  s.required_ruby_version = '>= 1.9.3'
20
21
  s.add_dependency "mime", ">= 0.1"
data/lib/gmail.rb CHANGED
@@ -25,7 +25,8 @@ require 'gmail/label'
25
25
  module Gmail
26
26
 
27
27
  class << self
28
- attr_accessor :client_id, :client_secret, :refresh_token, :client, :service, :application_name, :application_version
28
+ attr_accessor :client_id, :client_secret, :refresh_token, :application_name, :application_version
29
+ attr_reader :service, :client, :mailbox_email
29
30
  def new hash
30
31
  [:client_id, :client_secret, :refresh_token, :application_name, :application_version].each do |accessor|
31
32
  Gmail.send("#{accessor}=", hash[accessor.to_s])
@@ -66,6 +67,10 @@ module Gmail
66
67
 
67
68
  end
68
69
 
70
+ def self.mailbox_email
71
+ @mailbox_email ||= self.request(@service.users.to_h['gmail.users.getProfile'])[:emailAddress]
72
+ end
73
+
69
74
  def self.connect(client_id=@client_id, client_secret=@client_secret, refresh_token=@refresh_token)
70
75
  unless client_id
71
76
  raise 'No client_id specified'
data/lib/gmail/message.rb CHANGED
@@ -28,6 +28,17 @@ module Gmail
28
28
  Message.get(response[:id])
29
29
  end
30
30
 
31
+ def insert
32
+ response = Gmail.request(self.class.base_method.insert,{}, msg_parameters)
33
+ Message.get(response[:id])
34
+ end
35
+
36
+ def insert!
37
+ response = Gmail.request(self.class.base_method.insert,{}, msg_parameters)
38
+ @values = Message.get(response[:id]).values
39
+ self
40
+ end
41
+
31
42
  def reply_all_with msg
32
43
  msg = set_headers_for_reply msg
33
44
  msg = quote_in msg
@@ -126,21 +137,20 @@ module Gmail
126
137
 
127
138
  def set_headers_for_reply msg
128
139
  to_ar = []
129
- split_regexp = Regexp.new "\s*,\s*"
130
- if delivered_to
131
- to_ar = to.split(split_regexp)
132
- result = to_ar.grep(Regexp.new delivered_to)
133
- if result
134
- to_ar = to_ar - result
135
- end
136
- end
140
+ split_regexp = Regexp.new("\s*,\s*")
141
+ own_email = delivered_to || Gmail.mailbox_email
142
+ to_ar = to.split(split_regexp) + (cc || []).split(split_regexp)
143
+ result = to_ar.grep(Regexp.new(own_email, "i"))
144
+ to_ar = to_ar - result
145
+
137
146
  msg.subject = subject
138
- msg.to = from
139
- if cc.nil?
140
- msg.cc = to_ar.join(", ")
147
+ if from.match(Regexp.new(own_email, "i"))
148
+ msg.to = to_ar.first
149
+ to_ar = to_ar.drop(1)
141
150
  else
142
- msg.cc = (to_ar + cc.split(split_regexp)).join(", ")
151
+ msg.to = from
143
152
  end
153
+ msg.cc = to_ar.join(", ")
144
154
  msg.bcc = nil
145
155
  msg.threadId = thread_id
146
156
  msg.references = ((references || "").split(Regexp.new "\s+") << message_id).join(" ")
data/lib/gmail/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Gmail
2
- VERSION = "0.0.5"
2
+ VERSION = "0.0.6"
3
3
  end # Gmail
@@ -284,6 +284,27 @@ module Gmail
284
284
  assert_nil new_m.body
285
285
 
286
286
 
287
+ end
288
+
289
+ should "Reply to all construct should be easy and call getProfile if delivered_to is not set" do
290
+ m = Gmail::Message.new test_to_reply_message2
291
+ reply_message = Gmail::Message.new test_reply_message
292
+ @mock.expects(:execute).with(api_method: Gmail.service.users.to_h['gmail.users.getProfile'],parameters: {userId: "me"} , headers: {'Content-Type' => 'application/json'}).once.returns(test_response({emailAddress: "julie@juliedesk.com"}))
293
+ new_m = m.reply_all_with reply_message
294
+ expected_msg = Gmail::Message.new test_replied_message
295
+
296
+ assert_equal expected_msg.to, new_m.to
297
+ assert_equal expected_msg.cc, new_m.cc
298
+ assert_nil new_m.bcc
299
+ assert_equal expected_msg.subject, new_m.subject
300
+ assert_equal expected_msg.references, new_m.references
301
+ assert_equal expected_msg.in_reply_to, new_m.in_reply_to
302
+ assert_equal expected_msg.thread_id, new_m.thread_id
303
+ assert_equal expected_msg.body, new_m.body
304
+ assert_nil new_m.html
305
+ assert_nil new_m.text
306
+
307
+
287
308
  end
288
309
 
289
310
  should "forward construct should be easy" do
@@ -314,5 +335,19 @@ module Gmail
314
335
  assert_nil new_m.body
315
336
  end
316
337
 
338
+ should "Insert call should be easy" do
339
+ m = Gmail::Message.new test_message
340
+ m.raw = m.raw
341
+ @mock.expects(:execute).with(api_method: Gmail.service.users.messages.insert, parameters: {userId: "me"}, body_object:{raw: m.raw, labelIds: test_message[:labelIds], threadId: test_message[:threadId]} , headers: {'Content-Type' => 'application/json'} ).twice.returns(test_response(test_message))
342
+ @mock.expects(:execute).with(api_method: Gmail.service.users.messages.get, parameters: {userId: "me", id: test_message[:id]}, headers: {'Content-Type' => 'application/json'}).twice.returns(test_response(test_message))
343
+
344
+
345
+ new_m = m.insert
346
+
347
+ assert_not_equal m.object_id, new_m.object_id
348
+ new_m = m.insert!
349
+ assert_equal m.object_id, new_m.object_id
350
+ end
351
+
317
352
  end
318
353
  end
data/test/test_data.rb CHANGED
@@ -66,6 +66,10 @@ module Gmail
66
66
  {:id=>"14aecf708ee65122", :threadId=>"14aecf708ee65122", :labelIds=>["INBOX", "IMPORTANT", "CATEGORY_PERSONAL", "UNREAD"], :snippet=>"coucou Julien Hobeika | Co-Founder &amp; CEO Email: julien@juliedesk.com Tel: +33 6 63 33 17 55 Julie", :historyId=>"232755", :payload=>{:mimeType=>"multipart/alternative", :filename=>"", :headers=>[{:name=>"Delivered-To", :value=>"julie@juliedesk.com"}, {:name=>"Received", :value=>"by 10.64.89.39 with SMTP id bl7csp1888330ieb; Thu, 15 Jan 2015 01:40:21 -0800 (PST)"}, {:name=>"X-Received", :value=>"by 10.194.2.75 with SMTP id 11mr16697173wjs.78.1421314820755; Thu, 15 Jan 2015 01:40:20 -0800 (PST)"}, {:name=>"Return-Path", :value=>"<julien@wepopp.com>"}, {:name=>"Received", :value=>"from mail-wg0-f52.google.com (mail-wg0-f52.google.com. [74.125.82.52]) by mx.google.com with ESMTPS id cz7si1861265wjc.17.2015.01.15.01.40.19 for <julie@juliedesk.com> (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 15 Jan 2015 01:40:20 -0800 (PST)"}, {:name=>"Received-SPF", :value=>"pass (google.com: domain of julien@wepopp.com designates 74.125.82.52 as permitted sender) client-ip=74.125.82.52;"}, {:name=>"Authentication-Results", :value=>"mx.google.com; spf=pass (google.com: domain of julien@wepopp.com designates 74.125.82.52 as permitted sender) smtp.mail=julien@wepopp.com"}, {:name=>"Received", :value=>"by mail-wg0-f52.google.com with SMTP id x12so13734359wgg.11 for <julie@juliedesk.com>; Thu, 15 Jan 2015 01:40:19 -0800 (PST)"}, {:name=>"X-Google-DKIM-Signature", :value=>"v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:from:date:message-id:subject:to:cc :content-type; bh=VX+NTBD3y6zC7y2eoK6dXfXslqvi6t2cSoTCjb3ydPE=; b=GJnt5rk9Ck0uf9drEbY8tmxHqEosl3+89TyqId0TMttNgmjhV+rTX5tGe1N1wbPS0o ZMl5zDe/A5GGd7PHa8ykZZwNv5GQn0cjMQIMs+nMyUTUCUYeioWirF3frDJ8siV7+EXF s+l5+8Ul3suVPTcg5+zoNGgTJu3mWBC4E+1KMbVLYNOZtOd5PEMJPCZuTu2/k8Vw0Iw6 8JG02sSAzWRxNJnUoCRrShTV7C+eNRehvI7utHGMrobP1chWb2qZgLvbwGnpo/eBceya XWo/bpd9OcAYhb0spf0M2pXJ6TL/fzYbplFj0Lj8sXfRphQJivUjUVj4F02Tty2HpQ+q 4kQw=="}, {:name=>"X-Gm-Message-State", :value=>"ALoCoQk6eM56sO2fhoPw1I+al4RvoL3xd/Mzo7nmPK4WlB/OUaOD0isPUduI2MUrEdZgQ8tty/AH"}, {:name=>"X-Received", :value=>"by 10.180.126.99 with SMTP id mx3mr17257983wib.66.1421314819809; Thu, 15 Jan 2015 01:40:19 -0800 (PST)"}, {:name=>"MIME-Version", :value=>"1.0"}, {:name=>"Received", :value=>"by 10.180.8.228 with HTTP; Thu, 15 Jan 2015 01:39:59 -0800 (PST)"}, {:name=>"From", :value=>"Julien Hobeika <julien@juliedesk.com>"}, {:name=>"Date", :value=>"Thu, 15 Jan 2015 10:39:59 +0100"}, {:name=>"Message-ID", :value=>"<CAA-2G7UbpEhf1G6-fF_ruSew7SRjsOpU+wPbmWufrknmbxQVZg@mail.gmail.com>"}, {:name=>"Subject", :value=>"test reply message"}, {:name=>"To", :value=>"Julie Desk <julie@juliedesk.com>, Julien Hobeika <julien.hobeika@gmail.com>"}, {:name=>"Cc", :value=>"Julien Hobeika <julien@juliedesk.com>, Nicolas Marlier <nicolas@wepopp.com>"}, {:name=>"Content-Type", :value=>"multipart/alternative; boundary=e89a8f8389d1f2fbe9050cada4ac"}], :body=>{:size=>0}, :parts=>[{:partId=>"0", :mimeType=>"text/plain", :filename=>"", :headers=>[{:name=>"Content-Type", :value=>"text/plain; charset=UTF-8"}, {:name=>"Content-Transfer-Encoding", :value=>"quoted-printable"}], :body=>{:size=>144, :data=>"Y291Y291DQoNCg0KKkp1bGllbiBIb2JlaWthIHwgQ28tRm91bmRlciAmIENFTypFbWFpbDoganVsaWVuQGp1bGllZGVzay5jb20NClRlbDogKzMzIDYgNjMgMzMgMTcgNTUNCg0KKkp1bGllIERlc2sqDQp3d3cuanVsaWVkZXNrLmNvbQ0KDQoNCuGQpw0K"}}, {:partId=>"1", :mimeType=>"text/html", :filename=>"", :headers=>[{:name=>"Content-Type", :value=>"text/html; charset=UTF-8"}, {:name=>"Content-Transfer-Encoding", :value=>"quoted-printable"}], :body=>{:size=>742, :data=>"PGRpdiBkaXI9Imx0ciI-Y291Y291PGJyIGNsZWFyPSJhbGwiPjxkaXY-PGRpdiBjbGFzcz0iZ21haWxfc2lnbmF0dXJlIj48ZGl2IGRpcj0ibHRyIj48cD48Yj5KdWxpZW4gSG9iZWlrYSB8IENvLUZvdW5kZXIgJmFtcDsgQ0VPPGJyPjwvYj5FbWFpbDrCoDxhIGhyZWY9Im1haWx0bzpqdWxpZW5AanVsaWVkZXNrLmNvbSIgdGFyZ2V0PSJfYmxhbmsiPmp1bGllbkBqdWxpZWRlc2suY29tPC9hPjxicj5UZWw6ICszMyA2IDYzIDMzIDE3IDU1PC9wPjxwPjxiPkp1bGllIERlc2s8L2I-PGI-PGJyPjwvYj48YSBocmVmPSJodHRwOi8vd3d3Lmp1bGllZGVzay5jb20vIiBzdHlsZT0iY29sb3I6cmdiKDE3LDg1LDIwNCk7Zm9udC1mYW1pbHk6SGVsdmV0aWNhIiB0YXJnZXQ9Il9ibGFuayI-d3d3Lmp1bGllZGVzay5jb208L2E-PGI-PGJyPjwvYj48L3A-PHA-PGJyPjwvcD48L2Rpdj48L2Rpdj48L2Rpdj4NCjxkaXYgaHNwYWNlPSJzdHJlYWstcHQtbWFyayIgc3R5bGU9Im1heC1oZWlnaHQ6MXB4Ij48aW1nIHN0eWxlPSJ3aWR0aDowcHg7IG1heC1oZWlnaHQ6MHB4OyIgc3JjPSJodHRwczovL21haWxmb29nYWUuYXBwc3BvdC5jb20vdD9zZW5kZXI9YWFuVnNhV1Z1UUhkbGNHOXdjQzVqYjIwJTNEJmFtcDt0eXBlPXplcm9jb250ZW50JmFtcDtndWlkPTBiMWRiODRkLTFmMTctNDE1MS05ZmE5LTUxMWNiYTg0ODAyMiI-PGZvbnQgY29sb3I9IiNmZmZmZmYiIHNpemU9IjEiPuGQpzwvZm9udD48L2Rpdj48L2Rpdj4NCg=="}}]}, :sizeEstimate=>3710}
67
67
  end
68
68
 
69
+ def test_to_reply_message2(params = {}) #without delivered_to in headers
70
+ {:id=>"14aecf708ee65122", :threadId=>"14aecf708ee65122", :labelIds=>["INBOX", "IMPORTANT", "CATEGORY_PERSONAL", "UNREAD"], :snippet=>"coucou Julien Hobeika | Co-Founder &amp; CEO Email: julien@juliedesk.com Tel: +33 6 63 33 17 55 Julie", :historyId=>"232755", :payload=>{:mimeType=>"multipart/alternative", :filename=>"", :headers=>[{:name=>"Received", :value=>"by 10.64.89.39 with SMTP id bl7csp1888330ieb; Thu, 15 Jan 2015 01:40:21 -0800 (PST)"}, {:name=>"X-Received", :value=>"by 10.194.2.75 with SMTP id 11mr16697173wjs.78.1421314820755; Thu, 15 Jan 2015 01:40:20 -0800 (PST)"}, {:name=>"Return-Path", :value=>"<julien@wepopp.com>"}, {:name=>"Received", :value=>"from mail-wg0-f52.google.com (mail-wg0-f52.google.com. [74.125.82.52]) by mx.google.com with ESMTPS id cz7si1861265wjc.17.2015.01.15.01.40.19 for <julie@juliedesk.com> (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 15 Jan 2015 01:40:20 -0800 (PST)"}, {:name=>"Received-SPF", :value=>"pass (google.com: domain of julien@wepopp.com designates 74.125.82.52 as permitted sender) client-ip=74.125.82.52;"}, {:name=>"Authentication-Results", :value=>"mx.google.com; spf=pass (google.com: domain of julien@wepopp.com designates 74.125.82.52 as permitted sender) smtp.mail=julien@wepopp.com"}, {:name=>"Received", :value=>"by mail-wg0-f52.google.com with SMTP id x12so13734359wgg.11 for <julie@juliedesk.com>; Thu, 15 Jan 2015 01:40:19 -0800 (PST)"}, {:name=>"X-Google-DKIM-Signature", :value=>"v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:from:date:message-id:subject:to:cc :content-type; bh=VX+NTBD3y6zC7y2eoK6dXfXslqvi6t2cSoTCjb3ydPE=; b=GJnt5rk9Ck0uf9drEbY8tmxHqEosl3+89TyqId0TMttNgmjhV+rTX5tGe1N1wbPS0o ZMl5zDe/A5GGd7PHa8ykZZwNv5GQn0cjMQIMs+nMyUTUCUYeioWirF3frDJ8siV7+EXF s+l5+8Ul3suVPTcg5+zoNGgTJu3mWBC4E+1KMbVLYNOZtOd5PEMJPCZuTu2/k8Vw0Iw6 8JG02sSAzWRxNJnUoCRrShTV7C+eNRehvI7utHGMrobP1chWb2qZgLvbwGnpo/eBceya XWo/bpd9OcAYhb0spf0M2pXJ6TL/fzYbplFj0Lj8sXfRphQJivUjUVj4F02Tty2HpQ+q 4kQw=="}, {:name=>"X-Gm-Message-State", :value=>"ALoCoQk6eM56sO2fhoPw1I+al4RvoL3xd/Mzo7nmPK4WlB/OUaOD0isPUduI2MUrEdZgQ8tty/AH"}, {:name=>"X-Received", :value=>"by 10.180.126.99 with SMTP id mx3mr17257983wib.66.1421314819809; Thu, 15 Jan 2015 01:40:19 -0800 (PST)"}, {:name=>"MIME-Version", :value=>"1.0"}, {:name=>"Received", :value=>"by 10.180.8.228 with HTTP; Thu, 15 Jan 2015 01:39:59 -0800 (PST)"}, {:name=>"From", :value=>"Julien Hobeika <julien@juliedesk.com>"}, {:name=>"Date", :value=>"Thu, 15 Jan 2015 10:39:59 +0100"}, {:name=>"Message-ID", :value=>"<CAA-2G7UbpEhf1G6-fF_ruSew7SRjsOpU+wPbmWufrknmbxQVZg@mail.gmail.com>"}, {:name=>"Subject", :value=>"test reply message"}, {:name=>"To", :value=>"Julie Desk <julie@juliedesk.com>, Julien Hobeika <julien.hobeika@gmail.com>"}, {:name=>"Cc", :value=>"Julien Hobeika <julien@juliedesk.com>, Nicolas Marlier <nicolas@wepopp.com>"}, {:name=>"Content-Type", :value=>"multipart/alternative; boundary=e89a8f8389d1f2fbe9050cada4ac"}], :body=>{:size=>0}, :parts=>[{:partId=>"0", :mimeType=>"text/plain", :filename=>"", :headers=>[{:name=>"Content-Type", :value=>"text/plain; charset=UTF-8"}, {:name=>"Content-Transfer-Encoding", :value=>"quoted-printable"}], :body=>{:size=>144, :data=>"Y291Y291DQoNCg0KKkp1bGllbiBIb2JlaWthIHwgQ28tRm91bmRlciAmIENFTypFbWFpbDoganVsaWVuQGp1bGllZGVzay5jb20NClRlbDogKzMzIDYgNjMgMzMgMTcgNTUNCg0KKkp1bGllIERlc2sqDQp3d3cuanVsaWVkZXNrLmNvbQ0KDQoNCuGQpw0K"}}, {:partId=>"1", :mimeType=>"text/html", :filename=>"", :headers=>[{:name=>"Content-Type", :value=>"text/html; charset=UTF-8"}, {:name=>"Content-Transfer-Encoding", :value=>"quoted-printable"}], :body=>{:size=>742, :data=>"PGRpdiBkaXI9Imx0ciI-Y291Y291PGJyIGNsZWFyPSJhbGwiPjxkaXY-PGRpdiBjbGFzcz0iZ21haWxfc2lnbmF0dXJlIj48ZGl2IGRpcj0ibHRyIj48cD48Yj5KdWxpZW4gSG9iZWlrYSB8IENvLUZvdW5kZXIgJmFtcDsgQ0VPPGJyPjwvYj5FbWFpbDrCoDxhIGhyZWY9Im1haWx0bzpqdWxpZW5AanVsaWVkZXNrLmNvbSIgdGFyZ2V0PSJfYmxhbmsiPmp1bGllbkBqdWxpZWRlc2suY29tPC9hPjxicj5UZWw6ICszMyA2IDYzIDMzIDE3IDU1PC9wPjxwPjxiPkp1bGllIERlc2s8L2I-PGI-PGJyPjwvYj48YSBocmVmPSJodHRwOi8vd3d3Lmp1bGllZGVzay5jb20vIiBzdHlsZT0iY29sb3I6cmdiKDE3LDg1LDIwNCk7Zm9udC1mYW1pbHk6SGVsdmV0aWNhIiB0YXJnZXQ9Il9ibGFuayI-d3d3Lmp1bGllZGVzay5jb208L2E-PGI-PGJyPjwvYj48L3A-PHA-PGJyPjwvcD48L2Rpdj48L2Rpdj48L2Rpdj4NCjxkaXYgaHNwYWNlPSJzdHJlYWstcHQtbWFyayIgc3R5bGU9Im1heC1oZWlnaHQ6MXB4Ij48aW1nIHN0eWxlPSJ3aWR0aDowcHg7IG1heC1oZWlnaHQ6MHB4OyIgc3JjPSJodHRwczovL21haWxmb29nYWUuYXBwc3BvdC5jb20vdD9zZW5kZXI9YWFuVnNhV1Z1UUhkbGNHOXdjQzVqYjIwJTNEJmFtcDt0eXBlPXplcm9jb250ZW50JmFtcDtndWlkPTBiMWRiODRkLTFmMTctNDE1MS05ZmE5LTUxMWNiYTg0ODAyMiI-PGZvbnQgY29sb3I9IiNmZmZmZmYiIHNpemU9IjEiPuGQpzwvZm9udD48L2Rpdj48L2Rpdj4NCg=="}}]}, :sizeEstimate=>3710}
71
+ end
72
+
69
73
  def test_reply_message(params = {})
70
74
  {body: "test"}
71
75
  end
data/test/test_helper.rb CHANGED
@@ -12,6 +12,11 @@ module Gmail
12
12
  def self.connect
13
13
 
14
14
  end
15
+
16
+ def self.client= value
17
+ @client = value
18
+ end
19
+
15
20
  end
16
21
 
17
22
  class Test::Unit::TestCase
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gmail-api-ruby
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.5
4
+ version: 0.0.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Julien Hobeika
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-01-15 00:00:00.000000000 Z
11
+ date: 2015-01-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: mime
@@ -196,7 +196,8 @@ files:
196
196
  - test/test_data.rb
197
197
  - test/test_helper.rb
198
198
  homepage: http://github.com/jhk753/gmail-ruby-api
199
- licenses: []
199
+ licenses:
200
+ - MIT
200
201
  metadata: {}
201
202
  post_install_message:
202
203
  rdoc_options: []