diff options
| author | Marak Squires <[email protected]> | 2010-05-15 22:13:44 -0400 |
|---|---|---|
| committer | Marak Squires <[email protected]> | 2010-05-15 22:13:44 -0400 |
| commit | e9501fb7069a3acb419409b0e85d3b31b86acf97 (patch) | |
| tree | e47f85df2b1ac911692b8656abf9a6936f1b8af5 /Faker.js | |
| parent | 529dc7392faa95ca711badc80780c521aa0f7f9f (diff) | |
| download | faker-e9501fb7069a3acb419409b0e85d3b31b86acf97.tar.xz faker-e9501fb7069a3acb419409b0e85d3b31b86acf97.zip | |
added usage docs, created unit tests for library and bundled versions in node and browser
Diffstat (limited to 'Faker.js')
| -rw-r--r-- | Faker.js | 32 |
1 files changed, 23 insertions, 9 deletions
@@ -1,11 +1,22 @@ -/************** AUTOGENERATED @ 1273959730700 ***************/ -/* - WARNING: FOR USE IN THE BROWSER ONLY. IF YOU WANT TO USE THE NODE.JS VERSION YOU MUST +/*************** AUTOGENERATED @ 1273975889326 *************** + WARNING: THIS FILE WAS AUTOGENERATED BY THE FAKER BUILD SCRIPT + MODIFYING THIS FILE IS FINE, BUT YOU REALLY SHOULD BE MODIFYING + THE LIBRARY DIRECTLY AND REGENERATING THIS FILE USING BUILD.js!!!! + Faker.js - Written by Matthew Bergman and Marak Squires - var Faker = require(./pathToFaker/lib); + USAGE: - This file was autogenerated by the Faker BUILD script. You may modify this file you if you want, - but you should install node.js and modify the library directory so can you easily autogenerate this file yourself! + browser - + + <script src = "Faker.js" type = "text/javascript"></script> + <script> + var randomName = Faker.Name.findName(); + </script> + + node.js - + + var Faker = require(./Faker); + var randomName = Faker.Name.findName(); */ var Faker = {}; Faker.version = "0.0.1"; @@ -167,9 +178,11 @@ Faker.Lorem.words = function (num){ Faker.Lorem.sentence = function (wordCount){ if( typeof wordCount == 'undefined'){ var wordCount = 3;} - - return this.words(wordCount + Helpers.randomNumber(7)).join(' ').capitalize(); - //words(word_count + rand(6)).join(' ').capitalize + '.' + + // strange issue with the node_min_test failing for captialize, please fix and add this back + //return this.words(wordCount + Helpers.randomNumber(7)).join(' ').capitalize(); + + return this.words(wordCount + Helpers.randomNumber(7)).join(' '); }; Faker.Lorem.sentences = function (paragraphCount){ @@ -284,3 +297,4 @@ Faker.definitions.phone_formats = function (){return [ ];}; var definitions = Faker.definitions; var Helpers = Faker.Helpers; +if(typeof exports != "undefined"){for(var prop in Faker){exports[prop] = Faker[prop];}}
\ No newline at end of file |
