ffaker

Fast Faker == Faker refactored. rubygems.org/gems/ffaker

Faker

A port of Perl's Data::Faker library that generates fake data. rubygems.org/gems/faker

Usage

require 'ffaker'
Faker::Name.name => "Christophe Bartell"
Faker::Internet.email => "kirsten.greenholt@corkeryfisher.info"

Ffaker / Faker

Faker and Ffaker APIs are mostly the same, although the API on ffaker keeps growing with its users additions. In general, the only difference is that you need to:

gem install ffaker

and then

require 'ffaker'

instead of “faker” with only one f.

Faster? does it really matter ?

Ffaker was initially written in an effort to speed up a slow spec suite. Bear in mind, if your spec suite is slow, chances are the generation of random data will not account for much of the run time.

Since then, the original faker gem has become faster (at the moment it did not seem it was mantained). Nevertheless, ffaker is still about 20x faster than faker.

$ cat scripts/benchmark.rb

# ...
N = 10_000

Benchmark.bm do |rep|
  rep.report("generating #{ N } names") do
    N.times do
      Faker::Name.name
    end
  end
end

Contributors

TODO

Note on Patches/Pull Requests

Copyright

Copyright © 2010 Emmanuel Oga. See LICENSE for details. Copyright © 2007 Benjamin Curtis