jazz-jss 0.0.3 → 0.0.4
Sign up to get free protection for your applications and to get access to all the features.
- data/README.rdoc +44 -19
- data/bin/jazz +20 -8
- data/lib/jazz/cli.rb +73 -9
- data/lib/jazz/generators/controller/controller.rb +22 -0
- data/lib/jazz/generators/controller/templates/controller.js +38 -0
- data/lib/jazz/generators/helper/helper.rb +22 -0
- data/lib/jazz/generators/helper/templates/helper.js +6 -0
- data/lib/jazz/generators/model/model.rb +50 -0
- data/lib/jazz/generators/model/templates/database.js +14 -0
- data/lib/jazz/generators/model/templates/fixture.js +10 -0
- data/{templates → lib/jazz/generators/model/templates}/model.js +9 -12
- data/lib/jazz/generators/project/project.rb +27 -0
- data/{templates/app_root/development/app/assets/javascripts/application.js → lib/jazz/generators/project/templates/app_root/JEMFILE.js} +0 -0
- data/{templates/app_root/development/app/assets/stylesheets/application.css → lib/jazz/generators/project/templates/app_root/app/assets/javascripts/application.js} +0 -0
- data/{templates/view_create.html → lib/jazz/generators/project/templates/app_root/app/assets/stylesheets/application.sass} +0 -0
- data/lib/jazz/generators/project/templates/app_root/app/controllers/application_controller.js +9 -0
- data/{templates/app_root/development → lib/jazz/generators/project/templates/app_root}/app/helpers/application_helper.js +0 -1
- data/lib/jazz/generators/project/templates/app_root/app/scenarios/application_scenario.js +13 -0
- data/lib/jazz/generators/project/templates/app_root/app/views/layouts/index.handlebars +1 -0
- data/lib/jazz/generators/project/templates/app_root/config/boot.js +23 -0
- data/lib/jazz/generators/project/templates/app_root/config/routes.js +6 -0
- data/{templates/view_index.html → lib/jazz/generators/project/templates/app_root/db/fixtures/touch} +0 -0
- data/lib/jazz/generators/project/templates/app_root/index.html +11 -0
- data/lib/jazz/generators/project/templates/app_root/lib/jazz/_.js +9 -0
- data/lib/jazz/generators/project/templates/app_root/lib/jazz/lib/controller/_.js +1 -0
- data/lib/jazz/generators/project/templates/app_root/lib/jazz/lib/controller/controller.js +22 -0
- data/lib/jazz/generators/project/templates/app_root/lib/jazz/lib/core/_.js +1 -0
- data/{dist/jazz/lib → lib/jazz/generators/project/templates/app_root/lib/jazz/lib/core}/core.js +0 -0
- data/lib/jazz/generators/project/templates/app_root/lib/jazz/lib/database/_.js +3 -0
- data/lib/jazz/generators/project/templates/app_root/lib/jazz/lib/database/database.js +10 -0
- data/lib/jazz/generators/project/templates/app_root/lib/jazz/lib/database/finder.js +41 -0
- data/lib/jazz/generators/project/templates/app_root/lib/jazz/lib/database/modifier.js +10 -0
- data/lib/jazz/generators/project/templates/app_root/lib/jazz/lib/helper/_.js +2 -0
- data/lib/jazz/generators/project/templates/app_root/lib/jazz/lib/helper/helper.js +49 -0
- data/lib/jazz/generators/project/templates/app_root/lib/jazz/lib/helper/underscore.js +13 -0
- data/lib/jazz/generators/project/templates/app_root/lib/jazz/lib/model/_.js +4 -0
- data/lib/jazz/generators/project/templates/app_root/lib/jazz/lib/model/conditional.js +3 -0
- data/lib/jazz/generators/project/templates/app_root/lib/jazz/lib/model/finder.js +21 -0
- data/lib/jazz/generators/project/templates/app_root/lib/jazz/lib/model/model.js +23 -0
- data/lib/jazz/generators/project/templates/app_root/lib/jazz/lib/model/modifier.js +44 -0
- data/lib/jazz/generators/project/templates/app_root/lib/jazz/lib/route/_.js +1 -0
- data/lib/jazz/generators/project/templates/app_root/lib/jazz/lib/route/route.js +115 -0
- data/lib/jazz/generators/project/templates/app_root/lib/jazz/lib/scenario/_.js +2 -0
- data/lib/jazz/generators/project/templates/app_root/lib/jazz/lib/scenario/initialize_scenarios/application.js +3 -0
- data/lib/jazz/generators/project/templates/app_root/lib/jazz/lib/scenario/scenario.js +13 -0
- data/lib/jazz/generators/project/templates/app_root/lib/jazz/lib/view/_.js +1 -0
- data/lib/jazz/generators/project/templates/app_root/lib/jazz/lib/view/view.js +39 -0
- data/{dist/handlebars → lib/jazz/generators/project/templates/app_root/vendor}/handlebars.js +0 -0
- data/{dist/hashchange → lib/jazz/generators/project/templates/app_root/vendor}/hashchange.js +0 -0
- data/{dist/jquery → lib/jazz/generators/project/templates/app_root/vendor}/jquery.js +0 -0
- data/lib/jazz/generators/project/templates/app_root/vendor/simplemodal.js +698 -0
- data/lib/jazz/generators/project/templates/app_root/vendor/tipTip.js +191 -0
- data/{dist/underscore → lib/jazz/generators/project/templates/app_root/vendor}/underscore.js +0 -0
- data/lib/jazz/generators/project/templates/application.js +12 -0
- data/lib/jazz/generators/scaffold/scaffold.rb +73 -0
- data/lib/jazz/generators/scaffold/templates/controller.js +49 -0
- data/lib/jazz/generators/scaffold/templates/database.js +14 -0
- data/lib/jazz/generators/scaffold/templates/fixture.js +10 -0
- data/lib/jazz/generators/scaffold/templates/helper.js +6 -0
- data/lib/jazz/generators/scaffold/templates/model.js +13 -0
- data/lib/jazz/generators/scaffold/templates/scenario.js +7 -0
- data/lib/jazz/generators/scaffold/templates/view_edit.handlebars +6 -0
- data/lib/jazz/generators/scaffold/templates/view_form.handlebars +12 -0
- data/lib/jazz/generators/scaffold/templates/view_index.handlebars +27 -0
- data/lib/jazz/generators/scaffold/templates/view_new.handlebars +5 -0
- data/lib/jazz/generators/scaffold/templates/view_show.handlebars +10 -0
- data/lib/jazz/generators/scenario/scenario.rb +22 -0
- data/lib/jazz/generators/scenario/templates/scenario.js +7 -0
- data/lib/jazz/rack/config.ru +16 -0
- data/lib/jazz/sprockets/templates/handlebars.rb +30 -0
- metadata +120 -234
- data/dist/jazz/lib/controller.js +0 -17
- data/dist/jazz/lib/db.js +0 -41
- data/dist/jazz/lib/helper.js +0 -38
- data/dist/jazz/lib/model.js +0 -95
- data/dist/jazz/lib/route.js +0 -74
- data/dist/jazz/lib/view.js +0 -1
- data/dist/jazz/module.js +0 -15
- data/dist/require/order.js +0 -180
- data/dist/require/require.js +0 -31
- data/dist/require/template.js +0 -98
- data/lib/jazz.rb +0 -12
- data/lib/jazz/app_detector.rb +0 -70
- data/lib/jazz/app_generator.rb +0 -41
- data/lib/jazz/controller_generator.rb +0 -34
- data/lib/jazz/helper_generator.rb +0 -30
- data/lib/jazz/model_generator.rb +0 -27
- data/lib/jazz/scaffold_generator.rb +0 -49
- data/templates/app_root/Rakefile +0 -11
- data/templates/app_root/development/app/controllers/application_controller.js +0 -11
- data/templates/app_root/development/config/glue.js +0 -9
- data/templates/app_root/development/config/routes.js +0 -5
- data/templates/app_root/scripts/build.js +0 -30
- data/templates/app_root/scripts/r.js/LICENSE +0 -58
- data/templates/app_root/scripts/r.js/README.md +0 -177
- data/templates/app_root/scripts/r.js/build/build.js +0 -26
- data/templates/app_root/scripts/r.js/build/buildebug.sh +0 -4
- data/templates/app_root/scripts/r.js/build/example.build.js +0 -296
- data/templates/app_root/scripts/r.js/build/jslib/blank.js +0 -4
- data/templates/app_root/scripts/r.js/build/jslib/build.js +0 -952
- data/templates/app_root/scripts/r.js/build/jslib/commandLine.js +0 -23
- data/templates/app_root/scripts/r.js/build/jslib/commonJs.js +0 -152
- data/templates/app_root/scripts/r.js/build/jslib/env.js +0 -47
- data/templates/app_root/scripts/r.js/build/jslib/lang.js +0 -49
- data/templates/app_root/scripts/r.js/build/jslib/logger.js +0 -58
- data/templates/app_root/scripts/r.js/build/jslib/node.js +0 -106
- data/templates/app_root/scripts/r.js/build/jslib/node/args.js +0 -20
- data/templates/app_root/scripts/r.js/build/jslib/node/file.js +0 -263
- data/templates/app_root/scripts/r.js/build/jslib/node/load.js +0 -17
- data/templates/app_root/scripts/r.js/build/jslib/node/optimize.js +0 -10
- data/templates/app_root/scripts/r.js/build/jslib/node/print.js +0 -16
- data/templates/app_root/scripts/r.js/build/jslib/optimize.js +0 -279
- data/templates/app_root/scripts/r.js/build/jslib/opto.build.js +0 -11
- data/templates/app_root/scripts/r.js/build/jslib/parse.js +0 -590
- data/templates/app_root/scripts/r.js/build/jslib/pragma.js +0 -251
- data/templates/app_root/scripts/r.js/build/jslib/requirePatch.js +0 -286
- data/templates/app_root/scripts/r.js/build/jslib/rhino.js +0 -22
- data/templates/app_root/scripts/r.js/build/jslib/rhino/args.js +0 -21
- data/templates/app_root/scripts/r.js/build/jslib/rhino/file.js +0 -244
- data/templates/app_root/scripts/r.js/build/jslib/rhino/load.js +0 -12
- data/templates/app_root/scripts/r.js/build/jslib/rhino/optimize.js +0 -100
- data/templates/app_root/scripts/r.js/build/jslib/rhino/print.js +0 -12
- data/templates/app_root/scripts/r.js/build/jslib/uglifyjs/README.md +0 -16
- data/templates/app_root/scripts/r.js/build/jslib/uglifyjs/index.js +0 -21
- data/templates/app_root/scripts/r.js/build/jslib/uglifyjs/parse-js.js +0 -1342
- data/templates/app_root/scripts/r.js/build/jslib/uglifyjs/process.js +0 -2005
- data/templates/app_root/scripts/r.js/build/jslib/uglifyjs/squeeze-more.js +0 -55
- data/templates/app_root/scripts/r.js/build/jslib/x.js +0 -243
- data/templates/app_root/scripts/r.js/build/tests/all.js +0 -47
- data/templates/app_root/scripts/r.js/build/tests/allj.sh +0 -3
- data/templates/app_root/scripts/r.js/build/tests/alln.sh +0 -18
- data/templates/app_root/scripts/r.js/build/tests/anonSimple.build.js +0 -7
- data/templates/app_root/scripts/r.js/build/tests/buildUtils.js +0 -19
- data/templates/app_root/scripts/r.js/build/tests/builds.js +0 -489
- data/templates/app_root/scripts/r.js/build/tests/circular.build.js +0 -18
- data/templates/app_root/scripts/r.js/build/tests/convert.js +0 -18
- data/templates/app_root/scripts/r.js/build/tests/css.build.js +0 -6
- data/templates/app_root/scripts/r.js/build/tests/css/common/common.css +0 -4
- data/templates/app_root/scripts/r.js/build/tests/css/master.css +0 -10
- data/templates/app_root/scripts/r.js/build/tests/css/sub/sub1.css +0 -7
- data/templates/app_root/scripts/r.js/build/tests/cssTestCompare.css +0 -13
- data/templates/app_root/scripts/r.js/build/tests/end.frag +0 -3
- data/templates/app_root/scripts/r.js/build/tests/expected/unoExcludeShallow.js +0 -23
- data/templates/app_root/scripts/r.js/build/tests/exports.build.js +0 -12
- data/templates/app_root/scripts/r.js/build/tests/hasTestModule.build.js +0 -10
- data/templates/app_root/scripts/r.js/build/tests/hasTestModule.js +0 -30
- data/templates/app_root/scripts/r.js/build/tests/http/httpBuild.js +0 -70
- data/templates/app_root/scripts/r.js/build/tests/http/main.html +0 -28
- data/templates/app_root/scripts/r.js/build/tests/http/scripts/main.js +0 -18
- data/templates/app_root/scripts/r.js/build/tests/http/scripts/one.js +0 -3
- data/templates/app_root/scripts/r.js/build/tests/http/scripts/three.js +0 -5
- data/templates/app_root/scripts/r.js/build/tests/http/scripts/two.js +0 -7
- data/templates/app_root/scripts/r.js/build/tests/i18n.build.js +0 -17
- data/templates/app_root/scripts/r.js/build/tests/indexBuilder.build.js +0 -8
- data/templates/app_root/scripts/r.js/build/tests/lib/amdefine/a.js +0 -17
- data/templates/app_root/scripts/r.js/build/tests/lib/amdefine/b.js +0 -8
- data/templates/app_root/scripts/r.js/build/tests/lib/amdefine/build.js +0 -6
- data/templates/app_root/scripts/r.js/build/tests/lib/amdefine/c.js +0 -7
- data/templates/app_root/scripts/r.js/build/tests/lib/amdefine/d.js +0 -5
- data/templates/app_root/scripts/r.js/build/tests/lib/amdefine/expected.js +0 -36
- data/templates/app_root/scripts/r.js/build/tests/lib/amdefine/node_modules/amdefine/LICENSE +0 -58
- data/templates/app_root/scripts/r.js/build/tests/lib/amdefine/node_modules/amdefine/amdefine.js +0 -188
- data/templates/app_root/scripts/r.js/build/tests/lib/amdefine/node_modules/amdefine/package.json +0 -21
- data/templates/app_root/scripts/r.js/build/tests/lib/comments/bang.js +0 -10
- data/templates/app_root/scripts/r.js/build/tests/lib/comments/build.js +0 -6
- data/templates/app_root/scripts/r.js/build/tests/lib/comments/expected.js +0 -9
- data/templates/app_root/scripts/r.js/build/tests/lib/comments/license.js +0 -13
- data/templates/app_root/scripts/r.js/build/tests/lib/dotpackage/scripts/app.build.js +0 -15
- data/templates/app_root/scripts/r.js/build/tests/lib/dotpackage/scripts/main-expected.js +0 -13
- data/templates/app_root/scripts/r.js/build/tests/lib/dotpackage/scripts/main.js +0 -7
- data/templates/app_root/scripts/r.js/build/tests/lib/empty/build.js +0 -13
- data/templates/app_root/scripts/r.js/build/tests/lib/empty/expected.js +0 -8
- data/templates/app_root/scripts/r.js/build/tests/lib/empty/main.js +0 -1
- data/templates/app_root/scripts/r.js/build/tests/lib/empty/sub1.js +0 -1
- data/templates/app_root/scripts/r.js/build/tests/lib/empty/sub2.js +0 -1
- data/templates/app_root/scripts/r.js/build/tests/lib/nameInsertion/build.js +0 -6
- data/templates/app_root/scripts/r.js/build/tests/lib/nameInsertion/expected.js +0 -12
- data/templates/app_root/scripts/r.js/build/tests/lib/nameInsertion/main.js +0 -9
- data/templates/app_root/scripts/r.js/build/tests/lib/namespace/build.js +0 -8
- data/templates/app_root/scripts/r.js/build/tests/lib/namespace/expected.js +0 -47
- data/templates/app_root/scripts/r.js/build/tests/lib/namespace/main.js +0 -6
- data/templates/app_root/scripts/r.js/build/tests/lib/namespace/modules/four.js +0 -7
- data/templates/app_root/scripts/r.js/build/tests/lib/namespace/modules/one.js +0 -9
- data/templates/app_root/scripts/r.js/build/tests/lib/namespace/modules/three.js +0 -14
- data/templates/app_root/scripts/r.js/build/tests/lib/namespace/modules/two.js +0 -5
- data/templates/app_root/scripts/r.js/build/tests/lib/nested/a.js +0 -12
- data/templates/app_root/scripts/r.js/build/tests/lib/nested/b.js +0 -3
- data/templates/app_root/scripts/r.js/build/tests/lib/nested/build.js +0 -6
- data/templates/app_root/scripts/r.js/build/tests/lib/nested/buildWithCE.js +0 -7
- data/templates/app_root/scripts/r.js/build/tests/lib/nested/c.js +0 -3
- data/templates/app_root/scripts/r.js/build/tests/lib/nested/d.js +0 -3
- data/templates/app_root/scripts/r.js/build/tests/lib/nested/e.js +0 -3
- data/templates/app_root/scripts/r.js/build/tests/lib/nested/expected-built.js +0 -36
- data/templates/app_root/scripts/r.js/build/tests/lib/nested/expected-builtWithCE.js +0 -42
- data/templates/app_root/scripts/r.js/build/tests/lib/nested/main.js +0 -3
- data/templates/app_root/scripts/r.js/build/tests/lib/nested/top.js +0 -10
- data/templates/app_root/scripts/r.js/build/tests/lib/nestedHas/a.js +0 -3
- data/templates/app_root/scripts/r.js/build/tests/lib/nestedHas/b.js +0 -3
- data/templates/app_root/scripts/r.js/build/tests/lib/nestedHas/build.js +0 -6
- data/templates/app_root/scripts/r.js/build/tests/lib/nestedHas/buildNeedAll.js +0 -9
- data/templates/app_root/scripts/r.js/build/tests/lib/nestedHas/buildNeedB.js +0 -11
- data/templates/app_root/scripts/r.js/build/tests/lib/nestedHas/buildNeedC.js +0 -11
- data/templates/app_root/scripts/r.js/build/tests/lib/nestedHas/buildNeedD.js +0 -11
- data/templates/app_root/scripts/r.js/build/tests/lib/nestedHas/buildNested.js +0 -7
- data/templates/app_root/scripts/r.js/build/tests/lib/nestedHas/c.js +0 -3
- data/templates/app_root/scripts/r.js/build/tests/lib/nestedHas/d.js +0 -3
- data/templates/app_root/scripts/r.js/build/tests/lib/nestedHas/expected-built.js +0 -21
- data/templates/app_root/scripts/r.js/build/tests/lib/nestedHas/expected-builtNeedAll.js +0 -31
- data/templates/app_root/scripts/r.js/build/tests/lib/nestedHas/expected-builtNeedB.js +0 -24
- data/templates/app_root/scripts/r.js/build/tests/lib/nestedHas/expected-builtNeedC.js +0 -24
- data/templates/app_root/scripts/r.js/build/tests/lib/nestedHas/expected-builtNeedD.js +0 -25
- data/templates/app_root/scripts/r.js/build/tests/lib/nestedHas/expected-builtNested.js +0 -31
- data/templates/app_root/scripts/r.js/build/tests/lib/nestedHas/main.js +0 -17
- data/templates/app_root/scripts/r.js/build/tests/lib/plugins/build.js +0 -6
- data/templates/app_root/scripts/r.js/build/tests/lib/plugins/converter.js +0 -11
- data/templates/app_root/scripts/r.js/build/tests/lib/plugins/main.js +0 -6
- data/templates/app_root/scripts/r.js/build/tests/lib/plugins/plug.js +0 -29
- data/templates/app_root/scripts/r.js/build/tests/lib/plugins/util.js +0 -7
- data/templates/app_root/scripts/r.js/build/tests/nameOnly.build.js +0 -10
- data/templates/app_root/scripts/r.js/build/tests/nodeAll.js +0 -3
- data/templates/app_root/scripts/r.js/build/tests/nodeOptimize.js +0 -12
- data/templates/app_root/scripts/r.js/build/tests/nodeOptimizeNoCallback.js +0 -10
- data/templates/app_root/scripts/r.js/build/tests/order.build.js +0 -16
- data/templates/app_root/scripts/r.js/build/tests/override/override.js +0 -36
- data/templates/app_root/scripts/r.js/build/tests/packages.build.js +0 -59
- data/templates/app_root/scripts/r.js/build/tests/parse.js +0 -103
- data/templates/app_root/scripts/r.js/build/tests/simple.build.js +0 -13
- data/templates/app_root/scripts/r.js/build/tests/simpleNamespace.build.js +0 -17
- data/templates/app_root/scripts/r.js/build/tests/start.frag +0 -4
- data/templates/app_root/scripts/r.js/build/tests/text.build.js +0 -16
- data/templates/app_root/scripts/r.js/build/tests/textExclude.build.js +0 -16
- data/templates/app_root/scripts/r.js/dist.js +0 -95
- data/templates/app_root/scripts/r.js/dist/README.md +0 -6
- data/templates/app_root/scripts/r.js/dist/r-1.0.0.js +0 -9042
- data/templates/app_root/scripts/r.js/dist/r-edge.js +0 -9191
- data/templates/app_root/scripts/r.js/dist/r.js +0 -9099
- data/templates/app_root/scripts/r.js/lib/closure/COPYING +0 -202
- data/templates/app_root/scripts/r.js/lib/closure/README +0 -292
- data/templates/app_root/scripts/r.js/lib/closure/compiler.jar +0 -0
- data/templates/app_root/scripts/r.js/lib/rhino/LICENSE +0 -4
- data/templates/app_root/scripts/r.js/lib/rhino/js.jar +0 -0
- data/templates/app_root/scripts/r.js/require.js +0 -1952
- data/templates/app_root/scripts/r.js/tasks.txt +0 -2
- data/templates/app_root/scripts/r.js/tests/all.js +0 -49
- data/templates/app_root/scripts/r.js/tests/allNode.js +0 -3
- data/templates/app_root/scripts/r.js/tests/allj.sh +0 -1
- data/templates/app_root/scripts/r.js/tests/alln.sh +0 -2
- data/templates/app_root/scripts/r.js/tests/alpha.js +0 -3
- data/templates/app_root/scripts/r.js/tests/beta.js +0 -6
- data/templates/app_root/scripts/r.js/tests/doh/LICENSE +0 -195
- data/templates/app_root/scripts/r.js/tests/doh/README +0 -12
- data/templates/app_root/scripts/r.js/tests/doh/_browserRunner.js +0 -855
- data/templates/app_root/scripts/r.js/tests/doh/_nodeRunner.js +0 -20
- data/templates/app_root/scripts/r.js/tests/doh/_rhinoRunner.js +0 -17
- data/templates/app_root/scripts/r.js/tests/doh/_sounds/LICENSE +0 -10
- data/templates/app_root/scripts/r.js/tests/doh/_sounds/doh.wav +0 -0
- data/templates/app_root/scripts/r.js/tests/doh/_sounds/dohaaa.wav +0 -0
- data/templates/app_root/scripts/r.js/tests/doh/_sounds/woohoo.wav +0 -0
- data/templates/app_root/scripts/r.js/tests/doh/runner.html +0 -316
- data/templates/app_root/scripts/r.js/tests/doh/runner.js +0 -1499
- data/templates/app_root/scripts/r.js/tests/doh/runner.sh +0 -3
- data/templates/app_root/scripts/r.js/tests/doh/small_logo.png +0 -0
- data/templates/app_root/scripts/r.js/tests/node/canvasTest.js +0 -39
- data/templates/app_root/scripts/r.js/tests/node/embedded/README.md +0 -15
- data/templates/app_root/scripts/r.js/tests/node/embedded/coffee/foo.coffee +0 -1
- data/templates/app_root/scripts/r.js/tests/node/embedded/main.js +0 -13
- data/templates/app_root/scripts/r.js/tests/node/embedded/scripts/bar.js +0 -13
- data/templates/app_root/scripts/r.js/tests/node/index.js +0 -11
- data/templates/app_root/scripts/r.js/tests/node/tests/alpha/foo.js +0 -6
- data/templates/app_root/scripts/r.js/tests/node/tests/alpha/hello.html +0 -9
- data/templates/app_root/scripts/r.js/tests/node/tests/foo.js +0 -3
- data/templates/app_root/scripts/r.js/tests/node/tests/server.js +0 -11
- data/templates/app_root/scripts/r.js/tests/relative.js +0 -10
- data/templates/app_root/scripts/r.js/tests/sub/betaSub.js +0 -3
- data/templates/application.js +0 -7
- data/templates/boot.js +0 -42
- data/templates/controller.js +0 -19
- data/templates/db.js +0 -14
- data/templates/helper.js +0 -9
- data/templates/index.html +0 -9
- data/templates/scaffold_controller.js +0 -19
- data/templates/view_show.html +0 -0
- data/templates/view_update.html +0 -0
data/README.rdoc
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
jazz jss
|
2
|
-
|
2
|
+
========
|
3
3
|
|
4
4
|
It's a simple rapid prototyping JSS framework
|
5
5
|
|
@@ -12,32 +12,57 @@ Usage
|
|
12
12
|
-----
|
13
13
|
|
14
14
|
in shell
|
15
|
-
jazz new
|
16
|
-
cd
|
17
|
-
jazz generate scaffold
|
15
|
+
jazz new example
|
16
|
+
cd example
|
17
|
+
jazz generate scaffold user firstName:string lastName:string age:integer
|
18
18
|
|
19
19
|
add route to config/routes.js
|
20
20
|
Jazz.Route.draw(
|
21
21
|
{
|
22
|
-
'':
|
23
|
-
'/
|
22
|
+
'' : 'users_controller#index',
|
23
|
+
'/' : 'users_controller#index',
|
24
|
+
'/users' : 'users_controller#index',
|
25
|
+
'/users/:user_id' : 'users_controller#show',
|
26
|
+
'/users/:user_id/edit' : 'users_controller#edit',
|
27
|
+
'/users/make' : 'users_controller#make'
|
24
28
|
}
|
25
29
|
);
|
26
30
|
|
27
|
-
open
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
31
|
+
open db/create/create_users.js and add default values
|
32
|
+
var CreateUser = Jazz.Db.create(
|
33
|
+
{
|
34
|
+
columns: {
|
35
|
+
firstName: {
|
36
|
+
value: 'firstname',
|
37
|
+
type: 'string'
|
38
|
+
},
|
39
|
+
lastName: {
|
40
|
+
value: 'lastname',
|
41
|
+
type: 'string'
|
42
|
+
},
|
43
|
+
age: {
|
44
|
+
value: '23',
|
45
|
+
type: 'integer'
|
46
|
+
}
|
47
|
+
}
|
48
|
+
}
|
49
|
+
);
|
36
50
|
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
51
|
+
create_users = new CreateUser;
|
52
|
+
|
53
|
+
open db/fixtures/users.js and uncomment
|
54
|
+
_.times(
|
55
|
+
10,
|
56
|
+
function(){
|
57
|
+
new User({}).save();
|
58
|
+
}
|
59
|
+
);
|
60
|
+
|
61
|
+
in shell type
|
62
|
+
jazz server
|
63
|
+
|
64
|
+
openup your browser and navigate to
|
65
|
+
http://127.0.0.1:9292/index.html
|
41
66
|
|
42
67
|
Todo
|
43
68
|
----
|
data/bin/jazz
CHANGED
@@ -1,10 +1,22 @@
|
|
1
1
|
#!/usr/bin/env ruby
|
2
2
|
$LOAD_PATH.unshift File.join(File.dirname(__FILE__), '..', 'lib')
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
3
|
+
|
4
|
+
require 'rubygems'
|
5
|
+
require 'json'
|
6
|
+
require 'thor'
|
7
|
+
require 'thor/group'
|
8
|
+
require 'active_support/inflector'
|
9
|
+
|
10
|
+
|
11
|
+
require 'jazz/generators/project/project'
|
12
|
+
require 'jazz/generators/controller/controller'
|
13
|
+
require 'jazz/generators/model/model'
|
14
|
+
require 'jazz/generators/scenario/scenario'
|
15
|
+
require 'jazz/generators/helper/helper'
|
16
|
+
require 'jazz/generators/scaffold/scaffold'
|
17
|
+
|
18
|
+
require 'jazz/cli'
|
19
|
+
|
20
|
+
|
21
|
+
|
22
|
+
Jazz::Generators::Cli.start
|
data/lib/jazz/cli.rb
CHANGED
@@ -1,14 +1,78 @@
|
|
1
1
|
module Jazz
|
2
|
-
|
2
|
+
module Generators
|
3
|
+
class Cli < Thor
|
4
|
+
include Thor::Actions
|
3
5
|
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
6
|
+
####################################################################################
|
7
|
+
####################################################################################
|
8
|
+
|
9
|
+
desc "server", "Lets play Jazz"
|
10
|
+
def server
|
11
|
+
system "rackup #{File.dirname(__FILE__)}/rack/config.ru"
|
12
|
+
end
|
13
|
+
|
14
|
+
####################################################################################
|
15
|
+
####################################################################################
|
16
|
+
|
17
|
+
desc "new [NAME]", "Generates new Jazz application…"
|
18
|
+
def new name=nil
|
19
|
+
unless name
|
20
|
+
say "Please provide a Jazz Application name"
|
21
|
+
exit 0
|
22
|
+
end
|
23
|
+
new_app = Jazz::Generators::Project.new
|
24
|
+
new_app.name = name
|
25
|
+
new_app.create
|
10
26
|
end
|
27
|
+
|
28
|
+
####################################################################################
|
29
|
+
####################################################################################
|
30
|
+
|
31
|
+
desc "generate [TYPE] [NAME] [ATTRIBUTES]", "Generates new Jazz Resource"
|
32
|
+
def generate type=nil, name=nil, *attributes
|
33
|
+
|
34
|
+
unless type
|
35
|
+
say "Please provide a resource type"
|
36
|
+
exit 0
|
37
|
+
end
|
38
|
+
|
39
|
+
unless name
|
40
|
+
say "Please provide a resource name"
|
41
|
+
exit 0
|
42
|
+
end
|
43
|
+
|
44
|
+
case type
|
45
|
+
when "controller"
|
46
|
+
new_controller = Jazz::Generators::Controller.new
|
47
|
+
new_controller.name = name
|
48
|
+
new_controller.create
|
49
|
+
when "model"
|
50
|
+
new_model = Jazz::Generators::Model.new
|
51
|
+
new_model.name = name
|
52
|
+
new_model.attributes = attributes
|
53
|
+
new_model.create
|
54
|
+
when "scenario"
|
55
|
+
new_scenario = Jazz::Generators::Scenario.new
|
56
|
+
new_scenario.name = name
|
57
|
+
new_scenario.create
|
58
|
+
when "helper"
|
59
|
+
new_helper = Jazz::Generators::Helper.new
|
60
|
+
new_helper.name = name
|
61
|
+
new_helper.create
|
62
|
+
when "scaffold"
|
63
|
+
new_scaffold = Jazz::Generators::Scaffold.new
|
64
|
+
new_scaffold.name = name
|
65
|
+
new_scaffold.attributes = attributes
|
66
|
+
new_scaffold.create
|
67
|
+
else
|
68
|
+
say "Available types are: scaffold, controller, model, helper and scenario"
|
69
|
+
exit 0
|
70
|
+
end
|
71
|
+
end
|
72
|
+
|
73
|
+
####################################################################################
|
74
|
+
####################################################################################
|
75
|
+
|
11
76
|
end
|
12
|
-
|
13
77
|
end
|
14
|
-
end
|
78
|
+
end
|
@@ -0,0 +1,22 @@
|
|
1
|
+
module Jazz
|
2
|
+
module Generators
|
3
|
+
class Controller < Thor::Group
|
4
|
+
include Thor::Actions
|
5
|
+
|
6
|
+
attr_accessor :name
|
7
|
+
|
8
|
+
def self.source_root
|
9
|
+
File.join(File.dirname(__FILE__))
|
10
|
+
end
|
11
|
+
|
12
|
+
def create
|
13
|
+
create_controller
|
14
|
+
end
|
15
|
+
|
16
|
+
def create_controller
|
17
|
+
template "templates/controller.js", "app/controllers/#{name.downcase.pluralize}_controller.js"
|
18
|
+
end
|
19
|
+
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
@@ -0,0 +1,38 @@
|
|
1
|
+
var <%= name.capitalize.pluralize %>Controller = Jazz.Controller.create(
|
2
|
+
{
|
3
|
+
|
4
|
+
initialize : function(){
|
5
|
+
|
6
|
+
},
|
7
|
+
|
8
|
+
index : function(){
|
9
|
+
|
10
|
+
},
|
11
|
+
|
12
|
+
show : function(){
|
13
|
+
|
14
|
+
},
|
15
|
+
|
16
|
+
make : function(){
|
17
|
+
|
18
|
+
},
|
19
|
+
|
20
|
+
edit : function(){
|
21
|
+
|
22
|
+
},
|
23
|
+
|
24
|
+
create : function(){
|
25
|
+
|
26
|
+
},
|
27
|
+
|
28
|
+
update : function(){
|
29
|
+
|
30
|
+
},
|
31
|
+
|
32
|
+
destroy : function(){
|
33
|
+
|
34
|
+
}
|
35
|
+
}
|
36
|
+
);
|
37
|
+
|
38
|
+
<%= name.downcase.pluralize -%>_controller = new <%= name.capitalize.pluralize -%>Controller;
|
@@ -0,0 +1,22 @@
|
|
1
|
+
module Jazz
|
2
|
+
module Generators
|
3
|
+
class Helper < Thor::Group
|
4
|
+
include Thor::Actions
|
5
|
+
|
6
|
+
attr_accessor :name
|
7
|
+
|
8
|
+
def self.source_root
|
9
|
+
File.join(File.dirname(__FILE__))
|
10
|
+
end
|
11
|
+
|
12
|
+
def create
|
13
|
+
create_helper
|
14
|
+
end
|
15
|
+
|
16
|
+
def create_helper
|
17
|
+
template "templates/helper.js", "app/helpers/#{name.downcase.pluralize}_helper.js"
|
18
|
+
end
|
19
|
+
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
@@ -0,0 +1,50 @@
|
|
1
|
+
module Jazz
|
2
|
+
module Generators
|
3
|
+
class Model < Thor::Group
|
4
|
+
include Thor::Actions
|
5
|
+
|
6
|
+
attr_accessor :name, :attributes
|
7
|
+
|
8
|
+
def self.source_root
|
9
|
+
File.join(File.dirname(__FILE__))
|
10
|
+
end
|
11
|
+
|
12
|
+
def create
|
13
|
+
convert_attributes
|
14
|
+
create_model
|
15
|
+
create_database
|
16
|
+
create_fixture
|
17
|
+
end
|
18
|
+
|
19
|
+
def create_model
|
20
|
+
template "templates/model.js", "app/models/#{name.singularize.downcase}.js"
|
21
|
+
end
|
22
|
+
|
23
|
+
def create_database
|
24
|
+
template "templates/database.js", "db/create/create_#{name.pluralize.downcase}.js"
|
25
|
+
end
|
26
|
+
|
27
|
+
def create_fixture
|
28
|
+
template "templates/fixture.js", "db/fixtures/#{name.pluralize.downcase}.js"
|
29
|
+
end
|
30
|
+
|
31
|
+
def convert_attributes
|
32
|
+
@attribute_hash = Hash.new
|
33
|
+
|
34
|
+
attributes.each do |attribute|
|
35
|
+
val = attribute.split(':')
|
36
|
+
if val[0] && val[1]
|
37
|
+
@attribute_hash[val[0]] = val[1]
|
38
|
+
end
|
39
|
+
|
40
|
+
end
|
41
|
+
|
42
|
+
self.attributes = {}
|
43
|
+
self.attributes = @attribute_hash
|
44
|
+
end
|
45
|
+
|
46
|
+
|
47
|
+
|
48
|
+
end
|
49
|
+
end
|
50
|
+
end
|
@@ -0,0 +1,14 @@
|
|
1
|
+
var Create<%= name.singularize.capitalize %> = Jazz.Db.create(
|
2
|
+
{
|
3
|
+
columns: {
|
4
|
+
<% attributes.each_with_index do |(key, value), index| %>
|
5
|
+
<%= key %>: {
|
6
|
+
value: '',
|
7
|
+
type: '<%= value %>'
|
8
|
+
}<% unless attributes.length == index + 1 %>,<% end %>
|
9
|
+
<% end %>
|
10
|
+
}
|
11
|
+
}
|
12
|
+
);
|
13
|
+
|
14
|
+
create_<%= name.downcase.pluralize %> = new Create<%= name.singularize.capitalize %>;
|
@@ -1,16 +1,13 @@
|
|
1
1
|
var <%= name.singularize.capitalize %> = Jazz.Model.create(
|
2
|
-
|
3
|
-
|
4
|
-
{
|
2
|
+
{
|
3
|
+
configuration: {
|
5
4
|
table: create_<%= name.downcase.pluralize %>
|
6
5
|
},
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
}
|
15
|
-
|
6
|
+
|
7
|
+
clazz: {
|
8
|
+
},
|
9
|
+
|
10
|
+
object: {
|
11
|
+
}
|
12
|
+
}
|
16
13
|
);
|
@@ -0,0 +1,27 @@
|
|
1
|
+
module Jazz
|
2
|
+
module Generators
|
3
|
+
class Project < Thor::Group
|
4
|
+
include Thor::Actions
|
5
|
+
|
6
|
+
attr_accessor :name
|
7
|
+
|
8
|
+
def self.source_root
|
9
|
+
File.join(File.dirname(__FILE__))
|
10
|
+
end
|
11
|
+
|
12
|
+
def create
|
13
|
+
unless !File.directory?(self.name)
|
14
|
+
say "#{name} already exists"
|
15
|
+
exit 0
|
16
|
+
end
|
17
|
+
create_project
|
18
|
+
end
|
19
|
+
|
20
|
+
def create_project
|
21
|
+
directory "templates/app_root", name
|
22
|
+
template "templates/application.js", "#{name}/config/application.js"
|
23
|
+
end
|
24
|
+
|
25
|
+
end
|
26
|
+
end
|
27
|
+
end
|
File without changes
|
File without changes
|
File without changes
|