faker 3.2.3 → 3.3.0
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 +141 -0
- data/README.md +12 -5
- data/lib/faker/default/company.rb +68 -0
- data/lib/faker/default/id_number.rb +23 -20
- data/lib/faker/default/internet.rb +1 -39
- data/lib/faker/default/json.rb +2 -2
- data/lib/faker/default/phone_number.rb +37 -18
- data/lib/faker/default/south_africa.rb +3 -3
- data/lib/faker/japanese_media/fullmetal_alchemist_brotherhood.rb +13 -10
- data/lib/faker/locations/australia.rb +43 -38
- data/lib/faker/movies/{room.rb → the_room.rb} +4 -4
- data/lib/faker/music/smashing_pumpkins.rb +64 -0
- data/lib/faker/version.rb +1 -1
- data/lib/helpers/deprecator.rb +30 -0
- data/lib/locales/bg.yml +0 -1
- data/lib/locales/da-DK.yml +529 -37
- data/lib/locales/de-AT.yml +3487 -26
- data/lib/locales/de-CH.yml +51 -59
- data/lib/locales/de.yml +7182 -100
- data/lib/locales/ee.yml +0 -1
- data/lib/locales/en/address.yml +1826 -561
- data/lib/locales/en/australia.yml +106 -105
- data/lib/locales/en/bank.yml +1 -1
- data/lib/locales/en/finance.yml +3 -3
- data/lib/locales/en/{fma_brotherhood.yml → fullmetal_alchemist_brotherhood.yml} +3 -3
- data/lib/locales/en/harry_potter.yml +1 -1
- data/lib/locales/en/id_number.yml +1 -1
- data/lib/locales/en/internet.yml +0 -4
- data/lib/locales/en/phone_number.yml +78 -3
- data/lib/locales/en/smashing_pumpkins.yml +382 -0
- data/lib/locales/en/{room.yml → the_room.yml} +1 -1
- data/lib/locales/en-AU.yml +718 -47
- data/lib/locales/en-CA.yml +373 -19
- data/lib/locales/en-GB.yml +116 -9
- data/lib/locales/en-IND.yml +1259 -17
- data/lib/locales/en-KE.yml +212 -0
- data/lib/locales/en-MS.yml +364 -18
- data/lib/locales/en-NEP.yml +212 -38
- data/lib/locales/en-NZ.yml +1153 -124
- data/lib/locales/en-PAK.yml +369 -11
- data/lib/locales/en-SG.yml +581 -17
- data/lib/locales/en-US.yml +6923 -83
- data/lib/locales/en-au-ocker.yml +266 -24
- data/lib/locales/es-AR.yml +4569 -4600
- data/lib/locales/es-MX.yml +0 -1
- data/lib/locales/es.yml +0 -1
- data/lib/locales/fr/internet.yml +0 -1
- data/lib/locales/fr-CA.yml +2733 -44
- data/lib/locales/fr-CH.yml +0 -1
- data/lib/locales/fr.yml +3 -1
- data/lib/locales/hy.yml +3624 -120
- data/lib/locales/id.yml +839 -12
- data/lib/locales/it.yml +1304 -33
- data/lib/locales/ko.yml +0 -1
- data/lib/locales/lt.yml +297 -16
- data/lib/locales/lv.yml +0 -1
- data/lib/locales/nb-NO.yml +518 -30
- data/lib/locales/nl.yml +0 -1
- data/lib/locales/pl.yml +0 -1
- data/lib/locales/pt-BR.yml +8155 -665
- data/lib/locales/pt.yml +844 -45
- data/lib/locales/ru.yml +1353 -70
- data/lib/locales/sk.yml +4410 -44
- data/lib/locales/tr.yml +0 -2
- data/lib/locales/uk.yml +1808 -47
- data/lib/locales/zh-CN/bank.yml +17 -0
- metadata +14 -10
- data/History.md +0 -176
@@ -13,7 +13,7 @@ module Faker
|
|
13
13
|
#
|
14
14
|
# @faker.version 1.9.2
|
15
15
|
def id_number
|
16
|
-
Faker::
|
16
|
+
Faker::IdNumber.south_african_id_number
|
17
17
|
end
|
18
18
|
|
19
19
|
##
|
@@ -26,7 +26,7 @@ module Faker
|
|
26
26
|
#
|
27
27
|
# @faker.version 1.9.2
|
28
28
|
def valid_id_number
|
29
|
-
Faker::
|
29
|
+
Faker::IdNumber.valid_south_african_id_number
|
30
30
|
end
|
31
31
|
|
32
32
|
##
|
@@ -39,7 +39,7 @@ module Faker
|
|
39
39
|
#
|
40
40
|
# @faker.version 1.9.2
|
41
41
|
def invalid_id_number
|
42
|
-
Faker::
|
42
|
+
Faker::IdNumber.invalid_south_african_id_number
|
43
43
|
end
|
44
44
|
|
45
45
|
##
|
@@ -2,47 +2,50 @@
|
|
2
2
|
|
3
3
|
module Faker
|
4
4
|
class JapaneseMedia
|
5
|
-
class
|
5
|
+
class FullmetalAlchemistBrotherhood < Base
|
6
6
|
class << self
|
7
7
|
##
|
8
|
-
# Produces a character from
|
8
|
+
# Produces a character from FullmetalAlchemistBrotherhood.
|
9
9
|
#
|
10
10
|
# @return [String]
|
11
11
|
#
|
12
12
|
# @example
|
13
|
-
# Faker::JapaneseMedia::
|
13
|
+
# Faker::JapaneseMedia::FullmetalAlchemistBrotherhood.character #=> "Edward Elric"
|
14
14
|
#
|
15
15
|
# @faker.version next
|
16
16
|
def character
|
17
|
-
fetch('
|
17
|
+
fetch('fullmetal_alchemist_brotherhood.characters')
|
18
18
|
end
|
19
19
|
|
20
20
|
##
|
21
|
-
# Produces a cities from
|
21
|
+
# Produces a cities from FullmetalAlchemistBrotherhood.
|
22
22
|
#
|
23
23
|
# @return [String]
|
24
24
|
#
|
25
25
|
# @example
|
26
|
-
# Faker::JapaneseMedia::
|
26
|
+
# Faker::JapaneseMedia::FullmetalAlchemistBrotherhood.city #=> "Central City"
|
27
27
|
#
|
28
28
|
# @faker.version next
|
29
29
|
def city
|
30
|
-
fetch('
|
30
|
+
fetch('fullmetal_alchemist_brotherhood.cities')
|
31
31
|
end
|
32
32
|
|
33
33
|
##
|
34
|
-
# Produces a country from
|
34
|
+
# Produces a country from FullmetalAlchemistBrotherhood.
|
35
35
|
#
|
36
36
|
# @return [String]
|
37
37
|
#
|
38
38
|
# @example
|
39
|
-
# Faker::JapaneseMedia::
|
39
|
+
# Faker::JapaneseMedia::FullmetalAlchemistBrotherhood.country #=> "Xing"
|
40
40
|
#
|
41
41
|
# @faker.version next
|
42
42
|
def country
|
43
|
-
fetch('
|
43
|
+
fetch('fullmetal_alchemist_brotherhood.countries')
|
44
44
|
end
|
45
45
|
end
|
46
46
|
end
|
47
|
+
|
48
|
+
include Faker::Deprecator
|
49
|
+
deprecate_generator('FmaBrotherhood', FullmetalAlchemistBrotherhood)
|
47
50
|
end
|
48
51
|
end
|
@@ -1,47 +1,52 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
3
|
module Faker
|
4
|
-
|
5
|
-
class << self
|
6
|
-
##
|
7
|
-
# Produces a location in Australia
|
8
|
-
#
|
9
|
-
# @return [String]
|
10
|
-
#
|
11
|
-
# @example
|
12
|
-
# Faker::Australia.location
|
13
|
-
# #=> "Sydney"
|
14
|
-
#
|
15
|
-
# @faker.version next
|
16
|
-
def location
|
17
|
-
fetch('australia.locations')
|
18
|
-
end
|
4
|
+
extend Deprecator
|
19
5
|
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
6
|
+
class Locations
|
7
|
+
class Australia < Base
|
8
|
+
class << self
|
9
|
+
##
|
10
|
+
# Produces a location in Australia
|
11
|
+
#
|
12
|
+
# @return [String]
|
13
|
+
#
|
14
|
+
# @example
|
15
|
+
# Faker::Locations::Australia.location
|
16
|
+
# #=> "Sydney"
|
17
|
+
#
|
18
|
+
# @faker.version next
|
19
|
+
def location
|
20
|
+
fetch('locations.australia.locations')
|
21
|
+
end
|
22
|
+
|
23
|
+
# Produces an Australian animal
|
24
|
+
#
|
25
|
+
# @return [String]
|
26
|
+
#
|
27
|
+
# @example
|
28
|
+
# Faker::Locations::Australia.animal
|
29
|
+
# #=> "Dingo"
|
30
|
+
#
|
31
|
+
# @faker.version next
|
32
|
+
def animal
|
33
|
+
fetch('locations.australia.animals')
|
34
|
+
end
|
32
35
|
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
36
|
+
# Produces an Australian State or Territory
|
37
|
+
#
|
38
|
+
# @return [String]
|
39
|
+
#
|
40
|
+
# @example
|
41
|
+
# Faker::Locations::Australia.state
|
42
|
+
# #=> "New South Wales"
|
43
|
+
#
|
44
|
+
# @faker.version next
|
45
|
+
def state
|
46
|
+
fetch('locations.australia.states')
|
47
|
+
end
|
44
48
|
end
|
45
49
|
end
|
46
50
|
end
|
51
|
+
deprecate_generator('Australia', Locations::Australia)
|
47
52
|
end
|
@@ -14,7 +14,7 @@ module Faker
|
|
14
14
|
#
|
15
15
|
# @faker.version next
|
16
16
|
def actor
|
17
|
-
fetch('
|
17
|
+
fetch('the_room.actors')
|
18
18
|
end
|
19
19
|
|
20
20
|
##
|
@@ -27,7 +27,7 @@ module Faker
|
|
27
27
|
#
|
28
28
|
# @faker.version next
|
29
29
|
def character
|
30
|
-
fetch('
|
30
|
+
fetch('the_room.characters')
|
31
31
|
end
|
32
32
|
|
33
33
|
##
|
@@ -40,7 +40,7 @@ module Faker
|
|
40
40
|
#
|
41
41
|
# @faker.version next
|
42
42
|
def location
|
43
|
-
fetch('
|
43
|
+
fetch('the_room.locations')
|
44
44
|
end
|
45
45
|
|
46
46
|
##
|
@@ -55,7 +55,7 @@ module Faker
|
|
55
55
|
#
|
56
56
|
# @faker.version next
|
57
57
|
def quote
|
58
|
-
fetch('
|
58
|
+
fetch('the_room.quotes')
|
59
59
|
end
|
60
60
|
end
|
61
61
|
end
|
@@ -0,0 +1,64 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require_relative 'music'
|
4
|
+
|
5
|
+
module Faker
|
6
|
+
class Music
|
7
|
+
class SmashingPumpkins < Base
|
8
|
+
class << self
|
9
|
+
##
|
10
|
+
# Produces the name of a member of the Smashing Pumpkins (current and former)
|
11
|
+
#
|
12
|
+
# @return [String]
|
13
|
+
#
|
14
|
+
# @example
|
15
|
+
# Faker::Music::SmashingPumpkins.musician #=> "Billy Corgan"
|
16
|
+
#
|
17
|
+
# @faker.version next
|
18
|
+
def musician
|
19
|
+
fetch('smashing_pumpkins.musicians')
|
20
|
+
end
|
21
|
+
|
22
|
+
##
|
23
|
+
# Produces the name of an album by the Smashing Pumpkins.
|
24
|
+
#
|
25
|
+
# @return [String]
|
26
|
+
#
|
27
|
+
# @example
|
28
|
+
# Faker::Music::SmashingPumpkins.album #=> "Siamese Dream"
|
29
|
+
#
|
30
|
+
# @faker.version next
|
31
|
+
def album
|
32
|
+
fetch('smashing_pumpkins.albums')
|
33
|
+
end
|
34
|
+
|
35
|
+
##
|
36
|
+
# Produces a random Smashing Pumpkins song lyric.
|
37
|
+
#
|
38
|
+
# @return [String]
|
39
|
+
#
|
40
|
+
# @example
|
41
|
+
# Faker::Music::SmashingPumpkins.lyric #=> "Despite all my rage, I am still just a rat in a cage"
|
42
|
+
# Faker::Music::SmashingPumpkins.lyric #=> "Breathin' underwater, and livin' under glass"
|
43
|
+
#
|
44
|
+
# @faker.version next
|
45
|
+
def lyric
|
46
|
+
fetch('smashing_pumpkins.lyric')
|
47
|
+
end
|
48
|
+
|
49
|
+
##
|
50
|
+
# Produces the name of a song by the Smashing Pumpkins.
|
51
|
+
#
|
52
|
+
# @return [String]
|
53
|
+
#
|
54
|
+
# @example
|
55
|
+
# Faker::Music::SmashingPumpkins.song #=> "Stand Inside My Love"
|
56
|
+
#
|
57
|
+
# @faker.version next
|
58
|
+
def song
|
59
|
+
fetch('smashing_pumpkins.songs')
|
60
|
+
end
|
61
|
+
end
|
62
|
+
end
|
63
|
+
end
|
64
|
+
end
|
data/lib/faker/version.rb
CHANGED
@@ -0,0 +1,30 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
# Based on Rails ActiveSupport Deprecator
|
4
|
+
# https://github.com/rails/rails/blob/6f0d1ad14b92b9f5906e44740fce8b4f1c7075dc/activesupport/lib/active_support/deprecation/constant_accessor.rb
|
5
|
+
|
6
|
+
# rubocop:disable Style/ClassVars
|
7
|
+
module Faker
|
8
|
+
module Deprecator
|
9
|
+
def self.included(base)
|
10
|
+
extension = Module.new do
|
11
|
+
def const_missing(missing_const_name)
|
12
|
+
if class_variable_defined?(:@@_deprecated_constants) && (replacement = class_variable_get(:@@_deprecated_constants)[missing_const_name.to_s])
|
13
|
+
$stdout.puts("DEPRECATION WARNING: #{name}::#{replacement[:old_generator]} is deprecated. Use #{replacement[:new_constant]} instead.")
|
14
|
+
return replacement[:new_constant]
|
15
|
+
end
|
16
|
+
|
17
|
+
super
|
18
|
+
end
|
19
|
+
|
20
|
+
def deprecate_generator(old_generator_name, new_generator_constant)
|
21
|
+
class_variable_set(:@@_deprecated_constants, {}) unless class_variable_defined?(:@@_deprecated_constants)
|
22
|
+
class_variable_get(:@@_deprecated_constants)[old_generator_name] = { new_constant: new_generator_constant, old_generator: old_generator_name }
|
23
|
+
end
|
24
|
+
end
|
25
|
+
|
26
|
+
base.singleton_class.prepend extension
|
27
|
+
end
|
28
|
+
end
|
29
|
+
end
|
30
|
+
# rubocop:enable Style/ClassVars
|