contacts_txt 0.2.11 → 0.3.0
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
- checksums.yaml.gz.sig +0 -0
- data.tar.gz.sig +2 -2
- data/lib/contacts_txt.rb +43 -0
- metadata +5 -5
- metadata.gz.sig +0 -0
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: dd0833b7b56a5639600af7e814f3c4af60ad9f7165c794f249610584489d55ff
|
|
4
|
+
data.tar.gz: 8b072876b747432512bea5baa71f78a33d9121c7f18ba02ab04c0c555fb59b58
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 3d49e37178cf48065ced603ac1ff78b482a09b57b3ca8b27193cd7124727ce874bd62fe8914c5531d09ac4ea58b15b6e7bdd42374e8251105ec3fe704cff8682
|
|
7
|
+
data.tar.gz: b701993637e978e8a7eb44c63c4e44c8e1c19a42e9582dd6922906ea30cda1a41e219c29e6f5ae536a7fc6a1da18c6d953fccde546461902adaeaaef975e406a
|
checksums.yaml.gz.sig
CHANGED
|
Binary file
|
data.tar.gz.sig
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
�
|
|
2
|
-
|
|
1
|
+
c"�'���b<%�����Z&I*k�\��`ђΗS:�����yq����Ky���Ӱ�у�O== �>�G�gm�Jm�.�.T~;���vߥ1�:�K
|
|
2
|
+
M����b�0B������ﮭ(K�v�Y<@_�g��(�m�k�˿\��Ua�s�`����7���L��W5���Po�L0�RnƸV����.�3�
|
data/lib/contacts_txt.rb
CHANGED
|
@@ -188,3 +188,46 @@ class ContactsTxt
|
|
|
188
188
|
end
|
|
189
189
|
|
|
190
190
|
end
|
|
191
|
+
|
|
192
|
+
class ContactsTxtAgent < ContactsTxt
|
|
193
|
+
|
|
194
|
+
def find_mobile_by_name(s)
|
|
195
|
+
|
|
196
|
+
r = find_by_name(s).first
|
|
197
|
+
|
|
198
|
+
numbers = [r.sms.empty? ? r.mobile : r.sms, r.mobile].uniq\
|
|
199
|
+
.map {|x| x.sub(/\([^\)]+\)/,'').strip}
|
|
200
|
+
|
|
201
|
+
h = {}
|
|
202
|
+
h[:msg] = if numbers.length > 1 then
|
|
203
|
+
"The SMS number for %s is %s and the mobile number is %s" % \
|
|
204
|
+
[r.fullname, *numbers]
|
|
205
|
+
elsif numbers.first.length > 0 then
|
|
206
|
+
"The mobile number for %s is %s" % [r.fullname, numbers.first]
|
|
207
|
+
elsif r.tel.length > 0 then
|
|
208
|
+
"I don't have a mobile number, but the landline telephone " + \
|
|
209
|
+
"number for %s is %s" % [r.fullname, r.tel]
|
|
210
|
+
else
|
|
211
|
+
"I don't have a telephone number for " + r.fullname
|
|
212
|
+
end
|
|
213
|
+
|
|
214
|
+
h[:tags] = r.tags.to_s
|
|
215
|
+
h
|
|
216
|
+
end
|
|
217
|
+
|
|
218
|
+
def find_tel_by_name(s)
|
|
219
|
+
|
|
220
|
+
r = find_by_name(s).first
|
|
221
|
+
|
|
222
|
+
h = {}
|
|
223
|
+
|
|
224
|
+
if r.tel.empty? then
|
|
225
|
+
return find_mobile_by_name(s)
|
|
226
|
+
else
|
|
227
|
+
h[:msg] = "The telephone number for %s is %s" % [r.fullname, r.tel]
|
|
228
|
+
end
|
|
229
|
+
|
|
230
|
+
h[:tags] = r.tags.to_s
|
|
231
|
+
h
|
|
232
|
+
end
|
|
233
|
+
end
|
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.
|
|
4
|
+
version: 0.3.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- James Robertson
|
|
@@ -30,7 +30,7 @@ cert_chain:
|
|
|
30
30
|
Ms9N9IXVzqxWl6qaGY7lENrLhETsyyvXsYq+Djcg8A9Fvn3Fk3do1ooh9ePNno3a
|
|
31
31
|
1G4=
|
|
32
32
|
-----END CERTIFICATE-----
|
|
33
|
-
date: 2019-
|
|
33
|
+
date: 2019-03-10 00:00:00.000000000 Z
|
|
34
34
|
dependencies:
|
|
35
35
|
- !ruby/object:Gem::Dependency
|
|
36
36
|
name: dynarex
|
|
@@ -41,7 +41,7 @@ dependencies:
|
|
|
41
41
|
version: '1.8'
|
|
42
42
|
- - ">="
|
|
43
43
|
- !ruby/object:Gem::Version
|
|
44
|
-
version: 1.8.
|
|
44
|
+
version: 1.8.17
|
|
45
45
|
type: :runtime
|
|
46
46
|
prerelease: false
|
|
47
47
|
version_requirements: !ruby/object:Gem::Requirement
|
|
@@ -51,7 +51,7 @@ dependencies:
|
|
|
51
51
|
version: '1.8'
|
|
52
52
|
- - ">="
|
|
53
53
|
- !ruby/object:Gem::Version
|
|
54
|
-
version: 1.8.
|
|
54
|
+
version: 1.8.17
|
|
55
55
|
description:
|
|
56
56
|
email: james@jamesrobertson.eu
|
|
57
57
|
executables: []
|
|
@@ -78,7 +78,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
78
78
|
- !ruby/object:Gem::Version
|
|
79
79
|
version: '0'
|
|
80
80
|
requirements: []
|
|
81
|
-
rubygems_version: 3.0.
|
|
81
|
+
rubygems_version: 3.0.1
|
|
82
82
|
signing_key:
|
|
83
83
|
specification_version: 4
|
|
84
84
|
summary: Reads a contacts.txt file
|
metadata.gz.sig
CHANGED
|
Binary file
|