vcard 0.2.14 → 0.2.15
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 +2 -2
- data/lib/vcard/configuration.rb +12 -2
- data/lib/vcard/version.rb +1 -1
- data/test/configuration_test.rb +23 -0
- metadata +4 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7bf5d808360f93f671721cdfe17d1e5c96b802d2
|
4
|
+
data.tar.gz: 06944b096cbebd0121e4f78086c6c81fd6f49950
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2936818e7f3b42d0708f6b2d20390b5fc286176c180f802b311f12bc6f83cc6abab5df93bfe2e58e33f86c7758fa456e437ef2a486d5d85a10f5d9fc4e6f70da
|
7
|
+
data.tar.gz: fec1505251159775098a6b46bc742c5b4f19d538d18bc72ab05ecb718e1a35040a327bbc7c5d80e5e699bebccdeda454aadfc9bfb3848c3948c795d1f78a4e92
|
data/lib/vcard.rb
CHANGED
data/lib/vcard/configuration.rb
CHANGED
@@ -8,8 +8,18 @@ module Vcard
|
|
8
8
|
alias_method :ignore_invalid_vcards?, :ignore_invalid_vcards
|
9
9
|
|
10
10
|
def initialize
|
11
|
-
|
12
|
-
|
11
|
+
set_default_values
|
12
|
+
end
|
13
|
+
|
14
|
+
def reset
|
15
|
+
set_default_values
|
16
|
+
end
|
17
|
+
|
18
|
+
private
|
19
|
+
|
20
|
+
def set_default_values
|
21
|
+
@raise_on_invalid_line = true
|
22
|
+
@ignore_invalid_vcards = true
|
13
23
|
end
|
14
24
|
|
15
25
|
end
|
data/lib/vcard/version.rb
CHANGED
@@ -0,0 +1,23 @@
|
|
1
|
+
require "test_helper"
|
2
|
+
|
3
|
+
class ConfigurationTest < Test::Unit::TestCase
|
4
|
+
def test_should_be_an_instance_of_configuration
|
5
|
+
assert Vcard.configuration.is_a?(::Vcard::Configuration)
|
6
|
+
end
|
7
|
+
|
8
|
+
def test_have_default_values
|
9
|
+
Vcard.configuration.reset
|
10
|
+
assert_equal(Vcard.configuration.raise_on_invalid_line, true)
|
11
|
+
assert_equal(Vcard.configuration.ignore_invalid_vcards, true)
|
12
|
+
end
|
13
|
+
|
14
|
+
def test_allow_configuration_with_block
|
15
|
+
Vcard.configuration.reset
|
16
|
+
Vcard.configure do |config|
|
17
|
+
config.raise_on_invalid_line = false
|
18
|
+
config.ignore_invalid_vcards = false
|
19
|
+
end
|
20
|
+
assert_equal(Vcard.configuration.raise_on_invalid_line, false)
|
21
|
+
assert_equal(Vcard.configuration.ignore_invalid_vcards, false)
|
22
|
+
end
|
23
|
+
end
|
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.15
|
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: 2016-
|
11
|
+
date: 2016-12-01 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: Vcard extracted from Vpim
|
14
14
|
email:
|
@@ -35,6 +35,7 @@ files:
|
|
35
35
|
- lib/vcard/field.rb
|
36
36
|
- lib/vcard/vcard.rb
|
37
37
|
- lib/vcard/version.rb
|
38
|
+
- test/configuration_test.rb
|
38
39
|
- test/field_test.rb
|
39
40
|
- test/fixtures/bday_decode.vcard
|
40
41
|
- test/fixtures/bday_decode_2.vcard
|
@@ -90,6 +91,7 @@ signing_key:
|
|
90
91
|
specification_version: 4
|
91
92
|
summary: Vcard extracted from Vpim
|
92
93
|
test_files:
|
94
|
+
- test/configuration_test.rb
|
93
95
|
- test/field_test.rb
|
94
96
|
- test/fixtures/bday_decode.vcard
|
95
97
|
- test/fixtures/bday_decode_2.vcard
|