Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/adamcooke/fake-person
Create some fake personalities
https://github.com/adamcooke/fake-person
Last synced: about 1 month ago
JSON representation
Create some fake personalities
- Host: GitHub
- URL: https://github.com/adamcooke/fake-person
- Owner: adamcooke
- Archived: true
- Created: 2014-10-16T19:46:05.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2014-10-19T11:33:55.000Z (over 9 years ago)
- Last Synced: 2024-04-01T16:06:43.283Z (2 months ago)
- Language: Ruby
- Size: 163 KB
- Stars: 116
- Watchers: 6
- Forks: 5
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Lists
- awesome-ruby - Fake Person - Uses some of the most popular given & surnames in the US & UK. (Testing)
- awesome-ruby - Fake Person - Uses some of the most popular given & surnames in the US & UK. (Testing)
- awesome-ruby - Fake Person - Uses some of the most popular given & surnames in the US & UK. (Testing)
README
# Fake Person
This is a gem which will generate a "person" object for a completely make up human being. The primary reason for creating this is gem is for the Rails Rumble competition where we need to be able to generate fake personalities to allow judges to use our application.
## Installation
Just put the following in your Gemfile and run `bundle`.
```ruby
gem "fake_person", "~> 1.0"
```## Usage
```ruby
person = FakePerson.new# Names
person.first_name #=> "Alexander"
person.middle_name #=> "James"
person.last_name #=> "Smith"
person.name #=> "Alexander Smith"
person.name(:full) #=> "Alexander James Smith"
person.initials #=> "AJS"# Titles
person.title #=> "Mr"
person.name(:formal) #=> "Mr Smith"
person.name(:formal_with_first) #=> "Mr Alexander Smith"# Gender
person.gender #=> :male (or :female)# Date of birth
person.date_of_birth #=> #
person.age #=> 37# Usernames
person.username #=> "alexsmith" (various styles exist)# E-Mail Addresses
person.email_address #=> "[email protected]"
person.free_email_address #=> "[email protected]" (or various other free providers)# Activities
person.favorite_activity #=> "Figure skating"# Foods
person.favorite_food #=> "Pizza"# Likes/Dislikes
person.likes(3) #=> ['Driving', 'Fish fingers', 'Jogging']
person.dislikes(2) #=> ['Kitesurfing', 'Coffee']# Colour
person.favorite_color #=> "Purple"# Avatars
person.avatar_url #=> "https://s3-eu-west-1.amazonaws.com/fakepeople/male/256/57.png"
```## Why not Faker?
Faker is great and everything but the data it generates can be a little strange. This library uses some of the most popular given & surnames in the US & UK.