pew_pew 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (57) hide show
  1. data/.gitignore +19 -0
  2. data/.rspec +2 -0
  3. data/.yardopts +1 -0
  4. data/Gemfile +3 -0
  5. data/LICENSE +22 -0
  6. data/README.md +84 -0
  7. data/Rakefile +3 -0
  8. data/lib/pew_pew.rb +32 -0
  9. data/lib/pew_pew/client.rb +90 -0
  10. data/lib/pew_pew/config.rb +15 -0
  11. data/lib/pew_pew/domain.rb +9 -0
  12. data/lib/pew_pew/resource.rb +52 -0
  13. data/lib/pew_pew/resources/bounces.rb +41 -0
  14. data/lib/pew_pew/resources/campaigns.rb +141 -0
  15. data/lib/pew_pew/resources/complaints.rb +40 -0
  16. data/lib/pew_pew/resources/lists.rb +121 -0
  17. data/lib/pew_pew/resources/logs.rb +12 -0
  18. data/lib/pew_pew/resources/mailboxes.rb +41 -0
  19. data/lib/pew_pew/resources/messages.rb +37 -0
  20. data/lib/pew_pew/resources/routes.rb +57 -0
  21. data/lib/pew_pew/resources/stats.rb +12 -0
  22. data/lib/pew_pew/resources/unsubscribes.rb +43 -0
  23. data/lib/pew_pew/response.rb +11 -0
  24. data/lib/pew_pew/version.rb +3 -0
  25. data/pew_pew.gemspec +20 -0
  26. data/spec/fixtures/bounces.yml +144 -0
  27. data/spec/fixtures/campaigns.yml +368 -0
  28. data/spec/fixtures/complaints.yml +142 -0
  29. data/spec/fixtures/image.png +0 -0
  30. data/spec/fixtures/lists.yml +403 -0
  31. data/spec/fixtures/logs.yml +133 -0
  32. data/spec/fixtures/mailboxes.yml +141 -0
  33. data/spec/fixtures/messages.yml +196 -0
  34. data/spec/fixtures/mime.eml +34 -0
  35. data/spec/fixtures/routes.yml +225 -0
  36. data/spec/fixtures/stats.yml +61 -0
  37. data/spec/fixtures/unsubscribes.yml +219 -0
  38. data/spec/pew_pew/client_spec.rb +51 -0
  39. data/spec/pew_pew/config_spec.rb +38 -0
  40. data/spec/pew_pew/resource_spec.rb +46 -0
  41. data/spec/pew_pew/resources/bounces_spec.rb +78 -0
  42. data/spec/pew_pew/resources/campaigns_spec.rb +228 -0
  43. data/spec/pew_pew/resources/complaints_spec.rb +69 -0
  44. data/spec/pew_pew/resources/lists_spec.rb +283 -0
  45. data/spec/pew_pew/resources/logs_spec.rb +28 -0
  46. data/spec/pew_pew/resources/mailboxes_spec.rb +59 -0
  47. data/spec/pew_pew/resources/messages_spec.rb +53 -0
  48. data/spec/pew_pew/resources/routes_spec.rb +135 -0
  49. data/spec/pew_pew/resources/stats_spec.rb +26 -0
  50. data/spec/pew_pew/resources/unsubscribes_spec.rb +99 -0
  51. data/spec/pew_pew/response_spec.rb +21 -0
  52. data/spec/pew_pew_spec.rb +13 -0
  53. data/spec/spec_helper.rb +17 -0
  54. data/spec/support/contexts/api_requests.rb +23 -0
  55. data/spec/support/contexts/domain_resource.rb +17 -0
  56. data/spec/support/vcr.rb +6 -0
  57. metadata +211 -0
