snails 0.2.1 → 0.2.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/snails/mailer.rb +5 -1
- data/lib/snails/rspec.rb +14 -10
- data/snails.gemspec +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4434461cb2530dcf84cac86e3a4fc469effde080
|
4
|
+
data.tar.gz: bbb479d99909d465dbe56aa4704320a896d82b95
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: aad07e606f8d7e194b0b4f3242cc65083a5c7a53dff4178a5a6f4d5af1c32657eee13e7466aa8d7542f1231540b67b453e68f43688d282a75e3917c27e947108
|
7
|
+
data.tar.gz: 1b6337f12fcbc565425d8080aa819e3a921b81a1da0d6bd7e782ae67f474fea329cc32c0658158e70495f2036dd2f0f226a80adb2bfbdfaf82bcac8e67a64663
|
data/lib/snails/mailer.rb
CHANGED
@@ -95,7 +95,7 @@ A <%= @exception.class %> occurred in <%= @url %>:
|
|
95
95
|
@logger ||= @logfile ? Logger.new(@logfile) : Snails.logger
|
96
96
|
end
|
97
97
|
|
98
|
-
def send_email(from: nil, to:, subject:, body: nil, template: nil, html_body: nil, html_template: nil)
|
98
|
+
def send_email(from: nil, to:, subject:, body: nil, template: nil, html_body: nil, html_template: nil, message_id: nil, return_path: nil, list_unsubscribe: nil)
|
99
99
|
raise "No recipient given for mail: #{subject}!" if to.blank?
|
100
100
|
|
101
101
|
message = {
|
@@ -112,6 +112,10 @@ A <%= @exception.class %> occurred in <%= @url %>:
|
|
112
112
|
message[:html_body] = html_template ? render(html_template) : html_body
|
113
113
|
end
|
114
114
|
|
115
|
+
message[:message_id] = message_id if message_id
|
116
|
+
message[:return_path] = return_path if return_path
|
117
|
+
message[:list_unsubscribe] = list_unsubscribe if list_unsubscribe
|
118
|
+
|
115
119
|
logger.info "[#{to}] Delivering: #{subject}"
|
116
120
|
debug = @debug.nil? ? !Snails.env.production? : @debug # if debug isn't set, determine based on env
|
117
121
|
resp, email = Tuktuk.deliver(message, debug: debug)
|
data/lib/snails/rspec.rb
CHANGED
@@ -1,20 +1,24 @@
|
|
1
1
|
# $:.unshift(File.expand_path('../../lib', __FILE__))
|
2
2
|
|
3
|
-
ENV['RACK_ENV'] = 'test'
|
3
|
+
# ENV['RACK_ENV'] = 'test'
|
4
|
+
# require 'rubygems'
|
5
|
+
# require 'bundler'
|
6
|
+
# Bundler.require(:default, :test)
|
4
7
|
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
RSpec.configure do |config|
|
10
|
-
config.formatter = :fuubar
|
11
|
-
config.color = true
|
8
|
+
RSpec.configure do |config|
|
9
|
+
def db_type
|
10
|
+
ActiveRecord::Base.connection.instance_variable_get('@config')[:database] == ':memory:'
|
11
|
+
end
|
12
12
|
|
13
|
-
|
13
|
+
def load_db!
|
14
14
|
db_schema = "./db/schema.rb"
|
15
|
-
if File.exist?(db_schema) and
|
15
|
+
if defined?(ActiveRecord) and File.exist?(db_schema) and db_type == ':memory'
|
16
16
|
puts "Loading in-memory database schema."
|
17
17
|
load db_schema
|
18
18
|
end
|
19
19
|
end
|
20
|
+
|
21
|
+
config.formatter = 'Fuubar' if defined?(Fuubar)
|
22
|
+
config.color = true
|
23
|
+
config.before(:suite) { load_db! }
|
20
24
|
end
|
data/snails.gemspec
CHANGED
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.2.
|
4
|
+
version: 0.2.2
|
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: 2019-01-
|
11
|
+
date: 2019-01-23 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|