Skip to content

Commit 7f595f4

Browse files
authored
Merge pull request #1 from raiyankamal/master
Simple schema support and updated docs
2 parents ac45663 + 92e3dc3 commit 7f595f4

3 files changed

Lines changed: 31 additions & 6 deletions

File tree

‎.gitignore‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
.build*
2-
.idea/
2+
.idea/
3+
.versions

‎README.md‎

Lines changed: 28 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
Notes for updating to Meteor 0.9.0
1+
Notes for updating to Meteor 1.3.3
22
----------------------------------
33

4-
This package is now called `anti:fake`.
4+
This package is now called `muqube:fake`.
55

66

77

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

2222
# Usage
2323

24-
meteor add anti:fake
24+
meteor add muqube:fake
2525

2626

2727
# API
@@ -140,20 +140,43 @@ Selects a random element from provided array.
140140

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

143+
Only `Number`, `String` and `Boolean` type fields are supported at the moment. The `max` and `min` options are respected for `Number` and `String` type.
144+
143145
*Example:*
144146

145147
BookSchema = new SimpleSchema({
146148
title: {
147149
type: String
148150
},
151+
summary: {
152+
type: String
153+
max: 1000,
154+
min: 100
155+
}
149156
pages: {
150157
type: Number
151158
},
152159
available: {
153160
type: Boolean
161+
},
162+
price: {
163+
type: Number,
164+
max: 100,
165+
min: 25
154166
}
155167
});
156168
var fakeDoc = Fake.simpleSchemaDoc(BookSchema);
157-
// { "title": "Tendy Orbiter", "pages": 112, "available": true }
158169

159-
Only `Number`, `String` and `Boolean` type fields are supported at the moment.
170+
output:
171+
172+
{
173+
"title": "Orlycon ingcal tion comingedthe modecomal detion reed n.",
174+
"summary": "Ybecom perdythe cona ananed re de esni modiloalse.Ygen teres ble nesso ic.E es conesmo acor tyex.", // max and min limit respected
175+
"pages": 5721755277461235, // very big number is likely to appear since max and min limits were not specified for this field
176+
"available": true,
177+
"price": 93 // max and min limit respected
178+
}
179+
180+
## History
181+
182+
This package is forked from `anti:fake`. I forked it and added some modifications to support simple schema docs generation.

‎package.js‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ Package.describe({
33
version: "0.4.3",
44
summary: "Random text, data and simple schema docs generator",
55
git: "https://github.com/muqube/meteor-fake",
6+
documentation: "README.md"
67
});
78

89

0 commit comments

Comments
 (0)