-
Notifications
You must be signed in to change notification settings - Fork 3.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add Quotes namespace #1504
Merged
vbrazo
merged 11 commits into
faker-ruby:master
from
vbrazo:features/add-quotes-namespace
Jan 6, 2019
Merged
Add Quotes namespace #1504
Changes from 4 commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
d79fae2
Add Quotes namespace
vbrazo 5ec3301
Deprecate ::Yoda
vbrazo 8955979
Update unreleased_README.md
vbrazo 2628a64
Revert ::Fillmurray and ::GreekPhilosophers deprecations
vbrazo 08cc5e3
Deprecate ::Shakespeare
vbrazo ecec954
Fix ::Yoda deprecation
vbrazo 0713033
Minor changes after own review
vbrazo 6a9337c
Update yoda.rb
vbrazo 153ccd5
Merge branch 'master' into features/add-quotes-namespace
vbrazo 225fe54
Add quotes methods to Faker::Quote
vbrazo cdbbcc7
Merge branch 'features/add-quotes-namespace' of github.com:vbrazo/fak…
vbrazo File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 was deleted.
Oops, something went wrong.
18 changes: 9 additions & 9 deletions
18
doc/unreleased/default/greek_philosophers.md
100755 → 100644
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 |
---|---|---|
@@ -1,9 +1,9 @@ | ||
# Faker::GreekPhilosophers | ||
Available since version 1.9.0. | ||
```ruby | ||
Faker::GreekPhilosophers.name #=> "Socrates" | ||
Faker::GreekPhilosophers.quote #=> "Only the educated are free." | ||
``` | ||
# Faker::GreekPhilosophers | ||
|
||
Available since version 1.9.0. | ||
|
||
```ruby | ||
Faker::GreekPhilosophers.name #=> "Socrates" | ||
|
||
Faker::GreekPhilosophers.quote #=> "Only the educated are free." | ||
``` |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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,7 @@ | ||
# Faker::Quotes::FamousLastWords | ||
|
||
Available since version 1.9.0. | ||
|
||
```ruby | ||
Faker::Quotes::FamousLastWords.last_words #=> "My vocabulary did this to me. Your love will let you go on…" | ||
``` |
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,7 @@ | ||
# Faker::Quotes::Matz | ||
|
||
Available since version 1.8.0. | ||
|
||
```ruby | ||
Faker::Quotes::Matz.quote #=> "You want to enjoy life, don't you? If you get your job done quickly and your job is fun, that's good isn't it? That's the purpose of life, partly. Your life is better." | ||
``` |
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,6 @@ | ||
# Faker::Quotes::MostInterestingManInTheWorld | ||
|
||
```ruby | ||
# Random Most Interesting Man In The World quote | ||
Faker::Quotes::MostInterestingManInTheWorld.quote #=> "He can speak Russian… in French" | ||
``` |
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,7 @@ | ||
# Faker::Quotes::Robin | ||
|
||
Available since version 1.8.0. | ||
|
||
```ruby | ||
Faker::Quotes::Robin.quote #=> "Holy Razors Edge" | ||
``` |
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,7 @@ | ||
# Faker::Quotes::SingularSiegler | ||
|
||
Available since version 1.9.0. | ||
|
||
```ruby | ||
Faker::Quotes::SingularSiegler.quote #=> "Texas!" | ||
``` |
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,7 @@ | ||
# Faker::Quotes::Yoda | ||
|
||
Available since version 1.9.0. | ||
|
||
```ruby | ||
Faker::Quotes::Yoda.quote #=> "Use your feelings, Obi-Wan, and find him you will." | ||
``` |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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
File renamed without changes.
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,15 @@ | ||
# frozen_string_literal: true | ||
|
||
module Faker | ||
class MostInterestingManInTheWorld < Base | ||
class << self | ||
extend Gem::Deprecate | ||
|
||
def quote | ||
Faker::Quotes::MostInterestingManInTheWorld.quote | ||
end | ||
|
||
deprecate :quote, 'Faker::Quotes::MostInterestingManInTheWorld.quote', 2018, 12 | ||
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,15 @@ | ||
# frozen_string_literal: true | ||
|
||
module Faker | ||
class Robin < Base | ||
class << self | ||
extend Gem::Deprecate | ||
|
||
def quote | ||
Faker::Quotes::Robin.quote | ||
end | ||
|
||
deprecate :quote, 'Faker::Quotes::Robin.quote', 2018, 12 | ||
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,15 @@ | ||
# frozen_string_literal: true | ||
|
||
module Faker | ||
class SingularSiegler < Base | ||
class << self | ||
extend Gem::Deprecate | ||
|
||
def quote | ||
Faker::Quotes::SingularSiegler.quote | ||
end | ||
|
||
deprecate :quote, 'Faker::Quotes::SingularSiegler.quote', 2018, 12 | ||
end | ||
end | ||
end |
File renamed without changes.
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,15 @@ | ||
# frozen_string_literal: true | ||
|
||
module Faker | ||
class Quotes | ||
class FamousLastWords < Base | ||
flexible :famous_last_words | ||
|
||
class << self | ||
def last_words | ||
fetch('famous_last_words.last_words') | ||
end | ||
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,13 @@ | ||
# frozen_string_literal: true | ||
|
||
module Faker | ||
class Quotes | ||
class Matz < Base | ||
class << self | ||
def quote | ||
fetch('matz.quotes') | ||
end | ||
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,13 @@ | ||
# frozen_string_literal: true | ||
|
||
module Faker | ||
class Quotes | ||
class MostInterestingManInTheWorld < Base | ||
class << self | ||
def quote | ||
fetch('most_interesting_man_in_the_world.quotes') | ||
end | ||
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,13 @@ | ||
# frozen_string_literal: true | ||
|
||
module Faker | ||
class Quotes | ||
class Robin < Base | ||
class << self | ||
def quote | ||
fetch('robin.quotes') | ||
end | ||
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,13 @@ | ||
# frozen_string_literal: true | ||
|
||
module Faker | ||
class Quotes | ||
class SingularSiegler < Base | ||
class << self | ||
def quote | ||
fetch('singular_siegler.quotes') | ||
end | ||
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,14 @@ | ||
# frozen_string_literal: true | ||
|
||
module Faker | ||
class Quotes | ||
class Yoda < Base | ||
class << self | ||
# from: http://morecoolquotes.com/famous-yoda-quotes/ | ||
def quote | ||
fetch('yoda.quotes') | ||
end | ||
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,13 @@ | ||
# frozen_string_literal: true | ||
|
||
require_relative '../test_helper' | ||
|
||
class TestDeprecateYoda < Test::Unit::TestCase | ||
def setup | ||
@tester = Faker::Yoda | ||
end | ||
|
||
def test_fact | ||
assert @tester.quote.match(/\w+/) | ||
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,13 @@ | ||
# frozen_string_literal: true | ||
|
||
require_relative '../test_helper' | ||
|
||
class TestDeprecateFamousLastWords < Test::Unit::TestCase | ||
def setup | ||
@tester = Faker::FamousLastWords | ||
end | ||
|
||
def test_name | ||
assert @tester.last_words.match(/\w+/) | ||
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,13 @@ | ||
# frozen_string_literal: true | ||
|
||
require_relative '../test_helper' | ||
|
||
class TestDeprecateMatz < Test::Unit::TestCase | ||
def setup | ||
@tester = Faker::Matz | ||
end | ||
|
||
def test_quote | ||
assert @tester.quote.match(/\w+/) | ||
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,13 @@ | ||
# frozen_string_literal: true | ||
|
||
require_relative '../test_helper' | ||
|
||
class TestDeprecateRobin < Test::Unit::TestCase | ||
def setup | ||
@tester = Faker::Robin | ||
end | ||
|
||
def test_quote | ||
assert @tester.quote.match(/\w+/) | ||
end | ||
end |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It feels a bit redundant to go
Faker::Quotes::Yoda.quote
.Are we able to move this to Faker::Quotes.yoda while still being able to keep things like Faker::Quotes::Shakespeare?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree that it feels redundant. I don't see a problem with having both Faker::Quotes.yoda and Faker::Quotes::Shakespeare, but I'm open to hearing any contrary opinions. :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've just added
Faker::Quote.yoda
. I believe we should do the same forThey should be
what do you think?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sounds good to me