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 Hobby to default #2341
Merged
Merged
add Hobby to default #2341
Changes from 1 commit
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
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 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::Food | ||
|
||
Available since version 2.18.0. | ||
|
||
```ruby | ||
Faker::Hobby.activity #=> "Cooking" |
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,22 @@ | ||
# frozen_string_literal: true | ||
|
||
module Faker | ||
class Hobby < Base | ||
flexible :hobby | ||
|
||
class << self | ||
## | ||
# Retrieves a typical hobby activity. | ||
# | ||
# @return [String] | ||
# | ||
# @example | ||
# Faker::Hobby.activity #=> "Cooking" | ||
# | ||
# @faker.version 2.18.0 | ||
def activity | ||
fetch('hobby.activity') | ||
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,171 @@ | ||
en: | ||
faker: | ||
hobby: | ||
activity: | ||
- 3D printing | ||
- amateur radio | ||
- scrapbook | ||
- Amateur radio | ||
- Acting | ||
- Baton twirling | ||
- Board games | ||
- Book restoration | ||
- Cabaret | ||
- Calligraphy | ||
- Candle making | ||
- Computer programming | ||
- Coffee roasting | ||
- Cooking | ||
- Coloring | ||
- Cosplaying | ||
- Couponing | ||
- Creative writing | ||
- Crocheting | ||
- Cryptography | ||
- Dance | ||
- Digital arts | ||
- Drama | ||
- Drawing | ||
- Do it yourself | ||
- Electronics | ||
- Embroidery | ||
- Fashion | ||
- Flower arranging | ||
- Foreign language learning | ||
- Gaming | ||
- tabletop games | ||
- role-playing games | ||
- Gambling | ||
- Genealogy | ||
- Glassblowing | ||
- Gunsmithing | ||
- Homebrewing | ||
- Ice skating | ||
- Jewelry making | ||
- Jigsaw puzzles | ||
- Juggling | ||
- Knapping | ||
- Knitting | ||
- Kabaddi | ||
- Knife making | ||
- Lacemaking | ||
- Lapidary | ||
- Leather crafting | ||
- Lego building | ||
- Lockpicking | ||
- Machining | ||
- Macrame | ||
- Metalworking | ||
- Magic | ||
- Model building | ||
- Listening to music | ||
- Origami | ||
- Painting | ||
- Playing musical instruments | ||
- Pet | ||
- Poi | ||
- Pottery | ||
- Puzzles | ||
- Quilting | ||
- Reading | ||
- Scrapbooking | ||
- Sculpting | ||
- Sewing | ||
- Singing | ||
- Sketching | ||
- Soapmaking | ||
- Sports | ||
- Stand-up comedy | ||
- Sudoku | ||
- Table tennis | ||
- Taxidermy | ||
- Video gaming | ||
- Watching movies | ||
- Web surfing | ||
- Whittling | ||
- Wood carving | ||
- Woodworking | ||
- Worldbuilding | ||
- Writing | ||
- Yoga | ||
- Yo-yoing | ||
- Air sports | ||
- Archery | ||
- Astronomy | ||
- Backpacking | ||
- BASE jumping | ||
- Baseball | ||
- Basketball | ||
- Beekeeping | ||
- Bird watching | ||
- Blacksmithing | ||
- Board sports | ||
- Bodybuilding | ||
- Brazilian jiu-jitsu | ||
- Community | ||
- Cycling | ||
- Dowsing | ||
- Driving | ||
- Fishing | ||
- Flag Football | ||
- Flying | ||
- Flying disc | ||
- Foraging | ||
- Gardening | ||
- Geocaching | ||
- Ghost hunting | ||
- Graffiti | ||
- Handball | ||
- Hiking | ||
- Hooping | ||
- Horseback riding | ||
- Hunting | ||
- Inline skating | ||
- Jogging | ||
- Kayaking | ||
- Kite flying | ||
- Kitesurfing | ||
- LARPing | ||
- Letterboxing | ||
- Metal detecting | ||
- Motor sports | ||
- Mountain biking | ||
- Mountaineering | ||
- Mushroom hunting | ||
- Mycology | ||
- Netball | ||
- Nordic skating | ||
- Orienteering | ||
- Paintball | ||
- Parkour | ||
- Photography | ||
- Polo | ||
- Rafting | ||
- Rappelling | ||
- Rock climbing | ||
- Roller skating | ||
- Rugby | ||
- Running | ||
- Sailing | ||
- Sand art | ||
- Scouting | ||
- Scuba diving | ||
- Sculling | ||
- Rowing | ||
- Shooting | ||
- Shopping | ||
- Skateboarding | ||
- Skiing | ||
- Skimboarding | ||
- Skydiving | ||
- Slacklining | ||
- Snowboarding | ||
- Stone skipping | ||
- Surfing | ||
- Swimming | ||
- Taekwondo | ||
- Tai chi | ||
- Urban exploration | ||
- Vacation | ||
- Vehicle restoration | ||
- Water sports |
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,19 @@ | ||
# frozen_string_literal: true | ||
|
||
require_relative '../../test_helper' | ||
|
||
class TestFakerHobby < Test::Unit::TestCase | ||
def setup | ||
@tester = Faker::Hobby | ||
end | ||
|
||
def test_flexible_key | ||
flexible_key = @tester.instance_variable_get('@flexible_key') | ||
|
||
assert flexible_key == :hobby | ||
end | ||
|
||
def test_activity | ||
assert @tester.activity.match(/\w+/) | ||
end | ||
end |
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.
Can you convert this to next as documented in CONTRIBUTING.md (here and other places): https://github.com/faker-ruby/faker/blob/master/CONTRIBUTING.md