-
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::GreekPhilosophers (#1300)
* Added greek philosophers class, yaml file, test, and doc * Update CHANGELOG.md * Update README.md * Update greek_philosophers.md
- Loading branch information
1 parent
c5bd060
commit a20adad
Showing
6 changed files
with
66 additions
and
1 deletion.
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 |
---|---|---|
@@ -0,0 +1,9 @@ | ||
# Faker::GreekPhilosophers | ||
|
||
It might be available in the next version. | ||
|
||
```ruby | ||
Faker::GreekPhilosophers.name #=> "Socrates" | ||
|
||
Faker::GreekPhilosophers.quote #=> "Only the educated are free." | ||
``` |
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 @@ | ||
module Faker | ||
class GreekPhilosophers < Base | ||
class << self | ||
def name | ||
fetch('greek_philosophers.names') | ||
end | ||
|
||
def quote | ||
fetch('greek_philosophers.quotes') | ||
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,26 @@ | ||
en: | ||
faker: | ||
greek_philosophers: | ||
names: ["Plato", "Aristotle", "Pythagoras", "Heraclitus", "Parmenides", "Democritus", "Zeno of Elea", "Epicurus", "Anaxagoras", "Diogenes", "Antisthenes", "Gorgias", "Hippocrates", "Plutarch", "Proclus", "Chrysippus", "Solon", "Archimedes", "Thucydides", "Arcesilaus", "Posidonius", "Galen"] | ||
quotes: [ | ||
"Quality is not an act, it is a habit.", | ||
"Only the educated are free.", | ||
"Control thy passions lest they take vengence on thee.", | ||
"Love is composed of a single soul inhabiting two bodies.", | ||
"Rhetoric is the art of ruling the minds of men.", | ||
"The unexamined life is not worth living.", | ||
"There was never a genius without a tincture of madness.", | ||
"Dignity does not consist in possessing honors, but in deserving them.", | ||
"Most people would rather give than get affection.", | ||
"Beware the barrenness of a busy life.", | ||
"The secret to humor is surprise.", | ||
"Pleasure in the job puts perfection in the work.", | ||
"Philosophy is the highest music.", | ||
"The virtue of justice consists in moderation, as regulated by wisdom.", | ||
"Know how to listen, and you will profit even from those who talk badly.", | ||
"A few vices are sufficient to darken many virtues.", | ||
"It is impossible to begin to learn that which one thinks one already knows.", | ||
"It's not what happens to you, but how you react to it that matters.", | ||
"The mind is not a vessel to be filled but a fire to be kindled.", | ||
"Good habits formed at youth make all the difference.", | ||
] |
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,15 @@ | ||
require_relative 'test_helper' | ||
|
||
class TestFakerGreekPhilosophers < Test::Unit::TestCase | ||
def setup | ||
@tester = Faker::GreekPhilosophers | ||
end | ||
|
||
def test_name | ||
assert @tester.name.match(/\w+/) | ||
end | ||
|
||
def test_quote | ||
assert @tester.quote.match(/\w+/) | ||
end | ||
end |