vcard 0.2.8 → 0.2.9
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 +4 -4
- data/lib/vcard.rb +5 -0
- data/lib/vcard/bnf.rb +3 -0
- data/lib/vcard/version.rb +1 -1
- data/test/vcard_test.rb +2 -6
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4c2078e75d2f09ddec85c6b78173170aca3b6aff
|
4
|
+
data.tar.gz: c14d94622a5a3f51b5abdf1c8b1165e055defe4f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 93c38de01d0e9e354b9f28866ddf0e8893cd72885d6ebf522261c7904c58ddcb28c6d25505e62d636ec349504bf1f5ca5253de8d8eaff397e1fd19dc846b993f
|
7
|
+
data.tar.gz: 3cab48e4a7dd094b3a334b637360863e74e1b8c2bac61c2e29a2e40d72f4955fa87ebd33e1037442d6ce8f4efd1a7ac52377dcb8b2d2a9fd9c62bfbfb85e0052
|
data/lib/vcard.rb
CHANGED
@@ -26,16 +26,21 @@ module Vcard
|
|
26
26
|
def self.unfold(card) #:nodoc:
|
27
27
|
unfolded = []
|
28
28
|
|
29
|
+
prior_line = nil
|
29
30
|
card.lines do |line|
|
30
31
|
line.chomp!
|
31
32
|
# If it's a continuation line, add it to the last.
|
32
33
|
# If it's an empty line, drop it from the input.
|
33
34
|
if line =~ /^[ \t]/
|
34
35
|
unfolded[-1] << line[1, line.size-1]
|
36
|
+
elsif prior_line && (prior_line =~ Bnf::UNTERMINATED_QUOTED_PRINTABLE)
|
37
|
+
# Strip the trailing = off prior line, then append current line
|
38
|
+
unfolded[-1] = prior_line[0, prior_line.length-1] + line
|
35
39
|
elsif line =~ /^$/
|
36
40
|
else
|
37
41
|
unfolded << line
|
38
42
|
end
|
43
|
+
prior_line = unfolded[-1]
|
39
44
|
end
|
40
45
|
|
41
46
|
unfolded
|
data/lib/vcard/bnf.rb
CHANGED
@@ -69,5 +69,8 @@ module Vcard
|
|
69
69
|
# escape character classes then create new Regexp
|
70
70
|
SAFECHAR = Regexp.new(Regexp.escape("[ \t\x21\x23-\x2b\x2d-\x39\x3c-\x7e\x80-\xff]"))
|
71
71
|
ALL_SAFECHARS = /\A#{SAFECHAR}*\z/
|
72
|
+
|
73
|
+
# A quoted-printable encoded string with a trailing '=', indicating that it's not terminated
|
74
|
+
UNTERMINATED_QUOTED_PRINTABLE = /ENCODING=QUOTED-PRINTABLE:.*=$/
|
72
75
|
end
|
73
76
|
end
|
data/lib/vcard/version.rb
CHANGED
data/test/vcard_test.rb
CHANGED
@@ -416,14 +416,10 @@ EOF
|
|
416
416
|
assert_equal("http\\://www.homepage.com", card.url.uri)
|
417
417
|
end
|
418
418
|
|
419
|
-
def
|
420
|
-
# GOOGLE BUG - Whitespace before the LABEL field values is a broken
|
421
|
-
# line continuation.
|
422
|
-
# GOOGLE BUG - vCards are being exported with embedded "=" in them, so
|
423
|
-
# become unparseable.
|
419
|
+
def test_gmail_vcard_export
|
424
420
|
c = vcard(:gmail)
|
425
421
|
card = Vcard::Vcard.decode(c).first
|
426
|
-
assert_equal("123 Home, Home Street\r\
|
422
|
+
assert_equal("123 Home, Home Street\r\nKowloon, N/A\r\nHong Kong", card.value("label"))
|
427
423
|
end
|
428
424
|
|
429
425
|
def test_title
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: vcard
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.9
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Kuba Kuźma
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-
|
11
|
+
date: 2013-09-27 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: Vcard extracted from Vpim
|
14
14
|
email:
|
@@ -84,7 +84,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
84
84
|
version: '0'
|
85
85
|
requirements: []
|
86
86
|
rubyforge_project:
|
87
|
-
rubygems_version: 2.0.
|
87
|
+
rubygems_version: 2.0.3
|
88
88
|
signing_key:
|
89
89
|
specification_version: 4
|
90
90
|
summary: Vcard extracted from Vpim
|