From fc8fc6471574c865adee0435d92fac290f7d36e7 Mon Sep 17 00:00:00 2001 From: Paul Gallagher Date: Thu, 24 Jun 2021 20:08:18 +0800 Subject: [PATCH] Add Faker::TvShows::TheOfficeOriginal because, you know, I saw Faker::TvShows::TheOffice get added yesterday;-) --- README.md | 2 + doc/tv_shows/the_office_original.md | 7 +++ lib/faker/tv_shows/the_office_original.rb | 37 +++++++++++++++ lib/locales/en/the_office_original.yml | 46 +++++++++++++++++++ .../tv_shows/test_the_office_original.rb | 17 +++++++ 5 files changed, 109 insertions(+) create mode 100644 doc/tv_shows/the_office_original.md create mode 100644 lib/faker/tv_shows/the_office_original.rb create mode 100644 lib/locales/en/the_office_original.yml create mode 100644 test/faker/tv_shows/test_the_office_original.rb diff --git a/README.md b/README.md index d1795f9601..8d040bfc51 100644 --- a/README.md +++ b/README.md @@ -343,6 +343,8 @@ gem 'faker', :git => 'https://github.com/faker-ruby/faker.git', :branch => 'mast - [Faker::TvShows::TheExpanse](doc/tv_shows/the_expanse.md) - [Faker::TvShows::TheFreshPrinceOfBelAir](doc/tv_shows/the_fresh_prince_of_bel_air.md) - [Faker::TvShows::TheITCrowd](doc/tv_shows/the_it_crowd.md) + - [Faker::TvShows::TheOffice](doc/tv_shows/the_office.md) + - [Faker::TvShows::TheOfficeOriginal](doc/tv_shows/the_office_original.md) - [Faker::TvShows::TheThickOfIt](doc/tv_shows/the_thick_of_it.md) - [Faker::TvShows::TwinPeaks](doc/tv_shows/twin_peaks.md) - [Faker::TvShows::VentureBros](doc/tv_shows/venture_bros.md) diff --git a/doc/tv_shows/the_office_original.md b/doc/tv_shows/the_office_original.md new file mode 100644 index 0000000000..62cf4e6173 --- /dev/null +++ b/doc/tv_shows/the_office_original.md @@ -0,0 +1,7 @@ +# Faker::TvShows::TheOfficeOriginal + +```ruby +Faker::TvShows::TheOfficeOriginal.character #=> "David Brent" + +Faker::TvShows::TheOfficeOriginal.quote #=> "Unconditional trust. Mutual, likewise, reciprocated." +``` \ No newline at end of file diff --git a/lib/faker/tv_shows/the_office_original.rb b/lib/faker/tv_shows/the_office_original.rb new file mode 100644 index 0000000000..f32d081057 --- /dev/null +++ b/lib/faker/tv_shows/the_office_original.rb @@ -0,0 +1,37 @@ +# frozen_string_literal: true + +module Faker + class TvShows + class TheOfficeOriginal < Base + flexible :the_office_original + + class << self + ## + # Produces a character from The Office (original UK version). + # + # @return [String] + # + # @example + # Faker::TvShows::TheOfficeOriginal.character #=> "David Brent" + # + # @faker.version next + def character + fetch('the_office_original.characters') + end + + ## + # Produces a quote from The Office (original UK version). + # + # @return [String] + # + # @example + # Faker::TvShows::TheOfficeOriginal.quote #=> "Unconditional trust. Mutual, likewise, reciprocated." + # + # @faker.version next + def quote + fetch('the_office_original.quotes') + end + end + end + end +end diff --git a/lib/locales/en/the_office_original.yml b/lib/locales/en/the_office_original.yml new file mode 100644 index 0000000000..58bbb42a20 --- /dev/null +++ b/lib/locales/en/the_office_original.yml @@ -0,0 +1,46 @@ +en: + faker: + the_office_original: + characters: + [ + "David Brent", + "Tim Canterbury", + "Gareth Keenan", + "Dawn Tinsley", + "Jennifer Taylor-Clarke", + "Ricky Howard", + "Chris Finch", + "Neil Godwin", + "Rachel", + "Anne", + "Keith Bishop", + "Lee", + "Glynn aka Taffy", + "Malcolm", + "Donna", + "Karen Roper", + "Trudy", + "Oliver", + "Brenda", + "Rowan", + "Simon", + "Ray", + "Helena", + "Carol", + "Oggy", + ] + quotes: + [ + "Unconditional trust. Mutual, likewise, reciprocated.", + "I’m taking them into battle, and I’m doing my own stapling.", + "Ipso facto. Trust received, responsibility given and taken.", + "Were we successful? I’ll let you judge that when I tell you that we were once supported by a little-known Scottish outfit called Texas.", + "Yeah? If you were to ask me to name three geniuses, I probably wouldn’t say Einstein, Newton You know. I’d go Milligan, Cleese, Everett. Sessions.", + "Whilst getting the job done, they’re having a laugh at work with the Sword of Damocles hanging over them.", + "We are the most efficient branch – cogito ergo sum – we’ll be fine.", + "But, er I suppose I’ve created an atmosphere where I’m a friend first and a boss second. Probably an entertainer third.", + "What upsets me about the job? Um Wasted talent, yeah? People could come to me and they could go, David, you’ve been in the business twelve years. Can you spare us a moment to tell us how to run a team? How to keep them task-orientated as well as happy. But they don’t. That’s the tragedy.", + "You just have to accept that some days you are the pigeon, and some days you are the statue.", + "A sergeant major spends his time training his men to be killers. He doesn’t polish his own boots. He probably does polish his own boots, but, you know, that doesn’t mean I have to do my own filing.", + "You will never work in a place like this again. It’s brilliant. Fact. And you’ll never have another boss like me, someone who’s basically a chilled-out entertainer.", + ] diff --git a/test/faker/tv_shows/test_the_office_original.rb b/test/faker/tv_shows/test_the_office_original.rb new file mode 100644 index 0000000000..8856c0fdb4 --- /dev/null +++ b/test/faker/tv_shows/test_the_office_original.rb @@ -0,0 +1,17 @@ +# frozen_string_literal: true + +require_relative '../../test_helper' + +class TestFakerTvShowsTheOfficeOriginal < Test::Unit::TestCase + def setup + @tester = Faker::TvShows::TheOfficeOriginal + end + + def test_characters + assert @tester.character.match(/\w+/) + end + + def test_quotes + assert @tester.quote.match(/\w+/) + end +end