Skip to content

Commit

Permalink
Deprecate celebrity methods in favor of actor (faker-ruby#2133)
Browse files Browse the repository at this point in the history
* Deprecated the 'Buffy.celebrity' and 'TheFreshPrinceOfBelAir.celebrity' methods with corresponding 'actor' methods.

* Fixing version tag to be 'next'.
  • Loading branch information
vraravam authored and droznyk committed Oct 23, 2020
1 parent 50100b4 commit 213408c
Show file tree
Hide file tree
Showing 8 changed files with 48 additions and 12 deletions.
2 changes: 1 addition & 1 deletion doc/tv_shows/buffy.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Faker::TvShows::Buffy.character #=> "Buffy Summers"

Faker::TvShows::Buffy.quote #=> "If the apocalypse comes, beep me."

Faker::TvShows::Buffy.celebrity #=> "John Ritter"
Faker::TvShows::Buffy.actor #=> "John Ritter"

Faker::TvShows::Buffy.big_bad #=> "Glory"

Expand Down
2 changes: 1 addition & 1 deletion doc/tv_shows/the_fresh_prince_of_bel_air.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
```ruby
Faker::TvShows::TheFreshPrinceOfBelAir.character #=> "Will Smith"

Faker::TvShows::TheFreshPrinceOfBelAir.celebrity #=> "Quincy Jones"
Faker::TvShows::TheFreshPrinceOfBelAir.actor #=> "Quincy Jones"

Faker::TvShows::TheFreshPrinceOfBelAir.quote #=> "Girl, you look so good, I would marry your brother just to get in your family."
```
21 changes: 17 additions & 4 deletions lib/faker/tv_shows/buffy.rb
Original file line number Diff line number Diff line change
Expand Up @@ -33,17 +33,30 @@ def quote
end

##
# Produces a celebrity from Buffy the Vampire Slayer.
# Produces a actor from Buffy the Vampire Slayer.
#
# @return [String]
#
# @example
# Faker::TvShows::Buffy.actor #=> "John Ritter"
#
# @faker.version next
def actor
fetch('buffy.actors')
end

##
# Produces a actor from Buffy the Vampire Slayer.
#
# @return [String]
#
# @example
# Faker::TvShows::Buffy.celebrity #=> "John Ritter"
#
# @deprecated Use the `actor` method instead.
#
# @faker.version 1.9.2
def celebrity
fetch('buffy.celebrities')
end
alias celebrity actor

##
# Produces a big bad from Buffy the Vampire Slayer.
Expand Down
21 changes: 17 additions & 4 deletions lib/faker/tv_shows/the_fresh_prince_of_bel_air.rb
Original file line number Diff line number Diff line change
Expand Up @@ -20,17 +20,30 @@ def character
end

##
# Produces a celebrity from The Fresh Prince of Bel-Air.
# Produces a actor from The Fresh Prince of Bel-Air.
#
# @return [String]
#
# @example
# Faker::TvShows::TheFreshPrinceOfBelAir.actor #=> "Quincy Jones"
#
# @faker.version next
def actor
fetch('the_fresh_prince_of_bel_air.actors')
end

##
# Produces a actor from The Fresh Prince of Bel-Air.
#
# @return [String]
#
# @example
# Faker::TvShows::TheFreshPrinceOfBelAir.celebrity #=> "Quincy Jones"
#
# @deprecated Use the `actor` method instead.
#
# @faker.version 1.8.3
def celebrity
fetch('the_fresh_prince_of_bel_air.celebrities')
end
alias celebrity actor

##
# Produces a quote from The Fresh Prince of Bel-Air.
Expand Down
2 changes: 1 addition & 1 deletion lib/locales/en/buffy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ en:
"We don't know much about them except for they're very ugly, and they're very mobile for blind people.",
"And I wonder what possible catastrophe came crashing down from heaven and brought this dashing stranger to tears?"
]
celebrities: [
actors: [
'Sarah Michelle Geller',
'Alyson Hannigan',
'David Boreanaz',
Expand Down
2 changes: 1 addition & 1 deletion lib/locales/en/fresh_prince_of_bel_air.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ en:
faker:
the_fresh_prince_of_bel_air:
characters: ['Will Smith', 'Philip Banks', 'Carlton Banks', 'Ashley Banks', 'Hilary Banks', 'Vivian Banks', 'Nicky Banks', 'Geoffrey Butler', 'Jazz', 'Vy Smith', 'Hattie Banks', 'Lisa Wilkes', 'Jackie Ames', 'Henry Furth', 'Trevor', 'Tyriq', 'Ice Tray', 'Dee Dee', 'Kellogg Lieberbaum', 'Coach Smiley', 'Judge Carl Robertson']
celebrities: ['Quincy Jones', 'Jay Leno', 'Ronald Reagan', 'Dick Clark', 'Evander Holyfield', 'Isaiah Thomas', 'Heavy D', 'Don Cornelius', 'Kadeem Hardison', 'Hugh M. Hefner', 'Kareem Abdul-Jabbar', 'Bo Jackson', 'Ken Griffey Jr.', 'Al B. Sure!', 'John Ridley', 'Doctor Dré', 'Regis Philbin', 'William Shatner', 'B. B. King', 'Kim Fields', 'Arthel Neville', 'Oprah Winfrey', 'Donal J. Trump', 'Leeza Gibbons', 'Susan Powter', 'Tempestt Bledsoe', 'Kathie Lee Gifford', 'Garcelle Beauvais', 'Bree Walker']
actors: ['Quincy Jones', 'Jay Leno', 'Ronald Reagan', 'Dick Clark', 'Evander Holyfield', 'Isaiah Thomas', 'Heavy D', 'Don Cornelius', 'Kadeem Hardison', 'Hugh M. Hefner', 'Kareem Abdul-Jabbar', 'Bo Jackson', 'Ken Griffey Jr.', 'Al B. Sure!', 'John Ridley', 'Doctor Dré', 'Regis Philbin', 'William Shatner', 'B. B. King', 'Kim Fields', 'Arthel Neville', 'Oprah Winfrey', 'Donal J. Trump', 'Leeza Gibbons', 'Susan Powter', 'Tempestt Bledsoe', 'Kathie Lee Gifford', 'Garcelle Beauvais', 'Bree Walker']
quotes: [
"Girl, you look so good, I would marry your brother just to get in your family.",
"In west Philadelphia born and raised, on the playground was where I spent most of my days.",
Expand Down
5 changes: 5 additions & 0 deletions test/faker/tv_shows/test_buffy.rb
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,11 @@ def test_quote
assert @tester.quote.match(/\w+/)
end

def test_actor
assert @tester.actor.match(/\w+/)
end

# deprecated
def test_celebrity
assert @tester.celebrity.match(/\w+/)
end
Expand Down
5 changes: 5 additions & 0 deletions test/faker/tv_shows/test_the_fresh_prince_of_bel_air.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,11 @@ def test_character
assert @tester.character.match(/\w+/)
end

def test_actor
assert @tester.actor.match(/\w+/)
end

# deprecated
def test_celebrity
assert @tester.celebrity.match(/\w+/)
end
Expand Down

0 comments on commit 213408c

Please sign in to comment.