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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: d801e91a29c8c095e5f94fdbc15edaec46a0be6e
4
- data.tar.gz: df0ed66fbd0a2fb2d955a9db41ae85022e9ed8da
3
+ metadata.gz: 4434461cb2530dcf84cac86e3a4fc469effde080
4
+ data.tar.gz: bbb479d99909d465dbe56aa4704320a896d82b95
5
5
  SHA512:
6
- metadata.gz: aa89a7c352c5aa0d3445fb5e884241cbdb7fa629dff97fef576f90d361f8671bb64b7f8c48aa3d2608b468dbf86d8fb099104d9f0c8ec75b0f48558ce47dd34f
7
- data.tar.gz: f7b36827e10d29214eef8f8c450011b76f024c1e91a6522709b3f4ecd3f2a0cc2aed3df247cbbfe11e47a1de9730adfd11726108aff1d68d2eaf90e8c47175ec
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
- require 'rubygems'
6
- require 'bundler'
7
- Bundler.require(:default, :test)
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
- config.before(:suite) do
13
+ def load_db!
14
14
  db_schema = "./db/schema.rb"
15
- if File.exist?(db_schema) and ActiveRecord::Base.connection.instance_variable_get('@config')[:database] == ':memory:'
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
@@ -3,7 +3,7 @@
3
3
 
4
4
  Gem::Specification.new do |s|
5
5
  s.name = "snails"
6
- s.version = '0.2.1'
6
+ s.version = '0.2.2'
7
7
  s.platform = Gem::Platform::RUBY
8
8
  s.authors = ['Tomás Pollak']
9
9
  s.email = ['tomas@forkhq.com']
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.1
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-18 00:00:00.000000000 Z
11
+ date: 2019-01-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler