Skip to content

Commit

Permalink
Merge pull request #1 from raiyankamal/master
Browse files Browse the repository at this point in the history
Simple schema support and updated docs
  • Loading branch information
raiyankamal authored Jun 18, 2016
2 parents ac45663 + 92e3dc3 commit 7f595f4
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 6 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
.build*
.idea/
.idea/
.versions
33 changes: 28 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Notes for updating to Meteor 0.9.0
Notes for updating to Meteor 1.3.3
----------------------------------

This package is now called `anti:fake`.
This package is now called `muqube:fake`.



Expand All @@ -21,7 +21,7 @@ If you need more functionality, like fake web address or geographical location,

# Usage

meteor add anti:fake
meteor add muqube:fake


# API
Expand Down Expand Up @@ -140,20 +140,43 @@ Selects a random element from provided array.

Returns a random object created from [SimpleSchema](http://github.com/aldeed/meteor-simple-schema) definition.

Only `Number`, `String` and `Boolean` type fields are supported at the moment. The `max` and `min` options are respected for `Number` and `String` type.

*Example:*

BookSchema = new SimpleSchema({
title: {
type: String
},
summary: {
type: String
max: 1000,
min: 100
}
pages: {
type: Number
},
available: {
type: Boolean
},
price: {
type: Number,
max: 100,
min: 25
}
});
var fakeDoc = Fake.simpleSchemaDoc(BookSchema);
// { "title": "Tendy Orbiter", "pages": 112, "available": true }

Only `Number`, `String` and `Boolean` type fields are supported at the moment.
output:

{
"title": "Orlycon ingcal tion comingedthe modecomal detion reed n.",
"summary": "Ybecom perdythe cona ananed re de esni modiloalse.Ygen teres ble nesso ic.E es conesmo acor tyex.", // max and min limit respected
"pages": 5721755277461235, // very big number is likely to appear since max and min limits were not specified for this field
"available": true,
"price": 93 // max and min limit respected
}

## History

This package is forked from `anti:fake`. I forked it and added some modifications to support simple schema docs generation.
1 change: 1 addition & 0 deletions package.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ Package.describe({
version: "0.4.3",
summary: "Random text, data and simple schema docs generator",
git: "https://github.com/muqube/meteor-fake",
documentation: "README.md"
});


Expand Down

0 comments on commit 7f595f4

Please sign in to comment.