vcardigan 0.0.6 → 0.0.7
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/vcardigan/vcard.rb +6 -2
- data/lib/vcardigan/version.rb +1 -1
- data/spec/examples/vcard_spec.rb +25 -0
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: fecc595fa698e75daf5a8fa962f921ca403a7bb1
|
4
|
+
data.tar.gz: 42aca309a5059eb66eaf3f4c2c879c01f76955ee
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 47f0e8c1ff8ad181d2eed402c87d2d21059b28e6fcad55e8fa5656745099f0af9c6e611640292c21e3911432e34f4beb96ca93f0fbccb3c33a96257de466d27b
|
7
|
+
data.tar.gz: 1377d0431be7981ccf7270cc7130c25f01612b04319e45e7659732eecaf1c871c93400edf9429493462bec3b8d37a0e27c4b0d0672831d50f33fb070f59d3f73
|
data/lib/vcardigan/vcard.rb
CHANGED
@@ -65,9 +65,13 @@ module VCardigan
|
|
65
65
|
@group = nil
|
66
66
|
end
|
67
67
|
|
68
|
+
args.reject!(&:nil?)
|
69
|
+
|
68
70
|
# Build the property and add it to the vCard
|
69
|
-
|
70
|
-
|
71
|
+
if args.any?
|
72
|
+
property = build_prop(name, *args)
|
73
|
+
add_prop(property)
|
74
|
+
end
|
71
75
|
end
|
72
76
|
|
73
77
|
def remove(name)
|
data/lib/vcardigan/version.rb
CHANGED
data/spec/examples/vcard_spec.rb
CHANGED
@@ -108,6 +108,31 @@ describe VCardigan::VCard do
|
|
108
108
|
groups[group.to_s].first.should be_an_instance_of(VCardigan::Property)
|
109
109
|
end
|
110
110
|
end
|
111
|
+
|
112
|
+
context 'regardless of group' do
|
113
|
+
|
114
|
+
before do
|
115
|
+
vcard.add(name, *values)
|
116
|
+
end
|
117
|
+
|
118
|
+
context 'some args are nil' do
|
119
|
+
|
120
|
+
let(:values) { [nil, 'joe@strummer.com'] }
|
121
|
+
|
122
|
+
it 'should not build properties from nil args' do
|
123
|
+
fields[name.to_s].first.values.should == [values.last]
|
124
|
+
end
|
125
|
+
end
|
126
|
+
|
127
|
+
context 'all args are nil' do
|
128
|
+
|
129
|
+
let(:values) { [nil, nil] }
|
130
|
+
|
131
|
+
it 'should not build properties' do
|
132
|
+
fields[name.to_s].should be_nil
|
133
|
+
end
|
134
|
+
end
|
135
|
+
end
|
111
136
|
end
|
112
137
|
|
113
138
|
describe "#remove" do
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: vcardigan
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.7
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Matt Morgan
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2015-03-18 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rspec
|
@@ -82,3 +82,4 @@ test_files:
|
|
82
82
|
- spec/examples/property_spec.rb
|
83
83
|
- spec/examples/vcard_spec.rb
|
84
84
|
- spec/spec_helper.rb
|
85
|
+
has_rdoc: false
|