snails 0.5.1 → 0.5.3

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
  SHA256:
3
- metadata.gz: f4dea5ffee5850e36c01a2eb6ea7816a7f9939c80b434f19d141914826a309de
4
- data.tar.gz: 8515507cbd3caab1aa59f7eaf9e2cb18e45540eb1598f400a05c137369984022
3
+ metadata.gz: b2141ab903141a92598342792b0899b2edbc2a34f5bb0b99e15fe29cfcba39b0
4
+ data.tar.gz: 4ba7c23a174c9dd87ca088e0c3a9bb3394aaf83798a8ea00bb54fbf323a00b96
5
5
  SHA512:
6
- metadata.gz: 014b50854e970f640543d67c0fcb061f1b319db1d248057b03f197a05de2adcc9fa06b9612cd01a74a0c2a780096a436d628941eaddafb9c05ed743fd38f9dfe
7
- data.tar.gz: 7c32661693186daae08b75b47b643350623bdf2741ef8d2537da4dcb6178668e672a024c7040cb5d2bb0f0ce06f957dd23931c12338ba27992545689a46777fa
6
+ metadata.gz: 82448a3d03af7f7ebf4d8a40a95c4b95c193e0cfa4f93787eb3da22fbe21e6fdeaece97673037a44d2d47ff36b8962cfde325ec943461bf85c98b5444749ea30
7
+ data.tar.gz: 21b7792db470ed2967b7961593777873af3d5b50dcc23b3ba30d37d075354c42f4c9377bea8a416c13c00a2099eab60ab2e05cbb5693e199227ed05b88f493e8
data/lib/snails/app.rb CHANGED
@@ -243,7 +243,7 @@ module Snails
243
243
  value += checked ? " checked='true'" : ''
244
244
  end
245
245
 
246
- label + raw_input(index, type, id, name, value, options[:placeholder], classes: classes, disabled: options[:disabled])
246
+ label + raw_input(index, type, id, name, value, placeholder: options[:placeholder], classes: classes, disabled: options[:disabled])
247
247
  end
248
248
 
249
249
  def form_textarea(object, field, options = {})
@@ -414,7 +414,7 @@ module Snails
414
414
 
415
415
  set :protection, except: :frame_options
416
416
  set :views, Snails.root.join('lib', 'views')
417
- set :static_paths, %w(/css /img /js /files /fonts favicon.ico)
417
+ set :static_paths, %w(/css /img /js /files /fonts /favicon.ico)
418
418
 
419
419
  enable :method_override
420
420
  enable :logging
data/lib/snails/mailer.rb CHANGED
@@ -187,7 +187,7 @@ A <%= @exception.class %> occurred in <%= @url %>:
187
187
  resp, email = Tuktuk.deliver(email, debug: debug)
188
188
 
189
189
  if resp.is_a?(Tuktuk::Bounce)
190
- puts "[#{to}] Email bounced! [#{resp.code}] #{resp.message}"
190
+ puts "[#{email[:to]}] Email bounced! [#{resp.code}] #{resp.message}"
191
191
  end
192
192
 
193
193
  return resp, email
@@ -201,8 +201,8 @@ A <%= @exception.class %> occurred in <%= @url %>:
201
201
  class MailgunBackend < Backend
202
202
 
203
203
  def initialize(api_key:, domain_name:)
204
- @key = api_key
205
- @url = "https://api.mailgun.net/v3/#{domain_name}/messages"
204
+ # @key = api_key
205
+ @url = "https://api:#{api_key}@api.mailgun.net/v3/#{domain_name}/messages"
206
206
  end
207
207
 
208
208
  def deliver(email, options = {})
@@ -221,9 +221,12 @@ A <%= @exception.class %> occurred in <%= @url %>:
221
221
  raise ArgumentError, "Either text or html required"
222
222
  end
223
223
 
224
- opts = { username: 'api', password: @key }
225
- resp = Dagger.post(@url, data, opts)
226
- resp.ok? ? [resp.data, data[:to]] : nil
224
+ if email[:attachments]
225
+ data[:attachment] = email[:attachments].map { |att| { att[:content] }
226
+ end
227
+
228
+ resp = RestClient.post(@url, data)
229
+ resp.code == 200 ? [resp.body, data[:to]] : nil
227
230
  end
228
231
 
229
232
  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.5.1'
6
+ s.version = '0.5.3'
7
7
  s.platform = Gem::Platform::RUBY
8
8
  s.authors = ['Tomás Pollak']
9
9
  s.email = ['tomas@forkhq.com']
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: snails
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.1
4
+ version: 0.5.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tomás Pollak