@@ -0,0 +1,23 @@
1
+ shared_context 'API request', :resource do
2
+ let(:cassette_name) { described_class.name.split(/::/).last.downcase }
3
+ let(:client) { PewPew::Client.new }
4
+
5
+ around do |example|
6
+ client.configure do |config|
7
+ config.api_key = ENV['MAILGUN_API_KEY']
8
+ config.domain = ENV['MAILGUN_DOMAIN']
9
+ end
10
+
11
+ basic_auth = Base64.encode64(
12
+ "#{PewPew::Config::USERNAME}:#{client.config.api_key}"
13
+ ).strip
14
+
15
+ vcr_options = {
16
+ record: (ENV['VCR_RECORD'] || :none).to_sym,
17
+ match_requests_on: [:method, :uri, :headers, :body],
18
+ erb: { basic_auth: basic_auth, domain: client.config.domain }
19
+ }
20
+
21
+ VCR.use_cassette(cassette_name, vcr_options, &example)
22
+ end
23
+ end
@@ -0,0 +1,17 @@
1
+ shared_context 'domain resource', :domain do
2
+ context 'options' do
3
+ subject { described_class.new(client, options) }
4
+
5
+ context 'without options' do
6
+ let(:options) { {} }
7
+
8
+ its(:domain) { should == client.config.domain }
9
+ end
10
+
11
+ context 'with option :domain' do
12
+ let(:options) { { domain: 'pewpew.test' } }
13
+
14
+ its(:domain) { should == 'pewpew.test'}
15
+ end
16
+ end
17
+ end
@@ -0,0 +1,6 @@
1
+ require 'vcr'
2
+
3
+ VCR.configure do |config|
4
+ config.cassette_library_dir = File.expand_path('../../fixtures', __FILE__)
5
+ config.hook_into(:faraday)
6
+ end
metadata ADDED
@@ -0,0 +1,211 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: pew_pew
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.1
5
+ prerelease:
6
+ platform: ruby
7
+ authors:
8
+ - Tyler Hunt
9
+ autorequire:
10
+ bindir: bin
11
+ cert_chain: []
12
+ date: 2012-06-04 00:00:00.000000000 Z
13
+ dependencies:
14
+ - !ruby/object:Gem::Dependency
15
+ name: faraday_middleware
16
+ requirement: !ruby/object:Gem::Requirement
17
+ none: false
18
+ requirements:
19
+ - - ~>
20
+ - !ruby/object:Gem::Version
21
+ version: 0.8.0
22
+ type: :runtime
23
+ prerelease: false
24
+ version_requirements: !ruby/object:Gem::Requirement
25
+ none: false
26
+ requirements:
27
+ - - ~>
28
+ - !ruby/object:Gem::Version
29
+ version: 0.8.0
30
+ - !ruby/object:Gem::Dependency
31
+ name: hashie
32
+ requirement: !ruby/object:Gem::Requirement
33
+ none: false
34
+ requirements:
35
+ - - ~>
36
+ - !ruby/object:Gem::Version
37
+ version: '1.1'
38
+ type: :runtime
39
+ prerelease: false
40
+ version_requirements: !ruby/object:Gem::Requirement
41
+ none: false
42
+ requirements:
43
+ - - ~>
44
+ - !ruby/object:Gem::Version
45
+ version: '1.1'
46
+ - !ruby/object:Gem::Dependency
47
+ name: relax
48
+ requirement: !ruby/object:Gem::Requirement
49
+ none: false
50
+ requirements:
51
+ - - ~>
52
+ - !ruby/object:Gem::Version
53
+ version: 0.2.0
54
+ type: :runtime
55
+ prerelease: false
56
+ version_requirements: !ruby/object:Gem::Requirement
57
+ none: false
58
+ requirements:
59
+ - - ~>
60
+ - !ruby/object:Gem::Version
61
+ version: 0.2.0
62
+ - !ruby/object:Gem::Dependency
63
+ name: rspec
64
+ requirement: !ruby/object:Gem::Requirement
65
+ none: false
66
+ requirements:
67
+ - - ~>
68
+ - !ruby/object:Gem::Version
69
+ version: '2.6'
70
+ type: :development
71
+ prerelease: false
72
+ version_requirements: !ruby/object:Gem::Requirement
73
+ none: false
74
+ requirements:
75
+ - - ~>
76
+ - !ruby/object:Gem::Version
77
+ version: '2.6'
78
+ - !ruby/object:Gem::Dependency
79
+ name: vcr
80
+ requirement: !ruby/object:Gem::Requirement
81
+ none: false
82
+ requirements:
83
+ - - ~>
84
+ - !ruby/object:Gem::Version
85
+ version: '2.2'
86
+ type: :development
87
+ prerelease: false
88
+ version_requirements: !ruby/object:Gem::Requirement
89
+ none: false
90
+ requirements:
91
+ - - ~>
92
+ - !ruby/object:Gem::Version
93
+ version: '2.2'
94
+ description:
95
+ email:
96
+ executables: []
97
+ extensions: []
98
+ extra_rdoc_files: []
99
+ files:
100
+ - .gitignore
101
+ - .rspec
102
+ - .yardopts
103
+ - Gemfile
104
+ - LICENSE
105
+ - README.md
106
+ - Rakefile
107
+ - lib/pew_pew.rb
108
+ - lib/pew_pew/client.rb
109
+ - lib/pew_pew/config.rb
110
+ - lib/pew_pew/domain.rb
111
+ - lib/pew_pew/resource.rb
112
+ - lib/pew_pew/resources/bounces.rb
113
+ - lib/pew_pew/resources/campaigns.rb
114
+ - lib/pew_pew/resources/complaints.rb
115
+ - lib/pew_pew/resources/lists.rb
116
+ - lib/pew_pew/resources/logs.rb
117
+ - lib/pew_pew/resources/mailboxes.rb
118
+ - lib/pew_pew/resources/messages.rb
119
+ - lib/pew_pew/resources/routes.rb
120
+ - lib/pew_pew/resources/stats.rb
121
+ - lib/pew_pew/resources/unsubscribes.rb
122
+ - lib/pew_pew/response.rb
123
+ - lib/pew_pew/version.rb
124
+ - pew_pew.gemspec
125
+ - spec/fixtures/bounces.yml
126
+ - spec/fixtures/campaigns.yml
127
+ - spec/fixtures/complaints.yml
128
+ - spec/fixtures/image.png
129
+ - spec/fixtures/lists.yml
130
+ - spec/fixtures/logs.yml
131
+ - spec/fixtures/mailboxes.yml
132
+ - spec/fixtures/messages.yml
133
+ - spec/fixtures/mime.eml
134
+ - spec/fixtures/routes.yml
135
+ - spec/fixtures/stats.yml
136
+ - spec/fixtures/unsubscribes.yml
137
+ - spec/pew_pew/client_spec.rb
138
+ - spec/pew_pew/config_spec.rb
139
+ - spec/pew_pew/resource_spec.rb
140
+ - spec/pew_pew/resources/bounces_spec.rb
141
+ - spec/pew_pew/resources/campaigns_spec.rb
142
+ - spec/pew_pew/resources/complaints_spec.rb
143
+ - spec/pew_pew/resources/lists_spec.rb
144
+ - spec/pew_pew/resources/logs_spec.rb
145
+ - spec/pew_pew/resources/mailboxes_spec.rb
146
+ - spec/pew_pew/resources/messages_spec.rb
147
+ - spec/pew_pew/resources/routes_spec.rb
148
+ - spec/pew_pew/resources/stats_spec.rb
149
+ - spec/pew_pew/resources/unsubscribes_spec.rb
150
+ - spec/pew_pew/response_spec.rb
151
+ - spec/pew_pew_spec.rb
152
+ - spec/spec_helper.rb
153
+ - spec/support/contexts/api_requests.rb
154
+ - spec/support/contexts/domain_resource.rb
155
+ - spec/support/vcr.rb
156
+ homepage: http://github.com/tylerhunt/pew_pew
157
+ licenses: []
158
+ post_install_message:
159
+ rdoc_options: []
160
+ require_paths:
161
+ - lib
162
+ required_ruby_version: !ruby/object:Gem::Requirement
163
+ none: false
164
+ requirements:
165
+ - - ! '>='
166
+ - !ruby/object:Gem::Version
167
+ version: '0'
168
+ required_rubygems_version: !ruby/object:Gem::Requirement
169
+ none: false
170
+ requirements:
171
+ - - ! '>='
172
+ - !ruby/object:Gem::Version
173
+ version: '0'
174
+ requirements: []
175
+ rubyforge_project:
176
+ rubygems_version: 1.8.24
177
+ signing_key:
178
+ specification_version: 3
179
+ summary: A Ruby client library for using the Mailgun web service.
180
+ test_files:
181
+ - spec/fixtures/bounces.yml
182
+ - spec/fixtures/campaigns.yml
183
+ - spec/fixtures/complaints.yml
184
+ - spec/fixtures/image.png
185
+ - spec/fixtures/lists.yml
186
+ - spec/fixtures/logs.yml
187
+ - spec/fixtures/mailboxes.yml
188
+ - spec/fixtures/messages.yml
189
+ - spec/fixtures/mime.eml
190
+ - spec/fixtures/routes.yml
191
+ - spec/fixtures/stats.yml
192
+ - spec/fixtures/unsubscribes.yml
193
+ - spec/pew_pew/client_spec.rb
194
+ - spec/pew_pew/config_spec.rb
195
+ - spec/pew_pew/resource_spec.rb
196
+ - spec/pew_pew/resources/bounces_spec.rb
197
+ - spec/pew_pew/resources/campaigns_spec.rb
198
+ - spec/pew_pew/resources/complaints_spec.rb
199
+ - spec/pew_pew/resources/lists_spec.rb
200
+ - spec/pew_pew/resources/logs_spec.rb
201
+ - spec/pew_pew/resources/mailboxes_spec.rb
202
+ - spec/pew_pew/resources/messages_spec.rb
203
+ - spec/pew_pew/resources/routes_spec.rb
204
+ - spec/pew_pew/resources/stats_spec.rb
205
+ - spec/pew_pew/resources/unsubscribes_spec.rb
206
+ - spec/pew_pew/response_spec.rb
207
+ - spec/pew_pew_spec.rb
208
+ - spec/spec_helper.rb
209
+ - spec/support/contexts/api_requests.rb
210
+ - spec/support/contexts/domain_resource.rb
211
+ - spec/support/vcr.rb