Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/coderberry/grails-faker
Faker, a port of Data::Faker from Perl, is used to easily generate fake data: names, addresses, phone numbers, etc.
https://github.com/coderberry/grails-faker
Last synced: 12 days ago
JSON representation
Faker, a port of Data::Faker from Perl, is used to easily generate fake data: names, addresses, phone numbers, etc.
- Host: GitHub
- URL: https://github.com/coderberry/grails-faker
- Owner: coderberry
- Created: 2012-05-09T00:39:55.000Z (over 12 years ago)
- Default Branch: master
- Last Pushed: 2012-09-28T15:09:41.000Z (over 12 years ago)
- Last Synced: 2025-01-09T14:41:27.454Z (13 days ago)
- Language: Groovy
- Size: 157 KB
- Stars: 9
- Watchers: 2
- Forks: 3
- Open Issues: 1
-
Metadata Files:
- Readme: README.markdown
Awesome Lists containing this project
README
# faker
Faker, a port of Data::Faker from Perl, is used to easily generate fake data: names, addresses, phone numbers, etc.
This plugin is a port developed in ruby, found at [http://faker.rubyforge.org](http://faker.rubyforge.org).### Installation
Execute the following from your application directory:
grails install-plugin faker
### Usage
def fakerService // instanciate the service
fakerService.name() => "Bob Hope"
### Available service methods
/* -- HELPERS -- */
println fakerService.numerify('#####') => 22415
println fakerService.letterify('??? ???') => cfo mpu
println fakerService.bothify('##? ?##') => 40h l06
/* -- NAME -- */
println fakerService.name() => Matilde Deckow
println fakerService.firstName() => Ernest
println fakerService.lastName() => Gutkowski
/* -- ADDRESS -- */
println fakerService.streetAddress() => 237 Ludwig Station
println fakerService.streetName() => Candido Dale
println fakerService.secondaryAddress() => Apt. 589
println fakerService.city() => Lake Buster
println fakerService.usState() => West Virginia
println fakerService.usStateAbbr() => MI
println fakerService.zipCode() => 31685
println fakerService.ukCounty() => West Sussex
println fakerService.ukCountry() => Northern Ireland
println fakerService.ukPostcode() => JJ40 9EW
/* -- COMPANY -- */
println fakerService.companyName() => Eichmann-Marks
println fakerService.companyCatchPhrase() => Expanded contextually-based paradigm
println fakerService.companyBS() => visualize cross-media schemas
println fakerService.occupation() => Gynecologist
/* -- INTERNET -- */
println fakerService.email() => [email protected]
println fakerService.email('Joe Blow') => [email protected]
println fakerService.freeEmail() => [email protected]
println fakerService.freeEmail('Joe Blow') => [email protected]
println fakerService.userName() => odessa
println fakerService.userName('Joe Blow') => joe_blow
println fakerService.domainName() => orn.info
/* -- LOREM -- */
println fakerService.sentence(3) => Quas dolor culpa rerum tempora autem.
println fakerService.paragraph(3) => Et sint aliquid cum quas tempore tempora labore fuga. Voluptatem et saepe eaque illum. Voluptas eius explicabo eos at qui in saepe quis.
/* -- PHONE -- */
println fakerService.phoneNumber() => (535)286-9804 x571
println fakerService.phoneNumber('##########') => 1698340636
/* -- VERSION -- */
println fakerService.version() => 3.2.1### License
This code is free to use under the terms of the MIT license.
### Contact
Comments are welcome. Send an email to cavneb at gmail.com.
### Version History
* 0.7 - Converting static methods to instance methods and tabs to spaces by [Pablo Alba](http://albaontech.wordpress.com/)
* 0.6 - Spanish added by [Pablo Alba](http://albaontech.wordpress.com/)
* 0.2 - Fixed bug with domain names including commas and apostrophes. Thanks to Mike Hugo for the fix code.
* 0.1 - Initial Release