contacts_txt 0.1.0 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- checksums.yaml.gz.sig +0 -0
- data/lib/contacts_txt.rb +16 -10
- data.tar.gz.sig +0 -0
- metadata +22 -22
- metadata.gz.sig +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8b04f5d5c2877130ad7148f8f70f59a7152c952a
|
4
|
+
data.tar.gz: 4ec53ce5b4a212a1ecaa0b948880d5ab9ebc5ea4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e8d499c9199611a2b4d20606707a6030e5d9fa38d35aa70a43a0b79d4dfe134b69d2104e251f11055472622e9d25f4e80a7243a245b04d03b04c99701cdd7808
|
7
|
+
data.tar.gz: 1aa070d581222a12060a720c44fca986a707fecb2f328182d2b11c414dfb6dceba0139458790613e08d131bdefc6781bbac19e4c74975eb5770cf571a6b2c63c
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
data/lib/contacts_txt.rb
CHANGED
@@ -9,28 +9,34 @@ class ContactsTxt
|
|
9
9
|
|
10
10
|
attr_reader :to_s
|
11
11
|
|
12
|
-
def initialize(
|
13
|
-
|
12
|
+
def initialize(raw_filename='contacts.txt', path: File.dirname(raw_filename), \
|
13
|
+
fields: %w(mobile email dob tags address notes))
|
14
14
|
@fields = %w(fullname firstname lastname tel) | fields
|
15
|
-
@filename, @path = filename, path
|
16
15
|
|
17
|
-
|
16
|
+
@path = path
|
17
|
+
@filename = path == '.' ? raw_filename : File.basename(raw_filename)
|
18
|
+
|
19
|
+
fpath = File.join(path, @filename)
|
18
20
|
|
19
|
-
@dx =
|
20
|
-
|
21
|
-
else
|
22
|
-
new_dx()
|
23
|
-
end
|
21
|
+
@dx = File.exists?(fpath) ? import_to_dx(File.read(fpath)) : new_dx()
|
22
|
+
|
24
23
|
end
|
25
24
|
|
26
25
|
def dx()
|
27
26
|
@dx
|
28
27
|
end
|
28
|
+
|
29
|
+
# returns a Dynarex object
|
30
|
+
#
|
31
|
+
def email_list()
|
32
|
+
@dx.filter {|x| x.email.length > 0}
|
33
|
+
end
|
29
34
|
|
30
35
|
def save(filename=@filename)
|
31
36
|
|
32
37
|
s = dx_to_s(@dx, title: File.basename(filename) )
|
33
38
|
File.write File.join(@path, filename), s
|
39
|
+
@dx.save File.join(@path, filename.sub(/\.txt$/,'.xml'))
|
34
40
|
|
35
41
|
end
|
36
42
|
|
@@ -73,4 +79,4 @@ class ContactsTxt
|
|
73
79
|
|
74
80
|
end
|
75
81
|
|
76
|
-
end
|
82
|
+
end
|
data.tar.gz.sig
CHANGED
Binary file
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: contacts_txt
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- James Robertson
|
@@ -12,26 +12,26 @@ cert_chain:
|
|
12
12
|
-----BEGIN CERTIFICATE-----
|
13
13
|
MIIDljCCAn6gAwIBAgIBATANBgkqhkiG9w0BAQUFADBIMRIwEAYDVQQDDAlnZW1t
|
14
14
|
YXN0ZXIxHjAcBgoJkiaJk/IsZAEZFg5qYW1lc3JvYmVydHNvbjESMBAGCgmSJomT
|
15
|
-
|
15
|
+
8ixkARkWAmV1MB4XDTE2MTIyMzIwMDMyNFoXDTE3MTIyMzIwMDMyNFowSDESMBAG
|
16
16
|
A1UEAwwJZ2VtbWFzdGVyMR4wHAYKCZImiZPyLGQBGRYOamFtZXNyb2JlcnRzb24x
|
17
17
|
EjAQBgoJkiaJk/IsZAEZFgJldTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoC
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
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mZuvJ3LtQteR5p0R8DSLcTXMkOrWD6wC
|
32
|
+
07GXbdChvjqXQg==
|
33
33
|
-----END CERTIFICATE-----
|
34
|
-
date:
|
34
|
+
date: 2016-12-23 00:00:00.000000000 Z
|
35
35
|
dependencies:
|
36
36
|
- !ruby/object:Gem::Dependency
|
37
37
|
name: dynarex
|
@@ -39,20 +39,20 @@ dependencies:
|
|
39
39
|
requirements:
|
40
40
|
- - "~>"
|
41
41
|
- !ruby/object:Gem::Version
|
42
|
-
version: '1.
|
42
|
+
version: '1.7'
|
43
43
|
- - ">="
|
44
44
|
- !ruby/object:Gem::Version
|
45
|
-
version: 1.
|
45
|
+
version: 1.7.17
|
46
46
|
type: :runtime
|
47
47
|
prerelease: false
|
48
48
|
version_requirements: !ruby/object:Gem::Requirement
|
49
49
|
requirements:
|
50
50
|
- - "~>"
|
51
51
|
- !ruby/object:Gem::Version
|
52
|
-
version: '1.
|
52
|
+
version: '1.7'
|
53
53
|
- - ">="
|
54
54
|
- !ruby/object:Gem::Version
|
55
|
-
version: 1.
|
55
|
+
version: 1.7.17
|
56
56
|
description:
|
57
57
|
email: james@r0bertson.co.uk
|
58
58
|
executables: []
|
@@ -80,7 +80,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
80
80
|
version: '0'
|
81
81
|
requirements: []
|
82
82
|
rubyforge_project:
|
83
|
-
rubygems_version: 2.
|
83
|
+
rubygems_version: 2.5.1
|
84
84
|
signing_key:
|
85
85
|
specification_version: 4
|
86
86
|
summary: Reads a contacts.txt file
|
metadata.gz.sig
CHANGED
Binary file
|