vcard_parser 0.0.3 → 0.0.4

Sign up to get free protection for your applications and to get access to all the features.
data/ChangeLog CHANGED
@@ -1,3 +1,5 @@
1
+ # 0.0.4
2
+ - ignore parameters name case (ex: type=VOICE;Type=WORK)
1
3
 
2
4
  # 0.0.3
3
5
  - added Field#values which return an array of values (split the string with ";")
data/README.md CHANGED
@@ -18,7 +18,8 @@ This gem is tested against these ruby by travis-ci.org:
18
18
  ```ruby
19
19
  require 'vcard_parser'
20
20
 
21
- cards = VCardParser:parse(...)
21
+ vcard = File.read('specs/data/vcard3.0.vcf')
22
+ cards = VCardParser::VCard.parse(vcard)
22
23
 
23
24
  puts cards[0].fields
24
25
  puts cards[0]['N']
@@ -42,6 +42,7 @@ module VCardParser
42
42
  if m[:params]
43
43
  m[:params].split(';').reject{|s| s.empty? }.each do |p|
44
44
  pname, pvalue = p.split('=')
45
+ pname.downcase!
45
46
  params[pname] ||= []
46
47
  params[pname] << pvalue
47
48
  end
@@ -1,3 +1,3 @@
1
1
  module VcardParser
2
- VERSION = "0.0.3"
2
+ VERSION = "0.0.4"
3
3
  end
@@ -53,6 +53,16 @@ describe 'Field 3.0' do
53
53
  }
54
54
  end
55
55
 
56
+ should 'ignore parameters name case' do
57
+ f = VCardParser::V30::Field.parse("TEL;type=WORK;type=VOICE;Type=pref;tYPe=something:1234")
58
+ f.group.should == nil
59
+ f.name.should == "TEL"
60
+ f.value.should == "1234"
61
+ f.params.should == {
62
+ 'type' => %w(WORK VOICE pref something)
63
+ }
64
+ end
65
+
56
66
  should 'generate vcf line from data' do
57
67
  line = "TEL;type=WORK;type=VOICE;type=pref:1234"
58
68
  f = VCardParser::V30::Field.parse(line)
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.3
4
+ version: 0.0.4
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-29 00:00:00.000000000 Z
12
+ date: 2013-02-14 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: 1022099259668470761
54
+ hash: -891506393792489968
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: 1022099259668470761
63
+ hash: -891506393792489968
64
64
  requirements: []
65
65
  rubyforge_project:
66
- rubygems_version: 1.8.23
66
+ rubygems_version: 1.8.24
67
67
  signing_key:
68
68
  specification_version: 3
69
69
  summary: A simple vCard parser