Coder Social home page Coder Social logo

fake-person's Introduction

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.

gem "fake_person", "~> 1.0"

Usage

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              #=> #<Date: 1954-10-12>
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.

fake-person's People

Contributors

adamcooke avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

fake-person's Issues

Avatar Copyright

Hi,

Cool bit of code.

I'm curious about the avatar images. Where did you get them? Who owns the copyright? How are they licensed (if at all)?

Thanks!

Real birthdate

Hi

It would be nice, for testing and real process of the app, that the person instance have a age with at least the correspondent birthyear.

For example:
person.date_of_birth #=> #<Date: 1954-10-12>
person.age #=> 37

Should be
person.date_of_birth #=> #<Date: 1978-10-12>
person.age #=> 37

Thanks.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.