-
Notifications
You must be signed in to change notification settings - Fork 46
/
beans.rb
44 lines (30 loc) · 824 Bytes
/
beans.rb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
require 'faker'
def entry(fname, lname, cell)
my_str = <<-FOO
BEGIN:VCARD
VERSION:4.0
N:#{lname};#{fname};;;
FN:#{fname} #{lname}
ORG:Bubba Gump Shrimp Co.
TITLE:Shrimp Man
PHOTO;MEDIATYPE=image/gif:http://www.example.com/dir_photos/my_photo.gif
TEL;TYPE=work,voice;VALUE=uri:tel:+#{cell}
REV:20080424T195243Z
END:VCARD
FOO
return my_str
end
file = File.open("./contacts.vcf", "w")
400.times do
fname = "CCC#{Faker::Name.first_name}" #=> "Kaci"
lname = "#{Faker::Name.last_name}" #=> "Ernser"
#name = "A#{Faker::Name.name}"
Faker::Config.locale = 'en-US'
cell = "1#{Faker::PhoneNumber.exchange_code}#{Faker::PhoneNumber.exchange_code}#{Faker::PhoneNumber.subscriber_number}"
puts "#{fname} #{lname}"
puts cell
e = entry(fname, lname, cell)
file.write(e)
file.write("\n")
end
file.close