mailchimp_ses 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
data/.document ADDED
@@ -0,0 +1,5 @@
1
+ lib/**/*.rb
2
+ bin/*
3
+ -
4
+ features/**/*.feature
5
+ LICENSE.txt
data/.rspec ADDED
@@ -0,0 +1 @@
1
+ --color
data/Gemfile ADDED
@@ -0,0 +1,14 @@
1
+ source "http://rubygems.org"
2
+
3
+ gem 'monster_mash'
4
+ gem 'json'
5
+
6
+ # Add dependencies to develop your gem here.
7
+ # Include everything needed to run rake, tests, features, etc.
8
+ group :development do
9
+ gem "rspec", "~> 2.3.0"
10
+ gem "bundler", "~> 1.0.0"
11
+ gem "jeweler", "~> 1.5.2"
12
+ gem "rcov", ">= 0"
13
+ gem 'vcr'
14
+ end
data/Gemfile.lock ADDED
@@ -0,0 +1,38 @@
1
+ GEM
2
+ remote: http://rubygems.org/
3
+ specs:
4
+ diff-lcs (1.1.2)
5
+ git (1.2.5)
6
+ jeweler (1.5.2)
7
+ bundler (~> 1.0.0)
8
+ git (>= 1.2.5)
9
+ rake
10
+ json (1.5.1)
11
+ mime-types (1.16)
12
+ monster_mash (0.2.0)
13
+ typhoeus (>= 0.2.0)
14
+ rake (0.8.7)
15
+ rcov (0.9.9)
16
+ rspec (2.3.0)
17
+ rspec-core (~> 2.3.0)
18
+ rspec-expectations (~> 2.3.0)
19
+ rspec-mocks (~> 2.3.0)
20
+ rspec-core (2.3.1)
21
+ rspec-expectations (2.3.0)
22
+ diff-lcs (~> 1.1.2)
23
+ rspec-mocks (2.3.0)
24
+ typhoeus (0.2.1)
25
+ mime-types
26
+ vcr (1.4.0)
27
+
28
+ PLATFORMS
29
+ ruby
30
+
31
+ DEPENDENCIES
32
+ bundler (~> 1.0.0)
33
+ jeweler (~> 1.5.2)
34
+ json
35
+ monster_mash
36
+ rcov
37
+ rspec (~> 2.3.0)
38
+ vcr
data/LICENSE.txt ADDED
@@ -0,0 +1,20 @@
1
+ Copyright (c) 2011 David Balatero
2
+
3
+ Permission is hereby granted, free of charge, to any person obtaining
4
+ a copy of this software and associated documentation files (the
5
+ "Software"), to deal in the Software without restriction, including
6
+ without limitation the rights to use, copy, modify, merge, publish,
7
+ distribute, sublicense, and/or sell copies of the Software, and to
8
+ permit persons to whom the Software is furnished to do so, subject to
9
+ the following conditions:
10
+
11
+ The above copyright notice and this permission notice shall be
12
+ included in all copies or substantial portions of the Software.
13
+
14
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
17
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
18
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
19
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
20
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,71 @@
1
+ mailchimp_ses
2
+ =============
3
+
4
+ This library implements a couple of methods in the new MailChimp SES API.
5
+
6
+ Setup
7
+ -----
8
+ Add to your Gemfile:
9
+
10
+ gem 'mailchimp_ses'
11
+
12
+ Configure your API key somewhere (in Rails, create `config/initializer/mailchimp_ses.rb`):
13
+
14
+ MailchimpSes.api_key = 'myapikey-us1'
15
+
16
+ send_email
17
+ ----------
18
+
19
+ Any missing required fields will raise ArgumentError from this method call.
20
+
21
+ Usage example:
22
+
23
+ MailchimpSes.send_email(
24
+ :message => {
25
+ :subject => 'Welcome to our website!',
26
+ :html => '<html>Welcome to our site.</html>',
27
+ :text => 'Welcome to our website.',
28
+ :from_name => 'David Balatero',
29
+ :from_email => 'david@balatero.com',
30
+ :to_email => ['john@smith.com'],
31
+ :to_name => ['John Smith']
32
+ },
33
+ :tags => ['welcome_message', 'new_user'],
34
+ :track_opens => true,
35
+ :track_clicks => true
36
+ )
37
+
38
+ Returns the parsed JSON response from MailChimp. Sample response:
39
+
40
+ {
41
+ "msg" => nil,
42
+ "aws_code" => nil,
43
+ "status" => "sent",
44
+ "message_id" => "6710077a-372b-11e0-blah-blah-blah"
45
+ }
46
+
47
+ verify_email_address
48
+ --------------------
49
+
50
+ A quick method to send an email verification message out. Useful for testing.
51
+
52
+ result = MailchimpSes.verify_email_address('foo@bar.com')
53
+ puts result.to_s # => "true"
54
+
55
+ Contributing to mailchimp_ses
56
+ -----------------------------
57
+
58
+ * Check out the latest master to make sure the feature hasn't been implemented or the bug hasn't been fixed yet
59
+ * Check out the issue tracker to make sure someone already hasn't requested it and/or contributed it
60
+ * Fork the project
61
+ * Start a feature/bugfix branch
62
+ * Commit and push until you are happy with your contribution
63
+ * Make sure to add tests for it. This is important so I don't break it in a future version unintentionally.
64
+ * Please try not to mess with the Rakefile, version, or history. If you want to have your own version, or is otherwise necessary, that is fine, but please isolate to its own commit so I can cherry-pick around it.
65
+
66
+ Copyright
67
+ ---------
68
+
69
+ Copyright (c) 2011 David Balatero. See LICENSE.txt for
70
+ further details.
71
+
data/README.md.html ADDED
@@ -0,0 +1,72 @@
1
+ <h1>mailchimp_ses</h1>
2
+
3
+ <p>This library implements a couple of methods in the new MailChimp SES API.</p>
4
+
5
+ <h2>Setup</h2>
6
+
7
+ <p>Add to your Gemfile:</p>
8
+
9
+ <pre><code>gem 'mailchimp_ses'
10
+ </code></pre>
11
+
12
+ <p>Configure your API key somewhere (in Rails, create <code>config/initializer/mailchimp_ses.rb</code>):</p>
13
+
14
+ <pre><code>MailchimpSes.api_key = 'myapikey-us1'
15
+ </code></pre>
16
+
17
+ <h2>send_email</h2>
18
+
19
+ <p>Any missing required fields will raise ArgumentError from this method call.</p>
20
+
21
+ <p>Usage example:</p>
22
+
23
+ <pre><code>MailchimpSes.send_email(
24
+ :message =&gt; {
25
+ :subject =&gt; 'Welcome to our website!',
26
+ :html =&gt; '&lt;html&gt;Welcome to our site.&lt;/html&gt;',
27
+ :text =&gt; 'Welcome to our website.',
28
+ :from_name =&gt; 'David Balatero',
29
+ :from_email =&gt; 'david@balatero.com',
30
+ :to_email =&gt; ['john@smith.com'],
31
+ :to_name =&gt; ['John Smith']
32
+ },
33
+ :tags =&gt; ['welcome_message', 'new_user'],
34
+ :track_opens =&gt; true,
35
+ :track_clicks =&gt; true
36
+ )
37
+ </code></pre>
38
+
39
+ <p>Returns the parsed JSON response from MailChimp. Sample response:</p>
40
+
41
+ <pre><code>{
42
+ "msg" =&gt; nil,
43
+ "aws_code" =&gt; nil,
44
+ "status" =&gt; "sent",
45
+ "message_id" =&gt; "6710077a-372b-11e0-blah-blah-blah"
46
+ }
47
+ </code></pre>
48
+
49
+ <h2>verify<em>email</em>address</h2>
50
+
51
+ <p>A quick method to send an email verification message out. Useful for testing.</p>
52
+
53
+ <pre><code>result = MailchimpSes.verify_email_address('foo@bar.com')
54
+ puts result.to_s # =&gt; "true"
55
+ </code></pre>
56
+
57
+ <h2>Contributing to mailchimp_ses</h2>
58
+
59
+ <ul>
60
+ <li>Check out the latest master to make sure the feature hasn&#8217;t been implemented or the bug hasn&#8217;t been fixed yet</li>
61
+ <li>Check out the issue tracker to make sure someone already hasn&#8217;t requested it and/or contributed it</li>
62
+ <li>Fork the project</li>
63
+ <li>Start a feature/bugfix branch</li>
64
+ <li>Commit and push until you are happy with your contribution</li>
65
+ <li>Make sure to add tests for it. This is important so I don&#8217;t break it in a future version unintentionally.</li>
66
+ <li>Please try not to mess with the Rakefile, version, or history. If you want to have your own version, or is otherwise necessary, that is fine, but please isolate to its own commit so I can cherry-pick around it.</li>
67
+ </ul>
68
+
69
+ <h2>Copyright</h2>
70
+
71
+ <p>Copyright (c) 2011 David Balatero. See LICENSE.txt for
72
+ further details.</p>
data/Rakefile ADDED
@@ -0,0 +1,55 @@
1
+ require 'rubygems'
2
+ require 'bundler'
3
+ begin
4
+ Bundler.setup(:default, :development)
5
+ rescue Bundler::BundlerError => e
6
+ $stderr.puts e.message
7
+ $stderr.puts "Run `bundle install` to install missing gems"
8
+ exit e.status_code
9
+ end
10
+ require 'rake'
11
+
12
+ require 'jeweler'
13
+ Jeweler::Tasks.new do |gem|
14
+ # gem is a Gem::Specification... see http://docs.rubygems.org/read/chapter/20 for more options
15
+ gem.name = "mailchimp_ses"
16
+ gem.homepage = "http://github.com/dbalatero/mailchimp_ses"
17
+ gem.license = "MIT"
18
+ gem.summary = %Q{Gives API methods for MailChimp SES.}
19
+ gem.description = %Q{Allows you to call MailChimp <-> Amazon SES integration methods.}
20
+ gem.email = "dbalatero@gmail.com"
21
+ gem.authors = ["David Balatero"]
22
+ # Include your dependencies below. Runtime dependencies are required when using your gem,
23
+ # and development dependencies are only needed for development (ie running rake tasks, tests, etc)
24
+ # gem.add_runtime_dependency 'jabber4r', '> 0.1'
25
+ # gem.add_development_dependency 'rspec', '> 1.2.3'
26
+
27
+ gem.add_development_dependency 'rspec', '~> 2.3.0'
28
+ gem.add_development_dependency 'jeweler', '~> 1.5.2'
29
+ gem.add_development_dependency 'vcr'
30
+ gem.add_runtime_dependency 'monster_mash', '>= 0.2.0'
31
+ end
32
+ Jeweler::RubygemsDotOrgTasks.new
33
+
34
+ require 'rspec/core'
35
+ require 'rspec/core/rake_task'
36
+ RSpec::Core::RakeTask.new(:spec) do |spec|
37
+ spec.pattern = FileList['spec/**/*_spec.rb']
38
+ end
39
+
40
+ RSpec::Core::RakeTask.new(:rcov) do |spec|
41
+ spec.pattern = 'spec/**/*_spec.rb'
42
+ spec.rcov = true
43
+ end
44
+
45
+ task :default => :spec
46
+
47
+ require 'rake/rdoctask'
48
+ Rake::RDocTask.new do |rdoc|
49
+ version = File.exist?('VERSION') ? File.read('VERSION') : ""
50
+
51
+ rdoc.rdoc_dir = 'rdoc'
52
+ rdoc.title = "mailchimp_ses #{version}"
53
+ rdoc.rdoc_files.include('README*')
54
+ rdoc.rdoc_files.include('lib/**/*.rb')
55
+ end
data/VERSION ADDED
@@ -0,0 +1 @@
1
+ 1.0.0
@@ -0,0 +1,93 @@
1
+ require 'monster_mash'
2
+ require 'json'
3
+
4
+ class MailchimpSes < MonsterMash::Base
5
+ @api_key = nil
6
+
7
+ defaults do
8
+ params :apikey => MailchimpSes.api_key
9
+ end
10
+
11
+ class << self
12
+ attr_accessor :api_key
13
+ end
14
+
15
+ post(:verify_email_address) do |email|
16
+ check_api_key!
17
+ uri "http://#{datacenter}.sts.mailchimp.com/1.0/VerifyEmailAddress"
18
+ params :email => email
19
+ handler do |response|
20
+ true
21
+ end
22
+ end
23
+
24
+ post(:send_email) do |options|
25
+ check_api_key!
26
+
27
+ uri "http://#{datacenter}.sts.mailchimp.com/1.0/SendEmail"
28
+
29
+ # Message params.
30
+ message = {
31
+ :html => extract_param(options[:message], :html),
32
+ :text => options[:message][:text],
33
+ :subject => extract_param(options[:message], :subject),
34
+ :from_name => extract_param(options[:message], :from_name),
35
+ :from_email => extract_param(options[:message], :from_email),
36
+ :to_email => convert_to_hash_array(extract_param(options[:message], :to_email))
37
+ }
38
+
39
+ # Pull optional to_name.
40
+ if options[:message].has_key?(:to_name) && !options[:message][:to_name].empty?
41
+ message[:to_name] = convert_to_hash_array(options[:message][:to_name])
42
+ end
43
+
44
+ # Check on to_email and to_name length.
45
+ if message.has_key?(:to_email) && message.has_key?(:to_name) &&
46
+ message[:to_email].size != message[:to_name].size
47
+ raise ArgumentError, "to_email and to_name need the same number of values"
48
+ end
49
+
50
+ # Handle tags.
51
+ tags = nil
52
+ if options[:tags] && options[:tags].size > 0
53
+ tags = convert_to_hash_array(options[:tags])
54
+ end
55
+
56
+ params :message => message,
57
+ :track_opens => extract_param(options, :track_opens).to_s,
58
+ :track_clicks => extract_param(options, :track_clicks).to_s,
59
+ :tags => tags
60
+
61
+ handler do |response|
62
+ json = JSON.parse(response.body)
63
+ end
64
+ end
65
+
66
+ private
67
+
68
+ def self.check_api_key!
69
+ if self.api_key.nil?
70
+ raise ArgumentError, "Set MailchimpSes.api_key in your config."
71
+ end
72
+ end
73
+
74
+ def self.convert_to_hash_array(value)
75
+ # Turn strings into 1-element arrays.
76
+ value = value.is_a?(Array) ? value : [value]
77
+
78
+ hash = {}
79
+ value.each_with_index { |val, i| hash[i] = val }
80
+ hash
81
+ end
82
+
83
+ def self.extract_param(hash, key)
84
+ if !hash.has_key?(key) || (hash[key].respond_to?(:empty?) && hash[key].empty?)
85
+ raise ArgumentError, "missing required #{key}"
86
+ end
87
+ hash[key]
88
+ end
89
+
90
+ def self.datacenter
91
+ api_key.split(/-/).last
92
+ end
93
+ end
@@ -0,0 +1,88 @@
1
+ # Generated by jeweler
2
+ # DO NOT EDIT THIS FILE DIRECTLY
3
+ # Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
4
+ # -*- encoding: utf-8 -*-
5
+
6
+ Gem::Specification.new do |s|
7
+ s.name = %q{mailchimp_ses}
8
+ s.version = "1.0.0"
9
+
10
+ s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
+ s.authors = ["David Balatero"]
12
+ s.date = %q{2011-02-12}
13
+ s.description = %q{Allows you to call MailChimp <-> Amazon SES integration methods.}
14
+ s.email = %q{dbalatero@gmail.com}
15
+ s.extra_rdoc_files = [
16
+ "LICENSE.txt",
17
+ "README.md",
18
+ "README.md.html"
19
+ ]
20
+ s.files = [
21
+ ".document",
22
+ ".rspec",
23
+ "Gemfile",
24
+ "Gemfile.lock",
25
+ "LICENSE.txt",
26
+ "README.md",
27
+ "Rakefile",
28
+ "VERSION",
29
+ "lib/mailchimp_ses.rb",
30
+ "mailchimp_ses.gemspec",
31
+ "spec/fixtures/vcr_cassettes/send_email.yml",
32
+ "spec/mailchimp_ses_spec.rb",
33
+ "spec/spec_helper.rb"
34
+ ]
35
+ s.homepage = %q{http://github.com/dbalatero/mailchimp_ses}
36
+ s.licenses = ["MIT"]
37
+ s.require_paths = ["lib"]
38
+ s.rubygems_version = %q{1.3.7}
39
+ s.summary = %q{Gives API methods for MailChimp SES.}
40
+ s.test_files = [
41
+ "spec/mailchimp_ses_spec.rb",
42
+ "spec/spec_helper.rb"
43
+ ]
44
+
45
+ if s.respond_to? :specification_version then
46
+ current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
47
+ s.specification_version = 3
48
+
49
+ if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
50
+ s.add_runtime_dependency(%q<monster_mash>, [">= 0"])
51
+ s.add_runtime_dependency(%q<json>, [">= 0"])
52
+ s.add_development_dependency(%q<rspec>, ["~> 2.3.0"])
53
+ s.add_development_dependency(%q<bundler>, ["~> 1.0.0"])
54
+ s.add_development_dependency(%q<jeweler>, ["~> 1.5.2"])
55
+ s.add_development_dependency(%q<rcov>, [">= 0"])
56
+ s.add_development_dependency(%q<vcr>, [">= 0"])
57
+ s.add_development_dependency(%q<rspec>, ["~> 2.3.0"])
58
+ s.add_development_dependency(%q<jeweler>, ["~> 1.5.2"])
59
+ s.add_development_dependency(%q<vcr>, [">= 0"])
60
+ s.add_runtime_dependency(%q<monster_mash>, [">= 0.2.0"])
61
+ else
62
+ s.add_dependency(%q<monster_mash>, [">= 0"])
63
+ s.add_dependency(%q<json>, [">= 0"])
64
+ s.add_dependency(%q<rspec>, ["~> 2.3.0"])
65
+ s.add_dependency(%q<bundler>, ["~> 1.0.0"])
66
+ s.add_dependency(%q<jeweler>, ["~> 1.5.2"])
67
+ s.add_dependency(%q<rcov>, [">= 0"])
68
+ s.add_dependency(%q<vcr>, [">= 0"])
69
+ s.add_dependency(%q<rspec>, ["~> 2.3.0"])
70
+ s.add_dependency(%q<jeweler>, ["~> 1.5.2"])
71
+ s.add_dependency(%q<vcr>, [">= 0"])
72
+ s.add_dependency(%q<monster_mash>, [">= 0.2.0"])
73
+ end
74
+ else
75
+ s.add_dependency(%q<monster_mash>, [">= 0"])
76
+ s.add_dependency(%q<json>, [">= 0"])
77
+ s.add_dependency(%q<rspec>, ["~> 2.3.0"])
78
+ s.add_dependency(%q<bundler>, ["~> 1.0.0"])
79
+ s.add_dependency(%q<jeweler>, ["~> 1.5.2"])
80
+ s.add_dependency(%q<rcov>, [">= 0"])
81
+ s.add_dependency(%q<vcr>, [">= 0"])
82
+ s.add_dependency(%q<rspec>, ["~> 2.3.0"])
83
+ s.add_dependency(%q<jeweler>, ["~> 1.5.2"])
84
+ s.add_dependency(%q<vcr>, [">= 0"])
85
+ s.add_dependency(%q<monster_mash>, [">= 0.2.0"])
86
+ end
87
+ end
88
+
@@ -0,0 +1,45 @@
1
+ ---
2
+ - !ruby/struct:VCR::HTTPInteraction
3
+ request: !ruby/struct:VCR::Request
4
+ method: :post
5
+ uri: http://us1.sts.mailchimp.com:80/1.0/SendEmail
6
+ body:
7
+ headers:
8
+ user-agent:
9
+ - Typhoeus - http://github.com/dbalatero/typhoeus/tree/master
10
+ response: !ruby/struct:VCR::Response
11
+ status: !ruby/struct:VCR::ResponseStatus
12
+ code: 200
13
+ message: Continue
14
+ headers:
15
+ x-powered-by:
16
+ - PHP/5.2.16
17
+ content-type:
18
+ - application/json; charset=utf-8
19
+ date:
20
+ - Sun, 13 Feb 2011 05:07:29 GMT
21
+ server:
22
+ - Apache/2.2.3 (Red Hat)
23
+ content-length:
24
+ - "110"
25
+ content-encoding:
26
+ - gzip
27
+ vary:
28
+ - Accept-Encoding
29
+ body: "{\"message_id\":\"2819e141-372f-11e0-bd4e-4162672e6bcb\",\"aws_code\":null,\"msg\":null,\"status\":\"sent\"}"
30
+ http_version: "1.1"
31
+ - !ruby/struct:VCR::HTTPInteraction
32
+ request: !ruby/struct:VCR::Request
33
+ method: :post
34
+ uri: http://test.sts.mailchimp.com:80/1.0/SendEmail
35
+ body:
36
+ headers:
37
+ user-agent:
38
+ - Typhoeus - http://github.com/dbalatero/typhoeus/tree/master
39
+ response: !ruby/struct:VCR::Response
40
+ status: !ruby/struct:VCR::ResponseStatus
41
+ code: 0
42
+ message:
43
+ headers:
44
+ body:
45
+ http_version:
@@ -0,0 +1,71 @@
1
+ require File.expand_path(File.dirname(__FILE__) + '/spec_helper')
2
+
3
+ describe "MailchimpSes" do
4
+ before(:each) do
5
+ # disabled in production.
6
+ MailchimpSes.api_key = "test-us1"
7
+
8
+ @valid_params = {
9
+ :message => {
10
+ :subject => 'Welcome to our website!',
11
+ :html => '<html>Welcome to our site.</html>',
12
+ :text => 'Welcome to our website.',
13
+ :from_name => 'David Balatero',
14
+ :from_email => 'david@mediapiston.com',
15
+ :to_email => ['dbalatero@gmail.com',],
16
+ :to_name => ['David Balatero']
17
+ },
18
+ :tags => ['fun', 'message', 'unique'],
19
+ :track_opens => true,
20
+ :track_clicks => true
21
+ }
22
+ end
23
+
24
+ describe "#send_email" do
25
+ describe "error checking" do
26
+ it "should raise error w/ no api key" do
27
+ MailchimpSes.api_key = nil
28
+ lambda {
29
+ MailchimpSes.send_email(@valid_params)
30
+ }.should raise_error(ArgumentError)
31
+ end
32
+
33
+ [:track_opens, :track_clicks].each do |field|
34
+ it "should require #{field}" do
35
+ @valid_params.delete(field)
36
+ lambda {
37
+ MailchimpSes.send_email(@valid_params)
38
+ }.should raise_error(ArgumentError)
39
+ end
40
+ end
41
+
42
+ [:html, :subject, :from_name, :from_email, :to_email].each do |field|
43
+ it "should require message #{field}" do
44
+ @valid_params[:message].delete(field)
45
+ lambda {
46
+ MailchimpSes.send_email(@valid_params)
47
+ }.should raise_error(ArgumentError)
48
+ end
49
+ end
50
+
51
+ it "should not allow to_email and to_name to be diff length" do
52
+ @valid_params[:message][:to_email] = ['fds@fds.com', 'a@b.com']
53
+ @valid_params[:message][:to_name] = ['My Friend Fds']
54
+
55
+ lambda {
56
+ MailchimpSes.send_email(@valid_params)
57
+ }.should raise_error(ArgumentError)
58
+ end
59
+ end
60
+
61
+ describe "real requests" do
62
+ use_vcr_cassette 'send_email', :record => :new_episodes
63
+
64
+ it "should return a success or failure" do
65
+ result = MailchimpSes.send_email(@valid_params)
66
+ result['status'].should == 'sent'
67
+ result['message_id'].should_not be_nil
68
+ end
69
+ end
70
+ end
71
+ end
@@ -0,0 +1,18 @@
1
+ $LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
2
+ $LOAD_PATH.unshift(File.dirname(__FILE__))
3
+ require 'rspec'
4
+ require 'vcr'
5
+ require 'mailchimp_ses'
6
+
7
+ # Requires supporting files with custom matchers and macros, etc,
8
+ # in ./support/ and its subdirectories.
9
+ Dir["#{File.dirname(__FILE__)}/support/**/*.rb"].each {|f| require f}
10
+
11
+ VCR.config do |c|
12
+ c.cassette_library_dir = File.dirname(__FILE__) + '/fixtures/vcr_cassettes'
13
+ c.stub_with :typhoeus # or :fakeweb
14
+ end
15
+
16
+ RSpec.configure do |config|
17
+ config.extend VCR::RSpec::Macros
18
+ end
metadata ADDED
@@ -0,0 +1,248 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: mailchimp_ses
3
+ version: !ruby/object:Gem::Version
4
+ hash: 23
5
+ prerelease: false
6
+ segments:
7
+ - 1
8
+ - 0
9
+ - 0
10
+ version: 1.0.0
11
+ platform: ruby
12
+ authors:
13
+ - David Balatero
14
+ autorequire:
15
+ bindir: bin
16
+ cert_chain: []
17
+
18
+ date: 2011-02-12 00:00:00 -08:00
19
+ default_executable:
20
+ dependencies:
21
+ - !ruby/object:Gem::Dependency
22
+ type: :runtime
23
+ prerelease: false
24
+ version_requirements: &id001 !ruby/object:Gem::Requirement
25
+ none: false
26
+ requirements:
27
+ - - ">="
28
+ - !ruby/object:Gem::Version
29
+ hash: 3
30
+ segments:
31
+ - 0
32
+ version: "0"
33
+ name: monster_mash
34
+ requirement: *id001
35
+ - !ruby/object:Gem::Dependency
36
+ type: :runtime
37
+ prerelease: false
38
+ version_requirements: &id002 !ruby/object:Gem::Requirement
39
+ none: false
40
+ requirements:
41
+ - - ">="
42
+ - !ruby/object:Gem::Version
43
+ hash: 3
44
+ segments:
45
+ - 0
46
+ version: "0"
47
+ name: json
48
+ requirement: *id002
49
+ - !ruby/object:Gem::Dependency
50
+ type: :development
51
+ prerelease: false
52
+ version_requirements: &id003 !ruby/object:Gem::Requirement
53
+ none: false
54
+ requirements:
55
+ - - ~>
56
+ - !ruby/object:Gem::Version
57
+ hash: 3
58
+ segments:
59
+ - 2
60
+ - 3
61
+ - 0
62
+ version: 2.3.0
63
+ name: rspec
64
+ requirement: *id003
65
+ - !ruby/object:Gem::Dependency
66
+ type: :development
67
+ prerelease: false
68
+ version_requirements: &id004 !ruby/object:Gem::Requirement
69
+ none: false
70
+ requirements:
71
+ - - ~>
72
+ - !ruby/object:Gem::Version
73
+ hash: 23
74
+ segments:
75
+ - 1
76
+ - 0
77
+ - 0
78
+ version: 1.0.0
79
+ name: bundler
80
+ requirement: *id004
81
+ - !ruby/object:Gem::Dependency
82
+ type: :development
83
+ prerelease: false
84
+ version_requirements: &id005 !ruby/object:Gem::Requirement
85
+ none: false
86
+ requirements:
87
+ - - ~>
88
+ - !ruby/object:Gem::Version
89
+ hash: 7
90
+ segments:
91
+ - 1
92
+ - 5
93
+ - 2
94
+ version: 1.5.2
95
+ name: jeweler
96
+ requirement: *id005
97
+ - !ruby/object:Gem::Dependency
98
+ type: :development
99
+ prerelease: false
100
+ version_requirements: &id006 !ruby/object:Gem::Requirement
101
+ none: false
102
+ requirements:
103
+ - - ">="
104
+ - !ruby/object:Gem::Version
105
+ hash: 3
106
+ segments:
107
+ - 0
108
+ version: "0"
109
+ name: rcov
110
+ requirement: *id006
111
+ - !ruby/object:Gem::Dependency
112
+ type: :development
113
+ prerelease: false
114
+ version_requirements: &id007 !ruby/object:Gem::Requirement
115
+ none: false
116
+ requirements:
117
+ - - ">="
118
+ - !ruby/object:Gem::Version
119
+ hash: 3
120
+ segments:
121
+ - 0
122
+ version: "0"
123
+ name: vcr
124
+ requirement: *id007
125
+ - !ruby/object:Gem::Dependency
126
+ type: :development
127
+ prerelease: false
128
+ version_requirements: &id008 !ruby/object:Gem::Requirement
129
+ none: false
130
+ requirements:
131
+ - - ~>
132
+ - !ruby/object:Gem::Version
133
+ hash: 3
134
+ segments:
135
+ - 2
136
+ - 3
137
+ - 0
138
+ version: 2.3.0
139
+ name: rspec
140
+ requirement: *id008
141
+ - !ruby/object:Gem::Dependency
142
+ type: :development
143
+ prerelease: false
144
+ version_requirements: &id009 !ruby/object:Gem::Requirement
145
+ none: false
146
+ requirements:
147
+ - - ~>
148
+ - !ruby/object:Gem::Version
149
+ hash: 7
150
+ segments:
151
+ - 1
152
+ - 5
153
+ - 2
154
+ version: 1.5.2
155
+ name: jeweler
156
+ requirement: *id009
157
+ - !ruby/object:Gem::Dependency
158
+ type: :development
159
+ prerelease: false
160
+ version_requirements: &id010 !ruby/object:Gem::Requirement
161
+ none: false
162
+ requirements:
163
+ - - ">="
164
+ - !ruby/object:Gem::Version
165
+ hash: 3
166
+ segments:
167
+ - 0
168
+ version: "0"
169
+ name: vcr
170
+ requirement: *id010
171
+ - !ruby/object:Gem::Dependency
172
+ type: :runtime
173
+ prerelease: false
174
+ version_requirements: &id011 !ruby/object:Gem::Requirement
175
+ none: false
176
+ requirements:
177
+ - - ">="
178
+ - !ruby/object:Gem::Version
179
+ hash: 23
180
+ segments:
181
+ - 0
182
+ - 2
183
+ - 0
184
+ version: 0.2.0
185
+ name: monster_mash
186
+ requirement: *id011
187
+ description: Allows you to call MailChimp <-> Amazon SES integration methods.
188
+ email: dbalatero@gmail.com
189
+ executables: []
190
+
191
+ extensions: []
192
+
193
+ extra_rdoc_files:
194
+ - LICENSE.txt
195
+ - README.md
196
+ - README.md.html
197
+ files:
198
+ - .document
199
+ - .rspec
200
+ - Gemfile
201
+ - Gemfile.lock
202
+ - LICENSE.txt
203
+ - README.md
204
+ - Rakefile
205
+ - VERSION
206
+ - lib/mailchimp_ses.rb
207
+ - mailchimp_ses.gemspec
208
+ - spec/fixtures/vcr_cassettes/send_email.yml
209
+ - spec/mailchimp_ses_spec.rb
210
+ - spec/spec_helper.rb
211
+ - README.md.html
212
+ has_rdoc: true
213
+ homepage: http://github.com/dbalatero/mailchimp_ses
214
+ licenses:
215
+ - MIT
216
+ post_install_message:
217
+ rdoc_options: []
218
+
219
+ require_paths:
220
+ - lib
221
+ required_ruby_version: !ruby/object:Gem::Requirement
222
+ none: false
223
+ requirements:
224
+ - - ">="
225
+ - !ruby/object:Gem::Version
226
+ hash: 3
227
+ segments:
228
+ - 0
229
+ version: "0"
230
+ required_rubygems_version: !ruby/object:Gem::Requirement
231
+ none: false
232
+ requirements:
233
+ - - ">="
234
+ - !ruby/object:Gem::Version
235
+ hash: 3
236
+ segments:
237
+ - 0
238
+ version: "0"
239
+ requirements: []
240
+
241
+ rubyforge_project:
242
+ rubygems_version: 1.3.7
243
+ signing_key:
244
+ specification_version: 3
245
+ summary: Gives API methods for MailChimp SES.
246
+ test_files:
247
+ - spec/mailchimp_ses_spec.rb
248
+ - spec/spec_helper.rb