Skip to content

Commit

Permalink
Added Mail API.
Browse files Browse the repository at this point in the history
  • Loading branch information
narinda committed Jun 8, 2011
1 parent 4010f35 commit ebfcf9a
Show file tree
Hide file tree
Showing 5 changed files with 41 additions and 18 deletions.
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.0.4
1.0.5
1 change: 1 addition & 0 deletions lib/sendgrid_toolkit.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
require 'sendgrid_toolkit/spam_reports'
require 'sendgrid_toolkit/bounces'
require 'sendgrid_toolkit/invalid_emails'
require 'sendgrid_toolkit/mail'

module SendgridToolkit
BASE_URI = "sendgrid.com/api"
Expand Down
14 changes: 14 additions & 0 deletions lib/sendgrid_toolkit/mail.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
module SendgridToolkit

class Mail < AbstractSendgridClient
def send(options = {})
response = api_post('mail', 'send', options)
response
end

def module_name
self.class.to_s.split("::").last.downcase
end
end

end
28 changes: 11 additions & 17 deletions sendgrid_toolkit.gemspec
Original file line number Diff line number Diff line change
@@ -1,39 +1,45 @@
# Generated by jeweler
# DO NOT EDIT THIS FILE DIRECTLY
# Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
# Instead, edit Jeweler::Tasks in rakefile, and run 'rake gemspec'
# -*- encoding: utf-8 -*-

Gem::Specification.new do |s|
s.name = %q{sendgrid_toolkit}
s.version = "1.0.4"
s.version = "1.0.5"

s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
s.authors = ["Robby Grossman"]
s.date = %q{2011-02-01}
s.date = %q{2011-06-08}
s.description = %q{A Ruby wrapper and utility library for communicating with the Sendgrid API}
s.email = %q{robby@freerobby.com}
s.extra_rdoc_files = [
"README.md"
]
s.files = [
".DS_Store",
"README.md",
"Rakefile",
"VERSION",
"lib/.DS_Store",
"lib/sendgrid_toolkit.rb",
"lib/sendgrid_toolkit/abstract_sendgrid_client.rb",
"lib/sendgrid_toolkit/bounces.rb",
"lib/sendgrid_toolkit/common.rb",
"lib/sendgrid_toolkit/invalid_emails.rb",
"lib/sendgrid_toolkit/mail.rb",
"lib/sendgrid_toolkit/sendgrid_error.rb",
"lib/sendgrid_toolkit/spam_reports.rb",
"lib/sendgrid_toolkit/statistics.rb",
"lib/sendgrid_toolkit/unsubscribes.rb",
"sendgrid_toolkit.gemspec",
"spec/.DS_Store",
"spec/helper.rb",
"spec/lib/.DS_Store",
"spec/lib/sendgrid_toolkit/abstract_sendgrid_client_spec.rb",
"spec/lib/sendgrid_toolkit/bounces_spec.rb",
"spec/lib/sendgrid_toolkit/common_spec.rb",
"spec/lib/sendgrid_toolkit/invalid_emails_spec.rb",
"spec/lib/sendgrid_toolkit/mail_spec.rb",
"spec/lib/sendgrid_toolkit/spam_reports_spec.rb",
"spec/lib/sendgrid_toolkit/statistics_spec.rb",
"spec/lib/sendgrid_toolkit/unsubscribes_spec.rb",
Expand All @@ -42,26 +48,14 @@ Gem::Specification.new do |s|
]
s.homepage = %q{http://github.com/freerobby/sendgrid_toolkit}
s.require_paths = ["lib"]
s.rubygems_version = %q{1.3.7}
s.rubygems_version = %q{1.3.6}
s.summary = %q{A Ruby wrapper and utility library for communicating with the Sendgrid API}
s.test_files = [
"spec/helper.rb",
"spec/lib/sendgrid_toolkit/abstract_sendgrid_client_spec.rb",
"spec/lib/sendgrid_toolkit/bounces_spec.rb",
"spec/lib/sendgrid_toolkit/common_spec.rb",
"spec/lib/sendgrid_toolkit/invalid_emails_spec.rb",
"spec/lib/sendgrid_toolkit/spam_reports_spec.rb",
"spec/lib/sendgrid_toolkit/statistics_spec.rb",
"spec/lib/sendgrid_toolkit/unsubscribes_spec.rb",
"spec/lib/sendgrid_toolkit_spec.rb",
"spec/webconnect/sendgrid_toolkit_spec.rb"
]

if s.respond_to? :specification_version then
current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
s.specification_version = 3

if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
if Gem::Version.new(Gem::RubyGemsVersion) >= Gem::Version.new('1.2.0') then
s.add_runtime_dependency(%q<httparty>, [">= 0"])
else
s.add_dependency(%q<httparty>, [">= 0"])
Expand Down
14 changes: 14 additions & 0 deletions spec/lib/sendgrid_toolkit/mail_spec.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
require File.expand_path("#{File.dirname(__FILE__)}/../../helper")

describe SendgridToolkit::Mail do
before do
FakeWeb.clean_registry
@obj = SendgridToolkit::Mail.new("fakeuser", "fakepass")
end

describe "#send" do
it "returns array of unsubscribed email addresses" do

end
end
end

0 comments on commit ebfcf9a

Please sign in to comment.