randamu 0.0.2 → 0.0.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/data/academic.yml +15 -0
- data/lib/data/date.yml +23 -0
- data/lib/data/{names.yml → people.yml} +41 -2
- data/lib/data/vehicles.yml +111 -0
- data/lib/randamu/core/academic.rb +8 -3
- data/lib/randamu/core/account.rb +10 -5
- data/lib/randamu/core/animal.rb +4 -1
- data/lib/randamu/core/boolean.rb +3 -1
- data/lib/randamu/core/business.rb +6 -3
- data/lib/randamu/core/date.rb +15 -4
- data/lib/randamu/core/doc.rb +4 -1
- data/lib/randamu/core/map.rb +24 -5
- data/lib/randamu/core/number.rb +3 -1
- data/lib/randamu/core/person.rb +16 -5
- data/lib/randamu/core/text.rb +8 -10
- data/lib/randamu/core/vehicle.rb +30 -0
- data/lib/randamu/generators/document_generator.rb +5 -3
- data/lib/randamu/generators/name_generator.rb +6 -8
- data/lib/randamu/support/dictionary.rb +30 -28
- data/lib/randamu.rb +5 -3
- metadata +8 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8e5720a28a5f5b7f6a23172b4345d89e337bb432c67eccf2ec4c62c710a6d25c
|
4
|
+
data.tar.gz: d9bf37cb193ddb8e68e705bce1068a044e14880ee6f63dfffcf708552b2c3cce
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 42018eeee9a4f4d1284d166163e27a215e6e3d36be052db0126d37bc484f872db463574a01cb78e2d973fbc89df4c1b661da3790183997b63b850fb37e5cfd0d
|
7
|
+
data.tar.gz: e9dcb6fffe6ef7addc09e889590a827f9aa2ef50172d878078c3c943dadf9d7a5ffe437fe48637e2652abed30c27236412c0e10185594786ee117d2d280ef188
|
data/lib/data/academic.yml
CHANGED
@@ -1,4 +1,19 @@
|
|
1
1
|
academic:
|
2
|
+
degrees:
|
3
|
+
- Doutor
|
4
|
+
- Mestre
|
5
|
+
- Bacharel
|
6
|
+
- Licenciado
|
7
|
+
- Tecnólogo
|
8
|
+
- Pós-Doutor
|
9
|
+
education_levels:
|
10
|
+
- Ensino Fundamental
|
11
|
+
- Ensino Médio
|
12
|
+
- Ensino Técnico
|
13
|
+
- Ensino Superior
|
14
|
+
- Pós-Graduação
|
15
|
+
- Mestrado
|
16
|
+
- Doutorado
|
2
17
|
universities:
|
3
18
|
- Universidade Federal de Minas Gerais
|
4
19
|
- Universidade Federal de Juiz de Fora
|
data/lib/data/date.yml
ADDED
@@ -0,0 +1,23 @@
|
|
1
|
+
date:
|
2
|
+
days:
|
3
|
+
- Segunda
|
4
|
+
- Terça
|
5
|
+
- Quarta
|
6
|
+
- Quinta
|
7
|
+
- Sexta
|
8
|
+
- Sábado
|
9
|
+
- Domingo
|
10
|
+
months:
|
11
|
+
- Janeiro
|
12
|
+
- Fevereiro
|
13
|
+
- Março
|
14
|
+
- Abril
|
15
|
+
- Maio
|
16
|
+
- Junho
|
17
|
+
- Julho
|
18
|
+
- Agosto
|
19
|
+
- Setembro
|
20
|
+
- Outubro
|
21
|
+
- Novembro
|
22
|
+
- Dezembro
|
23
|
+
|
@@ -1,4 +1,4 @@
|
|
1
|
-
|
1
|
+
people:
|
2
2
|
male_name:
|
3
3
|
- João
|
4
4
|
- Paulo
|
@@ -517,4 +517,43 @@ names:
|
|
517
517
|
- Abe Ração
|
518
518
|
- Euma Maria
|
519
519
|
- Al-Khabeid Kommer
|
520
|
-
- Sheik Volim Rabah
|
520
|
+
- Sheik Volim Rabah
|
521
|
+
religions:
|
522
|
+
- Cristianismo
|
523
|
+
- Judaísmo
|
524
|
+
- Islamismo
|
525
|
+
- Hinduísmo
|
526
|
+
- Budismo
|
527
|
+
- Espiritismo
|
528
|
+
- Candomblé
|
529
|
+
- Umbanda
|
530
|
+
- Druidismo
|
531
|
+
- Taoísmo
|
532
|
+
religions_adjectives:
|
533
|
+
- Cristão
|
534
|
+
- Judeu
|
535
|
+
- Islâmico
|
536
|
+
- Hindu
|
537
|
+
- Budista
|
538
|
+
- Espírita
|
539
|
+
- Candomblecista
|
540
|
+
- Umbandista
|
541
|
+
- Druida
|
542
|
+
- Taoísta
|
543
|
+
genders:
|
544
|
+
- Masculino
|
545
|
+
- Feminino
|
546
|
+
marital_status:
|
547
|
+
- Solteiro
|
548
|
+
- Casado
|
549
|
+
- Divorciado
|
550
|
+
- Viúvo
|
551
|
+
blood_types:
|
552
|
+
- A+
|
553
|
+
- A-
|
554
|
+
- B+
|
555
|
+
- B-
|
556
|
+
- AB+
|
557
|
+
- AB-
|
558
|
+
- O+
|
559
|
+
- O
|
@@ -0,0 +1,111 @@
|
|
1
|
+
vehicles:
|
2
|
+
brands:
|
3
|
+
volkswagen:
|
4
|
+
cars:
|
5
|
+
- Gol
|
6
|
+
- Golf
|
7
|
+
- Passat
|
8
|
+
- Polo
|
9
|
+
- Tiguan
|
10
|
+
- Voyage
|
11
|
+
- Virtus
|
12
|
+
- T-Cross
|
13
|
+
honda:
|
14
|
+
cars:
|
15
|
+
- Civic
|
16
|
+
- Accord
|
17
|
+
- Fit
|
18
|
+
- HR-V
|
19
|
+
- WR-V
|
20
|
+
motorcycles:
|
21
|
+
- CBR
|
22
|
+
- CB
|
23
|
+
- CRF
|
24
|
+
- XR
|
25
|
+
- XRE
|
26
|
+
- CG
|
27
|
+
- Biz
|
28
|
+
- Pop
|
29
|
+
- NC 750X
|
30
|
+
- PCX
|
31
|
+
toyota:
|
32
|
+
cars:
|
33
|
+
- Corolla
|
34
|
+
- Camry
|
35
|
+
- RAV4
|
36
|
+
- Hilux
|
37
|
+
- Yaris
|
38
|
+
ford:
|
39
|
+
cars:
|
40
|
+
- Fiesta
|
41
|
+
- Focus
|
42
|
+
- Fusion
|
43
|
+
- Mustang
|
44
|
+
- Ka
|
45
|
+
- EcoSport
|
46
|
+
chevrolet:
|
47
|
+
cars:
|
48
|
+
- Onix
|
49
|
+
- Prisma
|
50
|
+
- Cruze
|
51
|
+
- S10
|
52
|
+
- Spin
|
53
|
+
- Tracker
|
54
|
+
- Cobalt
|
55
|
+
fiat:
|
56
|
+
cars:
|
57
|
+
- Uno
|
58
|
+
- Palio
|
59
|
+
- Siena
|
60
|
+
- Toro
|
61
|
+
- Mobi
|
62
|
+
- Strada
|
63
|
+
- Argo
|
64
|
+
nissan:
|
65
|
+
cars:
|
66
|
+
- Sentra
|
67
|
+
- Altima
|
68
|
+
- Versa
|
69
|
+
- Kicks
|
70
|
+
yamaha:
|
71
|
+
motorcycles:
|
72
|
+
- YBR
|
73
|
+
- Fazer
|
74
|
+
- MT-03
|
75
|
+
- Tenere
|
76
|
+
- Lander
|
77
|
+
- NMAX
|
78
|
+
- XJ6
|
79
|
+
- Tracer 900
|
80
|
+
suzuki:
|
81
|
+
motorcycles:
|
82
|
+
- Hayabusa
|
83
|
+
- GSX-R750
|
84
|
+
- V-Strom
|
85
|
+
- Burgman 400
|
86
|
+
- GSR 150
|
87
|
+
- Intruder 125
|
88
|
+
kawasaki:
|
89
|
+
motorcycles:
|
90
|
+
- Ninja 300
|
91
|
+
- Z400
|
92
|
+
- Versys 650
|
93
|
+
- Vulcan S
|
94
|
+
- Z900
|
95
|
+
bmw:
|
96
|
+
cars:
|
97
|
+
- X1
|
98
|
+
- X6
|
99
|
+
motorcycles:
|
100
|
+
- G 310 R
|
101
|
+
- F 850 GS
|
102
|
+
- S 1000 RR
|
103
|
+
- R 1250 GS
|
104
|
+
- C 400 X
|
105
|
+
ducati:
|
106
|
+
motorcycles:
|
107
|
+
- Monster 797
|
108
|
+
- Multistrada 950
|
109
|
+
- Panigale V4
|
110
|
+
- Scrambler Icon
|
111
|
+
- Diavel 1260
|
@@ -1,9 +1,10 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
module Randamu
|
2
4
|
class Academic < Base
|
3
5
|
class << self
|
4
6
|
def education_level
|
5
|
-
|
6
|
-
'Superior', 'Pós-graduação', 'Mestrado', 'Doutorado'].sample
|
7
|
+
load_data('academic.education_levels').sample
|
7
8
|
end
|
8
9
|
|
9
10
|
def course
|
@@ -18,7 +19,11 @@ module Randamu
|
|
18
19
|
load_data('academic.universities').sample
|
19
20
|
end
|
20
21
|
|
21
|
-
|
22
|
+
def degree
|
23
|
+
load_data('academic.degrees').sample
|
24
|
+
end
|
25
|
+
|
26
|
+
alias college university
|
22
27
|
end
|
23
28
|
end
|
24
29
|
end
|
data/lib/randamu/core/account.rb
CHANGED
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
module Randamu
|
2
4
|
class Account < Base
|
3
5
|
extend NameGenerator
|
@@ -5,10 +7,13 @@ module Randamu
|
|
5
7
|
ALPHABET = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'
|
6
8
|
NUMERIC = '0123456789'
|
7
9
|
SPEACIAL = '!@#$%&*()_+'
|
10
|
+
USERNAME_TYPES = %i[default funny].freeze
|
8
11
|
|
9
12
|
class << self
|
10
13
|
def username(type: :default)
|
11
|
-
load_data("
|
14
|
+
return load_data("people.usernames.#{type}").sample if USERNAME_TYPES.include?(type)
|
15
|
+
|
16
|
+
load_data('people.usernames.default').sample
|
12
17
|
end
|
13
18
|
|
14
19
|
def password(length: 8, special: true, numeric: true, alphabet: true)
|
@@ -20,12 +25,12 @@ module Randamu
|
|
20
25
|
end
|
21
26
|
|
22
27
|
def phone(state: Dictionary::STATES.keys.sample, country_code: false)
|
23
|
-
base_phone_number = "(#{load_data("phone.ddd.#{state}").sample}) " + phone_number
|
28
|
+
base_phone_number = "(#{load_data("phone.ddd.#{state.upcase}").sample}) " + phone_number
|
24
29
|
country_code ? "+55 #{base_phone_number}" : base_phone_number
|
25
30
|
end
|
26
31
|
|
27
32
|
def phone_only_numbers(state: Dictionary::STATES.keys.sample, country_code: false)
|
28
|
-
base_phone_number = load_data("phone.ddd.#{state}").sample.to_s + phone_number
|
33
|
+
base_phone_number = load_data("phone.ddd.#{state.upcase}").sample.to_s + phone_number
|
29
34
|
country_code ? "55#{base_phone_number}" : base_phone_number
|
30
35
|
end
|
31
36
|
|
@@ -43,11 +48,11 @@ module Randamu
|
|
43
48
|
end
|
44
49
|
|
45
50
|
def phone_number
|
46
|
-
|
51
|
+
"9#{rand(10_000_000..99_999_999)}"
|
47
52
|
end
|
48
53
|
end
|
49
54
|
|
50
55
|
# private methods from NameGenerator
|
51
|
-
private_class_method :first_name, :last_name, :full_name
|
56
|
+
private_class_method :first_name, :last_name, :full_name
|
52
57
|
end
|
53
58
|
end
|
data/lib/randamu/core/animal.rb
CHANGED
@@ -1,7 +1,9 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
module Randamu
|
2
4
|
class Animal < Base
|
3
5
|
class << self
|
4
|
-
ANIMAL_TYPES = %w
|
6
|
+
ANIMAL_TYPES = %w[mammal bird fish amphibian reptile insect].freeze
|
5
7
|
|
6
8
|
def animal(type: nil)
|
7
9
|
animal_type(type).sample
|
@@ -10,6 +12,7 @@ module Randamu
|
|
10
12
|
private
|
11
13
|
def animal_type(type)
|
12
14
|
return all_animals unless ANIMAL_TYPES.include?(type.to_s)
|
15
|
+
|
13
16
|
load_data("animals.#{type}s")
|
14
17
|
end
|
15
18
|
|
data/lib/randamu/core/boolean.rb
CHANGED
@@ -1,12 +1,15 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
module Randamu
|
2
4
|
class Business < Base
|
3
5
|
class << self
|
4
6
|
def company_name
|
5
|
-
"#{load_data('
|
7
|
+
"#{load_data('people.last_name').sample} #{load_data('business.company_name.activity_area').sample} #{load_data('business.company_name.suffix').sample}"
|
6
8
|
end
|
9
|
+
|
7
10
|
def subscription
|
8
|
-
%w
|
11
|
+
%w[Mensal Semestral Anual].sample
|
9
12
|
end
|
10
13
|
end
|
11
14
|
end
|
12
|
-
end
|
15
|
+
end
|
data/lib/randamu/core/date.rb
CHANGED
@@ -1,7 +1,9 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
module Randamu
|
2
|
-
class Date
|
3
|
-
DATE_FORMAT = '%d/%m/%Y'
|
4
|
-
START_DATE = '01/01/1950'
|
4
|
+
class Date < Base
|
5
|
+
DATE_FORMAT = '%d/%m/%Y'
|
6
|
+
START_DATE = '01/01/1950'
|
5
7
|
PRESENT_DATE = ::Date.today.strftime(DATE_FORMAT).freeze
|
6
8
|
FUTURE_DATE = (::Date.today + (365 * rand(1..100))).strftime(DATE_FORMAT).freeze
|
7
9
|
|
@@ -14,6 +16,14 @@ module Randamu
|
|
14
16
|
generate_date(start_date, end_date, as_string)
|
15
17
|
end
|
16
18
|
|
19
|
+
def day_of_week
|
20
|
+
load_data('date.days').sample
|
21
|
+
end
|
22
|
+
|
23
|
+
def month
|
24
|
+
load_data('date.months').sample
|
25
|
+
end
|
26
|
+
|
17
27
|
private
|
18
28
|
def generate_date(start_date, end_date, as_string)
|
19
29
|
start_date = string_to_date(start_date)
|
@@ -23,6 +33,7 @@ module Randamu
|
|
23
33
|
return date_to_string(random_date) if as_string
|
24
34
|
random_date
|
25
35
|
end
|
36
|
+
|
26
37
|
def string_to_date(string)
|
27
38
|
::Date.strptime(string, DATE_FORMAT)
|
28
39
|
end
|
@@ -32,4 +43,4 @@ module Randamu
|
|
32
43
|
end
|
33
44
|
end
|
34
45
|
end
|
35
|
-
end
|
46
|
+
end
|
data/lib/randamu/core/doc.rb
CHANGED
data/lib/randamu/core/map.rb
CHANGED
@@ -1,8 +1,11 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
module Randamu
|
2
4
|
class Map < Base
|
3
5
|
class << self
|
4
|
-
def full_address
|
5
|
-
|
6
|
+
def full_address(state: nil)
|
7
|
+
city_name, state_name = state ? address_with_state(state.upcase) : address_without_state
|
8
|
+
"#{street}, #{rand(1..9999)}, #{city_name}, #{state_name} - #{zip_code}"
|
6
9
|
end
|
7
10
|
|
8
11
|
def street
|
@@ -19,19 +22,35 @@ module Randamu
|
|
19
22
|
|
20
23
|
def state(region: nil, acronym: false)
|
21
24
|
state_acronym = region ? Dictionary::REGIONS[region].sample : Dictionary::STATES.keys.sample
|
22
|
-
return state_acronym if acronym
|
23
25
|
|
24
|
-
|
26
|
+
return state_acronym if acronym
|
27
|
+
Dictionary::STATES[state_acronym.to_sym]
|
25
28
|
end
|
26
29
|
|
27
30
|
def city(state: nil)
|
28
|
-
return load_data("map.states.#{state}").sample if state
|
31
|
+
return load_data("map.states.#{state.upcase}").sample if state
|
32
|
+
|
29
33
|
load_data("map.states.#{Dictionary::STATES.keys.sample}").sample
|
30
34
|
end
|
31
35
|
|
32
36
|
def country
|
33
37
|
load_data('map.countries').sample
|
34
38
|
end
|
39
|
+
|
40
|
+
private
|
41
|
+
def address_with_state(state)
|
42
|
+
city_name = city(state: state)
|
43
|
+
state_name = Dictionary::STATES[state]
|
44
|
+
[city_name, state_name]
|
45
|
+
end
|
46
|
+
|
47
|
+
def address_without_state
|
48
|
+
region = Dictionary::REGIONS.keys.sample
|
49
|
+
state_acronym = Dictionary::REGIONS[region].sample
|
50
|
+
city_name = city(state: state_acronym)
|
51
|
+
state_name = Dictionary::STATES[state_acronym.to_sym]
|
52
|
+
[city_name, state_name]
|
53
|
+
end
|
35
54
|
end
|
36
55
|
end
|
37
56
|
end
|
data/lib/randamu/core/number.rb
CHANGED
data/lib/randamu/core/person.rb
CHANGED
@@ -1,20 +1,31 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
module Randamu
|
2
|
-
class
|
4
|
+
class Person < Base
|
3
5
|
extend NameGenerator
|
6
|
+
|
4
7
|
class << self
|
5
8
|
def profession
|
6
9
|
load_data('academic.professions').sample
|
7
10
|
end
|
11
|
+
|
8
12
|
def blood_type
|
9
|
-
|
13
|
+
load_data('people.blood_types').sample
|
10
14
|
end
|
15
|
+
|
11
16
|
def gender
|
12
|
-
|
17
|
+
load_data('people.genders').sample
|
13
18
|
end
|
14
19
|
|
15
20
|
def marital_status
|
16
|
-
|
21
|
+
load_data('people.marital_status').sample
|
22
|
+
end
|
23
|
+
|
24
|
+
def religion(adjective: true)
|
25
|
+
return load_data('people.religions_adjectives').sample if adjective
|
26
|
+
|
27
|
+
load_data('people.religions').sample
|
17
28
|
end
|
18
29
|
end
|
19
30
|
end
|
20
|
-
end
|
31
|
+
end
|
data/lib/randamu/core/text.rb
CHANGED
@@ -1,17 +1,15 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
module Randamu
|
2
4
|
class Text < Base
|
5
|
+
FORMATS = %i[upcase downcase capitalize].freeze
|
6
|
+
|
3
7
|
class << self
|
4
8
|
def word(format: nil)
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
load_data('texts.lorem').sample.downcase
|
10
|
-
when :capitalize
|
11
|
-
load_data('texts.lorem').sample.capitalize
|
12
|
-
else
|
13
|
-
load_data('texts.lorem').sample
|
14
|
-
end
|
9
|
+
word = load_data('texts.lorem').sample
|
10
|
+
|
11
|
+
return word.send(format) if format && FORMATS.include?(format.to_sym)
|
12
|
+
word
|
15
13
|
end
|
16
14
|
|
17
15
|
def title(words: 3)
|
@@ -0,0 +1,30 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Randamu
|
4
|
+
class Vehicle < Base
|
5
|
+
class << self
|
6
|
+
def brand
|
7
|
+
brands.keys.sample.capitalize
|
8
|
+
end
|
9
|
+
|
10
|
+
def car(brand: nil)
|
11
|
+
vehicles_by_type(brand, 'cars')
|
12
|
+
end
|
13
|
+
|
14
|
+
def motorcycle(brand: nil)
|
15
|
+
vehicles_by_type(brand, 'motorcycles')
|
16
|
+
end
|
17
|
+
|
18
|
+
private
|
19
|
+
def brands
|
20
|
+
load_data('vehicles.brands')
|
21
|
+
end
|
22
|
+
|
23
|
+
def vehicles_by_type(brand, type)
|
24
|
+
return brands[brand.to_s][type].sample if brand
|
25
|
+
|
26
|
+
brands.map { |_, v| v[type] }.compact.flatten.sample
|
27
|
+
end
|
28
|
+
end
|
29
|
+
end
|
30
|
+
end
|
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
module DocumentGenerator
|
2
4
|
def cpf(valid: true)
|
3
5
|
return generate_valid_cpf if valid
|
@@ -17,12 +19,13 @@ module DocumentGenerator
|
|
17
19
|
Array.new(9) { rand(0..9) }.join
|
18
20
|
end
|
19
21
|
|
20
|
-
#orgao emissor
|
22
|
+
# orgao emissor
|
21
23
|
def issuing_authority(full_name: false)
|
22
|
-
keys = load_data(
|
24
|
+
keys = load_data('doc.issuing_authority').keys
|
23
25
|
key = keys.sample
|
24
26
|
|
25
27
|
return "#{key} - #{load_data("doc.issuing_authority.#{key}")}" if full_name
|
28
|
+
|
26
29
|
key
|
27
30
|
end
|
28
31
|
|
@@ -91,5 +94,4 @@ module DocumentGenerator
|
|
91
94
|
remainder = sum % 11
|
92
95
|
remainder < 2 ? 0 : 11 - remainder
|
93
96
|
end
|
94
|
-
|
95
97
|
end
|
@@ -1,5 +1,7 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
module NameGenerator
|
2
|
-
GENDER = %w
|
4
|
+
GENDER = %w[male female].freeze
|
3
5
|
|
4
6
|
def first_name(gender: nil)
|
5
7
|
return load_db(gender).sample if !gender.nil? && GENDER.include?(gender.to_s)
|
@@ -12,20 +14,16 @@ module NameGenerator
|
|
12
14
|
load_db(:last).sample
|
13
15
|
end
|
14
16
|
|
15
|
-
def full_name(gender: nil)
|
16
|
-
"#{first_name(gender: gender)} #{last_name}"
|
17
|
-
end
|
18
|
-
|
19
|
-
def custom_name(length: 3, gender: nil)
|
17
|
+
def full_name(gender: nil, length: 2)
|
20
18
|
generate_custom_name(first_name(gender: gender), length)
|
21
19
|
end
|
22
20
|
|
23
21
|
private
|
24
22
|
def load_db(type)
|
25
|
-
return load_data("
|
23
|
+
return load_data("people.#{type}_name") unless type.nil?
|
26
24
|
|
27
25
|
type = GENDER.sample
|
28
|
-
load_data("
|
26
|
+
load_data("people.#{type}_name")
|
29
27
|
end
|
30
28
|
|
31
29
|
def generate_custom_name(initial_name, length)
|
@@ -1,32 +1,34 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
module Dictionary
|
2
4
|
STATES = {
|
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
|
-
|
5
|
+
AC: 'ACRE',
|
6
|
+
AL: 'ALAGOAS',
|
7
|
+
AP: 'AMAPÁ',
|
8
|
+
AM: 'AMAZONAS',
|
9
|
+
BA: 'BAHIA',
|
10
|
+
CE: 'CEARÁ',
|
11
|
+
DF: 'DISTRITO FEDERAL',
|
12
|
+
ES: 'ESPÍRITO SANTO',
|
13
|
+
GO: 'GOIÁS',
|
14
|
+
MA: 'MARANHÃO',
|
15
|
+
MT: 'MATO GROSSO',
|
16
|
+
MS: 'MATO GROSSO DO SUL',
|
17
|
+
MG: 'MINAS GERAIS',
|
18
|
+
PA: 'PARÁ',
|
19
|
+
PB: 'PARAÍBA',
|
20
|
+
PR: 'PARANÁ',
|
21
|
+
PE: 'PERNAMBUCO',
|
22
|
+
PI: 'PIAUÍ',
|
23
|
+
RJ: 'RIO DE JANEIRO',
|
24
|
+
RN: 'RIO GRANDE DO NORTE',
|
25
|
+
RS: 'RIO GRANDE DO SUL',
|
26
|
+
RO: 'RONDÔNIA',
|
27
|
+
RR: 'RORAIMA',
|
28
|
+
SC: 'SANTA CATARINA',
|
29
|
+
SP: 'SÃO PAULO',
|
30
|
+
SE: 'SERGIPE',
|
31
|
+
TO: 'TOCANTINS'
|
30
32
|
}.freeze
|
31
33
|
|
32
34
|
REGIONS = {
|
@@ -36,4 +38,4 @@ module Dictionary
|
|
36
38
|
norte: %w[AM RR AP PA TO RO AC],
|
37
39
|
nordeste: %w[MA PI CE RN PB PE AL SE BA]
|
38
40
|
}.freeze
|
39
|
-
end
|
41
|
+
end
|
data/lib/randamu.rb
CHANGED
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
require 'yaml'
|
2
4
|
require 'date'
|
3
5
|
|
@@ -17,6 +19,6 @@ module Randamu
|
|
17
19
|
end
|
18
20
|
end
|
19
21
|
|
20
|
-
Dir.glob(File.join(File.dirname(__FILE__), 'randamu', '/support/*.rb')).each { |file| require file }
|
21
|
-
Dir.glob(File.join(File.dirname(__FILE__), 'randamu', '/generators/*.rb')).each { |file| require file }
|
22
|
-
Dir.glob(File.join(File.dirname(__FILE__), 'randamu', '/core/*.rb')).each { |file| require file }
|
22
|
+
Dir.glob(File.join(File.dirname(__FILE__), 'randamu', '/support/*.rb')).sort.each { |file| require file }
|
23
|
+
Dir.glob(File.join(File.dirname(__FILE__), 'randamu', '/generators/*.rb')).sort.each { |file| require file }
|
24
|
+
Dir.glob(File.join(File.dirname(__FILE__), 'randamu', '/core/*.rb')).sort.each { |file| require file }
|
metadata
CHANGED
@@ -1,16 +1,16 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: randamu
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jorge Coutinho
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-
|
11
|
+
date: 2024-11-20 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
|
-
description: Random data
|
13
|
+
description: Random data generator in pt-BR / Gerador de dados aleatorios em pt-BR
|
14
14
|
email: jorgecoutinhodsn@gmail.com
|
15
15
|
executables: []
|
16
16
|
extensions: []
|
@@ -19,12 +19,14 @@ files:
|
|
19
19
|
- lib/data/academic.yml
|
20
20
|
- lib/data/animals.yml
|
21
21
|
- lib/data/business.yml
|
22
|
+
- lib/data/date.yml
|
22
23
|
- lib/data/doc.yml
|
23
24
|
- lib/data/emails.yml
|
24
25
|
- lib/data/map.yml
|
25
|
-
- lib/data/
|
26
|
+
- lib/data/people.yml
|
26
27
|
- lib/data/phone.yml
|
27
28
|
- lib/data/texts.yml
|
29
|
+
- lib/data/vehicles.yml
|
28
30
|
- lib/randamu.rb
|
29
31
|
- lib/randamu/core/academic.rb
|
30
32
|
- lib/randamu/core/account.rb
|
@@ -37,6 +39,7 @@ files:
|
|
37
39
|
- lib/randamu/core/number.rb
|
38
40
|
- lib/randamu/core/person.rb
|
39
41
|
- lib/randamu/core/text.rb
|
42
|
+
- lib/randamu/core/vehicle.rb
|
40
43
|
- lib/randamu/generators/document_generator.rb
|
41
44
|
- lib/randamu/generators/name_generator.rb
|
42
45
|
- lib/randamu/support/dictionary.rb
|
@@ -62,5 +65,5 @@ requirements: []
|
|
62
65
|
rubygems_version: 3.5.11
|
63
66
|
signing_key:
|
64
67
|
specification_version: 4
|
65
|
-
summary: Random data
|
68
|
+
summary: Random data generator in pt-BR
|
66
69
|
test_files: []
|