vcard_parser 0.0.4 → 0.0.5

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: f3479e4f93c58986ca30ad48b26cb80ca4807c72
4
+ data.tar.gz: 03c8d810f5e7cb038893cc1a1e537832a5c19d06
5
+ SHA512:
6
+ metadata.gz: 6bcb4e02b567e421c39aacb35bd6a611ed2d76d7c7d7f92f67d12b64f2a90085aa81ff54fb177e96041c5bba682f888c269705bfc9ce8eff514ed9570d7db1a6
7
+ data.tar.gz: fbfd66dc07e07afaeaed3813e4e4990cf83221591173dba1e19000a6d30b6df3ae5ac36fe2b2e6effe57734907c743574d5d6c1860b1c9ea61a99ecd2b63a237
data/ChangeLog CHANGED
@@ -1,3 +1,6 @@
1
+ # 0.0.5
2
+ - added support for NOTE field
3
+
1
4
  # 0.0.4
2
5
  - ignore parameters name case (ex: type=VOICE;Type=WORK)
3
6
 
@@ -72,6 +72,7 @@ module VCardParser
72
72
  def convert_value(value)
73
73
  case name
74
74
  when "REV", "BDAY" then Time.parse(value)
75
+ when "NOTE" then value.gsub('\r\n', "\n").gsub('\n', "\n")
75
76
  else
76
77
  value
77
78
  end
@@ -81,6 +82,7 @@ module VCardParser
81
82
  case name
82
83
  when "REV" then value.iso8601
83
84
  when "BDAY" then value.strftime("%Y-%m-%d")
85
+ when "NOTE" then value.gsub("\n", '\n')
84
86
  else
85
87
  value
86
88
  end
@@ -1,3 +1,3 @@
1
1
  module VcardParser
2
- VERSION = "0.0.4"
2
+ VERSION = "0.0.5"
3
3
  end
@@ -11,6 +11,18 @@ describe 'Field 3.0' do
11
11
  f.full_name.should == "item1.TEL"
12
12
  end
13
13
 
14
+ should 'parse NOTE field (\n)' do
15
+ f = VCardParser::V30::Field.parse('NOTE:two\nlines\nand three')
16
+ f.name.should == "NOTE"
17
+ f.value.should == "two\nlines\nand three"
18
+ end
19
+
20
+ should 'parse NOTE field (\r\n)' do
21
+ f = VCardParser::V30::Field.parse('NOTE:two\r\nlines\r\nand three')
22
+ f.name.should == "NOTE"
23
+ f.value.should == "two\nlines\nand three"
24
+ end
25
+
14
26
  should 'parse empty field' do
15
27
  f = VCardParser::V30::Field.parse("FN:")
16
28
  f.group.should == nil
@@ -63,6 +75,11 @@ describe 'Field 3.0' do
63
75
  }
64
76
  end
65
77
 
78
+ should 'generate vcf line for NOTE' do
79
+ f = VCardParser::V30::Field.new('NOTE', "two\nlines\nand three")
80
+ f.to_s.should == 'NOTE:two\nlines\nand three'
81
+ end
82
+
66
83
  should 'generate vcf line from data' do
67
84
  line = "TEL;type=WORK;type=VOICE;type=pref:1234"
68
85
  f = VCardParser::V30::Field.parse(line)
metadata CHANGED
@@ -1,15 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: vcard_parser
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.4
5
- prerelease:
4
+ version: 0.0.5
6
5
  platform: ruby
7
6
  authors:
8
7
  - Julien Ammous
9
8
  autorequire:
10
9
  bindir: bin
11
10
  cert_chain: []
12
- date: 2013-02-14 00:00:00.000000000 Z
11
+ date: 2013-04-24 00:00:00.000000000 Z
13
12
  dependencies: []
14
13
  description: A vCard parser
15
14
  email:
@@ -39,32 +38,25 @@ files:
39
38
  - vcard_parser.gemspec
40
39
  homepage: ''
41
40
  licenses: []
41
+ metadata: {}
42
42
  post_install_message:
43
43
  rdoc_options: []
44
44
  require_paths:
45
45
  - lib
46
46
  required_ruby_version: !ruby/object:Gem::Requirement
47
- none: false
48
47
  requirements:
49
- - - ! '>='
48
+ - - '>='
50
49
  - !ruby/object:Gem::Version
51
50
  version: '0'
52
- segments:
53
- - 0
54
- hash: -891506393792489968
55
51
  required_rubygems_version: !ruby/object:Gem::Requirement
56
- none: false
57
52
  requirements:
58
- - - ! '>='
53
+ - - '>='
59
54
  - !ruby/object:Gem::Version
60
55
  version: '0'
61
- segments:
62
- - 0
63
- hash: -891506393792489968
64
56
  requirements: []
65
57
  rubyforge_project:
66
- rubygems_version: 1.8.24
58
+ rubygems_version: 2.0.3
67
59
  signing_key:
68
- specification_version: 3
60
+ specification_version: 4
69
61
  summary: A simple vCard parser
70
62
  test_files: []