snails 0.5.4 → 0.5.6
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 +4 -4
- data/lib/snails/app.rb +1 -1
- data/lib/snails/mailer.rb +16 -4
- data/snails.gemspec +2 -2
- metadata +2 -16
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3e96e0a740a5950c034b72c516e8089d3db48cf27a93e7b7c9e965150ecb3279
|
4
|
+
data.tar.gz: d2614d7d14fd3a3fe39ad2e2e34d7afa9bcab3400f0fba19740e4f419309f40a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: af6420e37895e4432867fa08bbf950e94bc6c683feecf5a9be465d15cabda75a5e16bc7db53bf37615a2c3f54e576c20e9a0840357b8416ab736b401d2cc1cd0
|
7
|
+
data.tar.gz: f3285eda70a6dbbb729d98b90b372d7d8d4a66e860d91a697d686da84340205b3e64c094076714fe95a06312405ab46ef8ce220c6e3726bdf892df10e3398575
|
data/lib/snails/app.rb
CHANGED
@@ -117,7 +117,7 @@ module Snails
|
|
117
117
|
# app.sprockets.js_compressor = :uglifier
|
118
118
|
end
|
119
119
|
|
120
|
-
app.configure :development do
|
120
|
+
app.configure :development, :test do
|
121
121
|
# allow asset requests to pass
|
122
122
|
if app.respond_to?(:allow_paths)
|
123
123
|
app.allow_paths.push /^#{app.assets_prefix}(\/\w+)?\/([\w\.-]+)/
|
data/lib/snails/mailer.rb
CHANGED
@@ -1,7 +1,6 @@
|
|
1
1
|
require 'snails/util'
|
2
2
|
require 'erb'
|
3
3
|
require 'tilt/erb'
|
4
|
-
require 'tuktuk'
|
5
4
|
require 'snails'
|
6
5
|
|
7
6
|
module Snails
|
@@ -19,8 +18,8 @@ module Snails
|
|
19
18
|
def self.backends
|
20
19
|
{
|
21
20
|
'test_backend' => 'Snails::Mailer::TestBackend',
|
22
|
-
'smtp' => 'Snails::Mailer::TuktukBackend',
|
23
|
-
'mailgun' => 'Snails::Mailer::MailgunBackend'
|
21
|
+
'smtp' => 'Snails::Mailer::TuktukBackend', # requires tuktuk gem
|
22
|
+
'mailgun' => 'Snails::Mailer::MailgunBackend' # requires rest-client gem
|
24
23
|
}
|
25
24
|
end
|
26
25
|
|
@@ -200,6 +199,17 @@ A <%= @exception.class %> occurred in <%= @url %>:
|
|
200
199
|
|
201
200
|
class MailgunBackend < Backend
|
202
201
|
|
202
|
+
class Attachment < StringIO
|
203
|
+
attr_reader :original_filename, :content_type, :path
|
204
|
+
|
205
|
+
def initialize(data, filename, content_type)
|
206
|
+
super(data)
|
207
|
+
@path = '' # path
|
208
|
+
@original_filename = filename
|
209
|
+
@content_type = content_type || 'application/octet-stream'
|
210
|
+
end
|
211
|
+
end
|
212
|
+
|
203
213
|
def initialize(api_key:, domain_name:)
|
204
214
|
# @key = api_key
|
205
215
|
@url = "https://api:#{api_key}@api.mailgun.net/v3/#{domain_name}/messages"
|
@@ -222,7 +232,9 @@ A <%= @exception.class %> occurred in <%= @url %>:
|
|
222
232
|
end
|
223
233
|
|
224
234
|
if email[:attachments]
|
225
|
-
data[:attachment] = email[:attachments].map
|
235
|
+
data[:attachment] = email[:attachments].map do |att|
|
236
|
+
Attachment.new(att[:content], att[:filename], att[:content_type])
|
237
|
+
end
|
226
238
|
end
|
227
239
|
|
228
240
|
resp = RestClient.post(@url, data)
|
data/snails.gemspec
CHANGED
@@ -3,7 +3,7 @@
|
|
3
3
|
|
4
4
|
Gem::Specification.new do |s|
|
5
5
|
s.name = "snails"
|
6
|
-
s.version = '0.5.
|
6
|
+
s.version = '0.5.6'
|
7
7
|
s.platform = Gem::Platform::RUBY
|
8
8
|
s.authors = ['Tomás Pollak']
|
9
9
|
s.email = ['tomas@forkhq.com']
|
@@ -22,7 +22,7 @@ Gem::Specification.new do |s|
|
|
22
22
|
s.add_runtime_dependency "sinatra-activerecord", ">= 2.0.13"
|
23
23
|
s.add_runtime_dependency "sinatra-flash", ">= 0.3.0"
|
24
24
|
s.add_runtime_dependency "sprockets-helpers", ">= 1.2"
|
25
|
-
s.add_runtime_dependency "tuktuk", ">= 0.6.0"
|
25
|
+
# s.add_runtime_dependency "tuktuk", ">= 0.6.0"
|
26
26
|
|
27
27
|
s.files = `git ls-files`.split("\n")
|
28
28
|
s.executables = `git ls-files`.split("\n").map{|f| f =~ /^bin\/(.*)/ ? $1 : nil}.compact
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: snails
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.5.
|
4
|
+
version: 0.5.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Tomás Pollak
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2023-04-11 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -142,20 +142,6 @@ dependencies:
|
|
142
142
|
- - ">="
|
143
143
|
- !ruby/object:Gem::Version
|
144
144
|
version: '1.2'
|
145
|
-
- !ruby/object:Gem::Dependency
|
146
|
-
name: tuktuk
|
147
|
-
requirement: !ruby/object:Gem::Requirement
|
148
|
-
requirements:
|
149
|
-
- - ">="
|
150
|
-
- !ruby/object:Gem::Version
|
151
|
-
version: 0.6.0
|
152
|
-
type: :runtime
|
153
|
-
prerelease: false
|
154
|
-
version_requirements: !ruby/object:Gem::Requirement
|
155
|
-
requirements:
|
156
|
-
- - ">="
|
157
|
-
- !ruby/object:Gem::Version
|
158
|
-
version: 0.6.0
|
159
145
|
description: Ruby on Snails.
|
160
146
|
email:
|
161
147
|
- tomas@forkhq.com
|