locale_mailer 0.2.4 → 0.2.5

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 0189bbf06524259144c518b694d468179404bdbf
4
- data.tar.gz: 8dff893af987c86414e8b8f440f5c09d4212299f
3
+ metadata.gz: 1dd00ef7f3f32ac314a403785012618eed92a772
4
+ data.tar.gz: b15a11cb8ac35375ea396d5eea9894ce9bd9bc2e
5
5
  SHA512:
6
- metadata.gz: 70ff16922cb1bee954f087f6655bd9b20e4f7afbc74f633e5ff606ed25694c63e1340c6cf1b35e118ca32bf20f1b03a8dec0158d54e1af96a0fbdda4697f259f
7
- data.tar.gz: 25f125a438ba4916ce9da63443058109577008162ccdfbd05c44b9d935d1bd018498108137ecb04526ee3711d017fe3b421e01c2cba18e7d1793754bfaa01042
6
+ metadata.gz: ca33bb3c6cc76662f04b092ded74b95f483310342dc02129bae386b840834c6d7cc938829d78cb1602c51d8943051e6eb343f433331bd7b82a0c4f09ba6c50d8
7
+ data.tar.gz: 160adfc8a36ec0f7570a95621eab952cb028bc1a77fbff8a3581ef5ac562b351b6bf24439d795bf603ffa49517b5220293a673425bff6c7965d0a60d2bcff0f3
@@ -26,25 +26,22 @@ module LocaleMailer
26
26
  private
27
27
 
28
28
  def mail_with_localized_templates(options = {}, &block)
29
- begin
29
+ options.symbolize_keys!
30
+ if template_exists? action_name, mailer_name
30
31
  mail_without_localized_templates(options, &block)
31
- rescue ActionView::MissingTemplate => e
32
- options.symbolize_keys!
33
-
34
- if I18n.exists? action_i18n_path(options), I18n.locale
35
- options[:subject] = subject_from_locale(options) unless options.key?(:subject)
36
- mail_without_localized_templates options do |format|
37
- html_body = body_from_locale options
38
- format.html {
39
- html_body
40
- }
41
- format.text {
42
- Loofah.scrub_fragment(html_body, LocaleMailer::A2HREF).to_text
43
- }
44
- end
45
- else
46
- raise e
32
+ elsif I18n.exists? action_i18n_path(options), I18n.locale
33
+ options[:subject] = subject_from_locale(options) unless options.key?(:subject)
34
+ mail_without_localized_templates options do |format|
35
+ html_body = body_from_locale options
36
+ format.html {
37
+ html_body
38
+ }
39
+ format.text {
40
+ Loofah.scrub_fragment(html_body, LocaleMailer::A2HREF).to_text
41
+ }
47
42
  end
43
+ else
44
+ raise "LocaleMailer : Missing template and locale #{I18n.locale}.#{action_i18n_path(options)}"
48
45
  end
49
46
  end
50
47
 
@@ -1,3 +1,3 @@
1
1
  module LocaleMailer
2
- VERSION = "0.2.4"
2
+ VERSION = "0.2.5"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: locale_mailer
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.4
4
+ version: 0.2.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - itkin
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2016-05-17 00:00:00.000000000 Z
11
+ date: 2016-09-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: actionmailer