-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
63 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1,4 @@ | |||
source "http://rubygems.org" | |||
|
|||
# Specify your gem's dependencies in heroku-sendgrid-test-email.gemspec | |||
gemspec |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1,2 @@ | |||
require 'bundler' | |||
Bundler::GemHelper.install_tasks |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1,23 @@ | |||
# -*- encoding: utf-8 -*- | |||
$:.push File.expand_path("../lib", __FILE__) | |||
require "heroku-sendgrid-test-email/version" | |||
|
|||
Gem::Specification.new do |s| | |||
s.name = "heroku-sendgrid-test-email" | |||
s.version = Heroku::Command::Sendgrid::TestEmail::VERSION | |||
s.authors = ["Terence Lee"] | |||
s.email = ["hone02@gmail.com"] | |||
s.homepage = "" | |||
s.summary = %q{Heroku plugin to test sendgrid addon} | |||
s.description = %q{Heroku plugin to test sendgrid addon} | |||
|
|||
s.rubyforge_project = "heroku-sendgrid-test-email" | |||
|
|||
s.files = `git ls-files`.split("\n") | |||
s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n") | |||
s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) } | |||
s.require_paths = ["lib"] | |||
|
|||
s.add_dependency "heroku", "~> 2.0.0" | |||
s.add_development_dependency "rake" | |||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -1,21 +1 @@ | |||
class Heroku::Command::Sendgrid < Heroku::Command::Base | require 'heroku-sendgrid-test-email' | ||
def test_email | |||
app = extract_app | |||
vars = heroku.config_vars(app) | |||
to = '' | |||
args.each do |arg| | |||
key, value = arg.split("=") | |||
to = value if key == "to" | |||
end | |||
|
|||
if to.empty? | |||
error "please specify an address to send to using to=<me@example.com>" | |||
else | |||
resource = RestClient::Resource.new("https://pony-mail-test.heroku.com") | |||
display resource["/mail"].post(:sendgrid_username => vars["SENDGRID_USERNAME"], | |||
:sendgrid_password => vars["SENDGRID_PASSWORD"], | |||
:sendgrid_domain => vars["SENDGRID_DOMAIN"], | |||
:to => to) | |||
end | |||
end | |||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1 @@ | |||
require 'heroku-sendgrid-test-email/command/sendgrid' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1,23 @@ | |||
require 'heroku/command/base' | |||
|
|||
class Heroku::Command::Sendgrid < Heroku::Command::Base | |||
def test_email | |||
app = extract_app | |||
vars = heroku.config_vars(app) | |||
to = '' | |||
args.each do |arg| | |||
key, value = arg.split("=") | |||
to = value if key == "to" | |||
end | |||
|
|||
if to.empty? | |||
error "please specify an address to send to using to=<me@example.com>" | |||
else | |||
resource = RestClient::Resource.new("https://pony-mail-test.heroku.com") | |||
display resource["/mail"].post(:sendgrid_username => vars["SENDGRID_USERNAME"], | |||
:sendgrid_password => vars["SENDGRID_PASSWORD"], | |||
:sendgrid_domain => vars["SENDGRID_DOMAIN"], | |||
:to => to) | |||
end | |||
end | |||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1,9 @@ | |||
module Heroku | |||
module Command | |||
module Sendgrid | |||
module TestEmail | |||
VERSION = "0.0.1" | |||
end | |||
end | |||
end | |||
end |