12 | Welcome to Meteor Generate!
13 |
14 | To get started run mgen controller posts to create all pages for
15 | a Posts resource.
By default this will create all actions. Pass in --index
16 | to only create an index page, route and controller.
17 |
18 | To generate files for single page (HTML, JS, Sass) run mgen page foo
19 |
20 | See the
21 | Meteor Generate GitHub Page for more commands.
22 |
23 |
24 | Find me in client/main.html
25 | My route is in both/routes.js
26 |
27 |
28 |
29 |
--------------------------------------------------------------------------------
/templates/default/collection/permission.js:
--------------------------------------------------------------------------------
1 | // __name-pascal__ Permissions
2 | // see docs for more info - http://docs.meteor.com/#allow
3 |
4 | db.__name-camel__.allow({
5 | insert: function() {
6 | console.log("\n*** db.__name-camel__ insert not secure ***\n");
7 | return true;
8 | },
9 |
10 | update: function() {
11 | console.log("\n*** db.__name-camel__ update not secure ***\n");
12 | return true;
13 | },
14 |
15 | remove: function() {
16 | console.log("\n*** db.__name-camel__ remove not secure ***\n");
17 | return true;
18 | },
19 |
20 | //fetch: ['owner'],
21 |
22 | // perform a type check to ensure correct data is getting saved
23 | transform: function(doc) {
24 | check(doc, Match.Optional({
25 | _id: String
26 | }));
27 |
28 | return doc;
29 | }
30 | });
31 |
32 |
33 | db.__name-camel__.deny({
34 | update: doesNotOwnDocument,
35 | remove: doesNotOwnDocument,
36 | //fetch: ['owner']
37 | });
38 |
39 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | The MIT License (MIT)
2 |
3 | Copyright (c) 2013 Adam Brodzinski
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy of
6 | this software and associated documentation files (the "Software"), to deal in
7 | the Software without restriction, including without limitation the rights to
8 | use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
9 | the Software, and to permit persons to whom the Software is furnished to do so,
10 | subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
17 | FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
18 | COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
19 | IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
20 | CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
21 |
--------------------------------------------------------------------------------
/tests/package_spec.coffee:
--------------------------------------------------------------------------------
1 | require './spec_helper'
2 | Package = rewire '../lib/package'
3 |
4 | describe 'Package Module', ->
5 |
6 | before ->
7 | global.templatePath = 'test_path'
8 |
9 | Package.__set__("fs", {
10 | copySync: -> "copy success"
11 | existsSync: -> false
12 | appendFileSync: -> "append success"
13 | })
14 |
15 | it 'should create a new instance', ->
16 | pack = new Package()
17 | create = sinon.spy(pack, 'create')
18 | copyTemp = sinon.spy(pack, 'copyTemplate')
19 | rename = sinon.spy(pack, 'renamePackage')
20 | fsp = sinon.spy(fs, 'appendFileSync')
21 | pack.create('myTemplate')
22 |
23 | copyTemp.should.have.been.calledWith 'myTemplate'
24 | rename.should.have.been.calledOnce
25 | fsp.should.have.been.calledWithExactly './.meteor/packages', 'myTemplate'
26 |
27 | it "should copy the package template folder to clients root folder", ->
28 | pack = new Package()
29 | copy = sinon.spy(fs, 'copySync')
30 | pack.copyTemplate('packageDeluxe')
31 | path = 'test_path/package'
32 | dest = './packages/packageDeluxe'
33 |
34 | copy.should.have.been.calledWith(path, dest)
35 | copy.should.have.returned 'copy success'
36 |
37 |
--------------------------------------------------------------------------------
/lib/collection.coffee:
--------------------------------------------------------------------------------
1 | # Meteor Generate
2 | # Copyright(c) 2014 Adam Brodzinski