sendgrid_toolkit 1.0.2 → 1.0.3

Sign up to get free protection for your applications and to get access to all the features.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 1.0.2
1
+ 1.0.3
@@ -10,8 +10,12 @@ module SendgridToolkit
10
10
  def retrieve_with_timestamps(options = {})
11
11
  options.merge! :date => 1
12
12
  response = retrieve options
13
- response.each do |unsubscribe|
14
- unsubscribe['created'] = Time.parse(unsubscribe['created']) if unsubscribe.has_key?('created')
13
+ if response.is_a? Array
14
+ response.each do |message|
15
+ parse_message_time message
16
+ end
17
+ else
18
+ parse_message_time response
15
19
  end
16
20
  response
17
21
  end
@@ -28,6 +32,12 @@ module SendgridToolkit
28
32
  self.class.to_s.split("::").last.downcase
29
33
  end
30
34
 
35
+ private
36
+
37
+ def parse_message_time(message)
38
+ message['created'] = Time.parse(message['created']) if message.has_key?('created')
39
+ end
40
+
31
41
  end
32
42
 
33
43
  end
@@ -1,62 +1,60 @@
1
1
  # Generated by jeweler
2
2
  # DO NOT EDIT THIS FILE DIRECTLY
3
- # Instead, edit Jeweler::Tasks in Rakefile, and run the gemspec command
3
+ # Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
4
4
  # -*- encoding: utf-8 -*-
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{sendgrid_toolkit}
8
- s.version = "1.0.2"
8
+ s.version = "1.0.3"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Robby Grossman"]
12
- s.date = %q{2010-09-27}
12
+ s.date = %q{2011-01-21}
13
13
  s.description = %q{A Ruby wrapper and utility library for communicating with the Sendgrid API}
14
14
  s.email = %q{robby@freerobby.com}
15
15
  s.extra_rdoc_files = [
16
16
  "README.md"
17
17
  ]
18
18
  s.files = [
19
- ".gitignore",
20
- "README.md",
21
- "Rakefile",
22
- "VERSION",
23
- "lib/sendgrid_toolkit.rb",
24
- "lib/sendgrid_toolkit/abstract_sendgrid_client.rb",
25
- "lib/sendgrid_toolkit/bounces.rb",
26
- "lib/sendgrid_toolkit/common.rb",
27
- "lib/sendgrid_toolkit/invalid_emails.rb",
28
- "lib/sendgrid_toolkit/sendgrid_error.rb",
29
- "lib/sendgrid_toolkit/spam_reports.rb",
30
- "lib/sendgrid_toolkit/statistics.rb",
31
- "lib/sendgrid_toolkit/unsubscribes.rb",
32
- "sendgrid_toolkit.gemspec",
33
- "spec/helper.rb",
34
- "spec/lib/sendgrid_toolkit/abstract_sendgrid_client_spec.rb",
35
- "spec/lib/sendgrid_toolkit/bounces_spec.rb",
36
- "spec/lib/sendgrid_toolkit/common_spec.rb",
37
- "spec/lib/sendgrid_toolkit/invalid_emails_spec.rb",
38
- "spec/lib/sendgrid_toolkit/spam_reports_spec.rb",
39
- "spec/lib/sendgrid_toolkit/statistics_spec.rb",
40
- "spec/lib/sendgrid_toolkit/unsubscribes_spec.rb",
41
- "spec/lib/sendgrid_toolkit_spec.rb",
42
- "spec/webconnect/sendgrid_toolkit_spec.rb"
19
+ "README.md",
20
+ "Rakefile",
21
+ "VERSION",
22
+ "lib/sendgrid_toolkit.rb",
23
+ "lib/sendgrid_toolkit/abstract_sendgrid_client.rb",
24
+ "lib/sendgrid_toolkit/bounces.rb",
25
+ "lib/sendgrid_toolkit/common.rb",
26
+ "lib/sendgrid_toolkit/invalid_emails.rb",
27
+ "lib/sendgrid_toolkit/sendgrid_error.rb",
28
+ "lib/sendgrid_toolkit/spam_reports.rb",
29
+ "lib/sendgrid_toolkit/statistics.rb",
30
+ "lib/sendgrid_toolkit/unsubscribes.rb",
31
+ "sendgrid_toolkit.gemspec",
32
+ "spec/helper.rb",
33
+ "spec/lib/sendgrid_toolkit/abstract_sendgrid_client_spec.rb",
34
+ "spec/lib/sendgrid_toolkit/bounces_spec.rb",
35
+ "spec/lib/sendgrid_toolkit/common_spec.rb",
36
+ "spec/lib/sendgrid_toolkit/invalid_emails_spec.rb",
37
+ "spec/lib/sendgrid_toolkit/spam_reports_spec.rb",
38
+ "spec/lib/sendgrid_toolkit/statistics_spec.rb",
39
+ "spec/lib/sendgrid_toolkit/unsubscribes_spec.rb",
40
+ "spec/lib/sendgrid_toolkit_spec.rb",
41
+ "spec/webconnect/sendgrid_toolkit_spec.rb"
43
42
  ]
