forked from 85x14/griddler-ses
-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Complete gem update from Griddler::Ses to Griddler::AmazonSES (#2)
* Fix test suite. * Rename from Griddler::Ses to Griddler::AmazonSES. * Update last references from Ses to AmazonSES. * Bump version to 2.0.0.
- Loading branch information
Showing
12 changed files
with
42 additions
and
40 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 | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,3 @@ | ||
source 'https://rubygems.org' | ||
|
||
# Specify your gem's dependencies in griddler-ses.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
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 | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,16 @@ | ||
# coding: utf-8 | ||
lib = File.expand_path('../lib', __FILE__) | ||
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib) | ||
require 'griddler/ses/version' | ||
require 'griddler/amazon_ses/version' | ||
|
||
Gem::Specification.new do |spec| | ||
spec.name = "griddler-ses" | ||
spec.version = Griddler::Ses::VERSION | ||
spec.authors = ["Kent Mewhort @ Coupa"] | ||
spec.email = ["[email protected]"] | ||
spec.name = "griddler-amazon_ses" | ||
spec.version = Griddler::AmazonSES::VERSION | ||
spec.authors = ["Chuck Callebs", "Kent Mewhort @ Coupa"] | ||
spec.email = ["[email protected]", "[email protected]"] | ||
|
||
spec.summary = %q{Griddler adapter for AWS SES (handle incoming email replies through SES)} | ||
spec.homepage = "https://github.com/85x14/griddler-ses" | ||
spec.homepage = "https://github.com/ccallebs/griddler-amazon_ses" | ||
spec.license = "MIT" | ||
|
||
spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) } | ||
|
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 | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
require 'aws/sns_message' | ||
require 'griddler' | ||
require 'griddler/amazon_ses/version' | ||
require 'griddler/amazon_ses/adapter' | ||
require 'griddler/amazon_ses/middleware' | ||
require 'griddler/amazon_ses/railtie' | ||
|
||
module Griddler | ||
module AmazonSES | ||
end | ||
end | ||
|
||
Griddler.adapter_registry.register(:amazon_ses, Griddler::AmazonSES::Adapter) |
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 | Diff line number | Diff line change |
---|---|---|
|
@@ -2,7 +2,7 @@ | |
require 'net/http' | ||
|
||
module Griddler | ||
module Ses | ||
module AmazonSES | ||
class Adapter | ||
attr_reader :sns_json | ||
|
||
|
2 changes: 1 addition & 1 deletion
2
lib/griddler/ses/middleware.rb → lib/griddler/amazon_ses/middleware.rb
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 | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
module Griddler | ||
module Ses | ||
module AmazonSES | ||
class Middleware | ||
def initialize(app) | ||
@app = app | ||
|
4 changes: 3 additions & 1 deletion
4
lib/griddler/ses/railtie.rb → lib/griddler/amazon_ses/railtie.rb
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
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 | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
module Griddler | ||
module AmazonSES | ||
VERSION = "2.0.0" | ||
end | ||
end |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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 | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,13 @@ | ||
require 'spec_helper' | ||
|
||
describe Griddler::Ses::Adapter do | ||
describe Griddler::AmazonSES::Adapter do | ||
before do | ||
# mock the hash check on the notification, as we've zero'd the numbers | ||
allow_any_instance_of(AWS::SnsMessage).to receive(:authentic?).and_return(true) | ||
end | ||
|
||
it 'registers itself with griddler' do | ||
Griddler.adapter_registry[:ses].should eq Griddler::Ses::Adapter | ||
expect(Griddler.adapter_registry[:amazon_ses]).to eq Griddler::AmazonSES::Adapter | ||
end | ||
|
||
describe "Griddler shared examples" do | ||
|
@@ -16,27 +16,27 @@ | |
sns_message[:mail][:commonHeaders][:cc] = ['[email protected]'] | ||
sns_message[:mail][:commonHeaders][:from] = ['There <[email protected]>'] | ||
|
||
allow_any_instance_of(Griddler::Ses::Adapter).to receive(:sns_json).and_return(default_params) | ||
allow_any_instance_of(Griddler::AmazonSES::Adapter).to receive(:sns_json).and_return(default_params) | ||
end | ||
|
||
it_behaves_like 'Griddler adapter', :ses, {} | ||
it_behaves_like 'Griddler adapter', :amazon_ses, {} | ||
end | ||
|
||
describe '.normalize_params' do | ||
it 'parses out the "to" addresses, returning an array' do | ||
expect(Griddler::Ses::Adapter.normalize_params(default_params)[:to]).to eq ['"Mr Fugushima at Fugu, Inc" <[email protected]>', 'Foo bar <[email protected]>'] | ||
expect(Griddler::AmazonSES::Adapter.normalize_params(default_params)[:to]).to eq ['"Mr Fugushima at Fugu, Inc" <[email protected]>', 'Foo bar <[email protected]>'] | ||
end | ||
|
||
it 'parses out the "from" address, returning a string' do | ||
expect(Griddler::Ses::Adapter.normalize_params(default_params)[:from]).to eq "Test There <[email protected]>" | ||
expect(Griddler::AmazonSES::Adapter.normalize_params(default_params)[:from]).to eq "Test There <[email protected]>" | ||
end | ||
|
||
it 'parses out the "subject", returning a string' do | ||
expect(Griddler::Ses::Adapter.normalize_params(default_params)[:subject]).to eq "Test" | ||
expect(Griddler::AmazonSES::Adapter.normalize_params(default_params)[:subject]).to eq "Test" | ||
end | ||
|
||
it 'parses out the text' do | ||
expect(Griddler::Ses::Adapter.normalize_params(default_params)[:text]).to eq "Hi\n" | ||
expect(Griddler::AmazonSES::Adapter.normalize_params(default_params)[:text]).to eq "Hi\n" | ||
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