Skip to content

Commit

Permalink
Add Faker::Ancient
Browse files Browse the repository at this point in the history
Includes Ancient Greek gods, primordial deities, titans and common mortal heroes

Closes #765
  • Loading branch information
Paul Phönixweiß authored and stympy committed Dec 17, 2016
1 parent 2e28243 commit 87e65d3
Show file tree
Hide file tree
Showing 5 changed files with 65 additions and 0 deletions.
14 changes: 14 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ Contents
- [Faker::GameOfThrones](#fakergameofthrones)
- [Faker::Pokemon](#fakerpokemon)
- [Faker::Food](#fakerfood)
- [Faker::Ancient](#fakerancient)
- [Customization](#customization)
- [Contributing](#contributing)
- [Contact](#contact)
Expand Down Expand Up @@ -878,6 +879,19 @@ Faker::Food.spice #=> "Caraway Seed"
Faker::Food.measurement #=> "1/4 tablespoon"
```

###Faker::Ancient
----------------

```ruby
Faker::Ancient.god #=> "Zeus"
Faker::Ancient.primordial #=> "Gaia"
Faker::Ancient.titan #=> "Atlas"
Faker::Ancient.hero #=> "Achilles"
```

Customization
------------
Since you may want to make addresses and other types of data look different
Expand Down
1 change: 1 addition & 0 deletions lib/faker.rb
Original file line number Diff line number Diff line change
Expand Up @@ -230,6 +230,7 @@ def rand_in_range(from, to)
require 'faker/game_of_thrones'
require 'faker/pokemon'
require 'faker/food'
require 'faker/ancient'

require 'extensions/array'
require 'extensions/symbol'
Expand Down
21 changes: 21 additions & 0 deletions lib/faker/ancient.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
module Faker
class Ancient < Base
class << self
def god
fetch('ancient.god')
end

def primordial
fetch('ancient.primordial')
end

def titan
fetch('ancient.titan')
end

def hero
fetch('ancient.hero')
end
end
end
end
5 changes: 5 additions & 0 deletions lib/locales/en.yml
Original file line number Diff line number Diff line change
Expand Up @@ -429,3 +429,8 @@ en:
spices: ["Achiote Seed", "Ajwain Seed", "Ajwan Seed", "Allspice Ground", "Allspice Whole", "Amchoor", "Anise", "Anise Star", "Aniseed Whole", "Annatto Seed", "Arrowroot", "Asafoetida", "Baharat", "Balti Masala", "Balti Stir Fry Mix", "Basil", "Bay Leaves", "Bay Leaves Chopped", "BBQ Seasoning", "Biryani Spice Mix", "Cajun Seasoning", "Caraway Seed", "Cardamom Ground", "Cardamom Whole", "Cassia", "Cassia Bark", "Cayenne Pepper", "Celery Leaf", "Celery Salt", "Celery Seed", "Chamomile", "Chervil", "Chicken Seasoning", "Chilli Crushed", "Chilli Ground", "Chilli Pepper", "Chillies Whole", "China Star", "Chinese 5 Spice", "Chives", "Cinnamon Bark", "Cinnamon Ground", "Cinnamon Powder", "Cinnamon Sticks", "Cloves Ground", "Cloves Whole", "Colombo Powder", "Coriander Ground", "Coriander Leaf", "Coriander Seed", "Creole Seasoning", "Cumin Ground", "Cumin Seed", "Cumin Seed Black", "Cumin Seed Royal", "Curly Leaf Parsley", "Curry Chinese", "Curry Hot", "Curry Leaves", "Curry Madras Medium", "Curry Mild", "Curry Thai Green", "Curry Thai Red", "Dhansak Spice Mix", "Dill Herb", "Dill Leaf", "Dill Seed", "Fajita Seasoning", "Fennel Seed", "Fenugreek Ground", "Fenugreek Leaf", "Fenugreek Seed", "Fines Herbes", "Fish Seasoning", "Five Spice Mix", "French Lavender", "Galangal Ground", "Garam Masala", "Garlic Chips", "Garlic Granules", "Garlic Powder", "Garlic Salt", "German Chamomile", "Ginger Root", "Ginger Ground", "Green Cardamom", "Herbes de Provence", "Jalfrezi Curry Powder", "Jalfrezi Mix", "Jerk Seasoning", "Juniper Berries", "Kaffir Leaves", "Korma Curry Powder", "Korma Mix", "Lamb Seasoning", "Lavender", "Lemon Grass", "Lemon Grass Chopped", "Lemon Pepper", "Lime Leaves", "Lime Leaves Ground", "Liquorice Root", "Mace Ground", "Mace Whole", "Mango Powder", "Marjoram", "Methi", "Methi Leaves", "Mexican Salsa Mix", "Mint", "Mixed Herbs", "Mixed Spice", "Mulled Cider Spices", "Mulled Wine Spices", "Mustard Powder", "Mustard Seed Black", "Mustard Seed Brown", "Mustard Seed White", "Mustard Seed Yellow", "Nigella", "Nutmeg Ground", "Nutmeg Whole", "Onion Seed", "Orange Zest", "Oregano", "Paella Seasoning", "Paprika", "Paprika Hungarian", "Paprika Smoked", "Parsley", "Parsley Flat Leaf", "Pepper Black Coarse", "Pepper Black Ground", "Pepper White Ground", "Peppercorns Black", "Peppercorns Cracked Black", "Peppercorns Green", "Peppercorns Mixed", "Peppercorns Pink", "Peppercorns Szechwan", "Peppercorns White", "Pickling Spice", "Pimento Berries", "Pimento Ground", "Piri Piri Seasoning", "Pizza Topping Mix", "Poppy Seed", "Pot Marjoram", "Poudre de Colombo", "Ras-el-Hanout", "Rice Paper", "Rogan Josh Curry Powder", "Rogan Josh Mix", "Rose Baie", "Rosemary", "Saffron", "Sage", "Sea Salt Coarse", "Seasoning Salt", "Self Adhesive Spice Labels", "Sesame Seed", "Spearmint", "Spice Charts", "Steak Seasoning", "Sumac Ground", "Sweet Basil", "Sweet Laurel", "Tagine Seasoning", "Tandoori Masala", "Tandoori Mix", "Tarragon", "Thai Creen Curry Mix", "Thai Red Curry Mix", "Thai Stir Fry", "Thyme", "Tikka Masala", "Tikka Masala Curry Powder", "Turmeric", "Turmeric Powder", "Vanilla Bean", "Vanilla Pods", "Vegetable Seasoning", "Zahtar Spice Mix"]
measurements: ["teaspoon", "tablespoon", "cup", "pint", "quart", "gallon"]
measurement_sizes: ["1/4", "1/3", "1/2", "1", "2", "3"]
ancient:
god: ["Aphrodite", "Apollo", "Ares", "Artemis", "Athena", "Demeter", "Dionysus", "Hades", "Hephaestus", "Hera", "Hermes", "Hestia", "Poseidon", "Zeus"]
primordial: ["Aion", "Aether", "Ananke", "Chaos", "Chronos", "Erebus", "Eros", "Hypnos", "Nesoi", "Uranus", "Gaia", "Ourea", "Phanes", "Pontus", "Tartarus", "Thalassa", "Thanatos", "Hemera", "Nyx", "Nemesis"]
titan: ["Coeus", "Crius", "Cronus", "Hyperion", "Iapetus", "Mnemosyne", "Oceanus", "Phoebe", "Rhea", "Tethys", "Theia", "Themis", "Asteria", "Astraeus", "Atlas", "Aura", "Clymene", "Dione", "Helios", "Selene", "Eos", "Epimetheus", "Eurybia", "Eurynome", "Lelantos", "Leto", "Menoetius", "Metis", "Ophion", "Pallas", "Perses", "Prometheus", "Styx"]
hero: ["Abderus", "Achilles", "Aeneas", "Ajax", "Amphitryon", "Antilochus", "Bellerophon", "Castor", "Chrysippus", "Daedalus", "Diomedes", "Eleusis", "Eunostus", "Ganymede", "Hector", "Hercules", "Icarus", "Iolaus", "Jason", "Meleager", "Odysseus", "Orpheus", "Pandion", "Perseus", "Theseus", "Alcestis", "Amymone", "Andromache", "Andromeda", "Antigone", "Arachne", "Ariadne", "Atalanta", "Briseis", "Caeneus", "Cassandra", "Cassiopeia", "Clytemnestra", "Danaë", "Deianeira", "Electra", "Europa", "Hecuba", "Helen", "Hermione", "Iphigenia", "Ismene", "Jocasta", "Medea", "Medusa", "Niobe", "Pandora", "Penelope", "Phaedra", "Polyxena", "Semele", "Thrace"]
24 changes: 24 additions & 0 deletions test/test_faker_ancient.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
require File.expand_path(File.dirname(__FILE__) + '/test_helper.rb')

class TestFakerAncient < Test::Unit::TestCase
def setup
@tester = Faker::Ancient
end

def test_god
assert @tester.god.match(/\w+/)
end

def test_primordial
assert @tester.primordial.match(/\w+/)
end

def test_titan
assert @tester.titan.match(/\w+/)
end

def test_hero
assert @tester.hero.match(/\w+/)
end

end

0 comments on commit 87e65d3

Please sign in to comment.