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.
Files changed (283) hide show
  1. data/README.rdoc +44 -19
  2. data/bin/jazz +20 -8
  3. data/lib/jazz/cli.rb +73 -9
  4. data/lib/jazz/generators/controller/controller.rb +22 -0
  5. data/lib/jazz/generators/controller/templates/controller.js +38 -0
  6. data/lib/jazz/generators/helper/helper.rb +22 -0
  7. data/lib/jazz/generators/helper/templates/helper.js +6 -0
  8. data/lib/jazz/generators/model/model.rb +50 -0
  9. data/lib/jazz/generators/model/templates/database.js +14 -0
  10. data/lib/jazz/generators/model/templates/fixture.js +10 -0
  11. data/{templates → lib/jazz/generators/model/templates}/model.js +9 -12
  12. data/lib/jazz/generators/project/project.rb +27 -0
  13. data/{templates/app_root/development/app/assets/javascripts/application.js → lib/jazz/generators/project/templates/app_root/JEMFILE.js} +0 -0
  14. data/{templates/app_root/development/app/assets/stylesheets/application.css → lib/jazz/generators/project/templates/app_root/app/assets/javascripts/application.js} +0 -0
  15. data/{templates/view_create.html → lib/jazz/generators/project/templates/app_root/app/assets/stylesheets/application.sass} +0 -0
  16. data/lib/jazz/generators/project/templates/app_root/app/controllers/application_controller.js +9 -0
  17. data/{templates/app_root/development → lib/jazz/generators/project/templates/app_root}/app/helpers/application_helper.js +0 -1
  18. data/lib/jazz/generators/project/templates/app_root/app/scenarios/application_scenario.js +13 -0
  19. data/lib/jazz/generators/project/templates/app_root/app/views/layouts/index.handlebars +1 -0
  20. data/lib/jazz/generators/project/templates/app_root/config/boot.js +23 -0
  21. data/lib/jazz/generators/project/templates/app_root/config/routes.js +6 -0
  22. data/{templates/view_index.html → lib/jazz/generators/project/templates/app_root/db/fixtures/touch} +0 -0
  23. data/lib/jazz/generators/project/templates/app_root/index.html +11 -0
  24. data/lib/jazz/generators/project/templates/app_root/lib/jazz/_.js +9 -0
  25. data/lib/jazz/generators/project/templates/app_root/lib/jazz/lib/controller/_.js +1 -0
  26. data/lib/jazz/generators/project/templates/app_root/lib/jazz/lib/controller/controller.js +22 -0
  27. data/lib/jazz/generators/project/templates/app_root/lib/jazz/lib/core/_.js +1 -0
  28. data/{dist/jazz/lib → lib/jazz/generators/project/templates/app_root/lib/jazz/lib/core}/core.js +0 -0
  29. data/lib/jazz/generators/project/templates/app_root/lib/jazz/lib/database/_.js +3 -0
  30. data/lib/jazz/generators/project/templates/app_root/lib/jazz/lib/database/database.js +10 -0
  31. data/lib/jazz/generators/project/templates/app_root/lib/jazz/lib/database/finder.js +41 -0
  32. data/lib/jazz/generators/project/templates/app_root/lib/jazz/lib/database/modifier.js +10 -0
  33. data/lib/jazz/generators/project/templates/app_root/lib/jazz/lib/helper/_.js +2 -0
  34. data/lib/jazz/generators/project/templates/app_root/lib/jazz/lib/helper/helper.js +49 -0
  35. data/lib/jazz/generators/project/templates/app_root/lib/jazz/lib/helper/underscore.js +13 -0
  36. data/lib/jazz/generators/project/templates/app_root/lib/jazz/lib/model/_.js +4 -0
  37. data/lib/jazz/generators/project/templates/app_root/lib/jazz/lib/model/conditional.js +3 -0
  38. data/lib/jazz/generators/project/templates/app_root/lib/jazz/lib/model/finder.js +21 -0
  39. data/lib/jazz/generators/project/templates/app_root/lib/jazz/lib/model/model.js +23 -0
  40. data/lib/jazz/generators/project/templates/app_root/lib/jazz/lib/model/modifier.js +44 -0
  41. data/lib/jazz/generators/project/templates/app_root/lib/jazz/lib/route/_.js +1 -0
  42. data/lib/jazz/generators/project/templates/app_root/lib/jazz/lib/route/route.js +115 -0
  43. data/lib/jazz/generators/project/templates/app_root/lib/jazz/lib/scenario/_.js +2 -0
  44. data/lib/jazz/generators/project/templates/app_root/lib/jazz/lib/scenario/initialize_scenarios/application.js +3 -0
  45. data/lib/jazz/generators/project/templates/app_root/lib/jazz/lib/scenario/scenario.js +13 -0
  46. data/lib/jazz/generators/project/templates/app_root/lib/jazz/lib/view/_.js +1 -0
  47. data/lib/jazz/generators/project/templates/app_root/lib/jazz/lib/view/view.js +39 -0
  48. data/{dist/handlebars → lib/jazz/generators/project/templates/app_root/vendor}/handlebars.js +0 -0
  49. data/{dist/hashchange → lib/jazz/generators/project/templates/app_root/vendor}/hashchange.js +0 -0
  50. data/{dist/jquery → lib/jazz/generators/project/templates/app_root/vendor}/jquery.js +0 -0
  51. data/lib/jazz/generators/project/templates/app_root/vendor/simplemodal.js +698 -0
  52. data/lib/jazz/generators/project/templates/app_root/vendor/tipTip.js +191 -0
  53. data/{dist/underscore → lib/jazz/generators/project/templates/app_root/vendor}/underscore.js +0 -0
  54. data/lib/jazz/generators/project/templates/application.js +12 -0
  55. data/lib/jazz/generators/scaffold/scaffold.rb +73 -0
  56. data/lib/jazz/generators/scaffold/templates/controller.js +49 -0
  57. data/lib/jazz/generators/scaffold/templates/database.js +14 -0
  58. data/lib/jazz/generators/scaffold/templates/fixture.js +10 -0
  59. data/lib/jazz/generators/scaffold/templates/helper.js +6 -0
  60. data/lib/jazz/generators/scaffold/templates/model.js +13 -0
  61. data/lib/jazz/generators/scaffold/templates/scenario.js +7 -0
  62. data/lib/jazz/generators/scaffold/templates/view_edit.handlebars +6 -0
  63. data/lib/jazz/generators/scaffold/templates/view_form.handlebars +12 -0
  64. data/lib/jazz/generators/scaffold/templates/view_index.handlebars +27 -0
  65. data/lib/jazz/generators/scaffold/templates/view_new.handlebars +5 -0
  66. data/lib/jazz/generators/scaffold/templates/view_show.handlebars +10 -0
  67. data/lib/jazz/generators/scenario/scenario.rb +22 -0
  68. data/lib/jazz/generators/scenario/templates/scenario.js +7 -0
  69. data/lib/jazz/rack/config.ru +16 -0
  70. data/lib/jazz/sprockets/templates/handlebars.rb +30 -0
  71. metadata +120 -234
  72. data/dist/jazz/lib/controller.js +0 -17
  73. data/dist/jazz/lib/db.js +0 -41
  74. data/dist/jazz/lib/helper.js +0 -38
  75. data/dist/jazz/lib/model.js +0 -95
  76. data/dist/jazz/lib/route.js +0 -74
  77. data/dist/jazz/lib/view.js +0 -1
  78. data/dist/jazz/module.js +0 -15
  79. data/dist/require/order.js +0 -180
  80. data/dist/require/require.js +0 -31
  81. data/dist/require/template.js +0 -98
  82. data/lib/jazz.rb +0 -12
  83. data/lib/jazz/app_detector.rb +0 -70
  84. data/lib/jazz/app_generator.rb +0 -41
  85. data/lib/jazz/controller_generator.rb +0 -34
  86. data/lib/jazz/helper_generator.rb +0 -30
  87. data/lib/jazz/model_generator.rb +0 -27
  88. data/lib/jazz/scaffold_generator.rb +0 -49
  89. data/templates/app_root/Rakefile +0 -11
  90. data/templates/app_root/development/app/controllers/application_controller.js +0 -11
  91. data/templates/app_root/development/config/glue.js +0 -9
  92. data/templates/app_root/development/config/routes.js +0 -5
  93. data/templates/app_root/scripts/build.js +0 -30
  94. data/templates/app_root/scripts/r.js/LICENSE +0 -58
  95. data/templates/app_root/scripts/r.js/README.md +0 -177
  96. data/templates/app_root/scripts/r.js/build/build.js +0 -26
  97. data/templates/app_root/scripts/r.js/build/buildebug.sh +0 -4
  98. data/templates/app_root/scripts/r.js/build/example.build.js +0 -296
  99. data/templates/app_root/scripts/r.js/build/jslib/blank.js +0 -4
  100. data/templates/app_root/scripts/r.js/build/jslib/build.js +0 -952
  101. data/templates/app_root/scripts/r.js/build/jslib/commandLine.js +0 -23
  102. data/templates/app_root/scripts/r.js/build/jslib/commonJs.js +0 -152
  103. data/templates/app_root/scripts/r.js/build/jslib/env.js +0 -47
  104. data/templates/app_root/scripts/r.js/build/jslib/lang.js +0 -49
  105. data/templates/app_root/scripts/r.js/build/jslib/logger.js +0 -58
  106. data/templates/app_root/scripts/r.js/build/jslib/node.js +0 -106
  107. data/templates/app_root/scripts/r.js/build/jslib/node/args.js +0 -20
  108. data/templates/app_root/scripts/r.js/build/jslib/node/file.js +0 -263
  109. data/templates/app_root/scripts/r.js/build/jslib/node/load.js +0 -17
  110. data/templates/app_root/scripts/r.js/build/jslib/node/optimize.js +0 -10
  111. data/templates/app_root/scripts/r.js/build/jslib/node/print.js +0 -16
  112. data/templates/app_root/scripts/r.js/build/jslib/optimize.js +0 -279
  113. data/templates/app_root/scripts/r.js/build/jslib/opto.build.js +0 -11
  114. data/templates/app_root/scripts/r.js/build/jslib/parse.js +0 -590
  115. data/templates/app_root/scripts/r.js/build/jslib/pragma.js +0 -251
  116. data/templates/app_root/scripts/r.js/build/jslib/requirePatch.js +0 -286
  117. data/templates/app_root/scripts/r.js/build/jslib/rhino.js +0 -22
  118. data/templates/app_root/scripts/r.js/build/jslib/rhino/args.js +0 -21
  119. data/templates/app_root/scripts/r.js/build/jslib/rhino/file.js +0 -244
  120. data/templates/app_root/scripts/r.js/build/jslib/rhino/load.js +0 -12
  121. data/templates/app_root/scripts/r.js/build/jslib/rhino/optimize.js +0 -100
  122. data/templates/app_root/scripts/r.js/build/jslib/rhino/print.js +0 -12
  123. data/templates/app_root/scripts/r.js/build/jslib/uglifyjs/README.md +0 -16
  124. data/templates/app_root/scripts/r.js/build/jslib/uglifyjs/index.js +0 -21
  125. data/templates/app_root/scripts/r.js/build/jslib/uglifyjs/parse-js.js +0 -1342
  126. data/templates/app_root/scripts/r.js/build/jslib/uglifyjs/process.js +0 -2005
  127. data/templates/app_root/scripts/r.js/build/jslib/uglifyjs/squeeze-more.js +0 -55
  128. data/templates/app_root/scripts/r.js/build/jslib/x.js +0 -243
  129. data/templates/app_root/scripts/r.js/build/tests/all.js +0 -47
  130. data/templates/app_root/scripts/r.js/build/tests/allj.sh +0 -3
  131. data/templates/app_root/scripts/r.js/build/tests/alln.sh +0 -18
  132. data/templates/app_root/scripts/r.js/build/tests/anonSimple.build.js +0 -7
  133. data/templates/app_root/scripts/r.js/build/tests/buildUtils.js +0 -19
  134. data/templates/app_root/scripts/r.js/build/tests/builds.js +0 -489
  135. data/templates/app_root/scripts/r.js/build/tests/circular.build.js +0 -18
  136. data/templates/app_root/scripts/r.js/build/tests/convert.js +0 -18
  137. data/templates/app_root/scripts/r.js/build/tests/css.build.js +0 -6
  138. data/templates/app_root/scripts/r.js/build/tests/css/common/common.css +0 -4
  139. data/templates/app_root/scripts/r.js/build/tests/css/master.css +0 -10
  140. data/templates/app_root/scripts/r.js/build/tests/css/sub/sub1.css +0 -7
  141. data/templates/app_root/scripts/r.js/build/tests/cssTestCompare.css +0 -13
  142. data/templates/app_root/scripts/r.js/build/tests/end.frag +0 -3
  143. data/templates/app_root/scripts/r.js/build/tests/expected/unoExcludeShallow.js +0 -23
  144. data/templates/app_root/scripts/r.js/build/tests/exports.build.js +0 -12
  145. data/templates/app_root/scripts/r.js/build/tests/hasTestModule.build.js +0 -10
  146. data/templates/app_root/scripts/r.js/build/tests/hasTestModule.js +0 -30
  147. data/templates/app_root/scripts/r.js/build/tests/http/httpBuild.js +0 -70
  148. data/templates/app_root/scripts/r.js/build/tests/http/main.html +0 -28
  149. data/templates/app_root/scripts/r.js/build/tests/http/scripts/main.js +0 -18
  150. data/templates/app_root/scripts/r.js/build/tests/http/scripts/one.js +0 -3
  151. data/templates/app_root/scripts/r.js/build/tests/http/scripts/three.js +0 -5
  152. data/templates/app_root/scripts/r.js/build/tests/http/scripts/two.js +0 -7
  153. data/templates/app_root/scripts/r.js/build/tests/i18n.build.js +0 -17
  154. data/templates/app_root/scripts/r.js/build/tests/indexBuilder.build.js +0 -8
  155. data/templates/app_root/scripts/r.js/build/tests/lib/amdefine/a.js +0 -17
  156. data/templates/app_root/scripts/r.js/build/tests/lib/amdefine/b.js +0 -8
  157. data/templates/app_root/scripts/r.js/build/tests/lib/amdefine/build.js +0 -6
  158. data/templates/app_root/scripts/r.js/build/tests/lib/amdefine/c.js +0 -7
  159. data/templates/app_root/scripts/r.js/build/tests/lib/amdefine/d.js +0 -5
  160. data/templates/app_root/scripts/r.js/build/tests/lib/amdefine/expected.js +0 -36
  161. data/templates/app_root/scripts/r.js/build/tests/lib/amdefine/node_modules/amdefine/LICENSE +0 -58
  162. data/templates/app_root/scripts/r.js/build/tests/lib/amdefine/node_modules/amdefine/amdefine.js +0 -188
  163. data/templates/app_root/scripts/r.js/build/tests/lib/amdefine/node_modules/amdefine/package.json +0 -21
  164. data/templates/app_root/scripts/r.js/build/tests/lib/comments/bang.js +0 -10
  165. data/templates/app_root/scripts/r.js/build/tests/lib/comments/build.js +0 -6
  166. data/templates/app_root/scripts/r.js/build/tests/lib/comments/expected.js +0 -9
  167. data/templates/app_root/scripts/r.js/build/tests/lib/comments/license.js +0 -13
  168. data/templates/app_root/scripts/r.js/build/tests/lib/dotpackage/scripts/app.build.js +0 -15
  169. data/templates/app_root/scripts/r.js/build/tests/lib/dotpackage/scripts/main-expected.js +0 -13
  170. data/templates/app_root/scripts/r.js/build/tests/lib/dotpackage/scripts/main.js +0 -7
  171. data/templates/app_root/scripts/r.js/build/tests/lib/empty/build.js +0 -13
  172. data/templates/app_root/scripts/r.js/build/tests/lib/empty/expected.js +0 -8
  173. data/templates/app_root/scripts/r.js/build/tests/lib/empty/main.js +0 -1
  174. data/templates/app_root/scripts/r.js/build/tests/lib/empty/sub1.js +0 -1
  175. data/templates/app_root/scripts/r.js/build/tests/lib/empty/sub2.js +0 -1
  176. data/templates/app_root/scripts/r.js/build/tests/lib/nameInsertion/build.js +0 -6
  177. data/templates/app_root/scripts/r.js/build/tests/lib/nameInsertion/expected.js +0 -12
  178. data/templates/app_root/scripts/r.js/build/tests/lib/nameInsertion/main.js +0 -9
  179. data/templates/app_root/scripts/r.js/build/tests/lib/namespace/build.js +0 -8
  180. data/templates/app_root/scripts/r.js/build/tests/lib/namespace/expected.js +0 -47
  181. data/templates/app_root/scripts/r.js/build/tests/lib/namespace/main.js +0 -6
  182. data/templates/app_root/scripts/r.js/build/tests/lib/namespace/modules/four.js +0 -7
  183. data/templates/app_root/scripts/r.js/build/tests/lib/namespace/modules/one.js +0 -9
  184. data/templates/app_root/scripts/r.js/build/tests/lib/namespace/modules/three.js +0 -14
  185. data/templates/app_root/scripts/r.js/build/tests/lib/namespace/modules/two.js +0 -5
  186. data/templates/app_root/scripts/r.js/build/tests/lib/nested/a.js +0 -12
  187. data/templates/app_root/scripts/r.js/build/tests/lib/nested/b.js +0 -3
  188. data/templates/app_root/scripts/r.js/build/tests/lib/nested/build.js +0 -6
  189. data/templates/app_root/scripts/r.js/build/tests/lib/nested/buildWithCE.js +0 -7
  190. data/templates/app_root/scripts/r.js/build/tests/lib/nested/c.js +0 -3
  191. data/templates/app_root/scripts/r.js/build/tests/lib/nested/d.js +0 -3
  192. data/templates/app_root/scripts/r.js/build/tests/lib/nested/e.js +0 -3
  193. data/templates/app_root/scripts/r.js/build/tests/lib/nested/expected-built.js +0 -36
  194. data/templates/app_root/scripts/r.js/build/tests/lib/nested/expected-builtWithCE.js +0 -42
  195. data/templates/app_root/scripts/r.js/build/tests/lib/nested/main.js +0 -3
  196. data/templates/app_root/scripts/r.js/build/tests/lib/nested/top.js +0 -10
  197. data/templates/app_root/scripts/r.js/build/tests/lib/nestedHas/a.js +0 -3
  198. data/templates/app_root/scripts/r.js/build/tests/lib/nestedHas/b.js +0 -3
  199. data/templates/app_root/scripts/r.js/build/tests/lib/nestedHas/build.js +0 -6
  200. data/templates/app_root/scripts/r.js/build/tests/lib/nestedHas/buildNeedAll.js +0 -9
  201. data/templates/app_root/scripts/r.js/build/tests/lib/nestedHas/buildNeedB.js +0 -11
  202. data/templates/app_root/scripts/r.js/build/tests/lib/nestedHas/buildNeedC.js +0 -11
  203. data/templates/app_root/scripts/r.js/build/tests/lib/nestedHas/buildNeedD.js +0 -11
  204. data/templates/app_root/scripts/r.js/build/tests/lib/nestedHas/buildNested.js +0 -7
  205. data/templates/app_root/scripts/r.js/build/tests/lib/nestedHas/c.js +0 -3
  206. data/templates/app_root/scripts/r.js/build/tests/lib/nestedHas/d.js +0 -3
  207. data/templates/app_root/scripts/r.js/build/tests/lib/nestedHas/expected-built.js +0 -21
  208. data/templates/app_root/scripts/r.js/build/tests/lib/nestedHas/expected-builtNeedAll.js +0 -31
  209. data/templates/app_root/scripts/r.js/build/tests/lib/nestedHas/expected-builtNeedB.js +0 -24
  210. data/templates/app_root/scripts/r.js/build/tests/lib/nestedHas/expected-builtNeedC.js +0 -24
  211. data/templates/app_root/scripts/r.js/build/tests/lib/nestedHas/expected-builtNeedD.js +0 -25
  212. data/templates/app_root/scripts/r.js/build/tests/lib/nestedHas/expected-builtNested.js +0 -31
  213. data/templates/app_root/scripts/r.js/build/tests/lib/nestedHas/main.js +0 -17
  214. data/templates/app_root/scripts/r.js/build/tests/lib/plugins/build.js +0 -6
  215. data/templates/app_root/scripts/r.js/build/tests/lib/plugins/converter.js +0 -11
  216. data/templates/app_root/scripts/r.js/build/tests/lib/plugins/main.js +0 -6
  217. data/templates/app_root/scripts/r.js/build/tests/lib/plugins/plug.js +0 -29
  218. data/templates/app_root/scripts/r.js/build/tests/lib/plugins/util.js +0 -7
  219. data/templates/app_root/scripts/r.js/build/tests/nameOnly.build.js +0 -10
  220. data/templates/app_root/scripts/r.js/build/tests/nodeAll.js +0 -3
  221. data/templates/app_root/scripts/r.js/build/tests/nodeOptimize.js +0 -12
  222. data/templates/app_root/scripts/r.js/build/tests/nodeOptimizeNoCallback.js +0 -10
  223. data/templates/app_root/scripts/r.js/build/tests/order.build.js +0 -16
  224. data/templates/app_root/scripts/r.js/build/tests/override/override.js +0 -36
  225. data/templates/app_root/scripts/r.js/build/tests/packages.build.js +0 -59
  226. data/templates/app_root/scripts/r.js/build/tests/parse.js +0 -103
  227. data/templates/app_root/scripts/r.js/build/tests/simple.build.js +0 -13
  228. data/templates/app_root/scripts/r.js/build/tests/simpleNamespace.build.js +0 -17
  229. data/templates/app_root/scripts/r.js/build/tests/start.frag +0 -4
  230. data/templates/app_root/scripts/r.js/build/tests/text.build.js +0 -16
  231. data/templates/app_root/scripts/r.js/build/tests/textExclude.build.js +0 -16
  232. data/templates/app_root/scripts/r.js/dist.js +0 -95
  233. data/templates/app_root/scripts/r.js/dist/README.md +0 -6
  234. data/templates/app_root/scripts/r.js/dist/r-1.0.0.js +0 -9042
  235. data/templates/app_root/scripts/r.js/dist/r-edge.js +0 -9191
  236. data/templates/app_root/scripts/r.js/dist/r.js +0 -9099
  237. data/templates/app_root/scripts/r.js/lib/closure/COPYING +0 -202
  238. data/templates/app_root/scripts/r.js/lib/closure/README +0 -292
  239. data/templates/app_root/scripts/r.js/lib/closure/compiler.jar +0 -0
  240. data/templates/app_root/scripts/r.js/lib/rhino/LICENSE +0 -4
  241. data/templates/app_root/scripts/r.js/lib/rhino/js.jar +0 -0
  242. data/templates/app_root/scripts/r.js/require.js +0 -1952
  243. data/templates/app_root/scripts/r.js/tasks.txt +0 -2
  244. data/templates/app_root/scripts/r.js/tests/all.js +0 -49
  245. data/templates/app_root/scripts/r.js/tests/allNode.js +0 -3
  246. data/templates/app_root/scripts/r.js/tests/allj.sh +0 -1
  247. data/templates/app_root/scripts/r.js/tests/alln.sh +0 -2
  248. data/templates/app_root/scripts/r.js/tests/alpha.js +0 -3
  249. data/templates/app_root/scripts/r.js/tests/beta.js +0 -6
  250. data/templates/app_root/scripts/r.js/tests/doh/LICENSE +0 -195
  251. data/templates/app_root/scripts/r.js/tests/doh/README +0 -12
  252. data/templates/app_root/scripts/r.js/tests/doh/_browserRunner.js +0 -855
  253. data/templates/app_root/scripts/r.js/tests/doh/_nodeRunner.js +0 -20
  254. data/templates/app_root/scripts/r.js/tests/doh/_rhinoRunner.js +0 -17
  255. data/templates/app_root/scripts/r.js/tests/doh/_sounds/LICENSE +0 -10
  256. data/templates/app_root/scripts/r.js/tests/doh/_sounds/doh.wav +0 -0
  257. data/templates/app_root/scripts/r.js/tests/doh/_sounds/dohaaa.wav +0 -0
  258. data/templates/app_root/scripts/r.js/tests/doh/_sounds/woohoo.wav +0 -0
  259. data/templates/app_root/scripts/r.js/tests/doh/runner.html +0 -316
  260. data/templates/app_root/scripts/r.js/tests/doh/runner.js +0 -1499
  261. data/templates/app_root/scripts/r.js/tests/doh/runner.sh +0 -3
  262. data/templates/app_root/scripts/r.js/tests/doh/small_logo.png +0 -0
  263. data/templates/app_root/scripts/r.js/tests/node/canvasTest.js +0 -39
  264. data/templates/app_root/scripts/r.js/tests/node/embedded/README.md +0 -15
  265. data/templates/app_root/scripts/r.js/tests/node/embedded/coffee/foo.coffee +0 -1
  266. data/templates/app_root/scripts/r.js/tests/node/embedded/main.js +0 -13
  267. data/templates/app_root/scripts/r.js/tests/node/embedded/scripts/bar.js +0 -13
  268. data/templates/app_root/scripts/r.js/tests/node/index.js +0 -11
  269. data/templates/app_root/scripts/r.js/tests/node/tests/alpha/foo.js +0 -6
  270. data/templates/app_root/scripts/r.js/tests/node/tests/alpha/hello.html +0 -9
  271. data/templates/app_root/scripts/r.js/tests/node/tests/foo.js +0 -3
  272. data/templates/app_root/scripts/r.js/tests/node/tests/server.js +0 -11
  273. data/templates/app_root/scripts/r.js/tests/relative.js +0 -10
  274. data/templates/app_root/scripts/r.js/tests/sub/betaSub.js +0 -3
  275. data/templates/application.js +0 -7
  276. data/templates/boot.js +0 -42
  277. data/templates/controller.js +0 -19
  278. data/templates/db.js +0 -14
  279. data/templates/helper.js +0 -9
  280. data/templates/index.html +0 -9
  281. data/templates/scaffold_controller.js +0 -19
  282. data/templates/view_show.html +0 -0
  283. 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 todo
16
- cd todo
17
- jazz generate scaffold item title state
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
- '': 'items_controller#index',
23
- '/items': 'items_controller#index'
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 app/controllers/items_controller.js and add this to index action
28
- milk = new Item({title: 'milk', state: false});
29
- milk.save();
30
-
31
- bread = new Item({title: 'bread', state: false});
32
- bread.save();
33
-
34
- open_cart = Item.findBy({state: false});
35
- console.log(open_cart);
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
- bread.set({state: true});
38
- bread.save();
39
- open_cart = Item.findBy({state: false});
40
- console.log(open_cart);
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
- require 'jazz'
4
-
5
- if(ARGV.include?('generate'))
6
- Jazz::CLI.start
7
- elsif(ARGV.include?('new'))
8
- ARGV.delete('new')
9
- Jazz::AppGenerator.start
10
- end
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
- class CLI < Thor
2
+ module Generators
3
+ class Cli < Thor
4
+ include Thor::Actions
3
5
 
4
- desc "Jazz generate [generator] [name]", "call a generator"
5
- def generate(requested_generator, name, *args)
6
- ARGV.delete('generate')
7
- if(ARGV.include?(requested_generator))
8
- ARGV.delete(requested_generator)
9
- ActiveSupport::Inflector.constantize("Jazz::#{requested_generator.capitalize}Generator").start
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,6 @@
1
+ var <%= name.capitalize.pluralize %>Helper = Jazz.Helper.extend(
2
+ {
3
+ }
4
+ );
5
+
6
+ <%= name.downcase.pluralize -%> = new <%= name.capitalize.pluralize %>Helper;
@@ -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 %>;
@@ -0,0 +1,10 @@
1
+ /*
2
+
3
+ _.times(
4
+ 10,
5
+ function(){
6
+ new <%= name.singularize.capitalize %>({}).save();
7
+ }
8
+ );
9
+
10
+ */
@@ -1,16 +1,13 @@
1
1
  var <%= name.singularize.capitalize %> = Jazz.Model.create(
2
-
3
- //configuration
4
- {
2
+ {
3
+ configuration: {
5
4
  table: create_<%= name.downcase.pluralize %>
6
5
  },
7
-
8
- //modelActions
9
- {
10
- },
11
-
12
- //objectActions
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
@@ -0,0 +1,9 @@
1
+ var ApplicationController = Jazz.Controller.create(
2
+ {
3
+ initialize:function () {
4
+ render( { view: 'layouts_index', to: 'body' } );
5
+ }
6
+ }
7
+ );
8
+
9
+ application_controller = new ApplicationController;