Szybka pomoc

Ściągawka z FFaker dla generowania danych testowych w Ruby

Skrócony przewodnik po FFaker dla Ruby: szybkie generowanie fikcyjnych danych dla adresów, firm, internetu, nazwisk i numerów telefonów.

· Opublikowano

FFaker to niezwykle szybka biblioteka do generowania realistycznych danych testowych w języku Ruby.

Installation

# gem install ffaker
require 'ffaker'

Adresy i geolokalizacja (Address & Geolocation)

Faker::Address.city                     #=> "Autumnside"
Faker::Address.street_name              #=> "Greyson Rapid"
Faker::Address.street_address           #=> "98786 Neal Motorway"
Faker::Address.secondary_address        #=> "Suite 560"

Faker::Geolocation.lat                  #=> 40.89505
Faker::Geolocation.lng                  #=> -115.120716

Firmy i stanowiska pracy (Company & Job)

Faker::Company.name                     #=> "Pouros-Ondricka"
Faker::Company.suffix                   #=> "and Sons"
Faker::Company.catch_phrase             #=> "Versatile mobile help-desk"
Faker::Company.position                 #=> "General Corporate President"
Faker::Job.title                        #=> "Product Division Technician"

Internet i adresy e-mail (Internet & Emails)

Faker::Internet.email                   #=> "[email protected]"
Faker::Internet.user_name               #=> "janelle_schamberger"
Faker::Internet.domain_name             #=> "langworth.biz"
Faker::Internet.free_email              #=> "[email protected]"

Teksty zastępcze (Lorem Ipsum)

Faker::Lorem.word                       #=> "omnis"
Faker::Lorem.sentence                   #=> "Rem sunt voluptatem laborum dolores."
Faker::Lorem.words(4)                   #=> ["repellat", "quos", "amet", "voluptatem"]
Faker::Lorem.paragraphs(2)

Powiązane ściągawki

Powiązane tematy