44
43
  s.homepage = %q{http://github.com/freerobby/sendgrid_toolkit}
45
- s.rdoc_options = ["--charset=UTF-8"]
46
44
  s.require_paths = ["lib"]
47
45
  s.rubygems_version = %q{1.3.7}
48
46
  s.summary = %q{A Ruby wrapper and utility library for communicating with the Sendgrid API}
49
47
  s.test_files = [
50
48
  "spec/helper.rb",
51
- "spec/lib/sendgrid_toolkit/abstract_sendgrid_client_spec.rb",
52
- "spec/lib/sendgrid_toolkit/bounces_spec.rb",
53
- "spec/lib/sendgrid_toolkit/common_spec.rb",
54
- "spec/lib/sendgrid_toolkit/invalid_emails_spec.rb",
55
- "spec/lib/sendgrid_toolkit/spam_reports_spec.rb",
56
- "spec/lib/sendgrid_toolkit/statistics_spec.rb",
57
- "spec/lib/sendgrid_toolkit/unsubscribes_spec.rb",
58
- "spec/lib/sendgrid_toolkit_spec.rb",
59
- "spec/webconnect/sendgrid_toolkit_spec.rb"
49
+ "spec/lib/sendgrid_toolkit/abstract_sendgrid_client_spec.rb",
50
+ "spec/lib/sendgrid_toolkit/bounces_spec.rb",
51
+ "spec/lib/sendgrid_toolkit/common_spec.rb",
52
+ "spec/lib/sendgrid_toolkit/invalid_emails_spec.rb",
53
+ "spec/lib/sendgrid_toolkit/spam_reports_spec.rb",
54
+ "spec/lib/sendgrid_toolkit/statistics_spec.rb",
55
+ "spec/lib/sendgrid_toolkit/unsubscribes_spec.rb",
56
+ "spec/lib/sendgrid_toolkit_spec.rb",
57
+ "spec/webconnect/sendgrid_toolkit_spec.rb"
60
58
  ]
61
59
 
62
60
  if s.respond_to? :specification_version then
@@ -3,7 +3,7 @@ require File.expand_path("#{File.dirname(__FILE__)}/../../helper")
3
3
  describe SendgridToolkit::Common do
4
4
 
5
5
  before do
6
- class FakeClass
6
+ class FakeClass < SendgridToolkit::AbstractSendgridClient
7
7
  include SendgridToolkit::Common
8
8
  end
9
9
  @fake_class = FakeClass.new
@@ -13,4 +13,11 @@ describe SendgridToolkit::Common do
13
13
  @fake_class.module_name.should == "fakeclass"
14
14
  end
15
15
 
16
+ it "does not choke if response does not have a 'message' field" do
17
+ FakeWeb.register_uri(:post, %r|https://sendgrid\.com/api/fakeclass\.delete\.json\?.*email=.+|, :body => 'An internal server error occurred. Please try again later.')
18
+ lambda {
19
+ @fake_class.delete :email => "user@domain.com"
20
+ }.should_not raise_error
21
+ end
22
+
16
23
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sendgrid_toolkit
3
3
  version: !ruby/object:Gem::Version
4
- hash: 19
4
+ hash: 17
5
5
  prerelease: false
6
6
  segments:
7
7
  - 1
8
8
  - 0
9
- - 2
10
- version: 1.0.2
9
+ - 3
10
+ version: 1.0.3
11
11
  platform: ruby
12
12
  authors:
13
13
  - Robby Grossman
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2010-09-27 00:00:00 -04:00
18
+ date: 2011-01-21 00:00:00 -05:00
19
19
  default_executable:
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency
@@ -41,7 +41,6 @@ extensions: []
41
41
  extra_rdoc_files:
42
42
  - README.md
43
43
  files:
44
- - .gitignore
45
44
  - README.md
46
45
  - Rakefile
47
46
  - VERSION
@@ -70,8 +69,8 @@ homepage: http://github.com/freerobby/sendgrid_toolkit
70
69
  licenses: []
71
70
 
72
71
  post_install_message:
73
- rdoc_options:
74
- - --charset=UTF-8
72
+ rdoc_options: []
73
+
75
74
  require_paths:
76
75
  - lib
77
76
  required_ruby_version: !ruby/object:Gem::Requirement
data/.gitignore DELETED
@@ -1,3 +0,0 @@
1
- pkg/
2
- doc/
3
- .idea/*