Skip to content

Commit 7990a43

Browse files
Kirk WangJamal-A-MohamedChava888sbs-cats
authored
Fix/Deprecate FmaBrotherhood Generator (#2856)
* Favor 'The Room' instead of 'Room' This commit will rename instances of room to the_room including the locales. Originally the `room.md` had a typo that referenced ::Room and not ::TheRoom which is also fixed here. Ref: - #2787 Co-authored-by: Jamal-A-Mohamed <[email protected]> Co-authored-by: Salvador <[email protected]> * Fix/Deprecate FmaBrotherhood Generator This commit fixes the naming discrpencies with the FmaBrotherhood (now FullmetalAlchemistBrotherhood) class and its filename. This adds deprecation warnings for the old FmaBrotherhood class and also makes the new FullmetalAlchemistBrotherhood class. Fix: - #2853 * Refactor deprecation for `FmaBrotherhood` This commit will refactor the changes from `FmaBrotherhood` to `FullmetalAlchemistBrotherhood` and use `Faker::Deprecator`. --------- Co-authored-by: Jamal-A-Mohamed <[email protected]> Co-authored-by: Salvador <[email protected]> Co-authored-by: Stefanni Brasil <[email protected]>
1 parent f586da7 commit 7990a43

File tree

5 files changed

+39
-18
lines changed

5 files changed

+39
-18
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -376,7 +376,7 @@ gem 'faker', :git => 'https://github.com/faker-ruby/faker.git', :branch => 'main
376376
- [Faker::JapaneseMedia::Naruto](doc/japanese_media/naruto.md)
377377
- [Faker::JapaneseMedia::Doraemon](doc/japanese_media/doraemon.md)
378378
- [Faker::JapaneseMedia::Conan](doc/japanese_media/conan.md)
379-
- [Faker::JapaneseMedia::FmaBrotherhood](doc/japanese_media/fullmetal_alchemist_brotherhood.md)
379+
- [Faker::JapaneseMedia::FullmetalAlchemistBrotherhood](doc/japanese_media/fullmetal_alchemist_brotherhood.md)
380380
</details>
381381

382382
<details>
Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
# Faker::JapaneseMedia::FmaBrotherhood
1+
# Faker::JapaneseMedia::FullmetalAchemistBrotherhood
22

33
```ruby
4-
Faker::JapaneseMedia::FmaBrotherhood.character #=> "Edward Elric"
4+
Faker::JapaneseMedia::FullmetalAchemistBrotherhood.character #=> "Edward Elric"
55

6-
Faker::JapaneseMedia::FmaBrotherhood.city #=> "Central City"
6+
Faker::JapaneseMedia::FullmetalAchemistBrotherhood.city #=> "Central City"
77

8-
Faker::JapaneseMedia::FmaBrotherhood.country #=> "Xing"
8+
Faker::JapaneseMedia::FullmetalAchemistBrotherhood.country #=> "Xing"
99
```

lib/faker/japanese_media/fullmetal_alchemist_brotherhood.rb

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2,47 +2,50 @@
22

33
module Faker
44
class JapaneseMedia
5-
class FmaBrotherhood < Base
5+
class FullmetalAlchemistBrotherhood < Base
66
class << self
77
##
8-
# Produces a character from FmaBrotherhood.
8+
# Produces a character from FullmetalAlchemistBrotherhood.
99
#
1010
# @return [String]
1111
#
1212
# @example
13-
# Faker::JapaneseMedia::FmaBrotherhood.character #=> "Edward Elric"
13+
# Faker::JapaneseMedia::FullmetalAlchemistBrotherhood.character #=> "Edward Elric"
1414
#
1515
# @faker.version next
1616
def character
17-
fetch('fma_brotherhood.characters')
17+
fetch('fullmetal_alchemist_brotherhood.characters')
1818
end
1919

2020
##
21-
# Produces a cities from FmaBrotherhood.
21+
# Produces a cities from FullmetalAlchemistBrotherhood.
2222
#
2323
# @return [String]
2424
#
2525
# @example
26-
# Faker::JapaneseMedia::FmaBrotherhood.city #=> "Central City"
26+
# Faker::JapaneseMedia::FullmetalAlchemistBrotherhood.city #=> "Central City"
2727
#
2828
# @faker.version next
2929
def city
30-
fetch('fma_brotherhood.cities')
30+
fetch('fullmetal_alchemist_brotherhood.cities')
3131
end
3232

3333
##
34-
# Produces a country from FmaBrotherhood.
34+
# Produces a country from FullmetalAlchemistBrotherhood.
3535
#
3636
# @return [String]
3737
#
3838
# @example
39-
# Faker::JapaneseMedia::FmaBrotherhood.country #=> "Xing"
39+
# Faker::JapaneseMedia::FullmetalAlchemistBrotherhood.country #=> "Xing"
4040
#
4141
# @faker.version next
4242
def country
43-
fetch('fma_brotherhood.countries')
43+
fetch('fullmetal_alchemist_brotherhood.countries')
4444
end
4545
end
4646
end
47+
48+
include Faker::Deprecator
49+
deprecate_generator('FmaBrotherhood', FullmetalAlchemistBrotherhood)
4750
end
4851
end

lib/locales/en/fma_brotherhood.yml renamed to lib/locales/en/fullmetal_alchemist_brotherhood.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
en:
22
faker:
3-
fma_brotherhood:
3+
fullmetal_alchemist_brotherhood:
44
characters:
55
- Edward Elric
66
- Alphonse Elric
77
- Roy Mustang
88
- Riza Hawkeye
99
- Scar
1010
- Winry Rockbell
11-
- May Chang
11+
- May Chang
1212
- Maes Hughes
1313
- Alex Louis Armstrong
1414
- Jean Havoc
@@ -47,7 +47,7 @@ en:
4747
- Isaac McDougal
4848
- Solf J. Kimblee
4949
- Van Hohenheim
50-
- Fu
50+
- Fu
5151
- Ling Yao
5252
- Lan Fan
5353
- Olivier Mira Armstrong

test/faker/japanese_media/test_faker_fullmetal_alchemist_brotherhood.rb

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,3 +19,21 @@ def test_country
1919
assert_match(/\w+/, @tester.country)
2020
end
2121
end
22+
23+
class TestFakerFullmetalAlchemistBrotherhood < Test::Unit::TestCase
24+
def setup
25+
@tester = Faker::JapaneseMedia::FullmetalAlchemistBrotherhood
26+
end
27+
28+
def test_character
29+
assert_match(/\w+/, @tester.character)
30+
end
31+
32+
def test_city
33+
assert_match(/\w+/, @tester.city)
34+
end
35+
36+
def test_country
37+
assert_match(/\w+/, @tester.country)
38+
end
39+
end

0 commit comments

Comments
 (0)