mailgun 0.7 → 0.8
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +0 -4
- data/CONTRIBUTORS.md +23 -0
- data/README.md +31 -16
- data/lib/mailgun.rb +4 -1
- data/lib/mailgun/base.rb +4 -4
- data/lib/mailgun/bounce.rb +24 -3
- data/lib/mailgun/message.rb +1 -1
- data/lib/multimap/.gitignore +4 -0
- data/lib/multimap/LICENSE +20 -0
- data/lib/multimap/README.rdoc +16 -0
- data/lib/multimap/Rakefile +34 -0
- data/lib/multimap/benchmarks/bm_nested_multimap_construction.rb +60 -0
- data/lib/multimap/benchmarks/bm_nested_multimap_lookup.rb +33 -0
- data/lib/multimap/ext/extconf.rb +6 -0
- data/lib/multimap/ext/nested_multimap_ext.c +24 -0
- data/lib/multimap/extras/graphing.rb +83 -0
- data/lib/multimap/lib/multimap.rb +569 -0
- data/lib/multimap/lib/multiset.rb +185 -0
- data/lib/multimap/lib/nested_multimap.rb +158 -0
- data/lib/multimap/spec/enumerable_examples.rb +50 -0
- data/lib/multimap/spec/hash_examples.rb +264 -0
- data/lib/multimap/spec/multimap_spec.rb +45 -0
- data/lib/multimap/spec/multiset_spec.rb +184 -0
- data/lib/multimap/spec/nested_multimap_spec.rb +202 -0
- data/lib/multimap/spec/set_examples.rb +301 -0
- data/lib/multimap/spec/spec_helper.rb +67 -0
- data/mailgun.gemspec +4 -4
- data/spec/base_spec.rb +2 -2
- data/spec/bounce_spec.rb +12 -0
- metadata +43 -23
@@ -0,0 +1,67 @@
|
|
1
|
+
require 'multiset'
|
2
|
+
require 'multimap'
|
3
|
+
require 'nested_multimap'
|
4
|
+
|
5
|
+
require 'enumerable_examples'
|
6
|
+
require 'hash_examples'
|
7
|
+
require 'set_examples'
|
8
|
+
|
9
|
+
# Rubinius Hash isn't ordered by insert order
|
10
|
+
Spec::Matchers.define :sorted_eql do |expected|
|
11
|
+
if defined? Rubinius
|
12
|
+
sorter = lambda { |a, b| a.hash <=> b.hash }
|
13
|
+
match do |actual|
|
14
|
+
actual.sort(&sorter).should eql(expected.sort(&sorter))
|
15
|
+
end
|
16
|
+
else
|
17
|
+
match do |actual|
|
18
|
+
actual.should eql(expected)
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
22
|
+
|
23
|
+
require 'set'
|
24
|
+
|
25
|
+
if defined? Rubinius
|
26
|
+
class Set
|
27
|
+
def <=>(other)
|
28
|
+
to_a <=> other.to_a
|
29
|
+
end
|
30
|
+
end
|
31
|
+
end
|
32
|
+
|
33
|
+
require 'forwardable'
|
34
|
+
|
35
|
+
class MiniArray
|
36
|
+
extend Forwardable
|
37
|
+
|
38
|
+
attr_accessor :data
|
39
|
+
|
40
|
+
def initialize(data = [])
|
41
|
+
@data = data
|
42
|
+
end
|
43
|
+
|
44
|
+
def initialize_copy(orig)
|
45
|
+
@data = orig.data.dup
|
46
|
+
end
|
47
|
+
|
48
|
+
def_delegators :@data, :<<, :each, :delete, :delete_if
|
49
|
+
|
50
|
+
def ==(other)
|
51
|
+
other.is_a?(self.class) && @data == other.data
|
52
|
+
end
|
53
|
+
|
54
|
+
def eql?(other)
|
55
|
+
other.is_a?(self.class) && @data.eql?(other.data)
|
56
|
+
end
|
57
|
+
|
58
|
+
if defined? Rubinius
|
59
|
+
def hash
|
60
|
+
@data.hash
|
61
|
+
end
|
62
|
+
|
63
|
+
def <=>(other)
|
64
|
+
@data <=> other.data
|
65
|
+
end
|
66
|
+
end
|
67
|
+
end
|
data/mailgun.gemspec
CHANGED
@@ -5,18 +5,18 @@ Gem::Specification.new do |gem|
|
|
5
5
|
gem.email = ["akash@akash.im"]
|
6
6
|
gem.description = %q{Mailgun library for Ruby}
|
7
7
|
gem.summary = %q{Idiomatic library for using the mailgun API from within ruby}
|
8
|
-
gem.homepage = "http://github.com/
|
8
|
+
gem.homepage = "http://github.com/HashNuke/mailgun"
|
9
9
|
|
10
10
|
gem.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
|
11
11
|
gem.files = `git ls-files`.split("\n")
|
12
12
|
gem.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
|
13
13
|
gem.name = "mailgun"
|
14
14
|
gem.require_paths = ["lib"]
|
15
|
-
gem.version = "0.
|
15
|
+
gem.version = "0.8"
|
16
16
|
|
17
|
-
gem.add_dependency(%q<rest-client>, [">= 0"])
|
18
|
-
gem.add_dependency(%q<multimap>, [">= 0"])
|
17
|
+
gem.add_dependency(%q<rest-client>, [">= 0"])
|
19
18
|
|
20
19
|
gem.add_development_dependency(%q<rspec>, [">= 2"])
|
21
20
|
gem.add_development_dependency(%q<debugger>, [">= 0"])
|
21
|
+
gem.add_development_dependency(%q<vcr>, [">= 0"])
|
22
22
|
end
|
data/spec/base_spec.rb
CHANGED
@@ -12,13 +12,13 @@ describe Mailgun::Base do
|
|
12
12
|
Mailgun.config { |c| c.api_key = "some-junk-string" }
|
13
13
|
expect do
|
14
14
|
Mailgun()
|
15
|
-
end.
|
15
|
+
end.not_to raise_error()
|
16
16
|
end
|
17
17
|
|
18
18
|
it "can be instanced with the api_key as a param" do
|
19
19
|
expect do
|
20
20
|
Mailgun({:api_key => "some-junk-string"})
|
21
|
-
end.
|
21
|
+
end.not_to raise_error()
|
22
22
|
end
|
23
23
|
|
24
24
|
describe "Mailgun.new" do
|
data/spec/bounce_spec.rb
CHANGED
@@ -51,4 +51,16 @@ describe Mailgun::Bounce do
|
|
51
51
|
end
|
52
52
|
end
|
53
53
|
|
54
|
+
describe "destroy bounces" do
|
55
|
+
it "should make DELETE request with correct params to remove a given email address" do
|
56
|
+
sample_response = "{\"message\"=>\"Bounced address has been removed\", \"address\"=>\"postmaster@bsample.mailgun.org\"}"
|
57
|
+
bounces_url = @mailgun.bounces(@sample[:domain]).send(:bounce_url, @sample[:email])
|
58
|
+
|
59
|
+
Mailgun.should_receive(:submit).
|
60
|
+
with(:delete, bounces_url).
|
61
|
+
and_return(sample_response)
|
62
|
+
|
63
|
+
@mailgun.bounces(@sample[:domain]).destroy(@sample[:email])
|
64
|
+
end
|
65
|
+
end
|
54
66
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: mailgun
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: '0.
|
4
|
+
version: '0.8'
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Akash Manohar J
|
@@ -9,62 +9,62 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date:
|
12
|
+
date: 2014-04-09 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rest-client
|
16
16
|
requirement: !ruby/object:Gem::Requirement
|
17
17
|
requirements:
|
18
|
-
- -
|
18
|
+
- - ">="
|
19
19
|
- !ruby/object:Gem::Version
|
20
20
|
version: '0'
|
21
21
|
type: :runtime
|
22
22
|
prerelease: false
|
23
23
|
version_requirements: !ruby/object:Gem::Requirement
|
24
24
|
requirements:
|
25
|
-
- -
|
25
|
+
- - ">="
|
26
26
|
- !ruby/object:Gem::Version
|
27
27
|
version: '0'
|
28
28
|
- !ruby/object:Gem::Dependency
|
29
|
-
name:
|
29
|
+
name: rspec
|
30
30
|
requirement: !ruby/object:Gem::Requirement
|
31
31
|
requirements:
|
32
|
-
- -
|
32
|
+
- - ">="
|
33
33
|
- !ruby/object:Gem::Version
|
34
|
-
version: '
|
35
|
-
type: :
|
34
|
+
version: '2'
|
35
|
+
type: :development
|
36
36
|
prerelease: false
|
37
37
|
version_requirements: !ruby/object:Gem::Requirement
|
38
38
|
requirements:
|
39
|
-
- -
|
39
|
+
- - ">="
|
40
40
|
- !ruby/object:Gem::Version
|
41
|
-
version: '
|
41
|
+
version: '2'
|
42
42
|
- !ruby/object:Gem::Dependency
|
43
|
-
name:
|
43
|
+
name: debugger
|
44
44
|
requirement: !ruby/object:Gem::Requirement
|
45
45
|
requirements:
|
46
|
-
- -
|
46
|
+
- - ">="
|
47
47
|
- !ruby/object:Gem::Version
|
48
|
-
version: '
|
48
|
+
version: '0'
|
49
49
|
type: :development
|
50
50
|
prerelease: false
|
51
51
|
version_requirements: !ruby/object:Gem::Requirement
|
52
52
|
requirements:
|
53
|
-
- -
|
53
|
+
- - ">="
|
54
54
|
- !ruby/object:Gem::Version
|
55
|
-
version: '
|
55
|
+
version: '0'
|
56
56
|
- !ruby/object:Gem::Dependency
|
57
|
-
name:
|
57
|
+
name: vcr
|
58
58
|
requirement: !ruby/object:Gem::Requirement
|
59
59
|
requirements:
|
60
|
-
- -
|
60
|
+
- - ">="
|
61
61
|
- !ruby/object:Gem::Version
|
62
62
|
version: '0'
|
63
63
|
type: :development
|
64
64
|
prerelease: false
|
65
65
|
version_requirements: !ruby/object:Gem::Requirement
|
66
66
|
requirements:
|
67
|
-
- -
|
67
|
+
- - ">="
|
68
68
|
- !ruby/object:Gem::Version
|
69
69
|
version: '0'
|
70
70
|
description: Mailgun library for Ruby
|
@@ -74,7 +74,8 @@ executables: []
|
|
74
74
|
extensions: []
|
75
75
|
extra_rdoc_files: []
|
76
76
|
files:
|
77
|
-
- .gitignore
|
77
|
+
- ".gitignore"
|
78
|
+
- CONTRIBUTORS.md
|
78
79
|
- Gemfile
|
79
80
|
- LICENSE
|
80
81
|
- README.md
|
@@ -92,6 +93,25 @@ files:
|
|
92
93
|
- lib/mailgun/message.rb
|
93
94
|
- lib/mailgun/route.rb
|
94
95
|
- lib/mailgun/unsubscribe.rb
|
96
|
+
- lib/multimap/.gitignore
|
97
|
+
- lib/multimap/LICENSE
|
98
|
+
- lib/multimap/README.rdoc
|
99
|
+
- lib/multimap/Rakefile
|
100
|
+
- lib/multimap/benchmarks/bm_nested_multimap_construction.rb
|
101
|
+
- lib/multimap/benchmarks/bm_nested_multimap_lookup.rb
|
102
|
+
- lib/multimap/ext/extconf.rb
|
103
|
+
- lib/multimap/ext/nested_multimap_ext.c
|
104
|
+
- lib/multimap/extras/graphing.rb
|
105
|
+
- lib/multimap/lib/multimap.rb
|
106
|
+
- lib/multimap/lib/multiset.rb
|
107
|
+
- lib/multimap/lib/nested_multimap.rb
|
108
|
+
- lib/multimap/spec/enumerable_examples.rb
|
109
|
+
- lib/multimap/spec/hash_examples.rb
|
110
|
+
- lib/multimap/spec/multimap_spec.rb
|
111
|
+
- lib/multimap/spec/multiset_spec.rb
|
112
|
+
- lib/multimap/spec/nested_multimap_spec.rb
|
113
|
+
- lib/multimap/spec/set_examples.rb
|
114
|
+
- lib/multimap/spec/spec_helper.rb
|
95
115
|
- mailgun.gemspec
|
96
116
|
- spec/base_spec.rb
|
97
117
|
- spec/bounce_spec.rb
|
@@ -105,7 +125,7 @@ files:
|
|
105
125
|
- spec/route_spec.rb
|
106
126
|
- spec/spec_helper.rb
|
107
127
|
- spec/unsubscribe_spec.rb
|
108
|
-
homepage: http://github.com/
|
128
|
+
homepage: http://github.com/HashNuke/mailgun
|
109
129
|
licenses: []
|
110
130
|
metadata: {}
|
111
131
|
post_install_message:
|
@@ -114,17 +134,17 @@ require_paths:
|
|
114
134
|
- lib
|
115
135
|
required_ruby_version: !ruby/object:Gem::Requirement
|
116
136
|
requirements:
|
117
|
-
- -
|
137
|
+
- - ">="
|
118
138
|
- !ruby/object:Gem::Version
|
119
139
|
version: '0'
|
120
140
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
121
141
|
requirements:
|
122
|
-
- -
|
142
|
+
- - ">="
|
123
143
|
- !ruby/object:Gem::Version
|
124
144
|
version: '0'
|
125
145
|
requirements: []
|
126
146
|
rubyforge_project:
|
127
|
-
rubygems_version: 2.
|
147
|
+
rubygems_version: 2.2.0
|
128
148
|
signing_key:
|
129
149
|
specification_version: 4
|
130
150
|
summary: Idiomatic library for using the mailgun API from within ruby
|