faker 3.5.1 → 3.5.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +118 -7
- data/README.md +76 -390
- data/lib/faker/books/lovecraft.rb +1 -1
- data/lib/faker/default/bank.rb +1 -5
- data/lib/faker/default/boolean.rb +2 -1
- data/lib/faker/default/code.rb +4 -0
- data/lib/faker/default/company.rb +2 -2
- data/lib/faker/default/driving_licence.rb +1 -1
- data/lib/faker/default/finance.rb +2 -2
- data/lib/faker/default/hipster.rb +1 -1
- data/lib/faker/default/html.rb +1 -1
- data/lib/faker/default/internet.rb +1 -1
- data/lib/faker/default/invoice.rb +2 -2
- data/lib/faker/default/json.rb +7 -2
- data/lib/faker/default/lorem.rb +1 -1
- data/lib/faker/default/markdown.rb +2 -2
- data/lib/faker/default/national_health_service.rb +1 -2
- data/lib/faker/default/placeholdit.rb +1 -1
- data/lib/faker/default/twitter.rb +194 -0
- data/lib/faker/default/types.rb +2 -2
- data/lib/faker/music/bossa_nova.rb +41 -0
- data/lib/faker/version.rb +1 -1
- data/lib/helpers/deprecator.rb +1 -1
- data/lib/locales/ar.yml +1602 -49
- data/lib/locales/de-CH.yml +31 -0
- data/lib/locales/ee.yml +2 -0
- data/lib/locales/en/cosmere.yml +1 -1
- data/lib/locales/en/elder_scrolls.yml +51 -52
- data/lib/locales/en/finance.yml +1 -1
- data/lib/locales/en/hobby.yml +0 -1
- data/lib/locales/en/overwatch.yml +1 -1
- data/lib/locales/en/rajnikanth.yml +1 -1
- data/lib/locales/en/restaurant.yml +1 -1
- data/lib/locales/en/street_fighter.yml +1 -1
- data/lib/locales/en-GB.yml +9 -7
- data/lib/locales/en-PAK.yml +24 -1
- data/lib/locales/fr/address.yml +761 -8
- data/lib/locales/ja/artist.yml +46 -0
- data/lib/locales/ja/book.yml +492 -3
- data/lib/locales/ja/lorem.yml +1 -1
- data/lib/locales/nl.yml +9 -1
- data/lib/locales/uk.yml +7 -7
- metadata +5 -7
- data/lib/faker/default/bossa_nova.rb +0 -33
data/README.md
CHANGED
|
@@ -1,18 +1,17 @@
|
|
|
1
|
-
![
|
|
1
|
+
# Faker [![Gem Version][version-badge]][rubygems] [![Build Status][github-actions-badge]][github-actions] [![Total Downloads][downloads-total]][rubygems] [![Downloads][downloads-badge]][rubygems]
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
3
|
+
<div align="center">
|
|
4
|
+
<img src="https://user-images.githubusercontent.com/36028424/40263395-4318481e-5b44-11e8-92e5-3dcc1ce169b3.png" width="400"/>
|
|
5
|
+
<p>Generate (almost) realistic fake data for testing, demos, and populating your database during development.</p>
|
|
6
|
+
</div>
|
|
7
7
|
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
and it was the original impetus for the creation of this gem.
|
|
8
|
+
[version-badge]: https://img.shields.io/gem/v/faker.svg
|
|
9
|
+
[rubygems]: https://rubygems.org/gems/faker
|
|
10
|
+
[github-actions-badge]: https://img.shields.io/github/actions/workflow/status/faker-ruby/faker/.github/workflows/ruby.yml?branch=main
|
|
11
|
+
[github-actions]: https://github.com/faker-ruby/faker/actions
|
|
12
|
+
[downloads-total]: https://img.shields.io/gem/dt/faker.svg
|
|
13
|
+
[downloads-badge]: https://img.shields.io/gem/dtv/faker.svg
|
|
14
|
+
[downloads-badge]: https://img.shields.io/gem/dtv/faker.svg
|
|
16
15
|
|
|
17
16
|
## Quick links
|
|
18
17
|
|
|
@@ -22,40 +21,19 @@ and it was the original impetus for the creation of this gem.
|
|
|
22
21
|
[rubydocs]: https://www.rubydoc.info/gems/faker/
|
|
23
22
|
[changelog]: CHANGELOG.md
|
|
24
23
|
|
|
25
|
-
##
|
|
24
|
+
## Features
|
|
26
25
|
|
|
27
|
-
-
|
|
28
|
-
-
|
|
26
|
+
- Internet: Email addresses, Passwords, Domains, etc.
|
|
27
|
+
- Date and Time: Travel back in time or to the future.
|
|
28
|
+
- Person: Names, Genders, Bios, Job titles, and more.
|
|
29
|
+
- Number add String: Random numbers and strings.
|
|
30
|
+
- Location: Addresses, Zip Codes, Street Names, States, and Countries.
|
|
31
|
+
- Finance: Account Details, Transactions, and Crypto Addresses.
|
|
32
|
+
- Localization - Customize faker with over 40 locales to generate realistic-looking Names, Addresses, and Phone Numbers.
|
|
29
33
|
|
|
30
|
-
|
|
31
|
-
[Computer und Kommunikation 4.5.2024, komplette Sendung]: https://www.deutschlandfunk.de/computer-und-kommunikation-4-5-2024-komplette-sendung-dlf-16492b03-100.html
|
|
34
|
+
> **Note** The generated names, addresses, emails, phone numbers, and/or other data might return valid information. Please be careful when using faker in your tests.
|
|
32
35
|
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
- [Faker](#faker)
|
|
36
|
-
- [Quick links](#quick-links)
|
|
37
|
-
- [Table of Contents](#table-of-contents)
|
|
38
|
-
- [Notes](#notes)
|
|
39
|
-
- [Getting Started](#getting-started)
|
|
40
|
-
- [Usage](#usage)
|
|
41
|
-
- [A note about the Generators versions](#a-note-about-the-generators-versions)
|
|
42
|
-
- [Ensuring unique values](#ensuring-unique-values)
|
|
43
|
-
- [Deterministic Random](#deterministic-random)
|
|
44
|
-
- [Customization](#customization)
|
|
45
|
-
- [Minitest and Faker \>= 2.22](#minitest-and-faker--222)
|
|
46
|
-
- [Generators](#generators)
|
|
47
|
-
- [Contributing](#contributing)
|
|
48
|
-
- [Versioning](#versioning)
|
|
49
|
-
- [License](#license)
|
|
50
|
-
|
|
51
|
-
### Notes
|
|
52
|
-
|
|
53
|
-
* While Faker generates data at random, returned values are not guaranteed to be unique by default.
|
|
54
|
-
To explicitly specify when you require unique values, see [Ensuring Unique Values](#ensuring-unique-values).
|
|
55
|
-
Values also can be deterministic if you use the deterministic feature, see [Deterministic Random](#deterministic-random)
|
|
56
|
-
* This is the `main` branch of Faker and may contain changes that are not yet released.
|
|
57
|
-
Please refer to the README of your version for the available methods.
|
|
58
|
-
The list of all versions is [available here](https://github.com/stympy/faker/releases).
|
|
36
|
+
For a complete list of the generators, see [Generators](./GENERATORS.md).
|
|
59
37
|
|
|
60
38
|
## Getting Started
|
|
61
39
|
|
|
@@ -69,49 +47,44 @@ Then run `bundle install`.
|
|
|
69
47
|
|
|
70
48
|
## Usage
|
|
71
49
|
|
|
72
|
-
Here are some examples of how to use Faker:
|
|
73
|
-
|
|
74
50
|
```ruby
|
|
75
51
|
require 'faker'
|
|
76
52
|
|
|
77
|
-
Faker::Name.name
|
|
78
|
-
|
|
79
|
-
Faker::
|
|
80
|
-
|
|
81
|
-
Faker::Markdown.emphasis
|
|
82
|
-
|
|
83
|
-
Faker::TvShows::RuPaul.queen #=> "Violet Chachki"
|
|
84
|
-
|
|
53
|
+
Faker::Name.name #=> "Christophe Bartell"
|
|
54
|
+
Faker::Internet.password #=> "Vg5mSvY1UeRg7"
|
|
55
|
+
Faker::Internet.email #=> "eliza@mann.test"
|
|
56
|
+
Faker::Address.full_address #=> "5479 William Way, East Sonnyhaven, LA 63637"
|
|
57
|
+
Faker::Markdown.emphasis #=> "Quo qui aperiam. Amet corrupti distinctio. Sit quia *dolor.*"
|
|
58
|
+
Faker::Lorem.paragraph #=> "Recusandae minima consequatur. Expedita sequi blanditiis. Ut fuga et."
|
|
85
59
|
Faker::Alphanumeric.alpha(number: 10) #=> "zlvubkrwga"
|
|
86
|
-
|
|
87
|
-
Faker::ProgrammingLanguage.name #=> "Ruby"
|
|
60
|
+
Faker::ProgrammingLanguage.name #=> "Ruby"
|
|
88
61
|
```
|
|
89
62
|
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
#### A note about the Generators versions
|
|
93
|
-
|
|
94
|
-
If you get a `uninitialized constant Faker::[some_class]` error, your version of
|
|
95
|
-
the gem is behind main.
|
|
96
|
-
|
|
97
|
-
To make sure that your gem is the one
|
|
98
|
-
documented here, change the line in your Gemfile to:
|
|
99
|
-
|
|
100
|
-
```ruby
|
|
101
|
-
gem 'faker', :git => 'https://github.com/faker-ruby/faker.git', :branch => 'main'
|
|
102
|
-
```
|
|
63
|
+
## Table of Contents
|
|
103
64
|
|
|
104
|
-
|
|
105
|
-
|
|
65
|
+
- [Faker ](#faker----)
|
|
66
|
+
- [Quick links](#quick-links)
|
|
67
|
+
- [Features](#features)
|
|
68
|
+
- [Getting Started](#getting-started)
|
|
69
|
+
- [Usage](#usage)
|
|
70
|
+
- [Table of Contents](#table-of-contents)
|
|
71
|
+
- [Notes](#notes)
|
|
72
|
+
- [Ensuring unique values](#ensuring-unique-values)
|
|
73
|
+
- [Deterministic Random](#deterministic-random)
|
|
74
|
+
- [Localization](#localization)
|
|
75
|
+
- [Minitest and Faker \>= 2.22](#minitest-and-faker--222)
|
|
76
|
+
- [Generators](#generators)
|
|
77
|
+
- [Contributing](#contributing)
|
|
78
|
+
- [Versioning](#versioning)
|
|
79
|
+
- [Inspiration](#inspiration)
|
|
80
|
+
- [In the media](#in-the-media)
|
|
81
|
+
- [License](#license)
|
|
106
82
|
|
|
107
|
-
|
|
108
|
-
# Faker::TvShows::ParksAndRec.character
|
|
83
|
+
### Notes
|
|
109
84
|
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
end
|
|
114
|
-
```
|
|
85
|
+
* While Faker generates data at random, returned values are not guaranteed to be unique by default. To explicitly specify when you require unique values, see [Ensuring Unique Values](#ensuring-unique-values).
|
|
86
|
+
* Values also can be deterministic if you use the deterministic feature, see [Deterministic Random](#deterministic-random).
|
|
87
|
+
* This is the `main` branch of Faker and may contain changes that are not yet released. The list of all versions is [available here](https://github.com/stympy/faker/releases).
|
|
115
88
|
|
|
116
89
|
### Ensuring unique values
|
|
117
90
|
|
|
@@ -127,7 +100,7 @@ exception may be raised. It is possible to clear the record of unique values
|
|
|
127
100
|
that have been returned, for example between tests.
|
|
128
101
|
|
|
129
102
|
```ruby
|
|
130
|
-
Faker::Name.unique.clear
|
|
103
|
+
Faker::Name.unique.clear # Clears used values for Faker::Name
|
|
131
104
|
Faker::UniqueGenerator.clear # Clears used values for all generators
|
|
132
105
|
```
|
|
133
106
|
|
|
@@ -136,7 +109,6 @@ collisions with the generated data (i.e: using FactoryBot with random and
|
|
|
136
109
|
manually set values).
|
|
137
110
|
|
|
138
111
|
```ruby
|
|
139
|
-
# Usage:
|
|
140
112
|
# Faker::<generator>.unique.exclude(method, arguments, list)
|
|
141
113
|
|
|
142
114
|
# Add 'azerty' and 'wxcvbn' to the string generator with 6 char length
|
|
@@ -150,18 +122,19 @@ to provide deterministic output of repeated method calls.
|
|
|
150
122
|
|
|
151
123
|
```ruby
|
|
152
124
|
Faker::Config.random = Random.new(42)
|
|
153
|
-
Faker::
|
|
154
|
-
Faker::
|
|
125
|
+
Faker::Lorem.word #=> "velit"
|
|
126
|
+
Faker::Lorem.word #=> "quisquam"
|
|
127
|
+
|
|
155
128
|
Faker::Config.random = Random.new(42)
|
|
156
|
-
Faker::
|
|
157
|
-
Faker::
|
|
129
|
+
Faker::Lorem.word #=> "velit"
|
|
130
|
+
Faker::Lorem.word #=> "quisquam"
|
|
158
131
|
|
|
159
|
-
Faker::Config.random = nil
|
|
160
|
-
Faker::Config.random.seed
|
|
161
|
-
Faker::
|
|
132
|
+
Faker::Config.random = nil # seeds the PRNG using default entropy sources
|
|
133
|
+
Faker::Config.random.seed #=> 185180369676275068918401850258677722187
|
|
134
|
+
Faker::Lorem.word #=> "ipsam"
|
|
162
135
|
```
|
|
163
136
|
|
|
164
|
-
###
|
|
137
|
+
### Localization
|
|
165
138
|
|
|
166
139
|
You may want Faker to print information depending on your location in the world.
|
|
167
140
|
To assist you in this, Faker uses the `I18n` gem to store strings and formats to
|
|
@@ -180,315 +153,16 @@ check out the [locales README](lib/locales/README.md).
|
|
|
180
153
|
|
|
181
154
|
### Minitest and Faker >= 2.22
|
|
182
155
|
|
|
183
|
-
To prevent Faker (version >= 2.22) from generating duplicate values when using Minitest,
|
|
156
|
+
To prevent Faker (version >= 2.22) from [generating duplicate values]((https://github.com/faker-ruby/faker/issues/2534)) when using Minitest,
|
|
184
157
|
you might need to add the following to the `test_helper.rb` or `rails_helper.rb` file:
|
|
185
158
|
|
|
186
159
|
```ruby
|
|
187
160
|
Faker::Config.random = Random.new
|
|
188
161
|
```
|
|
189
162
|
|
|
190
|
-
See [Issue #2534](https://github.com/faker-ruby/faker/issues/2534) for more details.
|
|
191
|
-
|
|
192
163
|
## Generators
|
|
193
164
|
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
**NOTE: Some of the generators below aren't released yet. If you want to use them, change the line in your gemfile to:**
|
|
197
|
-
|
|
198
|
-
```ruby
|
|
199
|
-
gem 'faker', :git => 'https://github.com/faker-ruby/faker.git', :branch => 'main'
|
|
200
|
-
```
|
|
201
|
-
|
|
202
|
-
<details>
|
|
203
|
-
<summary>Default</summary>
|
|
204
|
-
|
|
205
|
-
- [Faker::Address](doc/default/address.md)
|
|
206
|
-
- [Faker::Alphanumeric](doc/default/alphanumeric.md)
|
|
207
|
-
- [Faker::Ancient](doc/default/ancient.md)
|
|
208
|
-
- [Faker::App](doc/default/app.md)
|
|
209
|
-
- [Faker::Appliance](doc/default/appliance.md)
|
|
210
|
-
- [Faker::Artist](doc/default/artist.md)
|
|
211
|
-
- [Faker::Avatar](doc/default/avatar.md)
|
|
212
|
-
- [Faker::Bank](doc/default/bank.md)
|
|
213
|
-
- [Faker::Barcode](doc/default/barcode.md)
|
|
214
|
-
- [Faker::Beer](doc/default/beer.md)
|
|
215
|
-
- [Faker::Blood](doc/default/blood.md)
|
|
216
|
-
- [Faker::Boolean](doc/default/boolean.md)
|
|
217
|
-
- [Faker::BossaNova](doc/default/bossa_nova.md)
|
|
218
|
-
- [Faker::Business](doc/default/business.md)
|
|
219
|
-
- [Faker::Camera](doc/default/camera.md)
|
|
220
|
-
- [Faker::Cannabis](doc/default/cannabis.md)
|
|
221
|
-
- [Faker::ChileRut](doc/default/chile_rut.md)
|
|
222
|
-
- [Faker::ChuckNorris](doc/default/chuck_norris.md)
|
|
223
|
-
- [Faker::Code](doc/default/code.md)
|
|
224
|
-
- [Faker::Coffee](doc/default/coffee.md)
|
|
225
|
-
- [Faker::Coin](doc/default/coin.md)
|
|
226
|
-
- [Faker::Color](doc/default/color.md)
|
|
227
|
-
- [Faker::Commerce](doc/default/commerce.md)
|
|
228
|
-
- [Faker::Company](doc/default/company.md)
|
|
229
|
-
- [Faker::Compass](doc/default/compass.md)
|
|
230
|
-
- [Faker::Computer](doc/default/computer.md)
|
|
231
|
-
- [Faker::Construction](doc/default/construction.md)
|
|
232
|
-
- [Faker::Cosmere](doc/default/cosmere.md)
|
|
233
|
-
- [Faker::Crypto](doc/default/crypto.md)
|
|
234
|
-
- [Faker::CryptoCoin](doc/default/crypto_coin.md)
|
|
235
|
-
- [Faker::Currency](doc/default/currency.md)
|
|
236
|
-
- [Faker::Date](doc/default/date.md)
|
|
237
|
-
- [Faker::DcComics](doc/default/dc_comics.md)
|
|
238
|
-
- [Faker::Demographic](doc/default/demographic.md)
|
|
239
|
-
- [Faker::Dessert](doc/default/dessert.md)
|
|
240
|
-
- [Faker::Device](doc/default/device.md)
|
|
241
|
-
- [Faker::DrivingLicence](doc/default/driving_licence.md)
|
|
242
|
-
- [Faker::Drone](doc/drone/drone.md)
|
|
243
|
-
- [Faker::Educator](doc/default/educator.md)
|
|
244
|
-
- [Faker::ElectricalComponents](doc/default/electrical_components.md)
|
|
245
|
-
- [Faker::Emotion](doc/default/emotion.md)
|
|
246
|
-
- [Faker::Esport](doc/default/esport.md)
|
|
247
|
-
- [Faker::File](doc/default/file.md)
|
|
248
|
-
- [Faker::Finance](doc/default/finance.md)
|
|
249
|
-
- [Faker::Food](doc/default/food.md)
|
|
250
|
-
- [Faker::FunnyName](doc/default/funny_name.md)
|
|
251
|
-
- [Faker::Gender](doc/default/gender.md)
|
|
252
|
-
- [Faker::GreekPhilosophers](doc/default/greek_philosophers.md)
|
|
253
|
-
- [Faker::Hacker](doc/default/hacker.md)
|
|
254
|
-
- [Faker::Hipster](doc/default/hipster.md)
|
|
255
|
-
- [Faker::Hobby](doc/default/hobby.md)
|
|
256
|
-
- [Faker::House](doc/default/house.md)
|
|
257
|
-
- [Faker::IdNumber](doc/default/id_number.md)
|
|
258
|
-
- [Faker::IndustrySegments](doc/default/industry_segments.md)
|
|
259
|
-
- [Faker::Internet](doc/default/internet.md)
|
|
260
|
-
- [Faker::Invoice](doc/default/invoice.md)
|
|
261
|
-
- [Faker::Job](doc/default/job.md)
|
|
262
|
-
- [Faker::Json](doc/default/json.md)
|
|
263
|
-
- [Faker::Kpop](doc/default/kpop.md)
|
|
264
|
-
- [Faker::Lorem](doc/default/lorem.md)
|
|
265
|
-
- [Faker::LoremFlickr](doc/default/lorem_flickr.md)
|
|
266
|
-
- [Faker::Markdown](doc/default/markdown.md)
|
|
267
|
-
- [Faker::Marketing](doc/default/marketing.md)
|
|
268
|
-
- [Faker::Measurement](doc/default/measurement.md)
|
|
269
|
-
- [Faker::Military](doc/default/military.md)
|
|
270
|
-
- [Faker::Mountain](doc/default/mountain.md)
|
|
271
|
-
- [Faker::Name](doc/default/name.md)
|
|
272
|
-
- [Faker::Nation](doc/default/nation.md)
|
|
273
|
-
- [Faker::NatoPhoneticAlphabet](doc/default/nato_phonetic_alphabet.md)
|
|
274
|
-
- [Faker::NationalHealthService](doc/default/national_health_service.md)
|
|
275
|
-
- [Faker::Number](doc/default/number.md)
|
|
276
|
-
- [Faker::Omniauth](doc/default/omniauth.md)
|
|
277
|
-
- [Faker::PhoneNumber](doc/default/phone_number.md)
|
|
278
|
-
- [Faker::Placeholdit](doc/default/placeholdit.md)
|
|
279
|
-
- [Faker::ProgrammingLanguage](doc/default/programming_language.md)
|
|
280
|
-
- [Faker::Relationship](doc/default/relationship.md)
|
|
281
|
-
- [Faker::Restaurant](doc/default/restaurant.md)
|
|
282
|
-
- [Faker::Science](doc/default/science.md)
|
|
283
|
-
- [Faker::SlackEmoji](doc/default/slack_emoji.md)
|
|
284
|
-
- [Faker::Source](doc/default/source.md)
|
|
285
|
-
- [Faker::SouthAfrica](doc/default/south_africa.md)
|
|
286
|
-
- [Faker::Space](doc/default/space.md)
|
|
287
|
-
- [Faker::String](doc/default/string.md)
|
|
288
|
-
- [Faker::Stripe](doc/default/stripe.md)
|
|
289
|
-
- [Faker::Subscription](doc/default/subscription.md)
|
|
290
|
-
- [Faker::Superhero](doc/default/superhero.md)
|
|
291
|
-
- [Faker::Tea](doc/default/tea.md)
|
|
292
|
-
- [Faker::Team](doc/default/team.md)
|
|
293
|
-
- [Faker::Theater](doc/default/theater.md)
|
|
294
|
-
- [Faker::Time](doc/default/time.md)
|
|
295
|
-
- [Faker::Twitter](doc/default/twitter.md)
|
|
296
|
-
- [Faker::Types](doc/default/types.md)
|
|
297
|
-
- [Faker::University](doc/default/university.md)
|
|
298
|
-
- [Faker::Vehicle](doc/default/vehicle.md)
|
|
299
|
-
- [Faker::Verbs](doc/default/verbs.md)
|
|
300
|
-
- [Faker::VulnerabilityIdentifier](doc/default/vulnerability_identifier.md)
|
|
301
|
-
- [Faker::WorldCup](doc/default/world_cup.md)
|
|
302
|
-
</details>
|
|
303
|
-
|
|
304
|
-
<details>
|
|
305
|
-
<summary>Blockchain</summary>
|
|
306
|
-
|
|
307
|
-
- [Faker::Blockchain::Aeternity](doc/blockchain/aeternity.md)
|
|
308
|
-
- [Faker::Blockchain::Bitcoin](doc/blockchain/bitcoin.md)
|
|
309
|
-
- [Faker::Blockchain::Ethereum](doc/blockchain/ethereum.md)
|
|
310
|
-
- [Faker::Blockchain::Tezos](doc/blockchain/tezos.md)
|
|
311
|
-
</details>
|
|
312
|
-
|
|
313
|
-
<details>
|
|
314
|
-
<summary>Books</summary>
|
|
315
|
-
|
|
316
|
-
- [Faker::Book](doc/books/book.md)
|
|
317
|
-
- [Faker::Books::CultureSeries](doc/books/culture_series.md)
|
|
318
|
-
- [Faker::Books::Dune](doc/books/dune.md)
|
|
319
|
-
- [Faker::Books::Lovecraft](doc/books/lovecraft.md)
|
|
320
|
-
- [Faker::Books::TheKingkillerChronicle](doc/books/the_kingkiller_chronicle.md)
|
|
321
|
-
</details>
|
|
322
|
-
|
|
323
|
-
<details>
|
|
324
|
-
<summary>Fantasy</summary>
|
|
325
|
-
|
|
326
|
-
- [Faker::Fantasy::Tolkien](doc/fantasy/tolkien.md)
|
|
327
|
-
</details>
|
|
328
|
-
|
|
329
|
-
<details>
|
|
330
|
-
<summary>Travel</summary>
|
|
331
|
-
|
|
332
|
-
- [Faker:Travel::Airport](doc/travel/airport.md)
|
|
333
|
-
- [Faker:Travel::TrainStation](doc/travel/train_station.md)
|
|
334
|
-
</details>
|
|
335
|
-
|
|
336
|
-
<details>
|
|
337
|
-
<summary>Creature</summary>
|
|
338
|
-
|
|
339
|
-
- [Faker::Creature::Animal](doc/creature/animal.md)
|
|
340
|
-
- [Faker::Creature::Bird](doc/creature/bird.md)
|
|
341
|
-
- [Faker::Creature::Cat](doc/creature/cat.md)
|
|
342
|
-
- [Faker::Creature::Dog](doc/creature/dog.md)
|
|
343
|
-
- [Faker::Creature::Horse](doc/creature/horse.md)
|
|
344
|
-
</details>
|
|
345
|
-
|
|
346
|
-
<details>
|
|
347
|
-
<summary>Games</summary>
|
|
348
|
-
|
|
349
|
-
- [Faker::Game](doc/games/game.md)
|
|
350
|
-
- [Faker::Games::ClashOfClans](doc/games/clash_of_clans.md)
|
|
351
|
-
- [Faker::Games::DnD](doc/games/dnd.md)
|
|
352
|
-
- [Faker::Games::Dota](doc/games/dota.md)
|
|
353
|
-
- [Faker::Games::ElderScrolls](doc/games/elder_scrolls.md)
|
|
354
|
-
- [Faker::Games::Fallout](doc/games/fallout.md)
|
|
355
|
-
- [Faker::Games::FinalFantasyXIV](doc/games/final_fantasy_xiv.md)
|
|
356
|
-
- [Faker::Games::HalfLife](doc/games/half_life.md)
|
|
357
|
-
- [Faker::Games::Heroes](doc/games/heroes.md)
|
|
358
|
-
- [Faker::Games::HeroesOfTheStorm](doc/games/heroes_of_the_storm.md)
|
|
359
|
-
- [Faker::Games::LeagueOfLegends](doc/games/league_of_legends.md)
|
|
360
|
-
- [Faker::Games::Minecraft](doc/games/minecraft.md)
|
|
361
|
-
- [Faker::Games::Myst](doc/games/myst.md)
|
|
362
|
-
- [Faker::Games::Overwatch](doc/games/overwatch.md)
|
|
363
|
-
- [Faker::Games::Pokemon](doc/games/pokemon.md)
|
|
364
|
-
- [Faker::Games::SonicTheHedgehog](doc/games/sonic_the_hedgehog.md)
|
|
365
|
-
- [Faker::Games::StreetFighter](doc/games/street_fighter.md)
|
|
366
|
-
- [Faker::Games::SuperMario](doc/games/super_mario.md)
|
|
367
|
-
- [Faker::Games::SuperSmashBros](doc/games/super_smash_bros.md)
|
|
368
|
-
- [Faker::Games::Touhou](doc/games/touhou.md)
|
|
369
|
-
- [Faker::Games::WarhammerFantasy](doc/games/warhammer_fantasy.md)
|
|
370
|
-
- [Faker::Games::Witcher](doc/games/witcher.md)
|
|
371
|
-
- [Faker::Games::WorldOfWarcraft](doc/games/world_of_warcraft.md)
|
|
372
|
-
- [Faker::Games::Zelda](doc/games/zelda.md)
|
|
373
|
-
</details>
|
|
374
|
-
|
|
375
|
-
<details>
|
|
376
|
-
<summary>Japanese Media</summary>
|
|
377
|
-
|
|
378
|
-
- [Faker::JapaneseMedia::CowboyBebop](doc/japanese_media/cowboy_bebop.md)
|
|
379
|
-
- [Faker::JapaneseMedia::DragonBall](doc/japanese_media/dragon_ball.md)
|
|
380
|
-
- [Faker::JapaneseMedia::OnePiece](doc/japanese_media/one_piece.md)
|
|
381
|
-
- [Faker::JapaneseMedia::StudioGhibli](doc/japanese_media/studio_ghibli.md)
|
|
382
|
-
- [Faker::JapaneseMedia::SwordArtOnline](doc/japanese_media/sword_art_online.md)
|
|
383
|
-
- [Faker::JapaneseMedia::Naruto](doc/japanese_media/naruto.md)
|
|
384
|
-
- [Faker::JapaneseMedia::Doraemon](doc/japanese_media/doraemon.md)
|
|
385
|
-
- [Faker::JapaneseMedia::Conan](doc/japanese_media/conan.md)
|
|
386
|
-
- [Faker::JapaneseMedia::FullmetalAlchemistBrotherhood](doc/japanese_media/fullmetal_alchemist_brotherhood.md)
|
|
387
|
-
</details>
|
|
388
|
-
|
|
389
|
-
<details>
|
|
390
|
-
<summary>Movies</summary>
|
|
391
|
-
|
|
392
|
-
- [Faker::Movie](doc/movies/movie.md)
|
|
393
|
-
- [Faker::Movies::Avatar](doc/movies/avatar.md)
|
|
394
|
-
- [Faker::Movies::BackToTheFuture](doc/movies/back_to_the_future.md)
|
|
395
|
-
- [Faker::Movies::Departed](doc/movies/departed.md)
|
|
396
|
-
- [Faker::Movies::Ghostbusters](doc/movies/ghostbusters.md)
|
|
397
|
-
- [Faker::Movies::HarryPotter](doc/movies/harry_potter.md)
|
|
398
|
-
- [Faker::Movies::HitchhikersGuideToTheGalaxy](doc/movies/hitchhikers_guide_to_the_galaxy.md)
|
|
399
|
-
- [Faker::Movies::Hobbit](doc/movies/hobbit.md)
|
|
400
|
-
- [Faker::Movies::HowToTrainYourDragon](doc/movies/how_to_train_your_dragon.md)
|
|
401
|
-
- [Faker::Movies::Lebowski](doc/movies/lebowski.md)
|
|
402
|
-
- [Faker::Movies::LordOfTheRings](doc/movies/lord_of_the_rings.md)
|
|
403
|
-
- [Faker::Movies::PrincessBride](doc/movies/princess_bride.md)
|
|
404
|
-
- [Faker::Movies::StarWars](doc/movies/star_wars.md)
|
|
405
|
-
- [Faker::Movies::TRON](doc/movies/tron.md)
|
|
406
|
-
- [Faker::Movies::VForVendetta](doc/movies/v_for_vendetta.md)
|
|
407
|
-
</details>
|
|
408
|
-
|
|
409
|
-
<details>
|
|
410
|
-
<summary>Music</summary>
|
|
411
|
-
|
|
412
|
-
- [Faker::Music](doc/music/music.md)
|
|
413
|
-
- [Faker::Music::GratefulDead](doc/music/grateful_dead.md)
|
|
414
|
-
- [Faker::Music::Hiphop](doc/music/hiphop.md)
|
|
415
|
-
- [Faker::Music::Opera](doc/music/opera.md)
|
|
416
|
-
- [Faker::Music::PearlJam](doc/music/pearl_jam.md)
|
|
417
|
-
- [Faker::Music::Phish](doc/music/phish.md)
|
|
418
|
-
- [Faker::Music::Prince](doc/music/prince.md)
|
|
419
|
-
- [Faker::Music::RockBand](doc/music/rock_band.md)
|
|
420
|
-
- [Faker::Music::Rush](doc/music/rush.md)
|
|
421
|
-
- [Faker::Music::SmashingPumpkins](doc/music/smashing_pumpkins.md)
|
|
422
|
-
- [Faker::Music::UmphreysMcgee](doc/music/umphreys_mcgee.md)
|
|
423
|
-
</details>
|
|
424
|
-
|
|
425
|
-
<details>
|
|
426
|
-
<summary>Quotes</summary>
|
|
427
|
-
|
|
428
|
-
- [Faker::Quote](doc/quotes/quote.md)
|
|
429
|
-
- [Faker::Quotes::Chiquito](doc/quotes/chiquito.md)
|
|
430
|
-
- [Faker::Quotes::Rajnikanth](doc/quotes/rajnikanth.md)
|
|
431
|
-
- [Faker::Quotes::Shakespeare](doc/quotes/shakespeare.md)
|
|
432
|
-
</details>
|
|
433
|
-
|
|
434
|
-
<details>
|
|
435
|
-
<summary>Sports</summary>
|
|
436
|
-
|
|
437
|
-
- [Faker::Sport](doc/sports/sport.md)
|
|
438
|
-
- [Faker::Sports::Basketball](doc/sports/basketball.md)
|
|
439
|
-
- [Faker::Sports::Chess](doc/sports/chess.md)
|
|
440
|
-
- [Faker::Sports::Football](doc/sports/football.md)
|
|
441
|
-
- [Faker::Sports::Mountaineering](doc/sports/mountaineering.md)
|
|
442
|
-
- [Faker::Sports::Volleyball](doc/sports/volleyball.md)
|
|
443
|
-
</details>
|
|
444
|
-
|
|
445
|
-
<details>
|
|
446
|
-
<summary>Tv Shows</summary>
|
|
447
|
-
|
|
448
|
-
- [Faker::TvShows::AquaTeenHungerForce](doc/tv_shows/aqua_teen_hunger_force.md)
|
|
449
|
-
- [Faker::TvShows::Archer](doc/tv_shows/archer.md)
|
|
450
|
-
- [Faker::TvShows::BigBangTheory](doc/tv_shows/big_bang_theory.md)
|
|
451
|
-
- [Faker::TvShows::BojackHorseman](doc/tv_shows/bojack_horseman.md)
|
|
452
|
-
- [Faker::TvShows::BreakingBad](doc/tv_shows/breaking_bad.md)
|
|
453
|
-
- [Faker::TvShows::BrooklynNineNine](doc/tv_shows/brooklyn_nine_nine.md)
|
|
454
|
-
- [Faker::TvShows::Buffy](doc/tv_shows/buffy.md)
|
|
455
|
-
- [Faker::TvShows::Community](doc/tv_shows/community.md)
|
|
456
|
-
- [Faker::TvShows::DrWho](doc/tv_shows/dr_who.md)
|
|
457
|
-
- [Faker::TvShows::DumbAndDumber](doc/tv_shows/dumb_and_dumber.md)
|
|
458
|
-
- [Faker::TvShows::FamilyGuy](doc/tv_shows/family_guy.md)
|
|
459
|
-
- [Faker::TvShows::FinalSpace](doc/tv_shows/final_space.md)
|
|
460
|
-
- [Faker::TvShows::Friends](doc/tv_shows/friends.md)
|
|
461
|
-
- [Faker::TvShows::GameOfThrones](doc/tv_shows/game_of_thrones.md)
|
|
462
|
-
- [Faker::TvShows::HeyArnold](doc/tv_shows/hey_arnold.md)
|
|
463
|
-
- [Faker::TvShows::HowIMetYourMother](doc/tv_shows/how_i_met_your_mother.md)
|
|
464
|
-
- [Faker::TvShows::MichaelScott](doc/tv_shows/michael_scott.md)
|
|
465
|
-
- [Faker::TvShows::NewGirl](doc/tv_shows/new_girl.md)
|
|
466
|
-
- [Faker::TvShows::ParksAndRec](doc/tv_shows/parks_and_rec.md)
|
|
467
|
-
- [Faker::TvShows::RickAndMorty](doc/tv_shows/rick_and_morty.md)
|
|
468
|
-
- [Faker::TvShows::RuPaul](doc/tv_shows/rupaul.md)
|
|
469
|
-
- [Faker::TvShows::Seinfeld](doc/tv_shows/seinfeld.md)
|
|
470
|
-
- [Faker::TvShows::SiliconValley](doc/tv_shows/silicon_valley.md)
|
|
471
|
-
- [Faker::TvShows::Simpsons](doc/tv_shows/simpsons.md)
|
|
472
|
-
- [Faker::TvShows::SouthPark](doc/tv_shows/south_park.md)
|
|
473
|
-
- [Faker::TvShows::Spongebob](doc/tv_shows/spongebob.md)
|
|
474
|
-
- [Faker::TvShows::StarTrek](doc/tv_shows/star_trek.md)
|
|
475
|
-
- [Faker::TvShows::Stargate](doc/tv_shows/stargate.md)
|
|
476
|
-
- [Faker::TvShows::StrangerThings](doc/tv_shows/stranger_things.md)
|
|
477
|
-
- [Faker::TvShows::Suits](doc/tv_shows/suits.md)
|
|
478
|
-
- [Faker::TvShows::Supernatural](doc/tv_shows/supernatural.md)
|
|
479
|
-
- [Faker::TvShows::TheExpanse](doc/tv_shows/the_expanse.md)
|
|
480
|
-
- [Faker::TvShows::TheFreshPrinceOfBelAir](doc/tv_shows/the_fresh_prince_of_bel_air.md)
|
|
481
|
-
- [Faker::TvShows::TheITCrowd](doc/tv_shows/the_it_crowd.md)
|
|
482
|
-
- [Faker::TvShows::TheThickOfIt](doc/tv_shows/the_thick_of_it.md)
|
|
483
|
-
- [Faker::TvShows::TwinPeaks](doc/tv_shows/twin_peaks.md)
|
|
484
|
-
- [Faker::TvShows::VentureBros](doc/tv_shows/venture_bros.md)
|
|
485
|
-
</details>
|
|
486
|
-
|
|
487
|
-
<details>
|
|
488
|
-
<summary>Locations</summary>
|
|
489
|
-
|
|
490
|
-
- [Faker::Locations::Australia](doc/locations/australia.md)
|
|
491
|
-
</details>
|
|
165
|
+
To see the full list, check out the [GENERATORS](./GENERATORS.md) document.
|
|
492
166
|
|
|
493
167
|
## Contributing
|
|
494
168
|
|
|
@@ -499,7 +173,7 @@ instructions on setting up the repo on your machine, opening bug reports, unders
|
|
|
499
173
|
and creating a good pull request.
|
|
500
174
|
|
|
501
175
|
There is a [Discord channel](https://discord.gg/RMumTwB) to discuss anything
|
|
502
|
-
regarding improvements or feature requests.
|
|
176
|
+
regarding improvements or feature requests. This is not actively monitored by the current maintainers.
|
|
503
177
|
|
|
504
178
|
Thank you, contributors!
|
|
505
179
|
|
|
@@ -507,6 +181,18 @@ Thank you, contributors!
|
|
|
507
181
|
|
|
508
182
|
Faker follows Semantic Versioning 2.0 as defined at https://semver.org.
|
|
509
183
|
|
|
184
|
+
## Inspiration
|
|
185
|
+
|
|
186
|
+
Faker was inspired by [Perl's Data::Faker library](https://metacpan.org/pod/Data::Faker).
|
|
187
|
+
|
|
188
|
+
## In the media
|
|
189
|
+
|
|
190
|
+
- 📰 [With Great Humor Comes Great Developer Engagement] - KTH Royal Institute of Technology research
|
|
191
|
+
- 🎧 [Computer und Kommunikation 4.5.2024, komplette Sendung] - Deutschland Funk Radio Interview
|
|
192
|
+
|
|
193
|
+
[With Great Humor Comes Great Developer Engagement]: https://arxiv.org/pdf/2312.01680
|
|
194
|
+
[Computer und Kommunikation 4.5.2024, komplette Sendung]: https://www.deutschlandfunk.de/computer-und-kommunikation-4-5-2024-komplette-sendung-dlf-16492b03-100.html
|
|
195
|
+
|
|
510
196
|
## License
|
|
511
197
|
|
|
512
198
|
This code is free to use under the terms of the MIT license.
|
data/lib/faker/default/bank.rb
CHANGED
data/lib/faker/default/code.rb
CHANGED
|
@@ -168,6 +168,7 @@ module Faker
|
|
|
168
168
|
|
|
169
169
|
# Reporting body identifier
|
|
170
170
|
RBI = %w[01 10 30 33 35 44 45 49 50 51 52 53 54 86 91 98 99].freeze
|
|
171
|
+
private_constant :RBI
|
|
171
172
|
|
|
172
173
|
def generate_imei
|
|
173
174
|
str = Array.new(15, 0)
|
|
@@ -269,7 +270,10 @@ module Faker
|
|
|
269
270
|
end
|
|
270
271
|
|
|
271
272
|
EAN_CHECK_DIGIT8 = [3, 1, 3, 1, 3, 1, 3].freeze
|
|
273
|
+
private_constant :EAN_CHECK_DIGIT8
|
|
274
|
+
|
|
272
275
|
EAN_CHECK_DIGIT13 = [1, 3, 1, 3, 1, 3, 1, 3, 1, 3, 1, 3].freeze
|
|
276
|
+
private_constant :EAN_CHECK_DIGIT13
|
|
273
277
|
|
|
274
278
|
def rut_verificator_digit(rut)
|
|
275
279
|
total = rut.to_s.rjust(8, '0').chars.zip(%w[3 2 7 6 5 4 3 2]).collect { |a, b| a.to_i * b.to_i }.inject(:+)
|
|
@@ -494,7 +494,7 @@ module Faker
|
|
|
494
494
|
# Construct taxpayer number
|
|
495
495
|
gen.group(name: :taxpayer_number) do |g_|
|
|
496
496
|
g_.letter(length: 3, ranges: ['A'..'Z'])
|
|
497
|
-
g_.letter(length: 1, ranges: [%w[A B C F G H L J P T K]]
|
|
497
|
+
g_.letter(length: 1, ranges: [%w[A B C F G H L J P T K]])
|
|
498
498
|
g_.letter(length: 1, ranges: ['A'..'Z'])
|
|
499
499
|
g_.int(length: 4, ranges: [0..9999])
|
|
500
500
|
g_.letter(length: 1, ranges: ['A'..'Z'])
|
|
@@ -591,7 +591,7 @@ module Faker
|
|
|
591
591
|
|
|
592
592
|
def weight_sum(array, weights)
|
|
593
593
|
sum = 0
|
|
594
|
-
(0..weights.size - 1).each do |index|
|
|
594
|
+
(0..(weights.size - 1)).each do |index|
|
|
595
595
|
sum += (array[index] * weights[index])
|
|
596
596
|
end
|
|
597
597
|
sum
|
|
@@ -97,11 +97,11 @@ module Faker
|
|
|
97
97
|
##
|
|
98
98
|
# Returns a random condominium fiscal code.
|
|
99
99
|
#
|
|
100
|
-
# @param country [String] Two capital letter country code to use for the
|
|
100
|
+
# @param country [String] Two capital letter country code to use for the condominium fiscal code number.
|
|
101
101
|
# @return [String]
|
|
102
102
|
#
|
|
103
103
|
# @example
|
|
104
|
-
# Faker::Finance.condominium_fiscal_code #=> "
|
|
104
|
+
# Faker::Finance.condominium_fiscal_code #=> "01234567890"
|
|
105
105
|
#
|
|
106
106
|
# @faker.version next
|
|
107
107
|
def condominium_fiscal_code(country: 'IT')
|
data/lib/faker/default/html.rb
CHANGED
|
@@ -187,7 +187,7 @@ module Faker
|
|
|
187
187
|
def random(exclude: [])
|
|
188
188
|
method_list = available_methods
|
|
189
189
|
exclude.each { |ex| method_list.delete_if { |meth| meth == ex.to_sym } }
|
|
190
|
-
send(method_list[Faker::Config.random.rand(0..method_list.length - 1)])
|
|
190
|
+
send(method_list[Faker::Config.random.rand(0..(method_list.length - 1))])
|
|
191
191
|
end
|
|
192
192
|
|
|
193
193
|
##
|