ffaker 1.32.1 → 2.0.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 +35 -23
- data/README.md +3 -3
- data/Rakefile +20 -0
- data/ffaker.gemspec +2 -2
- data/lib/ffaker.rb +2 -2
- data/lib/ffaker/address.rb +9 -9
- data/lib/ffaker/address_au.rb +3 -3
- data/lib/ffaker/address_br.rb +3 -3
- data/lib/ffaker/address_ca.rb +3 -3
- data/lib/ffaker/address_da.rb +3 -3
- data/lib/ffaker/address_de.rb +3 -3
- data/lib/ffaker/address_fi.rb +4 -4
- data/lib/ffaker/address_fr.rb +5 -5
- data/lib/ffaker/address_mx.rb +3 -3
- data/lib/ffaker/address_nl.rb +3 -3
- data/lib/ffaker/address_se.rb +4 -4
- data/lib/ffaker/address_sn.rb +2 -2
- data/lib/ffaker/address_uk.rb +3 -3
- data/lib/ffaker/address_us.rb +3 -3
- data/lib/ffaker/bacon_ipsum.rb +1 -1
- data/lib/ffaker/boolean.rb +1 -1
- data/lib/ffaker/color.rb +1 -1
- data/lib/ffaker/company.rb +1 -1
- data/lib/ffaker/company_it.rb +1 -1
- data/lib/ffaker/company_se.rb +1 -1
- data/lib/ffaker/conference.rb +1 -1
- data/lib/ffaker/courses.rb +1 -1
- data/lib/ffaker/currency.rb +1 -1
- data/lib/ffaker/dizzle_ipsum.rb +1 -1
- data/lib/ffaker/education.rb +1 -1
- data/lib/ffaker/food.rb +1 -1
- data/lib/ffaker/gender.rb +1 -1
- data/lib/ffaker/gender_cn.rb +1 -1
- data/lib/ffaker/gender_kr.rb +1 -1
- data/lib/ffaker/geolocation.rb +1 -1
- data/lib/ffaker/guid.rb +2 -2
- data/lib/ffaker/healthcare_ipsum.rb +1 -1
- data/lib/ffaker/hipster_ipsum.rb +1 -1
- data/lib/ffaker/html_ipsum.rb +9 -9
- data/lib/ffaker/identification.rb +3 -3
- data/lib/ffaker/identification_es.rb +1 -1
- data/lib/ffaker/identification_es_cl.rb +1 -1
- data/lib/ffaker/identification_es_co.rb +2 -2
- data/lib/ffaker/identification_mx.rb +1 -1
- data/lib/ffaker/internet.rb +2 -2
- data/lib/ffaker/internet_se.rb +2 -2
- data/lib/ffaker/job.rb +1 -1
- data/lib/ffaker/job_fr.rb +1 -1
- data/lib/ffaker/job_ja.rb +1 -1
- data/lib/ffaker/job_kr.rb +1 -1
- data/lib/ffaker/locale.rb +1 -1
- data/lib/ffaker/lorem.rb +1 -1
- data/lib/ffaker/lorem_ar.rb +1 -1
- data/lib/ffaker/lorem_cn.rb +1 -1
- data/lib/ffaker/lorem_fr.rb +1 -1
- data/lib/ffaker/lorem_kr.rb +1 -1
- data/lib/ffaker/movie.rb +7 -7
- data/lib/ffaker/name.rb +1 -1
- data/lib/ffaker/name_br.rb +1 -1
- data/lib/ffaker/name_cn.rb +1 -1
- data/lib/ffaker/name_cs.rb +6 -6
- data/lib/ffaker/name_da.rb +2 -2
- data/lib/ffaker/name_de.rb +2 -2
- data/lib/ffaker/name_fr.rb +1 -1
- data/lib/ffaker/name_ga.rb +1 -1
- data/lib/ffaker/name_it.rb +1 -1
- data/lib/ffaker/name_ja.rb +1 -1
- data/lib/ffaker/name_kr.rb +1 -1
- data/lib/ffaker/name_mx.rb +2 -2
- data/lib/ffaker/name_nb.rb +2 -2
- data/lib/ffaker/name_nl.rb +2 -2
- data/lib/ffaker/name_ph.rb +2 -2
- data/lib/ffaker/name_ru.rb +7 -7
- data/lib/ffaker/name_se.rb +2 -2
- data/lib/ffaker/name_sn.rb +1 -1
- data/lib/ffaker/name_th.rb +1 -1
- data/lib/ffaker/name_vn.rb +1 -1
- data/lib/ffaker/nato_alphabet.rb +1 -1
- data/lib/ffaker/phone_number.rb +3 -3
- data/lib/ffaker/phone_number_au.rb +7 -7
- data/lib/ffaker/phone_number_cu.rb +12 -14
- data/lib/ffaker/phone_number_da.rb +3 -3
- data/lib/ffaker/phone_number_de.rb +4 -4
- data/lib/ffaker/phone_number_fr.rb +3 -3
- data/lib/ffaker/phone_number_it.rb +2 -2
- data/lib/ffaker/phone_number_kr.rb +3 -3
- data/lib/ffaker/phone_number_mx.rb +7 -7
- data/lib/ffaker/phone_number_nl.rb +5 -5
- data/lib/ffaker/phone_number_se.rb +5 -5
- data/lib/ffaker/phone_number_sg.rb +9 -9
- data/lib/ffaker/phone_number_sn.rb +5 -5
- data/lib/ffaker/product.rb +1 -1
- data/lib/ffaker/skill.rb +1 -1
- data/lib/ffaker/ssn.rb +2 -2
- data/lib/ffaker/ssn_mx.rb +7 -7
- data/lib/ffaker/ssn_se.rb +1 -1
- data/lib/ffaker/string.rb +1 -1
- data/lib/ffaker/time.rb +1 -1
- data/lib/ffaker/unit.rb +1 -1
- data/lib/ffaker/unit_english.rb +2 -2
- data/lib/ffaker/unit_metric.rb +2 -2
- data/lib/ffaker/utils/array_utils.rb +1 -1
- data/lib/ffaker/utils/module_utils.rb +3 -3
- data/lib/ffaker/vehicle.rb +3 -3
- data/lib/ffaker/venue.rb +1 -1
- data/scripts/benchmark.rb +2 -2
- data/scripts/profiling.rb +1 -1
- data/test/test_address.rb +21 -21
- data/test/test_address_au.rb +17 -17
- data/test/test_address_br.rb +7 -7
- data/test/test_address_ca.rb +4 -4
- data/test/test_address_da.rb +9 -9
- data/test/test_address_de.rb +5 -5
- data/test/test_address_fi.rb +6 -6
- data/test/test_address_mx.rb +5 -5
- data/test/test_address_nl.rb +1 -1
- data/test/test_address_se.rb +6 -6
- data/test/test_address_sn.rb +4 -4
- data/test/test_address_uk.rb +3 -3
- data/test/test_address_us.rb +7 -7
- data/test/test_array_utils.rb +1 -1
- data/test/test_bacon_ipsum.rb +6 -6
- data/test/test_boolean.rb +1 -1
- data/test/test_color.rb +1 -1
- data/test/test_company.rb +6 -6
- data/test/test_company_it.rb +4 -4
- data/test/test_company_se.rb +2 -2
- data/test/test_conference.rb +1 -1
- data/test/test_course_mathematiques.rb +1 -1
- data/test/test_course_philosophie.rb +1 -1
- data/test/test_dizzle_ipsum.rb +6 -6
- data/test/test_education.rb +1 -1
- data/test/test_faker.rb +6 -6
- data/test/test_food.rb +4 -4
- data/test/test_gender.rb +1 -1
- data/test/test_gender_cn.rb +1 -1
- data/test/test_gender_kr.rb +1 -1
- data/test/test_geolocation.rb +3 -3
- data/test/test_guid.rb +1 -1
- data/test/test_healthcare_ipsum.rb +6 -6
- data/test/test_hipster_ipsum.rb +6 -6
- data/test/test_html_ipsum.rb +19 -19
- data/test/test_identification.rb +1 -1
- data/test/test_identification_co.rb +1 -1
- data/test/test_identification_es.rb +1 -1
- data/test/test_identification_es_cl.rb +1 -1
- data/test/test_identification_es_mx.rb +7 -7
- data/test/test_internet.rb +1 -1
- data/test/test_internet_se.rb +1 -1
- data/test/test_job.rb +1 -1
- data/test/test_job_fr.rb +1 -1
- data/test/test_job_ja.rb +1 -1
- data/test/test_job_kr.rb +1 -1
- data/test/test_lorem.rb +13 -13
- data/test/test_lorem_ar.rb +8 -8
- data/test/test_lorem_cn.rb +10 -10
- data/test/test_lorem_fr.rb +8 -8
- data/test/test_lorem_kr.rb +2 -2
- data/test/test_module_utils.rb +1 -1
- data/test/test_movie.rb +1 -1
- data/test/test_name.rb +1 -1
- data/test/test_name_br.rb +1 -1
- data/test/test_name_cn.rb +1 -1
- data/test/test_name_cs.rb +6 -6
- data/test/test_name_de.rb +1 -1
- data/test/test_name_fr.rb +10 -10
- data/test/test_name_ga.rb +12 -12
- data/test/test_name_it.rb +10 -10
- data/test/test_name_ja.rb +2 -2
- data/test/test_name_kr.rb +1 -1
- data/test/test_name_mx.rb +58 -58
- data/test/test_name_nb.rb +5 -5
- data/test/test_name_nl.rb +1 -1
- data/test/test_name_ph.rb +1 -1
- data/test/test_name_ru.rb +5 -5
- data/test/test_name_se.rb +5 -5
- data/test/test_name_sn.rb +21 -21
- data/test/test_name_th.rb +6 -6
- data/test/test_nato_alphabet.rb +5 -5
- data/test/test_phone_number.rb +2 -2
- data/test/test_phone_number_au.rb +10 -10
- data/test/test_phone_number_cu.rb +13 -13
- data/test/test_phone_number_de.rb +10 -10
- data/test/test_phone_number_kr.rb +1 -1
- data/test/test_phone_number_mx.rb +1 -1
- data/test/test_phone_number_nl.rb +1 -1
- data/test/test_phone_number_se.rb +15 -15
- data/test/test_phone_number_sg.rb +1 -1
- data/test/test_phone_number_sn.rb +7 -7
- data/test/test_skill.rb +4 -4
- data/test/test_ssn.rb +1 -1
- data/test/test_ssn_mx.rb +10 -10
- data/test/test_ssn_se.rb +5 -5
- data/test/test_string.rb +1 -1
- data/test/test_time.rb +1 -1
- data/test/test_units.rb +5 -5
- data/test/test_units_english.rb +11 -11
- data/test/test_units_metric.rb +11 -11
- data/test/test_vehicle.rb +9 -9
- data/test/test_venue.rb +1 -1
- metadata +3 -3
data/lib/ffaker/address_nl.rb
CHANGED
@@ -2,9 +2,9 @@
|
|
2
2
|
|
3
3
|
require 'ffaker/address'
|
4
4
|
|
5
|
-
module
|
5
|
+
module FFaker
|
6
6
|
module AddressNL
|
7
|
-
include
|
7
|
+
include FFaker::Address
|
8
8
|
|
9
9
|
extend ModuleUtils
|
10
10
|
extend self
|
@@ -12,7 +12,7 @@ module Faker
|
|
12
12
|
POSTAL_CODE_FORMAT = ['#### ??']
|
13
13
|
|
14
14
|
def postal_code
|
15
|
-
|
15
|
+
FFaker.bothify POSTAL_CODE_FORMAT
|
16
16
|
end
|
17
17
|
|
18
18
|
def zip_code
|
data/lib/ffaker/address_se.rb
CHANGED
@@ -2,13 +2,13 @@
|
|
2
2
|
|
3
3
|
require 'ffaker/address'
|
4
4
|
|
5
|
-
module
|
5
|
+
module FFaker
|
6
6
|
|
7
7
|
# List of countries from http://sv.wikipedia.org/wiki/V%C3%A4rldens_l%C3%A4nder#Lista_.C3.B6ver_l.C3.A4nder
|
8
8
|
# The streetnames are all the roads in Stockholm that contains "väg" or "gata"
|
9
9
|
# List of cities are from http://sv.wikipedia.org/wiki/Sveriges_kommuner
|
10
10
|
module AddressSE
|
11
|
-
include
|
11
|
+
include FFaker::Address
|
12
12
|
|
13
13
|
extend ModuleUtils
|
14
14
|
extend self
|
@@ -17,7 +17,7 @@ module Faker
|
|
17
17
|
STREET_NBR_FORMATS = ['##', '#', '#a', '#b', '###']
|
18
18
|
|
19
19
|
def zip_code
|
20
|
-
|
20
|
+
FFaker.numerify ZIP_FORMATS.sample
|
21
21
|
end
|
22
22
|
|
23
23
|
def city
|
@@ -33,7 +33,7 @@ module Faker
|
|
33
33
|
end
|
34
34
|
|
35
35
|
def street_nbr
|
36
|
-
|
36
|
+
FFaker.numerify STREET_NBR_FORMATS.sample
|
37
37
|
end
|
38
38
|
|
39
39
|
def full_address
|
data/lib/ffaker/address_sn.rb
CHANGED
data/lib/ffaker/address_uk.rb
CHANGED
@@ -2,9 +2,9 @@
|
|
2
2
|
|
3
3
|
require 'ffaker/address'
|
4
4
|
|
5
|
-
module
|
5
|
+
module FFaker
|
6
6
|
module AddressUK
|
7
|
-
include
|
7
|
+
include FFaker::Address
|
8
8
|
|
9
9
|
extend ModuleUtils
|
10
10
|
extend self
|
@@ -21,7 +21,7 @@ module Faker
|
|
21
21
|
end
|
22
22
|
|
23
23
|
def postcode
|
24
|
-
|
24
|
+
FFaker.bothify(POSTCODE.sample).upcase
|
25
25
|
end
|
26
26
|
end
|
27
27
|
end
|
data/lib/ffaker/address_us.rb
CHANGED
@@ -2,9 +2,9 @@
|
|
2
2
|
|
3
3
|
require 'ffaker/address'
|
4
4
|
|
5
|
-
module
|
5
|
+
module FFaker
|
6
6
|
module AddressUS
|
7
|
-
include
|
7
|
+
include FFaker::Address
|
8
8
|
|
9
9
|
extend ModuleUtils
|
10
10
|
extend self
|
@@ -14,7 +14,7 @@ module Faker
|
|
14
14
|
CONTINENTAL_STATE_ABBR = (STATE_ABBR - ['HI', 'AK'])
|
15
15
|
|
16
16
|
def zip_code
|
17
|
-
|
17
|
+
FFaker.numerify ZIP_FORMATS.sample
|
18
18
|
end
|
19
19
|
|
20
20
|
def state
|
data/lib/ffaker/bacon_ipsum.rb
CHANGED
data/lib/ffaker/boolean.rb
CHANGED
data/lib/ffaker/color.rb
CHANGED
data/lib/ffaker/company.rb
CHANGED
data/lib/ffaker/company_it.rb
CHANGED
data/lib/ffaker/company_se.rb
CHANGED
data/lib/ffaker/conference.rb
CHANGED
data/lib/ffaker/courses.rb
CHANGED
data/lib/ffaker/currency.rb
CHANGED
data/lib/ffaker/dizzle_ipsum.rb
CHANGED
data/lib/ffaker/education.rb
CHANGED
data/lib/ffaker/food.rb
CHANGED
data/lib/ffaker/gender.rb
CHANGED
data/lib/ffaker/gender_cn.rb
CHANGED
data/lib/ffaker/gender_kr.rb
CHANGED
data/lib/ffaker/geolocation.rb
CHANGED
data/lib/ffaker/guid.rb
CHANGED
data/lib/ffaker/hipster_ipsum.rb
CHANGED
data/lib/ffaker/html_ipsum.rb
CHANGED
@@ -1,8 +1,8 @@
|
|
1
1
|
# encoding: utf-8
|
2
2
|
|
3
|
-
module
|
3
|
+
module FFaker
|
4
4
|
# Loosely based on http://html-ipsum.com/
|
5
|
-
# Requires
|
5
|
+
# Requires FFaker::Lorem module
|
6
6
|
module HTMLIpsum
|
7
7
|
extend ModuleUtils
|
8
8
|
extend self
|
@@ -128,33 +128,33 @@ module Faker
|
|
128
128
|
"<em>#{paragraph}</em>",
|
129
129
|
"<code>#{words 2}</code>",
|
130
130
|
"#{a 2}"
|
131
|
-
] +
|
131
|
+
] + FFaker::Lorem::paragraphs(count))
|
132
132
|
a.random_pick(count).join(sep)
|
133
133
|
end
|
134
134
|
|
135
135
|
private
|
136
136
|
def word
|
137
|
-
|
137
|
+
FFaker::Lorem::word
|
138
138
|
end
|
139
139
|
|
140
140
|
def words(word_count = 3)
|
141
|
-
|
141
|
+
FFaker::Lorem::words(word_count).join(' ')
|
142
142
|
end
|
143
143
|
|
144
144
|
def sentence(word_count = 3)
|
145
|
-
|
145
|
+
FFaker::Lorem::sentence(word_count)
|
146
146
|
end
|
147
147
|
|
148
148
|
def sentences(sentence_count = 3)
|
149
|
-
|
149
|
+
FFaker::Lorem::sentences(sentence_count).join(' ')
|
150
150
|
end
|
151
151
|
|
152
152
|
def paragraph(sentence_count = 3)
|
153
|
-
|
153
|
+
FFaker::Lorem::paragraph(sentence_count)
|
154
154
|
end
|
155
155
|
|
156
156
|
def paragraphs(paragraph_count = 3)
|
157
|
-
|
157
|
+
FFaker::Lorem::paragraphs(paragraph_count).join('<br>')
|
158
158
|
end
|
159
159
|
end
|
160
160
|
end
|
@@ -1,6 +1,6 @@
|
|
1
1
|
# encoding: utf-8
|
2
2
|
|
3
|
-
module
|
3
|
+
module FFaker
|
4
4
|
module Identification
|
5
5
|
extend ModuleUtils
|
6
6
|
extend self
|
@@ -9,11 +9,11 @@ module Faker
|
|
9
9
|
GENDERS = %w(Male Female)
|
10
10
|
|
11
11
|
def drivers_license
|
12
|
-
|
12
|
+
FFaker.bothify('?###-###-##-###-#').upcase
|
13
13
|
end
|
14
14
|
|
15
15
|
def ssn
|
16
|
-
|
16
|
+
FFaker.numerify('###-##-####')
|
17
17
|
end
|
18
18
|
|
19
19
|
def ethnicity
|
@@ -3,7 +3,7 @@
|
|
3
3
|
require 'ffaker/identification_es'
|
4
4
|
require "date"
|
5
5
|
|
6
|
-
module
|
6
|
+
module FFaker
|
7
7
|
module IdentificationESCO
|
8
8
|
include IdentificationES
|
9
9
|
|
@@ -15,7 +15,7 @@ module Faker
|
|
15
15
|
|
16
16
|
def drivers_license
|
17
17
|
how_many_numbers = 6 + rand(8)
|
18
|
-
|
18
|
+
FFaker.numerify("#" * how_many_numbers)
|
19
19
|
end
|
20
20
|
|
21
21
|
alias_method :id, :drivers_license
|
data/lib/ffaker/internet.rb
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
# encoding: utf-8
|
2
2
|
|
3
|
-
module
|
3
|
+
module FFaker
|
4
4
|
module Internet
|
5
5
|
extend ModuleUtils
|
6
6
|
extend self
|
@@ -75,7 +75,7 @@ module Faker
|
|
75
75
|
def slug(words = nil, glue = nil)
|
76
76
|
glue ||= SLUG_DELIMITERS.sample
|
77
77
|
|
78
|
-
(words ||
|
78
|
+
(words || FFaker::Lorem::words(2).join(glue)).downcase
|
79
79
|
end
|
80
80
|
|
81
81
|
def password(min_length = 8, max_length = 16)
|
data/lib/ffaker/internet_se.rb
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
|
3
3
|
require 'ffaker/internet'
|
4
4
|
|
5
|
-
module
|
5
|
+
module FFaker
|
6
6
|
module InternetSE
|
7
7
|
include Internet
|
8
8
|
|
@@ -106,7 +106,7 @@ module Faker
|
|
106
106
|
def slug(words = nil, glue = nil)
|
107
107
|
glue ||= SLUG_DELIMITERS.sample
|
108
108
|
|
109
|
-
(words ||
|
109
|
+
(words || FFaker::Lorem::words(2).join(' ')).gsub(' ', glue).downcase
|
110
110
|
end
|
111
111
|
end
|
112
112
|
end
|