faker 1.8.4 → 1.8.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +62 -3
- data/README.md +19 -6
- data/lib/faker/aqua_teen_hunger_force.rb +9 -0
- data/lib/faker/back_to_the_future.rb +17 -0
- data/lib/faker/bank.rb +16 -10
- data/lib/faker/breaking_bad.rb +16 -0
- data/lib/faker/company.rb +21 -0
- data/lib/faker/dog.rb +39 -0
- data/lib/faker/dumb_and_dumber.rb +17 -0
- data/lib/faker/dune.rb +54 -0
- data/lib/faker/esport.rb +5 -5
- data/lib/faker/fallout.rb +21 -0
- data/lib/faker/finance.rb +1 -1
- data/lib/faker/kpop.rb +29 -0
- data/lib/faker/lebowski.rb +17 -0
- data/lib/faker/markdown.rb +1 -0
- data/lib/faker/name.rb +8 -4
- data/lib/faker/one_piece.rb +29 -0
- data/lib/faker/programming_language.rb +13 -0
- data/lib/faker/rupaul.rb +4 -0
- data/lib/faker/science.rb +15 -0
- data/lib/faker/shakespeare.rb +4 -47
- data/lib/faker/silicon_valley.rb +33 -0
- data/lib/faker/star_wars.rb +26 -27
- data/lib/faker/stargate.rb +17 -0
- data/lib/faker/the_thick_of_it.rb +17 -0
- data/lib/faker/university.rb +2 -6
- data/lib/faker/v_for_vendetta.rb +17 -0
- data/lib/faker/vehicle.rb +2 -0
- data/lib/faker/version.rb +1 -1
- data/lib/faker/zelda.rb +4 -0
- data/lib/helpers/char.rb +21 -0
- data/lib/locales/de.yml +2 -2
- data/lib/locales/en-MS.yml +2 -0
- data/lib/locales/en.yml +0 -777
- data/lib/locales/en/ancient.yml +7 -0
- data/lib/locales/en/app.yml +8 -0
- data/lib/locales/en/aqua_teen_hunger_force.yml +4 -0
- data/lib/locales/en/artist.yml +4 -0
- data/lib/locales/en/back_to_the_future.yml +120 -0
- data/lib/locales/en/bank.yml +87 -0
- data/lib/locales/en/beer.yml +8 -0
- data/lib/locales/en/book.yml +7 -0
- data/lib/locales/en/breaking_bad.yml +28 -0
- data/lib/locales/en/business.yml +5 -0
- data/lib/locales/en/cat.yml +6 -0
- data/lib/locales/en/chuck_norris.yml +82 -0
- data/lib/locales/en/code.yml +4 -0
- data/lib/locales/en/coffee.yml +31 -0
- data/lib/locales/en/color.yml +4 -0
- data/lib/locales/en/commerce.yml +11 -0
- data/lib/locales/en/company.yml +20 -0
- data/lib/locales/en/compass.yml +34 -0
- data/lib/locales/en/demographic.yml +8 -0
- data/lib/locales/en/dessert.yml +6 -0
- data/lib/locales/en/dog.yml +11 -0
- data/lib/locales/en/dr_who.yml +25 -7
- data/lib/locales/en/dragon_ball.yml +4 -0
- data/lib/locales/en/dumb_and_dumber.yml +59 -0
- data/lib/locales/en/dune.yml +159 -0
- data/lib/locales/en/educator.yml +10 -0
- data/lib/locales/en/elder_scrolls.yml +7 -0
- data/lib/locales/en/esport.yml +8 -0
- data/lib/locales/en/fallout.yml +136 -0
- data/lib/locales/en/file.yml +5 -0
- data/lib/locales/en/finance.yml +50 -0
- data/lib/locales/en/food.yml +9 -0
- data/lib/locales/en/friends.yml +6 -0
- data/lib/locales/en/funny_name.yml +4 -0
- data/lib/locales/en/game_of_thrones.yml +8 -0
- data/lib/locales/en/hacker.yml +8 -0
- data/lib/locales/en/harry_potter.yml +8 -0
- data/lib/locales/en/hey_arnold.yml +24 -0
- data/lib/locales/en/hipster.yml +4 -0
- data/lib/locales/en/hitchhikers_guide_to_the_galaxy.yml +45 -0
- data/lib/locales/en/hobbit.yml +19 -0
- data/lib/locales/en/how_i_met_your_mother.yml +28 -0
- data/lib/locales/en/id_number.yml +5 -0
- data/lib/locales/en/job.yml +13 -0
- data/lib/locales/en/kpop.yml +83 -0
- data/lib/locales/en/league_of_legends.yml +9 -0
- data/lib/locales/en/lebowski.yml +43 -0
- data/lib/locales/en/lord_of_the_rings.yml +5 -0
- data/lib/locales/en/lorem.yml +5 -0
- data/lib/locales/en/markdown.yml +5 -0
- data/lib/locales/en/matz.yml +28 -0
- data/lib/locales/en/measurement.yml +11 -0
- data/lib/locales/en/music.yml +4 -0
- data/lib/locales/en/name.yml +25 -0
- data/lib/locales/en/one_piece.yml +9 -0
- data/lib/locales/en/overwatch.yml +35 -0
- data/lib/locales/en/phone_number.yml +6 -0
- data/lib/locales/en/pokemon.yml +7 -0
- data/lib/locales/en/programming_language.yml +5 -0
- data/lib/locales/en/robin.yml +4 -0
- data/lib/locales/en/rock_band.yml +4 -0
- data/lib/locales/en/rupaul.yml +95 -0
- data/lib/locales/en/science.yml +5 -0
- data/lib/locales/en/seinfeld.yml +5 -0
- data/lib/locales/en/shakespeare.yml +56 -0
- data/lib/locales/en/silicon_valley.yml +52 -0
- data/lib/locales/en/simpsons.yml +26 -0
- data/lib/locales/en/slack_emoji.yml +20 -0
- data/lib/locales/en/space.yml +16 -0
- data/lib/locales/en/star_trek.yml +7 -0
- data/lib/locales/en/star_wars.yml +246 -0
- data/lib/locales/en/stargate.yml +22 -0
- data/lib/locales/en/superhero.yml +12 -0
- data/lib/locales/en/team.yml +8 -0
- data/lib/locales/en/the_thick_of_it.yml +6 -0
- data/lib/locales/en/twin_peaks.yml +6 -0
- data/lib/locales/en/umphreys_mcgee.yml +4 -0
- data/lib/locales/en/university.yml +10 -0
- data/lib/locales/en/v_for_vendetta.yml +163 -0
- data/lib/locales/en/vehicle.yml +52 -0
- data/lib/locales/en/venture_bros.yml +7 -0
- data/lib/locales/en/yoda.yml +4 -0
- data/lib/locales/en/zelda.yml +7 -0
- data/lib/locales/fr.yml +1 -0
- data/lib/locales/ja.yml +1 -0
- data/lib/locales/ko.yml +2 -1
- data/lib/locales/nl.yml +1 -1
- data/lib/locales/pt-BR.yml +30 -3
- data/lib/locales/ru.yml +9 -3
- metadata +103 -5
@@ -0,0 +1,21 @@
|
|
1
|
+
module Faker
|
2
|
+
class Fallout < Base
|
3
|
+
class << self
|
4
|
+
def character
|
5
|
+
fetch('fallout.characters')
|
6
|
+
end
|
7
|
+
|
8
|
+
def faction
|
9
|
+
fetch('fallout.factions')
|
10
|
+
end
|
11
|
+
|
12
|
+
def location
|
13
|
+
fetch('fallout.locations')
|
14
|
+
end
|
15
|
+
|
16
|
+
def quote
|
17
|
+
fetch('fallout.quotes')
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
data/lib/faker/finance.rb
CHANGED
@@ -9,7 +9,7 @@ module Faker
|
|
9
9
|
def credit_card(*types)
|
10
10
|
types = CREDIT_CARD_TYPES if types.empty?
|
11
11
|
type = sample(types)
|
12
|
-
template = numerify(fetch("credit_card.#{type}"))
|
12
|
+
template = numerify(fetch("finance.credit_card.#{type}"))
|
13
13
|
|
14
14
|
# calculate the luhn checksum digit
|
15
15
|
multiplier = 1
|
data/lib/faker/kpop.rb
ADDED
@@ -0,0 +1,29 @@
|
|
1
|
+
module Faker
|
2
|
+
class Kpop < Base
|
3
|
+
class << self
|
4
|
+
def i_groups
|
5
|
+
fetch('kpop.i_groups')
|
6
|
+
end
|
7
|
+
|
8
|
+
def ii_groups
|
9
|
+
fetch('kpop.ii_groups')
|
10
|
+
end
|
11
|
+
|
12
|
+
def iii_groups
|
13
|
+
fetch('kpop.iii_groups')
|
14
|
+
end
|
15
|
+
|
16
|
+
def girl_groups
|
17
|
+
fetch('kpop.girl_groups')
|
18
|
+
end
|
19
|
+
|
20
|
+
def boy_bands
|
21
|
+
fetch('kpop.boy_bands')
|
22
|
+
end
|
23
|
+
|
24
|
+
def solo
|
25
|
+
fetch('kpop.solo')
|
26
|
+
end
|
27
|
+
end
|
28
|
+
end
|
29
|
+
end
|
data/lib/faker/markdown.rb
CHANGED
data/lib/faker/name.rb
CHANGED
@@ -16,24 +16,28 @@ module Faker
|
|
16
16
|
fetch('name.first_name')
|
17
17
|
end
|
18
18
|
|
19
|
-
def last_name
|
19
|
+
def last_name
|
20
20
|
fetch('name.last_name')
|
21
21
|
end
|
22
22
|
|
23
|
-
def prefix
|
23
|
+
def prefix
|
24
24
|
fetch('name.prefix')
|
25
25
|
end
|
26
26
|
|
27
|
-
def suffix
|
27
|
+
def suffix
|
28
28
|
fetch('name.suffix')
|
29
29
|
end
|
30
30
|
|
31
31
|
# Generate a buzzword-laden job title
|
32
32
|
# Wordlist from http://www.bullshitjob.com/title/
|
33
|
-
def title
|
33
|
+
def title
|
34
34
|
"#{fetch('name.title.descriptor')} #{fetch('name.title.level')} #{fetch('name.title.job')}"
|
35
35
|
end
|
36
36
|
|
37
|
+
def initials(character_count=3)
|
38
|
+
(0...character_count).map { (65 + rand(26)).chr }.join
|
39
|
+
end
|
40
|
+
|
37
41
|
def job_titles
|
38
42
|
fetch_all('name.title.job')
|
39
43
|
end
|
@@ -0,0 +1,29 @@
|
|
1
|
+
module Faker
|
2
|
+
class OnePiece < Base
|
3
|
+
class << self
|
4
|
+
def character
|
5
|
+
fetch('one_piece.characters')
|
6
|
+
end
|
7
|
+
|
8
|
+
def sea
|
9
|
+
fetch('one_piece.seas')
|
10
|
+
end
|
11
|
+
|
12
|
+
def island
|
13
|
+
fetch('one_piece.islands')
|
14
|
+
end
|
15
|
+
|
16
|
+
def location
|
17
|
+
fetch('one_piece.locations')
|
18
|
+
end
|
19
|
+
|
20
|
+
def quote
|
21
|
+
fetch('one_piece.quotes')
|
22
|
+
end
|
23
|
+
|
24
|
+
def akuma_no_mi
|
25
|
+
fetch('one_piece.akumas_no_mi')
|
26
|
+
end
|
27
|
+
end
|
28
|
+
end
|
29
|
+
end
|
data/lib/faker/rupaul.rb
CHANGED
data/lib/faker/shakespeare.rb
CHANGED
@@ -19,65 +19,22 @@ module Faker
|
|
19
19
|
end
|
20
20
|
|
21
21
|
def hamlet
|
22
|
-
|
23
|
-
"Neither a borrower nor a lender be; For loan oft loses both itself and friend, and borrowing dulls the edge of husbandry.",
|
24
|
-
"This above all: to thine own self be true.",
|
25
|
-
"Though this be madness, yet there is method in 't.",
|
26
|
-
"That it should come to this!.",
|
27
|
-
"There is nothing either good or bad, but thinking makes it so.",
|
28
|
-
"What a piece of work is man! how noble in reason! how infinite in faculty! in form and moving how express and admirable! in action how like an angel! in apprehension how like a god! the beauty of the world, the paragon of animals! .",
|
29
|
-
"The lady doth protest too much, methinks.",
|
30
|
-
"In my mind's eye.",
|
31
|
-
"A little more than kin, and less than kind.",
|
32
|
-
"The play 's the thing wherein I'll catch the conscience of the king.",
|
33
|
-
"And it must follow, as the night the day, thou canst not then be false to any man.",
|
34
|
-
"Brevity is the soul of wit.",
|
35
|
-
"Doubt that the sun doth move, doubt truth to be a liar, but never doubt I love.",
|
36
|
-
"Rich gifts wax poor when givers prove unkind.",
|
37
|
-
"Do you think I am easier to be played on than a pipe?",
|
38
|
-
"I will speak daggers to her, but use none.",
|
39
|
-
"When sorrows come, they come not single spies, but in battalions."]
|
22
|
+
fetch('shakespeare.hamlet')
|
40
23
|
end
|
41
24
|
|
42
|
-
|
43
25
|
def as_you_like_it
|
44
|
-
|
45
|
-
"Can one desire too much of a good thing?.",
|
46
|
-
"I like this place and willingly could waste my time in it.",
|
47
|
-
"How bitter a thing it is to look into happiness through another man's eyes!",
|
48
|
-
"Blow, blow, thou winter wind! Thou art not so unkind as man's ingratitude.",
|
49
|
-
"True is it that we have seen better days.",
|
50
|
-
"For ever and a day.",
|
51
|
-
"The fool doth think he is wise, but the wise man knows himself to be a fool."]
|
26
|
+
fetch('shakespeare.as_you_like_it')
|
52
27
|
end
|
53
28
|
|
54
29
|
|
55
30
|
def king_richard_iii
|
56
|
-
|
57
|
-
"A horse! a horse! my kingdom for a horse!.",
|
58
|
-
"Conscience is but a word that cowards use, devised at first to keep the strong in awe.",
|
59
|
-
"So wise so young, they say, do never live long.",
|
60
|
-
"Off with his head!",
|
61
|
-
"An honest tale speeds best, being plainly told.",
|
62
|
-
"The king's name is a tower of strength.",
|
63
|
-
"The world is grown so bad, that wrens make prey where eagles dare not perch."]
|
31
|
+
fetch('shakespeare.king_richard_iii')
|
64
32
|
end
|
65
33
|
|
66
34
|
def romeo_and_juliet
|
67
|
-
|
68
|
-
"It is the east, and Juliet is the sun.",
|
69
|
-
"Good Night, Good night! Parting is such sweet sorrow, that I shall say good night till it be morrow.",
|
70
|
-
"What's in a name? That which we call a rose by any other name would smell as sweet.",
|
71
|
-
"Wisely and slow; they stumble that run fast.",
|
72
|
-
"Tempt not a desperate man.",
|
73
|
-
"For you and I are past our dancing days.",
|
74
|
-
"O! she doth teach the torches to burn bright.",
|
75
|
-
"It seems she hangs upon the cheek of night like a rich jewel in an Ethiope's ear.",
|
76
|
-
"See, how she leans her cheek upon her hand! O that I were a glove upon that hand, that I might touch that cheek!.",
|
77
|
-
"Not stepping o'er the bounds of modesty."]
|
35
|
+
fetch('shakespeare.romeo_and_juliet')
|
78
36
|
end
|
79
37
|
|
80
38
|
end
|
81
39
|
end
|
82
40
|
end
|
83
|
-
|
@@ -0,0 +1,33 @@
|
|
1
|
+
module Faker
|
2
|
+
class SiliconValley < Base
|
3
|
+
class << self
|
4
|
+
def character
|
5
|
+
fetch('silicon_valley.characters')
|
6
|
+
end
|
7
|
+
|
8
|
+
def company
|
9
|
+
fetch('silicon_valley.companies')
|
10
|
+
end
|
11
|
+
|
12
|
+
def quote
|
13
|
+
fetch('silicon_valley.quotes')
|
14
|
+
end
|
15
|
+
|
16
|
+
def app
|
17
|
+
fetch('silicon_valley.apps')
|
18
|
+
end
|
19
|
+
|
20
|
+
def invention
|
21
|
+
fetch('silicon_valley.inventions')
|
22
|
+
end
|
23
|
+
|
24
|
+
def motto
|
25
|
+
fetch('silicon_valley.mottos')
|
26
|
+
end
|
27
|
+
|
28
|
+
def url
|
29
|
+
fetch('silicon_valley.urls')
|
30
|
+
end
|
31
|
+
end
|
32
|
+
end
|
33
|
+
end
|
data/lib/faker/star_wars.rb
CHANGED
@@ -13,10 +13,6 @@ module Faker
|
|
13
13
|
sample(planets)
|
14
14
|
end
|
15
15
|
|
16
|
-
def quote
|
17
|
-
sample(quotes)
|
18
|
-
end
|
19
|
-
|
20
16
|
def specie
|
21
17
|
sample(species)
|
22
18
|
end
|
@@ -34,50 +30,53 @@ module Faker
|
|
34
30
|
end
|
35
31
|
|
36
32
|
def characters
|
37
|
-
|
38
|
-
'Kylo Ren', 'Darth Sidious', 'Anakin Skywalker', 'Luke Skywalker', 'Ben Solo', 'Han Solo', 'Darth Vader', 'Watto', 'Mace Windu', 'Yoda', 'Count Dooku', 'Sebulba',
|
39
|
-
'Qui-Gon Jinn', 'Chewbacca', 'Jango Fett', 'Lando Calrissian', 'Bail Organa', 'Wedge Antilles', 'Poe Dameron', 'Ki-Adi-Mundi', 'Nute Gunray', 'Panaka', 'Rune Haako']
|
33
|
+
fetch('star_wars.characters')
|
40
34
|
end
|
41
35
|
|
42
36
|
def droids
|
43
|
-
|
44
|
-
'NR-N99', 'C-3PO', 'R2-D2', 'BB-8', 'R2-Q5']
|
37
|
+
fetch('star_wars.droids')
|
45
38
|
end
|
46
39
|
|
47
40
|
def planets
|
48
|
-
|
49
|
-
'Hosnian Prime', 'Jakku', 'Kamino', 'Kashyyyk', 'Lothal', 'Mustafar', 'Naboo',
|
50
|
-
'Sullust', 'Takodana', 'Tatooine', 'Utapau', 'Yavin']
|
41
|
+
fetch('star_wars.planets')
|
51
42
|
end
|
52
43
|
|
53
|
-
def
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
44
|
+
def quote(character = nil)
|
45
|
+
quoted_characters = translate('faker.star_wars.quotes')
|
46
|
+
|
47
|
+
if character.nil?
|
48
|
+
character = sample(quoted_characters.keys).to_s
|
49
|
+
else
|
50
|
+
character.to_s.downcase!
|
51
|
+
|
52
|
+
# check alternate spellings, nicknames, titles of characters
|
53
|
+
translate('faker.star_wars.alternate_character_spellings').each do |k, v|
|
54
|
+
character = k.to_s if v.include?(character)
|
55
|
+
end
|
56
|
+
|
57
|
+
unless quoted_characters.keys.include?(character.to_sym)
|
58
|
+
raise ArgumentError, "Character for quotes can be left blank or #{quoted_characters.keys.join(', ')}"
|
59
|
+
end
|
60
|
+
end
|
61
|
+
|
62
|
+
fetch('star_wars.quotes.' + character)
|
63
63
|
end
|
64
64
|
|
65
65
|
def species
|
66
|
-
|
66
|
+
fetch('star_wars.species')
|
67
67
|
end
|
68
68
|
|
69
69
|
def vehicles
|
70
|
-
|
71
|
-
'Sith Infiltrator', 'AT-ST Walker', 'TIE Bomber', 'Imperial Shuttle', 'Sandcrawler', 'TIE Interceptor', 'Speeder Bike', 'Death Star', 'AT-AT Walker', 'Imperial Star Destroyer', 'X-Wing Fighter']
|
70
|
+
fetch('star_wars.vehicles')
|
72
71
|
end
|
73
72
|
|
74
73
|
def wookiee_words
|
75
|
-
|
76
|
-
'gwyaaaag', 'roooarrgh', 'ur', 'ru', 'roo', 'hnn-rowr', 'yrroonn', 'nng', 'rarr']
|
74
|
+
fetch('star_wars.wookiee_words')
|
77
75
|
end
|
78
76
|
|
79
77
|
alias_method :wookie_sentence, :wookiee_sentence
|
80
78
|
alias_method :wookie_words, :wookiee_words
|
79
|
+
|
81
80
|
end
|
82
81
|
end
|
83
82
|
end
|
@@ -0,0 +1,17 @@
|
|
1
|
+
module Faker
|
2
|
+
class TheThickOfIt < Base
|
3
|
+
class << self
|
4
|
+
def character
|
5
|
+
fetch('the_thick_of_it.characters')
|
6
|
+
end
|
7
|
+
|
8
|
+
def department
|
9
|
+
fetch('the_thick_of_it.departments')
|
10
|
+
end
|
11
|
+
|
12
|
+
def position
|
13
|
+
fetch('the_thick_of_it.positions')
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
data/lib/faker/university.rb
CHANGED
@@ -16,15 +16,11 @@ module Faker
|
|
16
16
|
end
|
17
17
|
|
18
18
|
def greek_organization
|
19
|
-
|
20
|
-
3.times do |e|
|
21
|
-
organization = organization + sample(greek_alphabet)
|
22
|
-
end
|
23
|
-
organization
|
19
|
+
3.times.map { |_| sample(greek_alphabet) }.join
|
24
20
|
end
|
25
21
|
|
26
22
|
def greek_alphabet
|
27
|
-
['Α', 'B', 'Γ', 'Δ', 'E', 'Z', 'H', 'Θ', '
|
23
|
+
['Α', 'B', 'Γ', 'Δ', 'E', 'Z', 'H', 'Θ', 'I', 'K', 'Λ', 'M', 'N', 'Ξ',
|
28
24
|
'O', 'Π', 'P', 'Σ', 'T', 'Y', 'Φ', 'X', 'Ψ', 'Ω']
|
29
25
|
end
|
30
26
|
end
|
@@ -0,0 +1,17 @@
|
|
1
|
+
module Faker
|
2
|
+
class VForVendetta < Base
|
3
|
+
class << self
|
4
|
+
def character
|
5
|
+
fetch('v_for_vendetta.characters')
|
6
|
+
end
|
7
|
+
|
8
|
+
def speech
|
9
|
+
fetch('v_for_vendetta.speeches')
|
10
|
+
end
|
11
|
+
|
12
|
+
def quote
|
13
|
+
fetch('v_for_vendetta.quotes')
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|