vcard_parser 0.0.2 → 0.0.3

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.
data/ChangeLog CHANGED
@@ -1,4 +1,7 @@
1
1
 
2
+ # 0.0.3
3
+ - added Field#values which return an array of values (split the string with ";")
4
+
2
5
  # 0.0.2
3
6
  - VERSION can now be anywhere in the vCard (was required to be first)
4
7
  - When generating the vCard user can limit the fields exposed
@@ -27,6 +27,14 @@ module VCardParser
27
27
  ret
28
28
  end
29
29
 
30
+ def values
31
+ if value
32
+ value.split(';')
33
+ else
34
+ nil
35
+ end
36
+ end
37
+
30
38
  def self.parse(line)
31
39
  m = FORMAT.match(line.strip)
32
40
  if m
@@ -1,3 +1,3 @@
1
1
  module VcardParser
2
- VERSION = "0.0.2"
2
+ VERSION = "0.0.3"
3
3
  end
@@ -70,7 +70,13 @@ describe 'Field 3.0' do
70
70
  f = VCardParser::V30::Field.parse(line)
71
71
  f.to_s.should == line
72
72
  end
73
-
73
+
74
+ should 'return an array of values' do
75
+ line = %{ORG:ABC, Inc.;North American Division;Marketing}
76
+ f = VCardParser::V30::Field.parse(line)
77
+ f.to_s.should == line
78
+ f.values.should == ["ABC, Inc.", "North American Division", "Marketing"]
79
+ end
74
80
 
75
81
 
76
82
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: vcard_parser
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.3
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-11-08 00:00:00.000000000 Z
12
+ date: 2012-11-29 00:00:00.000000000 Z
13
13
  dependencies: []
14
14
  description: A vCard parser
15
15
  email:
@@ -51,7 +51,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
51
51
  version: '0'
52
52
  segments:
53
53
  - 0
54
- hash: 1834945485564550677
54
+ hash: 1022099259668470761
55
55
  required_rubygems_version: !ruby/object:Gem::Requirement
56
56
  none: false
57
57
  requirements:
@@ -60,10 +60,10 @@ required_rubygems_version: !ruby/object:Gem::Requirement
60
60
  version: '0'
61
61
  segments:
62
62
  - 0
63
- hash: 1834945485564550677
63
+ hash: 1022099259668470761
64
64
  requirements: []
65
65
  rubyforge_project:
66
- rubygems_version: 1.8.24
66
+ rubygems_version: 1.8.23
67
67
  signing_key:
68
68
  specification_version: 3
69
69
  summary: A simple vCard parser