card-mod-email 0.11.2 → 0.12.0

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: 10aefc7353bfddf6d8971013fb0ba917c3950b901947d7bd0e001547421495db
4
- data.tar.gz: 68566a2340b3e6261a48ed5aaa242aaa7ce792463e76bc9143eaed3b152974a1
3
+ metadata.gz: 4fe62914561422b91bab106b8e8c7053304005bba0c498f0a7f8a40c1b59c8a9
4
+ data.tar.gz: 526da10d64eb0bc8e6fc6a7074b15231cfb0972f507d75453883580adf1b08ed
5
5
  SHA512:
6
- metadata.gz: 3240e59d98e447df359967aa46706e5569f601aa1a5d6c7bbad902699e381bc93bfce22bba2ff7221d2e8bbf71f80860e2f1928ae4cb46557081f60d22f517a0
7
- data.tar.gz: 6c3a308ec8883023d7e83182a8fef52757660b48658d1bd1a19b1e1ea9b2e5e7a75524f278393de1e7718825a39ca424bdca95a6afac9663f042682da3ec8911
6
+ metadata.gz: 1e14ce63dc7e1ef50a1e0a7f388088265b540115c663dda5db3b0afa67a08dbfe73a61963ce8eeb669bb9778105f33e889d9af9ff6a5e0023933c1a8fa70ca15
7
+ data.tar.gz: 8e47cbb04bc43ada42948c910feec4d29c31ae24f59b2b961d0840f2cd335348c55b729dc98b317677cd5c3b8a0e16a069a3c196e5783bc013edce6948397098
@@ -1,4 +1,3 @@
1
-
2
1
  format do
3
2
  # turn off autodetection of uri's
4
3
  def chunk_list
@@ -27,7 +26,7 @@ format :email_text do
27
26
  end
28
27
 
29
28
  def email_address? string
30
- string =~ /.+\@.+\..+/
29
+ string =~ /.+@.+\..+/
31
30
  end
32
31
 
33
32
  def email_address_from_card name, context
@@ -1,6 +1,7 @@
1
1
  format :html do
2
2
  view :core do
3
3
  return super() if voo.hide? :test_context
4
+
4
5
  card.with_context test_context_card do
5
6
  super()
6
7
  end
@@ -1,4 +1,3 @@
1
-
2
1
  format :email_text do
3
2
  view :unknown do
4
3
  ""
@@ -8,6 +8,7 @@ format :email_html do
8
8
  def email_content context
9
9
  content = contextual_content context
10
10
  return unless content.present?
11
+
11
12
  Card::Mailer.layout content
12
13
  end
13
14
  end
@@ -1,4 +1,3 @@
1
-
2
1
  def clean_html?
3
2
  false
4
3
  end
@@ -6,8 +5,8 @@ end
6
5
  def deliver context=nil, fields={}, opts={}
7
6
  mail = format.mail context, fields, opts
8
7
  mail.deliver
9
- rescue Net::SMTPError => exception
10
- errors.add :exception, exception.message
8
+ rescue Net::SMTPError => e
9
+ errors.add :exception, e.message
11
10
  end
12
11
 
13
12
  format do
@@ -72,6 +71,7 @@ format do
72
71
 
73
72
  def add_attachments mail, list
74
73
  return unless list.present?
74
+
75
75
  each_valid_attachment list do |file, index|
76
76
  mail.add_file filename: attachment_name(file, index),
77
77
  content: File.read(file.path)
@@ -81,6 +81,7 @@ format do
81
81
  def each_valid_attachment list
82
82
  list.each_with_index do |cardname, index|
83
83
  next unless (file = Card[cardname]&.try(:attachment))
84
+
84
85
  yield file, index
85
86
  end
86
87
  end
@@ -22,6 +22,7 @@ end
22
22
 
23
23
  def email_field_from_card field, auth, format_opts
24
24
  return unless (field_card = fetch(field))
25
+
25
26
  auth ||= field_card.updater
26
27
  special_email_field_method(field, field_card, auth, format_opts) ||
27
28
  standard_email_field(field, field_card, auth, format_opts)
@@ -30,6 +31,7 @@ end
30
31
  def special_email_field_method field, field_card, auth, format_opts
31
32
  method = "email_#{field}_field"
32
33
  return unless respond_to? method
34
+
33
35
  send method, field_card, auth, format_opts
34
36
  end
35
37
 
@@ -73,7 +75,7 @@ def email_from_field_value conf_name, conf_email, actual_email
73
75
  end
74
76
 
75
77
  def configured_from_name_and_email raw_string
76
- if raw_string =~ /(.*)\<(.*)>/
78
+ if raw_string =~ /(.*)<(.*)>/
77
79
  [Regexp.last_match(1).strip, Regexp.last_match(2)]
78
80
  else
79
81
  [nil, raw_string]
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: card-mod-email
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.11.2
4
+ version: 0.12.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ethan McCutchen
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2021-03-15 00:00:00.000000000 Z
13
+ date: 2021-07-05 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: card
@@ -18,14 +18,14 @@ dependencies:
18
18
  requirements:
19
19
  - - '='
20
20
  - !ruby/object:Gem::Version
21
- version: 1.101.2
21
+ version: 1.102.0
22
22
  type: :runtime
23
23
  prerelease: false
24
24
  version_requirements: !ruby/object:Gem::Requirement
25
25
  requirements:
26
26
  - - '='
27
27
  - !ruby/object:Gem::Version
28
- version: 1.101.2
28
+ version: 1.102.0
29
29
  description: ''
30
30
  email:
31
31
  - info@decko.org
@@ -73,7 +73,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
73
73
  - !ruby/object:Gem::Version
74
74
  version: '0'
75
75
  requirements: []
76
- rubygems_version: 3.0.3
76
+ rubygems_version: 3.2.15
77
77
  signing_key:
78
78
  specification_version: 4
79
79
  summary: Email handling