README.md in faker19-1.0.2 vs README.md in faker19-1.0.3

- old
+ new

@@ -1,6 +1,6 @@ -Faker +Faker [![Build Status](http://travis-ci.org/TechnoGate/faker.png)](http://travis-ci.org/TechnoGate/faker) ===== This gem is a port of Perl's Data::Faker library that generates fake data. It comes in very handy for taking screenshots (taking screenshots for my project, [Catch the Best](http://catchthebest.com/) was the original impetus @@ -11,10 +11,25 @@ Usage ----- * Faker::Name.name => "Christophe Bartell" * Faker::Internet.email => "kirsten.greenholt@corkeryfisher.info" + +You can also get a unique user_name and email using the suffix argument: + +* Faker::Internet.user_name(nil, 3) => "kirsten.greenholt3" +* Faker::Internet.email(nil, 3) => "kirsten.greenholt3@corkeryfisher.info" + +This could help you, if you're using factory_girl for example to generate your +test data, so for example, for a unique email address, you may use factory_girl's +sequence method and pass the argument to the email function, like this: + + f.sequence(:email) { |n| Faker::Internet.email(nil, n) } + +The first argument is actually the *name* which is provided by the user_name +function if it's empty. + Usage with Rails ---------------- If you want to change your locale with Rails from the default of :en, change config/application.rb, setting config.i18n.locale to whatever locale you @@ -23,25 +38,10 @@ the formats and data in en.yml (if there is no Faker localization for your locale). If you'd prefer to set default_locale rather than locale, then you'll also need to add config.i18n.fallbacks.defaults = [:en] to your configuration to make the fallbacks work for Faker. -Command Line Usage ----------------- -Faker is also usable from the command line. All methods are available - - faker address -f street_name - faker company -f name - faker internet -f email - faker lorum -f sentences -n 10 - faker name -f first_name - faker phone_number - -Run `faker help` for general help or there is also help for each data type. For the address type for example run `faker help address`. - -Note that if you installed using bundler you may need to use `bundle exec faker` rather than just `faker`. - Customization ------------ Since you may want to make addresses and other types of data look different depending on where in the world you are (US postal codes vs. UK postal codes, for example), Faker uses the I18n gem to store strings (like state names) and @@ -51,15 +51,15 @@ rest. Contributing ------------ If you'd like to contribute code or formats/data for another locale, fork -the project at [github](https://github.com/stympy/faker), make your changes, +the project at [github](https://github.com/TechnoGate/faker), make your changes, then send a pull request. Contact ------- -Comments and feedback are welcome. Send an email to Benjamin Curtis via the [google group](http://groups.google.com/group/ruby-faker). +Comments and feedback are welcome. Send an email via the [google group](http://groups.google.com/group/ruby-faker). License ------- This code is free to use under the terms of the MIT license.