From 087c438d2168379e8beba2e3f1db6403d4b1e832 Mon Sep 17 00:00:00 2001 From: Jay Quigley Date: Sat, 15 May 2021 11:45:24 -0700 Subject: [PATCH] Add Faker::Emotion.word --- README.md | 1 + doc/default/emotion.md | 6 + lib/faker/default/emotion.rb | 31 ++ lib/locales/en/emotion.yml | 480 +++++++++++++++++++++++ test/faker/default/test_faker_emotion.rb | 17 + 5 files changed, 535 insertions(+) create mode 100644 doc/default/emotion.md create mode 100644 lib/faker/default/emotion.rb create mode 100644 lib/locales/en/emotion.yml create mode 100644 test/faker/default/test_faker_emotion.rb diff --git a/README.md b/README.md index 356e4cf0d3..d1795f9601 100644 --- a/README.md +++ b/README.md @@ -161,6 +161,7 @@ gem 'faker', :git => 'https://github.com/faker-ruby/faker.git', :branch => 'mast - [Faker::Drone](doc/drone/drone.md) - [Faker::Educator](doc/default/educator.md) - [Faker::ElectricalComponents](doc/default/electrical_components.md) + - [Faker::Emotion](doc/default/emotion.md) - [Faker::Esport](doc/default/esport.md) - [Faker::File](doc/default/file.md) - [Faker::Fillmurray](doc/default/fillmurray.md) diff --git a/doc/default/emotion.md b/doc/default/emotion.md new file mode 100644 index 0000000000..69e3a579be --- /dev/null +++ b/doc/default/emotion.md @@ -0,0 +1,6 @@ +# Faker::Emotion + +```ruby +Faker::Emotion.noun #=> "euphoria" +Faker::Emotion.adjective #=> "chagrined" +``` diff --git a/lib/faker/default/emotion.rb b/lib/faker/default/emotion.rb new file mode 100644 index 0000000000..6933685aec --- /dev/null +++ b/lib/faker/default/emotion.rb @@ -0,0 +1,31 @@ +# frozen_string_literal: true + +module Faker + class Emotion < Base + class << self + ## + # Produces an emotion noun. + # + # @return [String] + # + # @example + # Faker::Emotion.noun #=> "amazement" + # + def noun + fetch('emotion.noun') + end + + ## + # Produces an emotion adjective. + # + # @return [String] + # + # @example + # Faker::Emotion.adjective # => "nonplussed" + # + def adjective + fetch('emotion.adjective') + end + end + end +end diff --git a/lib/locales/en/emotion.yml b/lib/locales/en/emotion.yml new file mode 100644 index 0000000000..7c384d2dbd --- /dev/null +++ b/lib/locales/en/emotion.yml @@ -0,0 +1,480 @@ +en: + faker: + emotion: + adjective: + - abandoned + - able + - absorbed + - addled + - affable + - affectionate + - afraid + - aggravated + - aggressive + - agreeable + - alarmed + - amazed + - ambivalent + - amused + - angry + - annoyed + - anxious + - apprehensive + - ashamed + - astonished + - awed + - awkward + - baffled + - bashful + - bereaved + - bewildered + - bitter + - blissful + - blue + - bold + - bothered + - brave + - buoyant + - calm + - cantankerous + - capable + - carefree + - careful + - caring + - cautious + - chagrined + - charitable + - cheerful + - cold + - complacent + - composed + - compulsive + - concerned + - confident + - considerate + - contemptuous + - content + - contrite + - cooperative + - cranky + - crestfallen + - cross + - crushed + - curious + - daring + - defiant + - dejected + - delighted + - depressed + - detached + - determined + - devious + - disappointed + - discouraged + - disdainful + - disenchanted + - disengaged + - disgusted + - disillusioned + - disinterested + - dismayed + - dismissive + - distant + - doleful + - eager + - ecstatic + - edgy + - elated + - embarrassed + - emboldened + - enraged + - enthusiastic + - envious + - euphoric + - excited + - exhausted + - extravagant + - exuberant + - fair + - fatigued + - fearful + - flustered + - foolish + - forgiving + - frightened + - frustrated + - fulfilled + - funny + - furious + - generous + - glad + - gleeful + - gloomy + - glum + - gracious + - grateful + - greedy + - grief-stricken + - grouchy + - grumpy + - guarded + - guilty + - happy + - heartbroken + - helpless + - hesitant + - hopeless + - horrified + - humbled + - humiliated + - hurt + - hyperactive + - hysterical + - ignorant + - impatient + - impertinent + - inadequate + - indifferent + - inquisitive + - insecure + - inspired + - inspiring + - interested + - irked + - irrational + - irritable + - irritated + - isolated + - jaded + - jealous + - jittery + - jocular + - joyful + - joyous + - judged + - judgmental + - keen + - kind + - lackluster + - lazy + - leery + - lethargic + - listless + - lonely + - loving + - mad + - malevolent + - manic + - manipulated + - manipulative + - marvelous + - mean + - meek + - melancholy + - melodramatic + - mirthful + - mischievous + - miserable + - misunderstood + - moody + - mopey + - morose + - moved + - naive + - nasty + - naughty + - needed + - needy + - neglected + - neglectful + - nervous + - nice + - nonchalant + - nonplussed + - numb + - obedient + - obligated + - obsessed + - obsessive + - obstinate + - offended + - open + - openminded + - optimistic + - outraged + - overjoyed + - overloaded + - overpowered + - overstimulated + - panicked + - panicky + - passive + - peaceful + - peeved + - pensive + - perturbed + - petrified + - petty + - petulant + - placid + - playful + - pleased + - powerful + - powerless + - preoccupied + - pressured + - prickly + - prideful + - proud + - puzzled + - qualified + - quarrelsome + - querulous + - quiet + - quirky + - quivery + - rational + - rattled + - reasonable + - reasoned + - reassured + - rebellious + - refreshed + - rejuvenated + - relaxed + - relieved + - reluctant + - remorseful + - repulsed + - resentful + - reserved + - restless + - sad + - safe + - sanguine + - sarcastic + - satisfied + - scared + - scornful + - secure + - sensitive + - serene + - serious + - shy + - silly + - sincere + - skeptical + - smug + - sociable + - sorrowful + - spiteful + - startled + - stressed + - stubborn + - surprised + - sympathetic + - tearful + - teary + - temperamental + - tender + - terrified + - thankful + - thoughtful + - threatened + - tickled + - timid + - tired + - tiresome + - tolerant + - tolerated + - torn + - touched + - tranquil + - troubled + - trusted + - trusting + - trustworthy + - unafraid + - unappreciated + - uncertain + - uncomfortable + - undecided + - uneasy + - unhappy + - unimpressed + - unnerved + - unruffled + - unruly + - unsteady + - unsure + - uplifted + - uptight + - useful + - useless + - vacant + - vain + - valuable + - valued + - vexed + - vibrant + - victimized + - victorious + - violent + - vital + - vivacious + - volatile + - vulnerable + - warm + - wary + - wasted + - weak + - weary + - weepy + - whimsical + - whiny + - willful + - willing + - wishful + - wistful + - withdrawn + - witty + - woeful + - worn + - worried + - worthless + - wronged + - yearning + - yielding + - youthful + - zany + - zealous + - zestful + noun: + - adoration + - affection + - aggravation + - agitation + - agony + - alarm + - alienation + - amazement + - amusement + - anger + - anguish + - annoyance + - anxiety + - apprehension + - arousal + - astonishment + - attraction + - bitterness + - bliss + - caring + - cheerfulness + - compassion + - contempt + - contentment + - defeat + - dejection + - delight + - depression + - desire + - despair + - disappointment + - disgust + - dislike + - dismay + - displeasure + - distress + - dread + - eagerness + - ecstasy + - elation + - embarrassment + - enjoyment + - enthrallment + - enthusiasm + - envy + - euphoria + - exasperation + - excitement + - exhilaration + - fear + - ferocity + - fondness + - fright + - frustration + - fury + - gaiety + - gladness + - glee + - gloom + - glumness + - grief + - grouchiness + - grumpiness + - guilt + - happiness + - hate + - homesickness + - hope + - hopelessness + - horror + - hostility + - humiliation + - hurt + - hysteria + - infatuation + - insecurity + - insult + - irritation + - isolation + - jealousy + - liking + - loathing + - loneliness + - longing + - love + - lust + - melancholy + - misery + - mortification + - neglect + - nervousness + - optimism + - outrage + - panic + - passion + - pity + - pleasure + - pride + - rage + - rapture + - regret + - relief + - remorse + - resentment + - revulsion + - sadness + - scorn + - sentimentality + - shame + - shock + - sorrow + - spite + - suffering + - surprise + - sympathy + - tenderness + - tenseness + - terror + - thrill + - torment + - triumph + - uneasiness + - unhappiness + - vengefulness + - woe + - worry + - zeal + - zest diff --git a/test/faker/default/test_faker_emotion.rb b/test/faker/default/test_faker_emotion.rb new file mode 100644 index 0000000000..4f4989394b --- /dev/null +++ b/test/faker/default/test_faker_emotion.rb @@ -0,0 +1,17 @@ +# frozen_string_literal: true + +require_relative '../../test_helper' + +class TestFakerEmotion < Test::Unit::TestCase + def setup + @tester = Faker::Emotion + end + + def test_noun + assert @tester.noun.match(/\w+/) + end + + def test_adjective + assert @tester.adjective.match(/\w+/) + end +end