fake_person 1.0.0 → 1.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/db/activities.txt +43 -0
- data/db/foods.txt +60 -0
- data/lib/fake_person.rb +3 -0
- data/lib/fake_person/activities.rb +14 -0
- data/lib/fake_person/foods.rb +14 -0
- data/lib/fake_person/likes.rb +30 -0
- metadata +7 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0065161946c5d55306c092ba55545c0e995b56dd
|
4
|
+
data.tar.gz: 7cba228886d2e997021199e05d362c285a071eec
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: eb5d5eb7951503766edc13158912e40b8559f6fe943a48df8efce11afd94f79c9f36aa0f13eae3a00f88b1779cec804368b939cf775927891a0123a18ee43b5b
|
7
|
+
data.tar.gz: cc61f3cef91f6f703428ad5fbbb76c21e1a017ae4f780626ad533ad703c2b18cbf89bffddaeb01d693292126545ac57f27a32ec2e0b7707583feff0ef2983ec3
|
data/db/activities.txt
ADDED
@@ -0,0 +1,43 @@
|
|
1
|
+
astronomy
|
2
|
+
bathing
|
3
|
+
camping
|
4
|
+
climbing
|
5
|
+
coding
|
6
|
+
debugging
|
7
|
+
dog racing
|
8
|
+
drinking
|
9
|
+
driving
|
10
|
+
figure skating
|
11
|
+
gaming
|
12
|
+
geocaching
|
13
|
+
gongoozing
|
14
|
+
hiking
|
15
|
+
homebrewing
|
16
|
+
jogging
|
17
|
+
juggling
|
18
|
+
kitesurfing
|
19
|
+
knitting
|
20
|
+
nordic skating
|
21
|
+
paintballing
|
22
|
+
painting
|
23
|
+
photography
|
24
|
+
playing chess
|
25
|
+
playing darts
|
26
|
+
puzzles
|
27
|
+
rambling
|
28
|
+
reading
|
29
|
+
roller skating
|
30
|
+
sailing
|
31
|
+
sewing
|
32
|
+
shooting
|
33
|
+
shopping
|
34
|
+
singing
|
35
|
+
slot-car racing
|
36
|
+
stamp collecting
|
37
|
+
taxidermy
|
38
|
+
training mice
|
39
|
+
trainspotting
|
40
|
+
visiting museums
|
41
|
+
watching television
|
42
|
+
writing
|
43
|
+
yo-yoing
|
data/db/foods.txt
ADDED
@@ -0,0 +1,60 @@
|
|
1
|
+
apples
|
2
|
+
bacon
|
3
|
+
baked beans
|
4
|
+
basil
|
5
|
+
beer
|
6
|
+
biscuits
|
7
|
+
bloody mary
|
8
|
+
burritos
|
9
|
+
cake
|
10
|
+
calzone
|
11
|
+
cheese
|
12
|
+
chicken
|
13
|
+
chinese food
|
14
|
+
chips
|
15
|
+
chocolate
|
16
|
+
cider
|
17
|
+
coffee
|
18
|
+
cola
|
19
|
+
cornettos
|
20
|
+
cottage pie
|
21
|
+
courgettes
|
22
|
+
couscous
|
23
|
+
cream
|
24
|
+
crisps
|
25
|
+
crumbs off of the floor
|
26
|
+
curry
|
27
|
+
custard
|
28
|
+
dried fruit
|
29
|
+
fish fingers
|
30
|
+
ginger
|
31
|
+
ham
|
32
|
+
jam
|
33
|
+
lamb
|
34
|
+
lasagna
|
35
|
+
leeks
|
36
|
+
lemondade
|
37
|
+
lobster thermadore
|
38
|
+
marshmallows
|
39
|
+
mushrooms
|
40
|
+
mussels
|
41
|
+
oysters
|
42
|
+
pasta
|
43
|
+
peanuts
|
44
|
+
pears
|
45
|
+
pizza
|
46
|
+
popcorn
|
47
|
+
pork
|
48
|
+
potatoes
|
49
|
+
puff pastry
|
50
|
+
risotto
|
51
|
+
rum
|
52
|
+
salami
|
53
|
+
salmon
|
54
|
+
spaghetti
|
55
|
+
steak
|
56
|
+
stew
|
57
|
+
tea
|
58
|
+
tomatoes
|
59
|
+
veal
|
60
|
+
vodka
|
data/lib/fake_person.rb
CHANGED
@@ -0,0 +1,14 @@
|
|
1
|
+
class FakePerson
|
2
|
+
|
3
|
+
def favourite_activity
|
4
|
+
@favourite_activity ||= self.class.activities.sample
|
5
|
+
end
|
6
|
+
|
7
|
+
def self.activities
|
8
|
+
@activities ||= begin
|
9
|
+
path = File.expand_path(File.join('..', '..', '..', 'db', "activities.txt"), __FILE__)
|
10
|
+
File.read(path).split("\n").compact.map(&:capitalize)
|
11
|
+
end
|
12
|
+
end
|
13
|
+
|
14
|
+
end
|
@@ -0,0 +1,14 @@
|
|
1
|
+
class FakePerson
|
2
|
+
|
3
|
+
def favourite_food
|
4
|
+
@favourite_food ||= self.class.foods.sample
|
5
|
+
end
|
6
|
+
|
7
|
+
def self.foods
|
8
|
+
@foods ||= begin
|
9
|
+
path = File.expand_path(File.join('..', '..', '..', 'db', "foods.txt"), __FILE__)
|
10
|
+
File.read(path).split("\n").compact.map(&:capitalize)
|
11
|
+
end
|
12
|
+
end
|
13
|
+
|
14
|
+
end
|
@@ -0,0 +1,30 @@
|
|
1
|
+
class FakePerson
|
2
|
+
|
3
|
+
def likes(count=3)
|
4
|
+
@likes ||= begin
|
5
|
+
if count == 1
|
6
|
+
[favourite_activity]
|
7
|
+
elsif count == 2
|
8
|
+
[favourite_activity, favourite_food]
|
9
|
+
else
|
10
|
+
[favourite_activity, favourite_food] + activities_and_foods(count - 2, @dislikes)
|
11
|
+
end
|
12
|
+
end
|
13
|
+
end
|
14
|
+
|
15
|
+
def dislikes(count=3)
|
16
|
+
@dislikes ||= activities_and_foods(count, @likes)
|
17
|
+
end
|
18
|
+
|
19
|
+
private
|
20
|
+
|
21
|
+
def activities_and_foods(count, exclusion_list=nil)
|
22
|
+
exclusion_list ||= []
|
23
|
+
|
24
|
+
num_activities_to_get = (1..count).to_a.sample
|
25
|
+
num_foods_to_get = (count - num_activities_to_get)
|
26
|
+
|
27
|
+
(self.class.activities - exclusion_list).sample(num_activities_to_get) + (self.class.foods - exclusion_list).sample(num_foods_to_get)
|
28
|
+
end
|
29
|
+
|
30
|
+
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: fake_person
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Adam Cooke
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-10-
|
11
|
+
date: 2014-10-18 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: A Ruby library for creating fake personalities
|
14
14
|
email:
|
@@ -17,13 +17,18 @@ executables: []
|
|
17
17
|
extensions: []
|
18
18
|
extra_rdoc_files: []
|
19
19
|
files:
|
20
|
+
- db/activities.txt
|
21
|
+
- db/foods.txt
|
20
22
|
- db/given_names.female.txt
|
21
23
|
- db/given_names.male.txt
|
22
24
|
- db/surnames.txt
|
23
25
|
- lib/fake_person.rb
|
26
|
+
- lib/fake_person/activities.rb
|
24
27
|
- lib/fake_person/date_of_birth.rb
|
25
28
|
- lib/fake_person/email.rb
|
29
|
+
- lib/fake_person/foods.rb
|
26
30
|
- lib/fake_person/gender.rb
|
31
|
+
- lib/fake_person/likes.rb
|
27
32
|
- lib/fake_person/names.rb
|
28
33
|
- lib/fake_person/titles.rb
|
29
34
|
- lib/fake_person/username.rb
|