mailcatcher-cors 0.7.0 → 0.7.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +8 -8
- data/lib/mail_catcher/mail.rb +5 -0
- data/lib/mail_catcher/version.rb +1 -1
- data/lib/mail_catcher/web/application.rb +15 -0
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
ZTYzOTA1OWVkYTcxMjc5OGQ4NjY3ZWFhZmRiNjBlNWI5MTg2Y2MwZg==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
ZDE1OWRlN2Q4OTQ1MjI2YmYzZTQ1MWRhMWY5ZGRhZDQwNmViYjUzNQ==
|
7
7
|
SHA512:
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
ZjJiN2Q5MDJmMjFlNjMyMWRkNDAwNGZiYWUzNjJmYTVkODMzOWVmNWRmMTVj
|
10
|
+
MDY3Yzc2Mzk5Yjk4NDc2YzlhYjNhM2ExYjA0NjZmOTIxODY3MTVkNzM3ZTBk
|
11
|
+
N2E1M2IxYmViNzYwYThlYjg1Njg4YWU2OTgwZmI0YzZkZjMwOTg=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
NjNjOTBkNTVkMTkzYWJhZmRlZTE1NDM1NTgxMWFiMDBlZjY2MDg3ZjAxZmRh
|
14
|
+
YmVkZTE1NDAxMzI1YTJmOTg2ZjgzMGE3OTYzNzk0YzMxNGY3ZTk0MWUyYTgy
|
15
|
+
ZTRmZTU2MDNmODc0OGQ5MmZkN2M5NzdiMGZjZjYwMjE2ZGNjMmY=
|
data/lib/mail_catcher/mail.rb
CHANGED
@@ -157,4 +157,9 @@ module MailCatcher::Mail extend self
|
|
157
157
|
@delete_messages_query.execute(message_id) and
|
158
158
|
@delete_message_parts_query.execute(message_id)
|
159
159
|
end
|
160
|
+
|
161
|
+
def by_recipients(to)
|
162
|
+
@by_recipients_query = db.prepare "SELECT id FROM message WHERE recipients LIKE ?"
|
163
|
+
@by_recipients_query.execute("%#{to}%")
|
164
|
+
end
|
160
165
|
end
|
data/lib/mail_catcher/version.rb
CHANGED
@@ -194,6 +194,21 @@ module MailCatcher
|
|
194
194
|
not_found do
|
195
195
|
erb :"404"
|
196
196
|
end
|
197
|
+
|
198
|
+
|
199
|
+
get "/messages_from/:to.json" do |to|
|
200
|
+
content_type :json
|
201
|
+
Mail.by_recipients(to)
|
202
|
+
end
|
203
|
+
|
204
|
+
delete "/messages_from/:to" do |to|
|
205
|
+
Mail.by_recipients(to).map do |id|
|
206
|
+
Mail.delete_message!(id)
|
207
|
+
end
|
208
|
+
|
209
|
+
status 204
|
210
|
+
end
|
211
|
+
|
197
212
|
end
|
198
213
|
end
|
199
214
|
end
|