faker 2.3.0 → 2.4.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.
Files changed (36) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +27 -2
  3. data/README.md +2 -1
  4. data/lib/faker/blockchain/aeternity.rb +70 -0
  5. data/lib/faker/default/appliance.rb +18 -0
  6. data/lib/faker/default/dessert.rb +27 -0
  7. data/lib/faker/default/device.rb +54 -0
  8. data/lib/faker/default/electrical_components.rb +27 -0
  9. data/lib/faker/default/greek_philosophers.rb +18 -0
  10. data/lib/faker/default/industry_segments.rb +36 -0
  11. data/lib/faker/default/marketing.rb +9 -0
  12. data/lib/faker/default/military.rb +45 -0
  13. data/lib/faker/default/nato_phonetic_alphabet.rb +9 -0
  14. data/lib/faker/default/science.rb +27 -0
  15. data/lib/faker/default/subscription.rb +45 -0
  16. data/lib/faker/default/superhero.rb +45 -0
  17. data/lib/faker/games/dota.rb +47 -0
  18. data/lib/faker/games/heroes.rb +27 -0
  19. data/lib/faker/games/heroes_of_the_storm.rb +36 -0
  20. data/lib/faker/games/league_of_legends.rb +54 -0
  21. data/lib/faker/games/myst.rb +45 -0
  22. data/lib/faker/games/pokemon.rb +27 -0
  23. data/lib/faker/games/sonic_the_hedgehog.rb +27 -0
  24. data/lib/faker/games/witcher.rb +54 -0
  25. data/lib/faker/games/world_of_warcraft.rb +18 -0
  26. data/lib/faker/japanese_media/dragon_ball.rb +9 -0
  27. data/lib/faker/japanese_media/sword_art_online.rb +36 -0
  28. data/lib/faker/movies/hobbit.rb +37 -0
  29. data/lib/faker/movies/movie.rb +9 -0
  30. data/lib/faker/music/grateful_dead.rb +18 -0
  31. data/lib/faker/music/phish.rb +9 -0
  32. data/lib/faker/music/rock_band.rb +9 -0
  33. data/lib/faker/version.rb +1 -1
  34. data/lib/locales/en/science.yml +1 -1
  35. data/lib/locales/ja.yml +7 -8
  36. metadata +6 -5
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 8bec55e97c49aba2834c60f979ddfbbba32d561b6300640059e10b74f4f64a11
4
- data.tar.gz: 60197e5cfab12ef29607bfb817a86fb14db6757d3868afbc5dd2a2751412e070
3
+ metadata.gz: f048f99db924a824430ec4b564d6526df4912994e5837146e309adfa35d8a8b5
4
+ data.tar.gz: a6d6c98bd04fb29faaa2549e51053d882cf930dd4fae38b478e8e35230e496ab
5
5
  SHA512:
6
- metadata.gz: 6163f75344392f843e01d14ff8ddb484c40ad7b8b055a1e7a3be1cfebb972b5e5244ac4f61b424862d997bee39c4d3b61d1b605aebad6f6534e771acb32ca380
7
- data.tar.gz: 93310c967dc3daa9a664d456978a636b7bc01122fbbe4a1c565206db401bfcdadee214d01c0e4b2b22be4c001cdf255de5f46762df2cb16d9f4e5fcb2c006418
6
+ metadata.gz: 6e389da23548bfd30277a61c39051a874fb1da29b4af4258b11c8327eef7a2707c5862983eecd93658331d2c89643a18a588a3f978a3de3276511a501ff2f659
7
+ data.tar.gz: 9028bfe72719c6f4da2653bfc17f50fac5559a1238175045b9aaad4dd86fd404b12048e5e9ba6dbe7d3ab388300b5ff8763e0c0f9984fa51d57b2c760e5c02cb
@@ -1,5 +1,30 @@
1
1
  # Change Log
2
2
 
