-
Notifications
You must be signed in to change notification settings - Fork 3.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add Faker::JapaneseMedia namespace (#1420)
* Create Faker::JapaneseMedia namespace * Deprecate top-level JapaneseMedia methods * Update individual documentation for JapaneseMedia * Update changelog
- Loading branch information
Showing
20 changed files
with
207 additions
and
36 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
# Faker::DragonBall | ||
# Faker::JapaneseMedia::DragonBall | ||
|
||
Available since version 1.8.0. | ||
|
||
```ruby | ||
Faker::DragonBall.character #=> "Goku" | ||
Faker::JapaneseMedia::DragonBall.character #=> "Goku" | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,15 @@ | ||
# Faker::OnePiece | ||
# Faker::JapaneseMedia::OnePiece | ||
|
||
```ruby | ||
Faker::OnePiece.character #=> "Monkey D. Luffy" | ||
Faker::JapaneseMedia::OnePiece.character #=> "Monkey D. Luffy" | ||
|
||
Faker::OnePiece.sea #=> "East Blue" | ||
Faker::JapaneseMedia::OnePiece.sea #=> "East Blue" | ||
|
||
Faker::OnePiece.island #=> "Laftel" | ||
Faker::JapaneseMedia::OnePiece.island #=> "Laftel" | ||
|
||
Faker::OnePiece.location #=> "Foosha Village" | ||
Faker::JapaneseMedia::OnePiece.location #=> "Foosha Village" | ||
|
||
Faker::OnePiece.quote #=> "ONE PIECE IS REAL!" | ||
Faker::JapaneseMedia::OnePiece.quote #=> "ONE PIECE IS REAL!" | ||
|
||
Faker::OnePiece.akuma_no_mi #=> "Gomu Gomu no Mi" | ||
Faker::JapaneseMedia::OnePiece.akuma_no_mi #=> "Gomu Gomu no Mi" | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,18 @@ | ||
# Faker::SwordArtOnline | ||
# Faker::JapaneseMedia::SwordArtOnline | ||
|
||
Available since version 1.9.0. | ||
|
||
```ruby | ||
# Random Sword Art Online real name | ||
Faker::SwordArtOnline.real_name #=> "Kirigaya Kazuto" | ||
Faker::JapaneseMedia::SwordArtOnline.real_name #=> "Kirigaya Kazuto" | ||
|
||
# Random Sword Art Online game name | ||
Faker::SwordArtOnline.game_name #=> "Silica" | ||
Faker::JapaneseMedia::SwordArtOnline.game_name #=> "Silica" | ||
|
||
# Random Sword Art Online location | ||
Faker::SwordArtOnline.location #=> "Ruby Palace" | ||
Faker::JapaneseMedia::SwordArtOnline.location #=> "Ruby Palace" | ||
|
||
# Random Sword Art Online item | ||
Faker::SwordArtOnline.item #=> "Blackwyrm Coat" | ||
Faker::JapaneseMedia::SwordArtOnline.item #=> "Blackwyrm Coat" | ||
|
||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,15 @@ | ||
# frozen_string_literal: true | ||
|
||
module Faker | ||
class DragonBall < Base | ||
module DragonBall | ||
class << self | ||
extend Gem::Deprecate | ||
|
||
def character | ||
fetch('dragon_ball.characters') | ||
Faker::JapaneseMedia::DragonBall.character | ||
end | ||
|
||
deprecate :character, 'Faker::JapaneseMedia::DragonBall.character', 2018, 10 | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
# frozen_string_literal: true | ||
|
||
module Faker | ||
module JapaneseMedia | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
# frozen_string_literal: true | ||
|
||
module Faker | ||
module JapaneseMedia | ||
class DragonBall < Base | ||
class << self | ||
def character | ||
fetch('dragon_ball.characters') | ||
end | ||
end | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
# frozen_string_literal: true | ||
|
||
module Faker | ||
module JapaneseMedia | ||
class OnePiece < Base | ||
class << self | ||
def character | ||
fetch('one_piece.characters') | ||
end | ||
|
||
def sea | ||
fetch('one_piece.seas') | ||
end | ||
|
||
def island | ||
fetch('one_piece.islands') | ||
end | ||
|
||
def location | ||
fetch('one_piece.locations') | ||
end | ||
|
||
def quote | ||
fetch('one_piece.quotes') | ||
end | ||
|
||
def akuma_no_mi | ||
fetch('one_piece.akumas_no_mi') | ||
end | ||
end | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
# frozen_string_literal: true | ||
|
||
module Faker | ||
module JapaneseMedia | ||
class SwordArtOnline < Base | ||
class << self | ||
def real_name | ||
fetch('sword_art_online.real_name') | ||
end | ||
|
||
def game_name | ||
fetch('sword_art_online.game_name') | ||
end | ||
|
||
def location | ||
fetch('sword_art_online.location') | ||
end | ||
|
||
def item | ||
fetch('sword_art_online.item') | ||
end | ||
end | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,31 +1,40 @@ | ||
# frozen_string_literal: true | ||
|
||
module Faker | ||
class OnePiece < Base | ||
module OnePiece | ||
class << self | ||
extend Gem::Deprecate | ||
|
||
def character | ||
fetch('one_piece.characters') | ||
Faker::JapaneseMedia::OnePiece.character | ||
end | ||
|
||
def sea | ||
fetch('one_piece.seas') | ||
Faker::JapaneseMedia::OnePiece.sea | ||
end | ||
|
||
def island | ||
fetch('one_piece.islands') | ||
Faker::JapaneseMedia::OnePiece.island | ||
end | ||
|
||
def location | ||
fetch('one_piece.locations') | ||
Faker::JapaneseMedia::OnePiece.location | ||
end | ||
|
||
def quote | ||
fetch('one_piece.quotes') | ||
Faker::JapaneseMedia::OnePiece.quote | ||
end | ||
|
||
def akuma_no_mi | ||
fetch('one_piece.akumas_no_mi') | ||
Faker::JapaneseMedia::OnePiece.akuma_no_mi | ||
end | ||
|
||
deprecate :character, 'Faker::JapaneseMedia::OnePiece.character', 2018, 10 | ||
deprecate :sea, 'Faker::JapaneseMedia::OnePiece.sea', 2018, 10 | ||
deprecate :island, 'Faker::JapaneseMedia::OnePiece.island', 2018, 10 | ||
deprecate :location, 'Faker::JapaneseMedia::OnePiece.location', 2018, 10 | ||
deprecate :quote, 'Faker::JapaneseMedia::OnePiece.quote', 2018, 10 | ||
deprecate :akuma_no_mi, 'Faker::JapaneseMedia::OnePiece.akuma_no_mi', 2018, 10 | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,30 @@ | ||
# frozen_string_literal: true | ||
|
||
module Faker | ||
class SwordArtOnline < Base | ||
module SwordArtOnline | ||
class << self | ||
extend Gem::Deprecate | ||
|
||
def real_name | ||
fetch('sword_art_online.real_name') | ||
Faker::JapaneseMedia::SwordArtOnline.real_name | ||
end | ||
|
||
def game_name | ||
fetch('sword_art_online.game_name') | ||
Faker::JapaneseMedia::SwordArtOnline.game_name | ||
end | ||
|
||
def location | ||
fetch('sword_art_online.location') | ||
Faker::JapaneseMedia::SwordArtOnline.location | ||
end | ||
|
||
def item | ||
fetch('sword_art_online.item') | ||
Faker::JapaneseMedia::SwordArtOnline.item | ||
end | ||
|
||
deprecate :real_name, 'Faker::JapaneseMedia::SwordArtOnline.real_name', 2018, 10 | ||
deprecate :game_name, 'Faker::JapaneseMedia::SwordArtOnline.game_name', 2018, 10 | ||
deprecate :location, 'Faker::JapaneseMedia::SwordArtOnline.location', 2018, 10 | ||
deprecate :item, 'Faker::JapaneseMedia::SwordArtOnline.item', 2018, 10 | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
# frozen_string_literal: true | ||
|
||
require_relative 'test_helper' | ||
|
||
class TestFakerDragonBall < Test::Unit::TestCase | ||
def setup | ||
@tester = Faker::DragonBall | ||
end | ||
|
||
def test_character | ||
assert @tester.character.match(/\w+/) | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
# frozen_string_literal: true | ||
|
||
require_relative 'test_helper' | ||
|
||
class TestFakerOnePiece < Test::Unit::TestCase | ||
def setup | ||
@tester = Faker::OnePiece | ||
end | ||
|
||
def test_character | ||
assert @tester.character.match(/\w+/) | ||
end | ||
|
||
def test_sea | ||
assert @tester.sea.match(/\w+/) | ||
end | ||
|
||
def test_island | ||
assert @tester.island.match(/\w+/) | ||
end | ||
|
||
def test_location | ||
assert @tester.location.match(/\w+/) | ||
end | ||
|
||
def test_quote | ||
assert @tester.quote.match(/\w+/) | ||
end | ||
|
||
def test_akuma_no_mi | ||
assert @tester.akuma_no_mi.match(/\w+/) | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
# frozen_string_literal: true | ||
|
||
require_relative 'test_helper' | ||
|
||
class TestFakerSwordArtOnline < Test::Unit::TestCase | ||
def setup | ||
@tester = Faker::SwordArtOnline | ||
end | ||
|
||
def test_real_name | ||
assert @tester.real_name.match(/\w+\.?/) | ||
end | ||
|
||
def test_game_name | ||
assert @tester.game_name.match(/\w+\.?/) | ||
end | ||
|
||
def test_location | ||
assert @tester.location.match(/\w+\.?/) | ||
end | ||
|
||
def test_item | ||
assert @tester.item.match(/\w+\.?/) | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.