Faker – Ruby gem
September 1, 2009
Installation
cmd>gem install faker
Basic use:
require ‘faker’
puts c=Faker::Name.name
output:
lemon arora
Fill your MYSQL DB with faker gem.
Code:
require ‘mysql’
require ‘faker’
db = Mysql::new(“localhost”, “root”, “”, “jazzezravi_development”)
i=1
while i < 1000 do
c=Faker::Name.name
c.gsub(“‘”,”")
sql = “INSERT INTO datas VALUES(#{i},’#{c}’,’0′,’0′);”
db.query(sql)
i+=1
end
For more details about faker gem –> http://faker.rubyforge.org
September 24, 2009 at 10:06 am
I don’t know If I said it already but …Hey good stuff…keep up the good work!
I read a lot of blogs on a daily basis and for the most part, people lack substance but, I just wanted to make a quick comment to say I’m glad I found your blog. Thanks,)
A definite great read..Tony Brown