3
+ ## [v2.4.0](https://github.com/faker-ruby/faker/tree/v2.4.0) (2019-19-09)
4
+
5
+ ## Documentation
6
+
7
+ - [PR #1750](https://github.com/faker-ruby/faker/pull/1750) add only japanese word spec [@4geru](https://github.com/4geru)
8
+ - [PR #1740](https://github.com/faker-ruby/faker/pull/1740) Add more YARD docs [@connorshea](https://github.com/connorshea)
9
+ - [PR #1747](https://github.com/faker-ruby/faker/pull/1747) Fix PR links [@geniou](https://github.com/geniou)
10
+
11
+ ## Feature Request
12
+
13
+ - [PR #1742](https://github.com/faker-ruby/faker/pull/1742) Add Faker::Blockchain::Aeternity [@2pd](https://github.com/2pd)
14
+
15
+ ## Update locales
16
+
17
+ - [PR #1743](https://github.com/faker-ruby/faker/pull/1743) Fix another ambiguity in element_symbol field [@psibi](https://github.com/psibi)
18
+ - [PR #1748](https://github.com/faker-ruby/faker/pull/1748) fix typo from bread to breed [@4geru](https://github.com/4geru)
19
+ - [PR #1752](https://github.com/faker-ruby/faker/pull/1752) fix creature i18n path in japanese [@4geru](https://github.com/4geru)
20
+
21
+ ## Update local dependencies
22
+
23
+ The following development dependencies were updated:
24
+ - Update simplecov requirement from = 0.17.0 to = 0.17.1 (#1749)
25
+
26
+ ------------------------------------------------------------------------------
27
+
3
28
  ## [v2.3.0](https://github.com/faker-ruby/faker/tree/v2.3.0) (2019-12-09)
4
29
 
5
30
  ## Documentation
@@ -14,8 +39,8 @@
14
39
 
15
40
  ## Update locales
16
41
 
17
- - [PR #1732](https://github.com/faker-ruby/faker/pull/1732) Add pokemon name in Johto area [@mathieujobin](https://github.com/mathieujobin)
18
- - [PR #1723](https://github.com/faker-ruby/faker/pull/1723) Quebec province postal codes starts by [GHJ], adding missing two [@Ryutooooo](https://github.com/Ryutooooo)
42
+ - [PR #1723](https://github.com/faker-ruby/faker/pull/1723) Add pokemon name in Johto area [@mathieujobin](https://github.com/mathieujobin)
43
+ - [PR #1732](https://github.com/faker-ruby/faker/pull/1732) Quebec province postal codes starts by [GHJ], adding missing two [@Ryutooooo](https://github.com/Ryutooooo)
19
44
 
20
45
  ------------------------------------------------------------------------------
21
46
 
data/README.md CHANGED
@@ -4,7 +4,7 @@
4
4
  # Faker
5
5
  [![Build Status](https://travis-ci.org/faker-ruby/faker.svg?branch=master)](https://travis-ci.org/faker-ruby/faker)
6
6
  [![Gem Version](https://badge.fury.io/rb/faker.svg)](https://badge.fury.io/rb/faker)
7
- [![Inline docs](http://inch-ci.org/github/stympy/faker.svg?branch=master)](http://inch-ci.org/github/stympy/faker)
7
+ [![Inline docs](https://inch-ci.org/github/faker-ruby/faker.svg?branch=master)](https://inch-ci.org/github/faker-ruby/faker)
8
8
  [![Test Coverage](https://api.codeclimate.com/v1/badges/ef54c7f9df86e965d64b/test_coverage)](https://codeclimate.com/github/stympy/faker/test_coverage)
9
9
  [![Maintainability](https://api.codeclimate.com/v1/badges/ef54c7f9df86e965d64b/maintainability)](https://codeclimate.com/github/stympy/faker/maintainability)
10
10
 
@@ -211,6 +211,7 @@ gem 'faker', :git => 'https://github.com/faker-ruby/faker.git', :branch => 'mast
211
211
  - [Faker::WorldCup](doc/default/world_cup.md)
212
212
 
213
213
  ### Blockchain
214
+ - [Faker::Blockchain::Aeternity](doc/blockchain/aeternity.md)
214
215
  - [Faker::Blockchain::Bitcoin](doc/blockchain/bitcoin.md)
215
216
  - [Faker::Blockchain::Ethereum](doc/blockchain/ethereum.md)
216
217
  - [Faker::Blockchain::Tezos](doc/blockchain/tezos.md)
@@ -0,0 +1,70 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Faker
4
+ class Blockchain
5
+ class Aeternity < Base
6
+ class << self
7
+ ##
8
+ # Produces a random Aeternity wallet address
9
+ #
10
+ # @return [String]
11
+ #
12
+ # @example
13
+ # Faker::Blockchain::Aeternity.address
14
+ # #=> "ak_zvU8YQLagjcfng7Tg8yCdiZ1rpiWNp1PBn3vtUs44utSvbJVR"
15
+ #
16
+ def address
17
+ 'ak_' + rand_strings
18
+ end
19
+
20
+ ##
21
+ # Produces a random Aeternity transaction
22
+ #
23
+ # @return [String]
24
+ #
25
+ # @example
26
+ # Faker::Blockchain::Aeternity.transaction
27
+ # #=> "th_147nDP22h3pHrLt2qykTH4txUwQh1ccaXp"
28
+ #
29
+ def transaction
30
+ 'th_' + rand_strings(51)
31
+ end
32
+
33
+ ##
34
+ # Produces a random Aeternity contract
35
+ #
36
+ # @return [String]
37
+ #
38
+ # @example
39
+ # Faker::Blockchain::Aeternity.contract
40
+ # #=> "ct_Hk2JsNeWGEYQEHHQCfcBeGrwbhtYSwFTPdDhW2SvjFYVojyhW"
41
+ #
42
+ def contract
43
+ 'ct_' + rand_strings
44
+ end
45
+
46
+ ##
47
+ # Produces a random Aeternity oracle
48
+ #
49
+ # @return [String]
50
+ #
51
+ # @example
52
+ # Faker::Blockchain::Aeternity.oracle
53
+ # #=> "ok_28QDg7fkF5qiKueSdUvUBtCYPJdmMEoS73CztzXCRAwMGKHKZh"
54
+ #
55
+ def oracle
56
+ 'ok_' + rand_strings(51)
57
+ end
58
+
59
+ protected
60
+
61
+ def rand_strings(length = 50)
62
+ hex_alphabet = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'
63
+ var = +''
64
+ length.times { var << sample(shuffle(hex_alphabet.split(''))) }
65
+ var
66
+ end
67
+ end
68
+ end
69
+ end
70
+ end
@@ -3,10 +3,28 @@
3
3
  module Faker
4
4
  class Appliance < Base
5
5
  class << self
6
+ ##
7
+ # Produces the name of an appliance brand.
8
+ #
9
+ # @return [String]
10
+ #
11
+ # @example
12
+ # Faker::Appliance.brand #=> "Bosch"
13
+ #
14
+ # @faker.version 1.9.0
6
15
  def brand
7
16
  fetch('appliance.brand')
8
17
  end
9
18
 
19
+ ##
20
+ # Produces the name of a type of appliance equipment.
21
+ #
22
+ # @return [String]
23
+ #
24
+ # @example
25
+ # Faker::Appliance.equipment #=> "Appliance plug"
26
+ #
27
+ # @faker.version 1.9.0
10
28
  def equipment
11
29
  fetch('appliance.equipment')
12
30
  end
@@ -5,14 +5,41 @@ module Faker
5
5
  flexible :dessert
6
6
 
7
7
  class << self
8
+ ##
9
+ # Produces the name of a dessert variety.
10
+ #
11
+ # @return [String]
12
+ #
13
+ # @example
14
+ # Faker::Dessert.variety #=> "Cake"
15
+ #
16
+ # @faker.version 1.8.0
8
17
  def variety
9
18
  fetch('dessert.variety')
10
19
  end
11
20
 
21
+ ##
22
+ # Produces the name of a dessert topping.
23
+ #
24
+ # @return [String]
25
+ #
26
+ # @example
27
+ # Faker::Dessert.topping #=> "Gummy Bears"
28
+ #
29
+ # @faker.version 1.8.0
12
30
  def topping
13
31
  fetch('dessert.topping')
14
32
  end
15
33
 
34
+ ##
35
+ # Produces the name of a dessert flavor.
36
+ #
37
+ # @return [String]
38
+ #
39
+ # @example
40
+ # Faker::Dessert.flavor #=> "Salted Caramel"
41
+ #
42
+ # @faker.version 1.8.0
16
43
  def flavor
17
44
  fetch('dessert.flavor')
18
45
  end
@@ -3,26 +3,80 @@
3
3
  module Faker
4
4
  class Device < Base
5
5
  class << self
6
+ ##
7
+ # Produces a build number between 1 and 500.
8
+ #
9
+ # @return [Integer]
10
+ #
11
+ # @example
12
+ # Faker::Device.build_number #=> 5
13
+ #
14
+ # @faker.version 1.9.0
6
15
  def build_number
7
16
  Faker::Number.between(from: 1, to: 500)
8
17
  end
9
18
 
19
+ ##
20
+ # Produces the name of a manufacturer for a device.
21
+ #
22
+ # @return [String]
23
+ #
24
+ # @example
25
+ # Faker::Device.manufacturer #=> "Apple"
26
+ #
27
+ # @faker.version 1.9.0
10
28
  def manufacturer
11
29
  fetch('device.manufacturer')
12
30
  end
13
31
 
32
+ ##
33
+ # Produces a model name for a device.
34
+ #
35
+ # @return [String]
36
+ #
37
+ # @example
38
+ # Faker::Device.model_name #=> "iPhone 4"
39
+ #
40
+ # @faker.version 1.9.0
14
41
  def model_name
15
42
  fetch('device.model_name')
16
43
  end
17
44
 
45
+ ##
46
+ # Produces the name of a platform for a device.
47
+ #
48
+ # @return [String]
49
+ #
50
+ # @example
51
+ # Faker::Device.platform #=> "webOS"
52
+ #
53
+ # @faker.version 1.9.0
18
54
  def platform
19
55
  fetch('device.platform')
20
56
  end
21
57
 
58
+ ##
59
+ # Produces a serial code for a device.
60
+ #
61
+ # @return [String]
62
+ #
63
+ # @example
64
+ # Faker::Device.serial #=> "ejfjnRNInxh0363JC2WM"
65
+ #
66
+ # @faker.version 1.9.0
22
67
  def serial
23
68
  fetch('device.serial')
24
69
  end
25
70
 
71
+ ##
72
+ # Produces a version number between 1 and 1000.
73
+ #
74
+ # @return [Integer]
75
+ #
76
+ # @example
77
+ # Faker::Device.version #=> 42
78
+ #
79
+ # @faker.version 1.9.0
26
80
  def version
27
81
  Faker::Number.between(from: 1, to: 1000)
28
82
  end
@@ -5,14 +5,41 @@ module Faker
5
5
  flexible :electrical_components
6
6
 
7
7
  class << self
8
+ ##
9
+ # Produces an active electrical component.
10
+ #
11
+ # @return [String]
12
+ #
13
+ # @example
14
+ # Faker::ElectricalComponents.active #=> "Transistor"
15
+ #
16
+ # @faker.version 1.9.0
8
17
  def active
9
18
  fetch('electrical_components.active')
10
19
  end
11
20
 
21
+ ##
22
+ # Produces a passive electrical component.
23
+ #
24
+ # @return [String]
25
+ #
26
+ # @example
27
+ # Faker::ElectricalComponents.passive #=> "Resistor"
28
+ #
29
+ # @faker.version 1.9.0
12
30
  def passive
13
31
  fetch('electrical_components.passive')
14
32
  end
15
33
 
34
+ ##
35
+ # Produces an electromechanical electrical component.
36
+ #
37
+ # @return [String]
38
+ #
39
+ # @example
40
+ # Faker::ElectricalComponents.electromechanical #=> "Toggle Switch"
41
+ #
42
+ # @faker.version 1.9.0
16
43
  def electromechanical
17
44
  fetch('electrical_components.electromechanical')
18
45
  end
@@ -3,10 +3,28 @@
3
3
  module Faker
4
4
  class GreekPhilosophers < Base
5
5
  class << self
6
+ ##
7
+ # Produces the name of a Greek philosopher.
8
+ #
9
+ # @return [String]
10
+ #
11
+ # @example
12
+ # Faker::GreekPhilosophers.name #=> "Socrates"
13
+ #
14
+ # @faker.version 1.9.0
6
15
  def name
7
16
  fetch('greek_philosophers.names')
8
17
  end
9
18
 
19
+ ##
20
+ # Produces a quote from a Greek philosopher.
21
+ #
22
+ # @return [String]
23
+ #
24
+ # @example
25
+ # Faker::GreekPhilosophers.quote #=> "Only the educated are free."
26
+ #
27
+ # @faker.version 1.9.0
10
28
  def quote
11
29
  fetch('greek_philosophers.quotes')
12
30
  end
@@ -5,18 +5,54 @@ module Faker
5
5
  flexible :industry_segments
6
6
 
7
7
  class << self
8
+ ##
9
+ # Produces the name of an industry.
10
+ #
11
+ # @return [String]
12
+ #
13
+ # @example
14
+ # Faker::IndustrySegments.industry #=> "Basic Materials"
15
+ #
16
+ # @faker.version 1.9.2
8
17
  def industry
9
18
  fetch('industry_segments.industry')
10
19
  end
11
20
 
21
+ ##
22
+ # Produces the name of a super-sector of an industry.
23
+ #
24
+ # @return [String]
25
+ #
26
+ # @example
27
+ # Faker::IndustrySegments.super_sector #=> "Basic Resources"
28
+ #
29
+ # @faker.version 1.9.2
12
30
  def super_sector
13
31
  fetch('industry_segments.super_sector')
14
32
  end
15
33
 
34
+ ##
35
+ # Produces the name of a sector of an industry.
36
+ #
37
+ # @return [String]
38
+ #
39
+ # @example
40
+ # Faker::IndustrySegments.sector #=> "Industrial Metals & Mining"
41
+ #
42
+ # @faker.version 1.9.2
16
43
  def sector
17
44
  fetch('industry_segments.sector')
18
45
  end
19
46
 
47
+ ##
48
+ # Produces the name of a subsector of an industry.
49
+ #
50
+ # @return [String]
51
+ #
52
+ # @example
53
+ # Faker::IndustrySegments.industry #=> "Basic Materials"
54
+ #
55
+ # @faker.version 1.9.2
20
56
  def sub_sector
21
57
  fetch('industry_segments.sub_sector')
22
58
  end
@@ -5,6 +5,15 @@ module Faker
5
5
  flexible :marketing
6
6
 
7
7
  class << self
8
+ ##
9
+ # Produces the name of a video game console or platform.
10
+ #
11
+ # @return [String]
12
+ #
13
+ # @example
14
+ # Faker::Marketing.buzzwords #=> "rubber meets the road"
15
+ #
16
+ # @faker.version 1.9.4
8
17
  def buzzwords
9
18
  fetch('marketing.buzzwords')
10
19
  end
@@ -3,22 +3,67 @@
3
3
  module Faker
4
4
  class Military < Base
5
5
  class << self
6
+ ##
7
+ # Produces a rank in the U.S. Army.
8
+ #
9
+ # @return [String]
10
+ #
11
+ # @example
12
+ # Faker::Military.army_rank #=> "Staff Sergeant"
13
+ #
14
+ # @faker.version 1.9.0
6
15
  def army_rank
7
16
  fetch('military.army_rank')
8
17
  end
9
18
 
19
+ ##
20
+ # Produces a rank in the U.S. Marines.
21
+ #
22
+ # @return [String]
23
+ #
24
+ # @example
25
+ # Faker::Military.marines_rank #=> "Gunnery Sergeant"
26
+ #
27
+ # @faker.version 1.9.0
10
28
  def marines_rank
11
29
  fetch('military.marines_rank')
12
30
  end
13
31
 
32
+ ##
33
+ # Produces a rank in the U.S. Navy.
34
+ #
35
+ # @return [String]
36
+ #
37
+ # @example
38
+ # Faker::Military.navy_rank #=> "Seaman"
39
+ #
40
+ # @faker.version 1.9.0
14
41
  def navy_rank
15
42
  fetch('military.navy_rank')
16
43
  end
17
44
 
45
+ ##
46
+ # Produces a rank in the U.S. Air Force.
47
+ #
48
+ # @return [String]
49
+ #
50
+ # @example
51
+ # Faker::Military.air_force_rank #=> "Captain"
52
+ #
53
+ # @faker.version 1.9.0
18
54
  def air_force_rank
19
55
  fetch('military.air_force_rank')
20
56
  end
21
57
 
58
+ ##
59
+ # Produces a U.S. Department of Defense Paygrade.
60
+ #
61
+ # @return [String]
62
+ #
63
+ # @example
64
+ # Faker::Military.dod_paygrade #=> "E-6"
65
+ #
66
+ # @faker.version 1.9.0
22
67
  def dod_paygrade
23
68
  fetch('military.dod_paygrade')
24
69
  end