vmail 1.3.5 → 1.3.6

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.
@@ -622,7 +622,8 @@ function! CompleteContact(findstart, base)
622
622
  " model regex: match at beginning of line, or inside < > wrapping
623
623
  " email addr
624
624
  " '\(^ho\|<ho\)'
625
- let regex = shellescape('\(^' . a:base . '\|<' . a:base . '\)')
625
+ " let regex = shellescape('\(^' . a:base . '\|<' . a:base . '\)')
626
+ let regex = shellescape(a:base)
626
627
  let matches = system("grep -i " . regex . " " . $VMAIL_CONTACTS_FILE)
627
628
  return split(matches, "\n")
628
629
  endif
@@ -18,7 +18,14 @@ module Vmail
18
18
  end
19
19
 
20
20
  #Quote the names
21
- addrs.map { |addr| addr.gsub(/^(.*) (<.*)/, '"\1" \2') }.join(', ')
21
+ addrs.map { |addr|
22
+ # a little hackish
23
+ if addr =~ /"/
24
+ addr
25
+ else
26
+ addr.gsub(/^(.*) (<.*)/, '"\1" \2')
27
+ end
28
+ }.join(', ')
22
29
  end
23
30
 
24
31
  end
@@ -34,7 +34,7 @@ class ContactsExtractor
34
34
  name = address_struct.name
35
35
  if name
36
36
  name = Mail::Encodings.unquote_and_convert_to(name, 'UTF-8')
37
- yield "#{name} <#{email}>"
37
+ yield %Q("#{name}" <#{email}>)
38
38
  else
39
39
  yield email
40
40
  end
@@ -1,3 +1,3 @@
1
1
  module Vmail
2
- VERSION = "1.3.5"
2
+ VERSION = "1.3.6"
3
3
  end
@@ -24,4 +24,11 @@ class AddressQuoterTest < MiniTest::Unit::TestCase
24
24
  expected = %q("Bob Smith" <bobsmith@gmail.com>, "Jones, Rich A." <richjones@gmail.com>, peterbaker@gmail.com)
25
25
  assert_equal expected, quote_addresses(string)
26
26
  end
27
+
28
+ def test_quoting_already_quoted
29
+ string = %q(Bob Smith <bobsmith@gmail.com>, "Jones, Rich A." <richjones@gmail.com>, peterbaker@gmail.com)
30
+ expected = %q("Bob Smith" <bobsmith@gmail.com>, "Jones, Rich A." <richjones@gmail.com>, peterbaker@gmail.com)
31
+ assert_equal expected, quote_addresses(string)
32
+ end
33
+
27
34
  end
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 1
7
7
  - 3
8
- - 5
9
- version: 1.3.5
8
+ - 6
9
+ version: 1.3.6
10
10
  platform: ruby
11
11
  authors:
12
12
  - Daniel Choi