Created
August 28, 2013 09:55
-
-
Save enajski/6364295 to your computer and use it in GitHub Desktop.
Faker CSV generator, courtesy of @yapee I think.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'faker' | |
modules = [Faker::Name, Faker::Company, Faker::Address, Faker::PhoneNumber, Faker::Internet] | |
puts modules.map { |x| x.methods(false).map { |y| "#{x.to_s.gsub("Faker::", "")} #{y}"} }.flatten.join(',') | |
data = (0...ARGV[0].to_i).map do | |
modules.map { |x| x.methods(false).map { |y| x.send(y) if x.method(y).arity < 1} }.flatten.join(',') | |
end | |
puts data.join("\n") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment