ffaker 2.14.0 → 2.15.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Changelog.md +7 -0
- data/README.md +8 -1
- data/REFERENCE.md +26 -2
- data/ffaker.gemspec +7 -2
- data/lib/ffaker.rb +6 -5
- data/lib/ffaker/address_fr.rb +5 -1
- data/lib/ffaker/address_nl.rb +1 -3
- data/lib/ffaker/{animals.rb → animal.rb} +0 -0
- data/lib/ffaker/{animals_cn.rb → animal_cn.rb} +0 -0
- data/lib/ffaker/animal_es.rb +12 -0
- data/lib/ffaker/{animals_us.rb → animal_us.rb} +0 -0
- data/lib/ffaker/company_ja.rb +24 -0
- data/lib/ffaker/data/address_fr/region +27 -0
- data/lib/ffaker/data/animal_es/common_names +135 -0
- data/lib/ffaker/identification_tw.rb +23 -0
- data/lib/ffaker/utils/unique_utils.rb +0 -2
- data/lib/version.rb +5 -0
- data/scripts/benchmark.rb +5 -3
- data/test/test_address_fr.rb +1 -1
- data/test/test_address_nl.rb +1 -1
- data/test/test_animal_es.rb +17 -0
- data/test/test_array_utils.rb +0 -1
- data/test/test_company_ja.rb +28 -0
- data/test/test_geolocation.rb +2 -2
- data/test/test_identification_tw.rb +17 -0
- data/test/test_ssn_se.rb +2 -2
- metadata +181 -155
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: dc2b63628581ea883c017e605877a39bf214d021b3646fdf743a1019de94482d
|
4
|
+
data.tar.gz: 381ea6af08e8efadd6c98e759881b2428fb9c93917ca0e906f70872876172f7d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: fa290391c027dadb421c9bc23e0582cecfedf821d6a16f29c72f5f11b3e29dc0a5f8db67656d1195ff4cca4cd52dbbe8c83f263cf427be7e1ccffc990df5b17a
|
7
|
+
data.tar.gz: 5908dd19aaab75ff494b59a9e7f79443b6bc9e825257bbc1417302ef2671a468c7eb8ed32955f4b7c9ff700a42509af13356daecc8d9d737bf03924f6c1f27bc
|
data/Changelog.md
CHANGED
@@ -2,6 +2,13 @@
|
|
2
2
|
|
3
3
|
- Add your change HERE
|
4
4
|
|
5
|
+
## 2.15.0
|
6
|
+
- Add `IdentificationTW` [@pominx]
|
7
|
+
- Add `CompanyJA` [@ktroutner]
|
8
|
+
- Add `AddressFR.region` [@GuillaumeOcculy]
|
9
|
+
- Add `AnimalES` [@delucas]
|
10
|
+
- Fix `AddressNL.postal_code` [@gerard76]
|
11
|
+
|
5
12
|
## 2.14.0
|
6
13
|
- Add `Code.npi` [@alibby]
|
7
14
|
|
data/README.md
CHANGED
@@ -27,7 +27,7 @@ need to:
|
|
27
27
|
and then
|
28
28
|
|
29
29
|
require 'ffaker'
|
30
|
-
|
30
|
+
|
31
31
|
### Rails
|
32
32
|
|
33
33
|
1. If using rails then add the gem to your development and test environments:
|
@@ -98,6 +98,13 @@ FFaker::Name.unique.name
|
|
98
98
|
(if you want to have your own version, that is fine but bump version in a commit by itself I can ignore when I pull)
|
99
99
|
* Send me a pull request. Bonus points for topic branches.
|
100
100
|
|
101
|
+
## Release
|
102
|
+
|
103
|
+
* Bump version in `lib/version.rb`.
|
104
|
+
* Update `Changelog.md`.
|
105
|
+
* Tag with `v<major>.<minor>.<patch>`.
|
106
|
+
* Push it.
|
107
|
+
|
101
108
|
## Copyright
|
102
109
|
|
103
110
|
Copyright (c) 2013 Emmanuel Oga. See LICENSE for details.
|
data/REFERENCE.md
CHANGED
@@ -30,6 +30,7 @@
|
|
30
30
|
* [FFaker::Airline](#ffakerairline)
|
31
31
|
* [FFaker::Animal](#ffakeranimal)
|
32
32
|
* [FFaker::AnimalCN](#ffakeranimalcn)
|
33
|
+
* [FFaker::AnimalES](#ffakeranimales)
|
33
34
|
* [FFaker::AnimalUS](#ffakeranimalus)
|
34
35
|
* [FFaker::Avatar](#ffakeravatar)
|
35
36
|
* [FFaker::BaconIpsum](#ffakerbaconipsum)
|
@@ -44,6 +45,7 @@
|
|
44
45
|
* [FFaker::Company](#ffakercompany)
|
45
46
|
* [FFaker::CompanyCN](#ffakercompanycn)
|
46
47
|
* [FFaker::CompanyIT](#ffakercompanyit)
|
48
|
+
* [FFaker::CompanyJA](#ffakercompanyja)
|
47
49
|
* [FFaker::CompanySE](#ffakercompanyse)
|
48
50
|
* [FFaker::Conference](#ffakerconference)
|
49
51
|
* [FFaker::CoursesFR](#ffakercoursesfr)
|
@@ -72,6 +74,7 @@
|
|
72
74
|
* [FFaker::IdentificationKr](#ffakeridentificationkr)
|
73
75
|
* [FFaker::IdentificationMX](#ffakeridentificationmx)
|
74
76
|
* [FFaker::IdentificationPL](#ffakeridentificationpl)
|
77
|
+
* [FFaker::IdentificationTW](#ffakeridentificationtw)
|
75
78
|
* [FFaker::Image](#ffakerimage)
|
76
79
|
* [FFaker::Internet](#ffakerinternet)
|
77
80
|
* [FFaker::InternetSE](#ffakerinternetse)
|
@@ -467,11 +470,12 @@
|
|
467
470
|
| `city` | Tremblay-en-France, Les Abymes, Pantin |
|
468
471
|
| `city_prefix` | East, East, Lake |
|
469
472
|
| `city_suffix` | burgh, burgh, berg |
|
470
|
-
| `country` |
|
473
|
+
| `country` | France, Senegal, Côte d'Ivoire |
|
471
474
|
| `country_code` | MO, ME, NE |
|
472
475
|
| `full_address` | 79, bd Isaac Clerc 2B607 Montigny-le-Bretonneux, 5655 T, bd Margaret Lucas, 2A042 Bagnolet, 47 rue Denis de Girard 2A145 Arles |
|
473
476
|
| `neighborhood` | Bridesburg, North East Irwindale, Babylon Bayside |
|
474
|
-
| `postal_code` |
|
477
|
+
| `postal_code` | 75008, 97659, 97356, 97949 |
|
478
|
+
| `region` | Bretagne, Île-de-France, Pays de la Loire, Mayotte |
|
475
479
|
| `secondary_address` | Apt. 596, Suite 111, Suite 400 |
|
476
480
|
| `street_address` | 7 impasse Zoé de Mercier, 19 bd Thérèse Ramos, 47 QUATER boulevard Patrick Cousin |
|
477
481
|
| `street_name` | Nakisha View, Dare Flats, Sunday Light |
|
@@ -840,12 +844,19 @@
|
|
840
844
|
| ------ | ------- |
|
841
845
|
| `common_name` | 蝾螈, 兔子, 青蛙 |
|
842
846
|
|
847
|
+
## FFaker::AnimalES
|
848
|
+
|
849
|
+
| Method | Example |
|
850
|
+
| ------ | ------- |
|
851
|
+
| `common_name` | Mono, Águila, Zorro |
|
852
|
+
|
843
853
|
## FFaker::AnimalUS
|
844
854
|
|
845
855
|
| Method | Example |
|
846
856
|
| ------ | ------- |
|
847
857
|
| `common_name` | Newt, Rabbit, Frog |
|
848
858
|
|
859
|
+
|
849
860
|
## FFaker::Avatar
|
850
861
|
|
851
862
|
| Method | Example |
|
@@ -969,6 +980,13 @@
|
|
969
980
|
| `prefix` | Laboratorio, Studio Tecnico, Studio Tecnico |
|
970
981
|
| `suffix` | Ingegneri, Architetti, s.n.c. |
|
971
982
|
|
983
|
+
## FFaker::CompanyJA
|
984
|
+
|
985
|
+
| Method | Example |
|
986
|
+
| ------ | ------- |
|
987
|
+
| `name` | 指宿株式会社, 松本建設, 斎藤書店 |
|
988
|
+
| `position` | 社員, 課長 |
|
989
|
+
|
972
990
|
## FFaker::CompanySE
|
973
991
|
|
974
992
|
| Method | Example |
|
@@ -1221,6 +1239,12 @@
|
|
1221
1239
|
| `identity_card` | AKH956298, CPI928237, VYB372774 |
|
1222
1240
|
| `drivers_license` | 47704/10/7415, 20409/05/8025, 90741/34/4389 |
|
1223
1241
|
|
1242
|
+
## FFaker::IdentificationTW
|
1243
|
+
|
1244
|
+
| Method | Example |
|
1245
|
+
| ------ | ------- |
|
1246
|
+
| `id` | A270604824, R298671809, X115253450 |
|
1247
|
+
|
1224
1248
|
## FFaker::Image
|
1225
1249
|
|
1226
1250
|
| Method | Example |
|
data/ffaker.gemspec
CHANGED
@@ -1,13 +1,17 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
+
lib = File.expand_path('lib', __dir__)
|
4
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
5
|
+
require 'version'
|
6
|
+
|
3
7
|
Gem::Specification.new do |s|
|
4
8
|
s.specification_version = 2 if s.respond_to? :specification_version=
|
5
9
|
s.required_rubygems_version = Gem::Requirement.new('>= 0') if s.respond_to? :required_rubygems_version=
|
6
10
|
s.rubygems_version = '1.3.5'
|
7
11
|
|
8
12
|
s.name = 'ffaker'
|
9
|
-
s.version =
|
10
|
-
s.date = '2020-
|
13
|
+
s.version = FFaker::VERSION
|
14
|
+
s.date = '2020-05-24'
|
11
15
|
s.required_ruby_version = '>= 2.4'
|
12
16
|
|
13
17
|
s.license = 'MIT'
|
@@ -43,5 +47,6 @@ Gem::Specification.new do |s|
|
|
43
47
|
s.test_files = Dir['test/**/*']
|
44
48
|
|
45
49
|
s.add_development_dependency 'rake', '~> 13.0'
|
50
|
+
s.add_development_dependency 'rubocop'
|
46
51
|
s.add_development_dependency 'test-unit'
|
47
52
|
end
|
data/lib/ffaker.rb
CHANGED
@@ -1,8 +1,6 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
3
|
module FFaker
|
4
|
-
VERSION = '2.14.0'
|
5
|
-
|
6
4
|
require 'ffaker/utils/array_utils'
|
7
5
|
require 'ffaker/utils/module_utils'
|
8
6
|
|
@@ -57,10 +55,11 @@ module FFaker
|
|
57
55
|
autoload :AddressUK, 'ffaker/address_uk'
|
58
56
|
autoload :AddressUS, 'ffaker/address_us'
|
59
57
|
autoload :Airline, 'ffaker/airline'
|
60
|
-
autoload :Animal, 'ffaker/
|
61
|
-
autoload :AnimalCN, 'ffaker/
|
58
|
+
autoload :Animal, 'ffaker/animal'
|
59
|
+
autoload :AnimalCN, 'ffaker/animal_cn'
|
60
|
+
autoload :AnimalES, 'ffaker/animal_es'
|
62
61
|
autoload :AnimalPL, 'ffaker/animal_pl'
|
63
|
-
autoload :AnimalUS, 'ffaker/
|
62
|
+
autoload :AnimalUS, 'ffaker/animal_us'
|
64
63
|
autoload :Avatar, 'ffaker/avatar'
|
65
64
|
autoload :AWS, 'ffaker/aws'
|
66
65
|
autoload :BaconIpsum, 'ffaker/bacon_ipsum'
|
@@ -75,6 +74,7 @@ module FFaker
|
|
75
74
|
autoload :Company, 'ffaker/company'
|
76
75
|
autoload :CompanyCN, 'ffaker/company_cn'
|
77
76
|
autoload :CompanyIT, 'ffaker/company_it'
|
77
|
+
autoload :CompanyJA, 'ffaker/company_ja'
|
78
78
|
autoload :CompanySE, 'ffaker/company_se'
|
79
79
|
autoload :Conference, 'ffaker/conference'
|
80
80
|
autoload :CoursesFR, 'ffaker/courses'
|
@@ -106,6 +106,7 @@ module FFaker
|
|
106
106
|
autoload :IdentificationKr, 'ffaker/identification_kr'
|
107
107
|
autoload :IdentificationMX, 'ffaker/identification_mx'
|
108
108
|
autoload :IdentificationPL, 'ffaker/identification_pl'
|
109
|
+
autoload :IdentificationTW, 'ffaker/identification_tw'
|
109
110
|
autoload :Image, 'ffaker/image'
|
110
111
|
autoload :Internet, 'ffaker/internet'
|
111
112
|
autoload :InternetSE, 'ffaker/internet_se'
|
data/lib/ffaker/address_fr.rb
CHANGED
@@ -13,7 +13,7 @@ module FFaker
|
|
13
13
|
MOD = [' B', ' T', ' Q', ' BIS', ' TER', ' QUATER', '', '', '', ''].freeze
|
14
14
|
SEP = [', ', ' '].freeze
|
15
15
|
TYPE = %w[rue avenue av boulevard bd impasse].freeze
|
16
|
-
POSTAL_CODE_FORMATS = ['
|
16
|
+
POSTAL_CODE_FORMATS = ['#####', '97###', '2A###', '2B###'].freeze
|
17
17
|
|
18
18
|
def street_address
|
19
19
|
FFaker.numerify(fetch_sample(NUM)) +
|
@@ -34,5 +34,9 @@ module FFaker
|
|
34
34
|
def full_address
|
35
35
|
%(#{street_address}#{fetch_sample(SEP)}#{postal_code} #{fetch_sample(CITY)})
|
36
36
|
end
|
37
|
+
|
38
|
+
def region
|
39
|
+
fetch_sample(REGION)
|
40
|
+
end
|
37
41
|
end
|
38
42
|
end
|
data/lib/ffaker/address_nl.rb
CHANGED
File without changes
|
File without changes
|
File without changes
|
@@ -0,0 +1,24 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module FFaker
|
4
|
+
module CompanyJA
|
5
|
+
extend ModuleUtils
|
6
|
+
extend self
|
7
|
+
|
8
|
+
TYPES = %w[株式会社 有限会社].freeze
|
9
|
+
DETAILED_TYPES = %w[ホールディングス 建設 商業 書店 不動産 銀行 証券].freeze
|
10
|
+
POSITIONS = %w[会長 社長 部長 課長 係長 社員 契約社員 派遣社員 アルバイト インターン]
|
11
|
+
|
12
|
+
def name
|
13
|
+
case rand(0..2)
|
14
|
+
when 0 then "#{NameJA.last_name}#{fetch_sample(TYPES)}"
|
15
|
+
when 1 then "#{fetch_sample(TYPES)}#{NameJA.last_name}"
|
16
|
+
when 2 then "#{NameJA.last_name}#{fetch_sample(DETAILED_TYPES)}"
|
17
|
+
end
|
18
|
+
end
|
19
|
+
|
20
|
+
def position
|
21
|
+
fetch_sample(POSITIONS)
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
@@ -0,0 +1,27 @@
|
|
1
|
+
Alsace
|
2
|
+
Aquitaine
|
3
|
+
Auvergne
|
4
|
+
Basse-Normandie
|
5
|
+
Bourgogne
|
6
|
+
Bretagne
|
7
|
+
Centre
|
8
|
+
Champagne-Ardenne
|
9
|
+
Corse
|
10
|
+
Franche-Comté
|
11
|
+
Haute-Normandie
|
12
|
+
Île-de-France
|
13
|
+
Languedoc-Roussillon
|
14
|
+
Limousin
|
15
|
+
Lorraine
|
16
|
+
Midi-Pyrénées
|
17
|
+
Nord-Pas-de-Calais
|
18
|
+
Pays de la Loire
|
19
|
+
Picardie
|
20
|
+
Poitou-Charentes
|
21
|
+
Provence-Alpes-Côte d'Azur
|
22
|
+
Rhône-Alpes
|
23
|
+
Guadeloupe
|
24
|
+
Guyane
|
25
|
+
La Réunion
|
26
|
+
Martinique
|
27
|
+
Mayotte
|
@@ -0,0 +1,135 @@
|
|
1
|
+
Águila
|
2
|
+
Albatros
|
3
|
+
Alce
|
4
|
+
Alpaca
|
5
|
+
Anguila
|
6
|
+
Antílope
|
7
|
+
Ardilla
|
8
|
+
Armadillo
|
9
|
+
Arrendajo
|
10
|
+
Avestruz
|
11
|
+
Babuino
|
12
|
+
Bacalao
|
13
|
+
Ballena
|
14
|
+
Barracuda
|
15
|
+
Bisonte
|
16
|
+
Burro
|
17
|
+
Búfalo
|
18
|
+
Búfalo de agua
|
19
|
+
Búho
|
20
|
+
Caballo
|
21
|
+
Caballo de mar
|
22
|
+
Cabra
|
23
|
+
Cabra montés
|
24
|
+
Camello
|
25
|
+
Cangrejo
|
26
|
+
Canguro
|
27
|
+
Caracol
|
28
|
+
Caribú
|
29
|
+
Carnero
|
30
|
+
Castor
|
31
|
+
Cazón
|
32
|
+
Cebra
|
33
|
+
Cerdo
|
34
|
+
Cerdo hormiguero
|
35
|
+
Chacal
|
36
|
+
Chimpancé
|
37
|
+
Cisne
|
38
|
+
Coala
|
39
|
+
Cobra
|
40
|
+
Cocodrilo
|
41
|
+
Codorniz
|
42
|
+
Colibrí
|
43
|
+
Comadreja
|
44
|
+
Conejillo de indias
|
45
|
+
Conejo
|
46
|
+
Coyote
|
47
|
+
Cuervo
|
48
|
+
Delfín
|
49
|
+
Dugongo
|
50
|
+
Elefante
|
51
|
+
Emú
|
52
|
+
Erizo
|
53
|
+
Faisán
|
54
|
+
Flamenco
|
55
|
+
Gacela
|
56
|
+
Ganso
|
57
|
+
Garza
|
58
|
+
Gato
|
59
|
+
Gorila
|
60
|
+
Grua
|
61
|
+
Halcón
|
62
|
+
Hiena
|
63
|
+
Hormiga
|
64
|
+
Hurón
|
65
|
+
Hámster
|
66
|
+
Jabali
|
67
|
+
Jaguar
|
68
|
+
Lagarto
|
69
|
+
Langosta
|
70
|
+
Leopardo
|
71
|
+
León
|
72
|
+
León marino
|
73
|
+
Liebre
|
74
|
+
Llama
|
75
|
+
Lobo
|
76
|
+
Loro
|
77
|
+
Lémur
|
78
|
+
Mamut
|
79
|
+
Manatí
|
80
|
+
Mangosta
|
81
|
+
Mapache
|
82
|
+
Mariposa
|
83
|
+
Marsopa
|
84
|
+
Mono
|
85
|
+
Morsa
|
86
|
+
Murciélago
|
87
|
+
Musaraña
|
88
|
+
Narval
|
89
|
+
Nutria
|
90
|
+
Ñu
|
91
|
+
Oso
|
92
|
+
Oso hormiguero
|
93
|
+
Oso polar
|
94
|
+
Ostra
|
95
|
+
Oveja
|
96
|
+
Paloma
|
97
|
+
Panda
|
98
|
+
Pantera
|
99
|
+
Pato
|
100
|
+
Pavo
|
101
|
+
Pavo real
|
102
|
+
Pelícano
|
103
|
+
Perdiz
|
104
|
+
Perezoso
|
105
|
+
Perrito de las praderas
|
106
|
+
Perro
|
107
|
+
Pez
|
108
|
+
Pingüino
|
109
|
+
Pinzón
|
110
|
+
Pollo
|
111
|
+
Poni
|
112
|
+
Puerco espín
|
113
|
+
Pulpo
|
114
|
+
Pájaro
|
115
|
+
Rana
|
116
|
+
Rata
|
117
|
+
Ratón
|
118
|
+
Reno
|
119
|
+
Salamandra
|
120
|
+
Salmón
|
121
|
+
Sapo
|
122
|
+
Sello
|
123
|
+
Serpiente
|
124
|
+
Simio
|
125
|
+
Tiburón
|
126
|
+
Tigre
|
127
|
+
Topo
|
128
|
+
Tortuga
|
129
|
+
Tritón
|
130
|
+
Ualabi
|
131
|
+
Uombat
|
132
|
+
Yak
|
133
|
+
Zarigüeya
|
134
|
+
Zorrillo
|
135
|
+
Zorro
|
@@ -0,0 +1,23 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module FFaker
|
4
|
+
module IdentificationTW
|
5
|
+
extend ModuleUtils
|
6
|
+
extend self
|
7
|
+
|
8
|
+
AREA_CODE = { a: 10, b: 11, c: 12, d: 13, e: 14, f: 15, g: 16, h: 17, i: 34, j: 18, k: 19, l: 20, m: 21, n: 22, o: 35, p: 23, q: 24, r: 25, s: 26, t: 27, u: 28, v: 29, w: 30, x: 31, y: 32, z: 33 }.freeze
|
9
|
+
|
10
|
+
# Identity Card Number
|
11
|
+
# https://en.wikipedia.org/wiki/National_identification_card_(Taiwan)#Identity_card_number
|
12
|
+
def id
|
13
|
+
letter = FFaker.letterify('?')
|
14
|
+
code = AREA_CODE[letter.to_sym]
|
15
|
+
gender = fetch_sample([1, 2])
|
16
|
+
serial = FFaker.numerify("#######")
|
17
|
+
a, b, c, d, e, f, g, h, i, j = "#{code}#{gender}#{serial}".split(//).map(&:to_i)
|
18
|
+
|
19
|
+
checksum = (9 * a + b + 2 * c + 3 * d + 4 * e + 5 * f + 6 * g + 7 * h + 8 * i + 9 * j) % 10
|
20
|
+
"#{letter.upcase}#{gender}#{serial}#{checksum}"
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
data/lib/version.rb
ADDED
data/scripts/benchmark.rb
CHANGED
@@ -7,13 +7,15 @@ NAMES_COUNT = 10_000
|
|
7
7
|
def run(name)
|
8
8
|
Benchmark.bm do |rep|
|
9
9
|
rep.report("generating #{NAMES_COUNT} names (#{name})") do
|
10
|
-
mod == 'ffaker' ? FFaker : Faker
|
10
|
+
mod = name == 'ffaker' ? FFaker : Faker
|
11
11
|
NAMES_COUNT.times { mod::Name.name }
|
12
12
|
end
|
13
13
|
end
|
14
14
|
end
|
15
15
|
|
16
|
-
[
|
16
|
+
%w[faker ffaker].each do |gem_name|
|
17
17
|
require gem_name
|
18
|
-
|
18
|
+
|
19
|
+
fork { run(gem_name) }
|
20
|
+
Process.wait
|
19
21
|
end
|
data/test/test_address_fr.rb
CHANGED
data/test/test_address_nl.rb
CHANGED
@@ -0,0 +1,17 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'helper'
|
4
|
+
|
5
|
+
class TestAnimalsES < Test::Unit::TestCase
|
6
|
+
include DeterministicHelper
|
7
|
+
|
8
|
+
assert_methods_are_deterministic(FFaker::AnimalES, :common_name)
|
9
|
+
|
10
|
+
def setup
|
11
|
+
@tester = FFaker::AnimalES
|
12
|
+
end
|
13
|
+
|
14
|
+
def test_name
|
15
|
+
assert_include @tester::COMMON_NAMES, @tester.common_name
|
16
|
+
end
|
17
|
+
end
|
data/test/test_array_utils.rb
CHANGED
@@ -0,0 +1,28 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'helper'
|
4
|
+
|
5
|
+
class TestCompanyJA < Test::Unit::TestCase
|
6
|
+
include DeterministicHelper
|
7
|
+
|
8
|
+
assert_methods_are_deterministic(
|
9
|
+
FFaker::CompanyJA,
|
10
|
+
:name, :position
|
11
|
+
)
|
12
|
+
|
13
|
+
def setup
|
14
|
+
@tester = FFaker::CompanyJA
|
15
|
+
end
|
16
|
+
|
17
|
+
def test_name
|
18
|
+
assert_match(japanese_regex(''), @tester.name)
|
19
|
+
end
|
20
|
+
|
21
|
+
def test_position
|
22
|
+
assert_match(japanese_regex(''), @tester.position)
|
23
|
+
end
|
24
|
+
|
25
|
+
def japanese_regex(word)
|
26
|
+
/\A(?:\p{Hiragana}|\p{Katakana}|[ー-]|[一-龠々])+#{word}\z/
|
27
|
+
end
|
28
|
+
end
|
data/test/test_geolocation.rb
CHANGED
@@ -30,8 +30,8 @@ class TestGeolocation < Test::Unit::TestCase
|
|
30
30
|
|
31
31
|
new_coords = FFaker::Geolocation.boxed_coords(coords[0], coords[1])
|
32
32
|
|
33
|
-
assert (lat_min..lat_max).cover?new_coords[0]
|
34
|
-
assert (lon_min..lon_max).cover?new_coords[1]
|
33
|
+
assert (lat_min..lat_max).cover? new_coords[0]
|
34
|
+
assert (lon_min..lon_max).cover? new_coords[1]
|
35
35
|
end
|
36
36
|
end
|
37
37
|
end
|
@@ -0,0 +1,17 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'helper'
|
4
|
+
|
5
|
+
class TestFakerIdentificationTW < Test::Unit::TestCase
|
6
|
+
include DeterministicHelper
|
7
|
+
|
8
|
+
assert_methods_are_deterministic(FFaker::IdentificationTW, :id)
|
9
|
+
|
10
|
+
def setup
|
11
|
+
@tester = FFaker::IdentificationTW
|
12
|
+
end
|
13
|
+
|
14
|
+
def test_id
|
15
|
+
assert_match(/\A[A-Z][12]\d{8}\z/, @tester.id)
|
16
|
+
end
|
17
|
+
end
|
data/test/test_ssn_se.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ffaker
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.
|
4
|
+
version: 2.15.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- https://github.com/ffaker/ffaker/graphs/contributors
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2020-
|
12
|
+
date: 2020-05-24 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rake
|
@@ -25,6 +25,20 @@ dependencies:
|
|
25
25
|
- - "~>"
|
26
26
|
- !ruby/object:Gem::Version
|
27
27
|
version: '13.0'
|
28
|
+
- !ruby/object:Gem::Dependency
|
29
|
+
name: rubocop
|
30
|
+
requirement: !ruby/object:Gem::Requirement
|
31
|
+
requirements:
|
32
|
+
- - ">="
|
33
|
+
- !ruby/object:Gem::Version
|
34
|
+
version: '0'
|
35
|
+
type: :development
|
36
|
+
prerelease: false
|
37
|
+
version_requirements: !ruby/object:Gem::Requirement
|
38
|
+
requirements:
|
39
|
+
- - ">="
|
40
|
+
- !ruby/object:Gem::Version
|
41
|
+
version: '0'
|
28
42
|
- !ruby/object:Gem::Dependency
|
29
43
|
name: test-unit
|
30
44
|
requirement: !ruby/object:Gem::Requirement
|
@@ -84,10 +98,11 @@ files:
|
|
84
98
|
- lib/ffaker/address_uk.rb
|
85
99
|
- lib/ffaker/address_us.rb
|
86
100
|
- lib/ffaker/airline.rb
|
101
|
+
- lib/ffaker/animal.rb
|
102
|
+
- lib/ffaker/animal_cn.rb
|
103
|
+
- lib/ffaker/animal_es.rb
|
87
104
|
- lib/ffaker/animal_pl.rb
|
88
|
-
- lib/ffaker/
|
89
|
-
- lib/ffaker/animals_cn.rb
|
90
|
-
- lib/ffaker/animals_us.rb
|
105
|
+
- lib/ffaker/animal_us.rb
|
91
106
|
- lib/ffaker/avatar.rb
|
92
107
|
- lib/ffaker/aws.rb
|
93
108
|
- lib/ffaker/bacon_ipsum.rb
|
@@ -102,6 +117,7 @@ files:
|
|
102
117
|
- lib/ffaker/company.rb
|
103
118
|
- lib/ffaker/company_cn.rb
|
104
119
|
- lib/ffaker/company_it.rb
|
120
|
+
- lib/ffaker/company_ja.rb
|
105
121
|
- lib/ffaker/company_se.rb
|
106
122
|
- lib/ffaker/conference.rb
|
107
123
|
- lib/ffaker/courses.rb
|
@@ -130,6 +146,7 @@ files:
|
|
130
146
|
- lib/ffaker/data/address_fi/countries
|
131
147
|
- lib/ffaker/data/address_fi/street
|
132
148
|
- lib/ffaker/data/address_fr/city
|
149
|
+
- lib/ffaker/data/address_fr/region
|
133
150
|
- lib/ffaker/data/address_gr/city
|
134
151
|
- lib/ffaker/data/address_gr/region
|
135
152
|
- lib/ffaker/data/address_gr/street
|
@@ -215,6 +232,7 @@ files:
|
|
215
232
|
- lib/ffaker/data/airline/names_list
|
216
233
|
- lib/ffaker/data/animal/common_names
|
217
234
|
- lib/ffaker/data/animal_cn/common_names
|
235
|
+
- lib/ffaker/data/animal_es/common_names
|
218
236
|
- lib/ffaker/data/animal_pl/common_names
|
219
237
|
- lib/ffaker/data/animal_us/common_names
|
220
238
|
- lib/ffaker/data/aws/ec2_instance_type
|
@@ -460,6 +478,7 @@ files:
|
|
460
478
|
- lib/ffaker/identification_kr.rb
|
461
479
|
- lib/ffaker/identification_mx.rb
|
462
480
|
- lib/ffaker/identification_pl.rb
|
481
|
+
- lib/ffaker/identification_tw.rb
|
463
482
|
- lib/ffaker/image.rb
|
464
483
|
- lib/ffaker/internet.rb
|
465
484
|
- lib/ffaker/internet_se.rb
|
@@ -556,6 +575,7 @@ files:
|
|
556
575
|
- lib/ffaker/vehicle.rb
|
557
576
|
- lib/ffaker/venue.rb
|
558
577
|
- lib/ffaker/youtube.rb
|
578
|
+
- lib/version.rb
|
559
579
|
- scripts/benchmark.rb
|
560
580
|
- scripts/profile.sh
|
561
581
|
- scripts/profiling.rb
|
@@ -590,6 +610,7 @@ files:
|
|
590
610
|
- test/test_airline.rb
|
591
611
|
- test/test_animal.rb
|
592
612
|
- test/test_animal_cn.rb
|
613
|
+
- test/test_animal_es.rb
|
593
614
|
- test/test_animal_pl.rb
|
594
615
|
- test/test_animal_us.rb
|
595
616
|
- test/test_array_utils.rb
|
@@ -607,6 +628,7 @@ files:
|
|
607
628
|
- test/test_company.rb
|
608
629
|
- test/test_company_cn.rb
|
609
630
|
- test/test_company_it.rb
|
631
|
+
- test/test_company_ja.rb
|
610
632
|
- test/test_company_se.rb
|
611
633
|
- test/test_conference.rb
|
612
634
|
- test/test_course_mathematiques.rb
|
@@ -640,6 +662,7 @@ files:
|
|
640
662
|
- test/test_identification_es_mx.rb
|
641
663
|
- test/test_identification_kr.rb
|
642
664
|
- test/test_identification_pl.rb
|
665
|
+
- test/test_identification_tw.rb
|
643
666
|
- test/test_image.rb
|
644
667
|
- test/test_internet.rb
|
645
668
|
- test/test_internet_se.rb
|
@@ -756,174 +779,177 @@ signing_key:
|
|
756
779
|
specification_version: 2
|
757
780
|
summary: Ffaker generates dummy data.
|
758
781
|
test_files:
|
759
|
-
- test/
|
760
|
-
- test/
|
761
|
-
- test/
|
762
|
-
- test/
|
763
|
-
- test/
|
764
|
-
- test/
|
765
|
-
- test/
|
766
|
-
- test/
|
767
|
-
- test/
|
768
|
-
- test/
|
769
|
-
- test/
|
770
|
-
- test/
|
771
|
-
- test/
|
772
|
-
- test/test_music.rb
|
773
|
-
- test/test_lorem_ru.rb
|
774
|
-
- test/test_job.rb
|
775
|
-
- test/test_address_ch.rb
|
776
|
-
- test/test_address_br.rb
|
777
|
-
- test/test_venue.rb
|
778
|
-
- test/test_name_ph.rb
|
782
|
+
- test/test_identification.rb
|
783
|
+
- test/test_identification_es_cl.rb
|
784
|
+
- test/test_animal.rb
|
785
|
+
- test/test_name_cs.rb
|
786
|
+
- test/test_address_da.rb
|
787
|
+
- test/test_lorem_ja.rb
|
788
|
+
- test/test_units.rb
|
789
|
+
- test/test_phone_number_mx.rb
|
790
|
+
- test/test_units_metric.rb
|
791
|
+
- test/test_aws.rb
|
792
|
+
- test/test_products.rb
|
793
|
+
- test/test_boolean.rb
|
794
|
+
- test/helper.rb
|
779
795
|
- test/test_address_nl.rb
|
780
|
-
- test/
|
781
|
-
- test/
|
782
|
-
- test/
|
783
|
-
- test/
|
784
|
-
- test/
|
785
|
-
- test/
|
796
|
+
- test/test_address_br.rb
|
797
|
+
- test/test_dizzle_ipsum.rb
|
798
|
+
- test/test_html_ipsum.rb
|
799
|
+
- test/test_address_au.rb
|
800
|
+
- test/test_sports.rb
|
801
|
+
- test/test_phone_number_br.rb
|
802
|
+
- test/test_healthcare_ru.rb
|
786
803
|
- test/test_bank.rb
|
804
|
+
- test/test_healthcare_ipsum.rb
|
805
|
+
- test/test_image.rb
|
806
|
+
- test/test_identification_br.rb
|
807
|
+
- test/test_address_us.rb
|
808
|
+
- test/test_locale.rb
|
809
|
+
- test/test_food.rb
|
810
|
+
- test/test_animal_pl.rb
|
811
|
+
- test/test_phone_number_tw.rb
|
812
|
+
- test/test_movie.rb
|
813
|
+
- test/test_address_ch_fr.rb
|
814
|
+
- test/test_hipster_ipsum.rb
|
815
|
+
- test/test_address_uk.rb
|
816
|
+
- test/test_name_ja.rb
|
817
|
+
- test/test_gender_ja.rb
|
818
|
+
- test/test_address_id.rb
|
819
|
+
- test/test_identification_es_mx.rb
|
820
|
+
- test/test_bacon_ipsum.rb
|
821
|
+
- test/test_name_ua.rb
|
822
|
+
- test/test_name_gr.rb
|
823
|
+
- test/test_name_ar.rb
|
824
|
+
- test/test_gender_br.rb
|
825
|
+
- test/test_lorem.rb
|
826
|
+
- test/test_animal_us.rb
|
787
827
|
- test/test_phone_number_ua.rb
|
788
|
-
- test/
|
828
|
+
- test/test_music.rb
|
789
829
|
- test/test_lorem_fr.rb
|
790
|
-
- test/
|
830
|
+
- test/test_address_mx.rb
|
831
|
+
- test/test_name_se.rb
|
832
|
+
- test/test_code.rb
|
833
|
+
- test/test_lorem_cn.rb
|
834
|
+
- test/test_tweet.rb
|
835
|
+
- test/test_company_cn.rb
|
836
|
+
- test/test_venue.rb
|
837
|
+
- test/test_job_ja.rb
|
838
|
+
- test/test_vehicle.rb
|
839
|
+
- test/test_phone_number_fr.rb
|
840
|
+
- test/test_phone_number_nl.rb
|
791
841
|
- test/test_array_utils.rb
|
792
|
-
- test/helper.rb
|
793
|
-
- test/test_name_nb.rb
|
794
|
-
- test/test_name_ua.rb
|
795
|
-
- test/test_faker.rb
|
796
|
-
- test/test_identification_es_cl.rb
|
797
|
-
- test/test_name_de.rb
|
798
|
-
- test/test_sports.rb
|
799
|
-
- test/test_address_ca.rb
|
800
|
-
- test/test_name_nl.rb
|
801
|
-
- test/test_nato_alphabet.rb
|
802
|
-
- test/test_job_vn.rb
|
803
|
-
- test/test_gender_br.rb
|
804
|
-
- test/test_book.rb
|
805
842
|
- test/test_guid.rb
|
806
|
-
- test/
|
807
|
-
- test/
|
808
|
-
- test/
|
843
|
+
- test/test_name_es.rb
|
844
|
+
- test/test_job_kr.rb
|
845
|
+
- test/test_airline.rb
|
846
|
+
- test/test_gender.rb
|
847
|
+
- test/test_name_nb.rb
|
848
|
+
- test/test_name_th.rb
|
849
|
+
- test/test_color.rb
|
850
|
+
- test/test_skill.rb
|
851
|
+
- test/test_job_br.rb
|
852
|
+
- test/test_name_cn.rb
|
853
|
+
- test/test_phone_number.rb
|
854
|
+
- test/test_address_ua.rb
|
809
855
|
- test/test_name_sn.rb
|
810
|
-
- test/test_name_gr.rb
|
811
|
-
- test/test_address_kr.rb
|
812
|
-
- test/test_address_uk.rb
|
813
|
-
- test/test_movie.rb
|
814
856
|
- test/test_course_mathematiques.rb
|
815
|
-
- test/
|
816
|
-
- test/test_name_tw.rb
|
857
|
+
- test/test_name_id.rb
|
817
858
|
- test/test_name_mx.rb
|
859
|
+
- test/test_name_fr.rb
|
860
|
+
- test/test_job_cn.rb
|
861
|
+
- test/test_name_it.rb
|
862
|
+
- test/test_phone_number_ru.rb
|
818
863
|
- test/test_phone_number_da.rb
|
819
|
-
- test/
|
820
|
-
- test/
|
864
|
+
- test/test_name_da.rb
|
865
|
+
- test/test_phone_number_kr.rb
|
866
|
+
- test/test_time.rb
|
821
867
|
- test/test_currency.rb
|
822
|
-
- test/
|
823
|
-
- test/test_food.rb
|
824
|
-
- test/test_gender_jp.rb
|
825
|
-
- test/test_healthcare_ipsum.rb
|
826
|
-
- test/test_name_th_en.rb
|
827
|
-
- test/test_geolocation.rb
|
828
|
-
- test/test_job_fr.rb
|
829
|
-
- test/test_address_ch_fr.rb
|
830
|
-
- test/test_phone_number_id.rb
|
831
|
-
- test/test_phone_number.rb
|
832
|
-
- test/test_youtube.rb
|
833
|
-
- test/test_phone_number_nl.rb
|
834
|
-
- test/test_module_utils.rb
|
835
|
-
- test/test_vehicle.rb
|
836
|
-
- test/test_name_ar.rb
|
837
|
-
- test/test_boolean.rb
|
838
|
-
- test/test_job_kr.rb
|
839
|
-
- test/test_address_ua.rb
|
840
|
-
- test/test_lorem_kr.rb
|
868
|
+
- test/test_lorem_ar.rb
|
841
869
|
- test/test_company_it.rb
|
842
|
-
- test/
|
843
|
-
- test/
|
844
|
-
- test/
|
845
|
-
- test/
|
846
|
-
- test/
|
847
|
-
- test/test_address_se.rb
|
848
|
-
- test/test_airline.rb
|
849
|
-
- test/test_gender_ja.rb
|
850
|
-
- test/test_address_fr.rb
|
851
|
-
- test/test_lorem.rb
|
852
|
-
- test/test_address_in.rb
|
870
|
+
- test/test_units_english.rb
|
871
|
+
- test/test_ssn.rb
|
872
|
+
- test/test_cheesy_lingo.rb
|
873
|
+
- test/test_gender_jp.rb
|
874
|
+
- test/test_animal_cn.rb
|
853
875
|
- test/test_phone_number_pl.rb
|
854
|
-
- test/
|
855
|
-
- test/
|
856
|
-
- test/
|
857
|
-
- test/
|
858
|
-
- test/
|
859
|
-
- test/
|
876
|
+
- test/test_address_se.rb
|
877
|
+
- test/test_book.rb
|
878
|
+
- test/test_identification_tw.rb
|
879
|
+
- test/test_filesystem.rb
|
880
|
+
- test/test_youtube.rb
|
881
|
+
- test/test_name_ru.rb
|
882
|
+
- test/test_gender_pl.rb
|
883
|
+
- test/test_name_tw.rb
|
884
|
+
- test/test_name_ga.rb
|
860
885
|
- test/test_unique_utils.rb
|
861
|
-
- test/
|
862
|
-
- test/test_lorem_cn.rb
|
863
|
-
- test/test_address_ch_it.rb
|
864
|
-
- test/test_gender_kr.rb
|
865
|
-
- test/test_address_id.rb
|
866
|
-
- test/test_internet.rb
|
886
|
+
- test/test_geolocation.rb
|
867
887
|
- test/test_phone_number_sg.rb
|
868
|
-
- test/
|
869
|
-
- test/
|
870
|
-
- test/
|
871
|
-
- test/test_name_ja.rb
|
872
|
-
- test/test_company.rb
|
873
|
-
- test/test_name_cs.rb
|
874
|
-
- test/test_course_philosophie.rb
|
875
|
-
- test/test_address_da.rb
|
876
|
-
- test/test_company_se.rb
|
877
|
-
- test/test_lorem_ie.rb
|
878
|
-
- test/test_products.rb
|
879
|
-
- test/test_sport_pl.rb
|
880
|
-
- test/test_company_cn.rb
|
881
|
-
- test/test_address_us.rb
|
882
|
-
- test/test_job_ja.rb
|
883
|
-
- test/test_address_ch_de.rb
|
884
|
-
- test/test_name_id.rb
|
888
|
+
- test/test_phone_number_se.rb
|
889
|
+
- test/test_lorem_kr.rb
|
890
|
+
- test/test_phone_number_cu.rb
|
885
891
|
- test/test_address_ru.rb
|
886
|
-
- test/
|
887
|
-
- test/test_address_mx.rb
|
888
|
-
- test/test_name_kr.rb
|
889
|
-
- test/test_name_cn.rb
|
890
|
-
- test/test_healthcare_ru.rb
|
892
|
+
- test/test_faker.rb
|
891
893
|
- test/test_conference.rb
|
892
|
-
- test/
|
893
|
-
- test/
|
894
|
-
- test/
|
895
|
-
- test/
|
896
|
-
- test/test_phone_number_de.rb
|
897
|
-
- test/test_name_fr.rb
|
898
|
-
- test/test_color_ua.rb
|
899
|
-
- test/test_lorem_ar.rb
|
900
|
-
- test/test_identification_pl.rb
|
901
|
-
- test/test_units_english.rb
|
902
|
-
- test/test_identification_br.rb
|
903
|
-
- test/test_gender_cn.rb
|
904
|
-
- test/test_animal_pl.rb
|
905
|
-
- test/test_skill.rb
|
906
|
-
- test/test_lorem_pl.rb
|
907
|
-
- test/test_name_da.rb
|
908
|
-
- test/test_ssn_se.rb
|
909
|
-
- test/test_bacon_ipsum.rb
|
910
|
-
- test/test_phone_number_tw.rb
|
911
|
-
- test/test_string.rb
|
894
|
+
- test/test_address_sn.rb
|
895
|
+
- test/test_address_ch_it.rb
|
896
|
+
- test/test_gender_id.rb
|
897
|
+
- test/test_lorem_ua.rb
|
912
898
|
- test/test_address_de.rb
|
899
|
+
- test/test_name_de.rb
|
913
900
|
- test/test_address_gr.rb
|
914
|
-
- test/
|
915
|
-
- test/
|
916
|
-
- test/
|
917
|
-
- test/
|
918
|
-
- test/
|
919
|
-
- test/
|
920
|
-
- test/test_dizzle_ipsum.rb
|
921
|
-
- test/test_phone_number_cu.rb
|
922
|
-
- test/test_address.rb
|
901
|
+
- test/test_job_vn.rb
|
902
|
+
- test/test_gender_cn.rb
|
903
|
+
- test/test_address_kr.rb
|
904
|
+
- test/test_phone_number_au.rb
|
905
|
+
- test/test_animal_es.rb
|
906
|
+
- test/test_identification_kr.rb
|
923
907
|
- test/test_name.rb
|
924
|
-
- test/
|
925
|
-
- test/
|
926
|
-
- test/
|
927
|
-
- test/
|
908
|
+
- test/test_lorem_pl.rb
|
909
|
+
- test/test_lorem_ru.rb
|
910
|
+
- test/test_name_vn.rb
|
911
|
+
- test/test_internet_se.rb
|
912
|
+
- test/test_address_fr.rb
|
913
|
+
- test/test_identification_pl.rb
|
914
|
+
- test/test_name_br.rb
|
915
|
+
- test/test_phone_number_de.rb
|
916
|
+
- test/test_name_kr.rb
|
917
|
+
- test/test_color_ua.rb
|
918
|
+
- test/test_nato_alphabet.rb
|
919
|
+
- test/test_address_ja.rb
|
920
|
+
- test/test_address_ca.rb
|
921
|
+
- test/test_identification_es.rb
|
922
|
+
- test/test_job.rb
|
923
|
+
- test/test_internet.rb
|
924
|
+
- test/test_ssn_se.rb
|
925
|
+
- test/test_identification_co.rb
|
926
|
+
- test/test_education_cn.rb
|
927
|
+
- test/test_company_ja.rb
|
928
|
+
- test/test_course_philosophie.rb
|
929
|
+
- test/test_address_pl.rb
|
930
|
+
- test/test_name_kh.rb
|
931
|
+
- test/test_education.rb
|
932
|
+
- test/test_sport_pl.rb
|
933
|
+
- test/test_address_ch.rb
|
934
|
+
- test/test_name_ph.rb
|
935
|
+
- test/test_job_fr.rb
|
936
|
+
- test/test_lorem_ie.rb
|
937
|
+
- test/test_address_in.rb
|
938
|
+
- test/test_ssn_mx.rb
|
939
|
+
- test/test_avatar.rb
|
940
|
+
- test/test_name_pl.rb
|
941
|
+
- test/test_color_pl.rb
|
942
|
+
- test/test_address_fi.rb
|
943
|
+
- test/test_phone_number_id.rb
|
944
|
+
- test/test_name_th_en.rb
|
928
945
|
- test/test_phone_number_sn.rb
|
929
|
-
- test/
|
946
|
+
- test/test_company.rb
|
947
|
+
- test/test_address_ch_de.rb
|
948
|
+
- test/test_name_nl.rb
|
949
|
+
- test/test_address.rb
|
950
|
+
- test/test_sem_ver.rb
|
951
|
+
- test/test_gender_kr.rb
|
952
|
+
- test/test_sport_us.rb
|
953
|
+
- test/test_company_se.rb
|
954
|
+
- test/test_string.rb
|
955
|
+
- test/test_module_utils.rb
|