ninjs 0.13.6 → 0.13.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (275) hide show
  1. data/VERSION +1 -1
  2. data/ninjs.gemspec +5 -290
  3. metadata +52 -345
  4. data/.bundle/config +0 -2
  5. data/CNAME +0 -1
  6. data/Gemfile +0 -16
  7. data/Gemfile.lock +0 -36
  8. data/LICENSE +0 -29
  9. data/README.md +0 -348
  10. data/bin/ninjs +0 -218
  11. data/lib/ninjs.rb +0 -10
  12. data/lib/ninjs/command.rb +0 -91
  13. data/lib/ninjs/configuration.rb +0 -72
  14. data/lib/ninjs/dependencies.rb +0 -16
  15. data/lib/ninjs/generator.rb +0 -57
  16. data/lib/ninjs/helpers.rb +0 -17
  17. data/lib/ninjs/manifest.rb +0 -9
  18. data/lib/ninjs/notification.rb +0 -37
  19. data/lib/ninjs/project.rb +0 -233
  20. data/repository/jquery/1.1.4.js +0 -2508
  21. data/repository/jquery/1.2.6.js +0 -32
  22. data/repository/jquery/1.3.2.js +0 -19
  23. data/repository/jquery/1.4.2.js +0 -154
  24. data/repository/jquery/1.4.3.js +0 -166
  25. data/repository/jquery/1.4.4.js +0 -167
  26. data/repository/jquery/1.5.js +0 -16
  27. data/repository/jquery/fancybox/1.3.1.js +0 -1079
  28. data/repository/jquery/fancybox/assets/1.3.1/css/fancybox.css +0 -363
  29. data/repository/jquery/fancybox/assets/1.3.1/images/fancybox/blank.gif +0 -0
  30. data/repository/jquery/fancybox/assets/1.3.1/images/fancybox/fancy_close.png +0 -0
  31. data/repository/jquery/fancybox/assets/1.3.1/images/fancybox/fancy_loading.png +0 -0
  32. data/repository/jquery/fancybox/assets/1.3.1/images/fancybox/fancy_nav_left.png +0 -0
  33. data/repository/jquery/fancybox/assets/1.3.1/images/fancybox/fancy_nav_right.png +0 -0
  34. data/repository/jquery/fancybox/assets/1.3.1/images/fancybox/fancy_shadow_e.png +0 -0
  35. data/repository/jquery/fancybox/assets/1.3.1/images/fancybox/fancy_shadow_n.png +0 -0
  36. data/repository/jquery/fancybox/assets/1.3.1/images/fancybox/fancy_shadow_ne.png +0 -0
  37. data/repository/jquery/fancybox/assets/1.3.1/images/fancybox/fancy_shadow_nw.png +0 -0
  38. data/repository/jquery/fancybox/assets/1.3.1/images/fancybox/fancy_shadow_s.png +0 -0
  39. data/repository/jquery/fancybox/assets/1.3.1/images/fancybox/fancy_shadow_se.png +0 -0
  40. data/repository/jquery/fancybox/assets/1.3.1/images/fancybox/fancy_shadow_sw.png +0 -0
  41. data/repository/jquery/fancybox/assets/1.3.1/images/fancybox/fancy_shadow_w.png +0 -0
  42. data/repository/jquery/fancybox/assets/1.3.1/images/fancybox/fancy_title_left.png +0 -0
  43. data/repository/jquery/fancybox/assets/1.3.1/images/fancybox/fancy_title_main.png +0 -0
  44. data/repository/jquery/fancybox/assets/1.3.1/images/fancybox/fancy_title_over.png +0 -0
  45. data/repository/jquery/fancybox/assets/1.3.1/images/fancybox/fancy_title_right.png +0 -0
  46. data/repository/jquery/fancybox/assets/1.3.1/images/fancybox/fancybox-x.png +0 -0
  47. data/repository/jquery/fancybox/assets/1.3.1/images/fancybox/fancybox-y.png +0 -0
  48. data/repository/jquery/fancybox/assets/1.3.1/images/fancybox/fancybox.png +0 -0
  49. data/repository/jquery/fancybox/assets/1.3.1/images/fancybox/jquery.easing-1.3.pack.js +0 -72
  50. data/repository/jquery/fancybox/latest.js +0 -1
  51. data/repository/jquery/latest.js +0 -1
  52. data/repository/jquery/mobile/1.0a3.js +0 -123
  53. data/repository/jquery/mobile/1.0a3/assets/css/jquery.mobile.css +0 -1652
  54. data/repository/jquery/mobile/1.0a3/assets/images/jquerymobile/ajax-loader.png +0 -0
  55. data/repository/jquery/mobile/1.0a3/assets/images/jquerymobile/form-check-off.png +0 -0
  56. data/repository/jquery/mobile/1.0a3/assets/images/jquerymobile/form-check-on.png +0 -0
  57. data/repository/jquery/mobile/1.0a3/assets/images/jquerymobile/form-radio-off.png +0 -0
  58. data/repository/jquery/mobile/1.0a3/assets/images/jquerymobile/form-radio-on.png +0 -0
  59. data/repository/jquery/mobile/1.0a3/assets/images/jquerymobile/icon-search-black.png +0 -0
  60. data/repository/jquery/mobile/1.0a3/assets/images/jquerymobile/icons-18-black.png +0 -0
  61. data/repository/jquery/mobile/1.0a3/assets/images/jquerymobile/icons-18-white.png +0 -0
  62. data/repository/jquery/mobile/1.0a3/assets/images/jquerymobile/icons-36-black.png +0 -0
  63. data/repository/jquery/mobile/1.0a3/assets/images/jquerymobile/icons-36-white.png +0 -0
  64. data/repository/jquery/mobile/latest.js +0 -1
  65. data/repository/jquery/mousewheel/3.0.2.js +0 -11
  66. data/repository/jquery/mousewheel/latest.js +0 -1
  67. data/repository/jquery/ui/1.8.7.js +0 -783
  68. data/repository/jquery/ui/assets/1.8.7/css/jqueryui/jquery.ui.accordion.css +0 -19
  69. data/repository/jquery/ui/assets/1.8.7/css/jqueryui/jquery.ui.all.css +0 -11
  70. data/repository/jquery/ui/assets/1.8.7/css/jqueryui/jquery.ui.autocomplete.css +0 -53
  71. data/repository/jquery/ui/assets/1.8.7/css/jqueryui/jquery.ui.base.css +0 -11
  72. data/repository/jquery/ui/assets/1.8.7/css/jqueryui/jquery.ui.button.css +0 -38
  73. data/repository/jquery/ui/assets/1.8.7/css/jqueryui/jquery.ui.core.css +0 -41
  74. data/repository/jquery/ui/assets/1.8.7/css/jqueryui/jquery.ui.datepicker.css +0 -68
  75. data/repository/jquery/ui/assets/1.8.7/css/jqueryui/jquery.ui.dialog.css +0 -21
  76. data/repository/jquery/ui/assets/1.8.7/css/jqueryui/jquery.ui.progressbar.css +0 -11
  77. data/repository/jquery/ui/assets/1.8.7/css/jqueryui/jquery.ui.resizable.css +0 -20
  78. data/repository/jquery/ui/assets/1.8.7/css/jqueryui/jquery.ui.selectable.css +0 -10
  79. data/repository/jquery/ui/assets/1.8.7/css/jqueryui/jquery.ui.slider.css +0 -24
  80. data/repository/jquery/ui/assets/1.8.7/css/jqueryui/jquery.ui.tabs.css +0 -18
  81. data/repository/jquery/ui/assets/1.8.7/css/jqueryui/jquery.ui.theme.css +0 -252
  82. data/repository/jquery/ui/assets/1.8.7/images/jqueryui/ui-bg_flat_0_aaaaaa_40x100.png +0 -0
  83. data/repository/jquery/ui/assets/1.8.7/images/jqueryui/ui-bg_flat_75_ffffff_40x100.png +0 -0
  84. data/repository/jquery/ui/assets/1.8.7/images/jqueryui/ui-bg_glass_55_fbf9ee_1x400.png +0 -0
  85. data/repository/jquery/ui/assets/1.8.7/images/jqueryui/ui-bg_glass_65_ffffff_1x400.png +0 -0
  86. data/repository/jquery/ui/assets/1.8.7/images/jqueryui/ui-bg_glass_75_dadada_1x400.png +0 -0
  87. data/repository/jquery/ui/assets/1.8.7/images/jqueryui/ui-bg_glass_75_e6e6e6_1x400.png +0 -0
  88. data/repository/jquery/ui/assets/1.8.7/images/jqueryui/ui-bg_glass_95_fef1ec_1x400.png +0 -0
  89. data/repository/jquery/ui/assets/1.8.7/images/jqueryui/ui-bg_highlight-soft_75_cccccc_1x100.png +0 -0
  90. data/repository/jquery/ui/assets/1.8.7/images/jqueryui/ui-icons_222222_256x240.png +0 -0
  91. data/repository/jquery/ui/assets/1.8.7/images/jqueryui/ui-icons_2e83ff_256x240.png +0 -0
  92. data/repository/jquery/ui/assets/1.8.7/images/jqueryui/ui-icons_454545_256x240.png +0 -0
  93. data/repository/jquery/ui/assets/1.8.7/images/jqueryui/ui-icons_888888_256x240.png +0 -0
  94. data/repository/jquery/ui/assets/1.8.7/images/jqueryui/ui-icons_cd0a0a_256x240.png +0 -0
  95. data/repository/jquery/ui/latest.js +0 -1
  96. data/repository/json2.js +0 -482
  97. data/repository/modernizr/1.5.js +0 -28
  98. data/repository/modernizr/latest.js +0 -1
  99. data/repository/ninjs/core/.core.pdoc.yaml +0 -0
  100. data/repository/ninjs/core/.existence.pdoc.yaml +0 -12
  101. data/repository/ninjs/core/.extend.pdoc.yaml +0 -0
  102. data/repository/ninjs/core/.nin.pdoc.yaml +0 -0
  103. data/repository/ninjs/core/application.js +0 -47
  104. data/repository/ninjs/core/existence.js +0 -277
  105. data/repository/ninjs/core/extend.js +0 -77
  106. data/repository/ninjs/core/module.js +0 -135
  107. data/repository/ninjs/core/nin.js +0 -4
  108. data/repository/ninjs/docs/Data/ClassHierarchy.nd +0 -0
  109. data/repository/ninjs/docs/Data/ConfigFileInfo.nd +0 -0
  110. data/repository/ninjs/docs/Data/FileInfo.nd +0 -16
  111. data/repository/ninjs/docs/Data/ImageFileInfo.nd +0 -0
  112. data/repository/ninjs/docs/Data/ImageReferenceTable.nd +0 -0
  113. data/repository/ninjs/docs/Data/IndexInfo.nd +0 -0
  114. data/repository/ninjs/docs/Data/PreviousMenuState.nd +0 -0
  115. data/repository/ninjs/docs/Data/PreviousSettings.nd +0 -0
  116. data/repository/ninjs/docs/Data/SymbolTable.nd +0 -0
  117. data/repository/ninjs/docs/Languages.txt +0 -113
  118. data/repository/ninjs/docs/Menu.txt +0 -63
  119. data/repository/ninjs/docs/Topics.txt +0 -81
  120. data/repository/ninjs/docs/files/core/application-js.html +0 -44
  121. data/repository/ninjs/docs/files/core/existence-js.html +0 -60
  122. data/repository/ninjs/docs/files/core/extend-js.html +0 -55
  123. data/repository/ninjs/docs/files/core/module-js.html +0 -80
  124. data/repository/ninjs/docs/files/core/nin-js.html +0 -38
  125. data/repository/ninjs/docs/index.html +0 -1
  126. data/repository/ninjs/docs/index/Classes.html +0 -33
  127. data/repository/ninjs/docs/index/Files.html +0 -45
  128. data/repository/ninjs/docs/index/Functions.html +0 -65
  129. data/repository/ninjs/docs/index/General.html +0 -85
  130. data/repository/ninjs/docs/index/Variables.html +0 -45
  131. data/repository/ninjs/docs/javascript/main.js +0 -841
  132. data/repository/ninjs/docs/javascript/prettify.js +0 -1526
  133. data/repository/ninjs/docs/javascript/searchdata.js +0 -152
  134. data/repository/ninjs/docs/search/ClassesN.html +0 -20
  135. data/repository/ninjs/docs/search/FilesA.html +0 -20
  136. data/repository/ninjs/docs/search/FilesE.html +0 -20
  137. data/repository/ninjs/docs/search/FilesM.html +0 -20
  138. data/repository/ninjs/docs/search/FilesN.html +0 -20
  139. data/repository/ninjs/docs/search/FunctionsA.html +0 -20
  140. data/repository/ninjs/docs/search/FunctionsC.html +0 -20
  141. data/repository/ninjs/docs/search/FunctionsE.html +0 -20
  142. data/repository/ninjs/docs/search/FunctionsI.html +0 -20
  143. data/repository/ninjs/docs/search/FunctionsM.html +0 -20
  144. data/repository/ninjs/docs/search/FunctionsR.html +0 -20
  145. data/repository/ninjs/docs/search/FunctionsS.html +0 -20
  146. data/repository/ninjs/docs/search/FunctionsSymbols.html +0 -20
  147. data/repository/ninjs/docs/search/FunctionsU.html +0 -20
  148. data/repository/ninjs/docs/search/GeneralA.html +0 -20
  149. data/repository/ninjs/docs/search/GeneralC.html +0 -20
  150. data/repository/ninjs/docs/search/GeneralD.html +0 -20
  151. data/repository/ninjs/docs/search/GeneralE.html +0 -20
  152. data/repository/ninjs/docs/search/GeneralF.html +0 -20
  153. data/repository/ninjs/docs/search/GeneralI.html +0 -20
  154. data/repository/ninjs/docs/search/GeneralM.html +0 -20
  155. data/repository/ninjs/docs/search/GeneralN.html +0 -20
  156. data/repository/ninjs/docs/search/GeneralR.html +0 -20
  157. data/repository/ninjs/docs/search/GeneralS.html +0 -20
  158. data/repository/ninjs/docs/search/GeneralSymbols.html +0 -20
  159. data/repository/ninjs/docs/search/GeneralT.html +0 -20
  160. data/repository/ninjs/docs/search/GeneralU.html +0 -20
  161. data/repository/ninjs/docs/search/GeneralV.html +0 -20
  162. data/repository/ninjs/docs/search/NoResults.html +0 -15
  163. data/repository/ninjs/docs/search/VariablesD.html +0 -20
  164. data/repository/ninjs/docs/search/VariablesN.html +0 -20
  165. data/repository/ninjs/docs/search/VariablesR.html +0 -20
  166. data/repository/ninjs/docs/search/VariablesT.html +0 -20
  167. data/repository/ninjs/docs/styles/main.css +0 -828
  168. data/repository/ninjs/extensions/jquery.elements.js +0 -60
  169. data/repository/ninjs/tests/index.html +0 -21
  170. data/repository/ninjs/tests/ninjs.test.js +0 -188
  171. data/repository/ninjs/tests/ninjs.utilities.test.js +0 -137
  172. data/repository/ninjs/tests/qunit/qunit.css +0 -197
  173. data/repository/ninjs/tests/qunit/qunit.js +0 -1415
  174. data/repository/ninjs/utilities/all.js +0 -5
  175. data/repository/ninjs/utilities/array.js +0 -29
  176. data/repository/ninjs/utilities/cookie.js +0 -0
  177. data/repository/ninjs/utilities/css.js +0 -51
  178. data/repository/ninjs/utilities/number.js +0 -11
  179. data/repository/ninjs/utilities/string.js +0 -61
  180. data/repository/nullconsole.js +0 -7
  181. data/repository/qunit/assets/css/qunit.css +0 -196
  182. data/repository/qunit/qunit.js +0 -1374
  183. data/repository/selectivizr/1.0.js +0 -5
  184. data/repository/selectivizr/latest.js +0 -1
  185. data/repository/syntaxhighlighter/all.js +0 -11
  186. data/repository/syntaxhighlighter/assets/css/syntaxhighlighter/shCore.css +0 -226
  187. data/repository/syntaxhighlighter/assets/css/syntaxhighlighter/shCoreDefault.css +0 -328
  188. data/repository/syntaxhighlighter/assets/css/syntaxhighlighter/shCoreDjango.css +0 -331
  189. data/repository/syntaxhighlighter/assets/css/syntaxhighlighter/shCoreEclipse.css +0 -339
  190. data/repository/syntaxhighlighter/assets/css/syntaxhighlighter/shCoreEmacs.css +0 -324
  191. data/repository/syntaxhighlighter/assets/css/syntaxhighlighter/shCoreFadeToGrey.css +0 -328
  192. data/repository/syntaxhighlighter/assets/css/syntaxhighlighter/shCoreMDUltra.css +0 -324
  193. data/repository/syntaxhighlighter/assets/css/syntaxhighlighter/shCoreMidnight.css +0 -324
  194. data/repository/syntaxhighlighter/assets/css/syntaxhighlighter/shCoreRDark.css +0 -324
  195. data/repository/syntaxhighlighter/assets/css/syntaxhighlighter/shThemeDefault.css +0 -117
  196. data/repository/syntaxhighlighter/assets/css/syntaxhighlighter/shThemeDjango.css +0 -120
  197. data/repository/syntaxhighlighter/assets/css/syntaxhighlighter/shThemeEclipse.css +0 -128
  198. data/repository/syntaxhighlighter/assets/css/syntaxhighlighter/shThemeEmacs.css +0 -113
  199. data/repository/syntaxhighlighter/assets/css/syntaxhighlighter/shThemeFadeToGrey.css +0 -117
  200. data/repository/syntaxhighlighter/assets/css/syntaxhighlighter/shThemeMDUltra.css +0 -113
  201. data/repository/syntaxhighlighter/assets/css/syntaxhighlighter/shThemeMidnight.css +0 -113
  202. data/repository/syntaxhighlighter/assets/css/syntaxhighlighter/shThemeRDark.css +0 -113
  203. data/repository/syntaxhighlighter/assets/scss/syntaxhighlighter/_shCore.scss +0 -216
  204. data/repository/syntaxhighlighter/assets/scss/syntaxhighlighter/_shCoreDefault.scss +0 -2
  205. data/repository/syntaxhighlighter/assets/scss/syntaxhighlighter/_shCoreDjango.scss +0 -2
  206. data/repository/syntaxhighlighter/assets/scss/syntaxhighlighter/_shCoreEclipse.scss +0 -2
  207. data/repository/syntaxhighlighter/assets/scss/syntaxhighlighter/_shCoreEmacs.scss +0 -2
  208. data/repository/syntaxhighlighter/assets/scss/syntaxhighlighter/_shCoreFadeToGrey.scss +0 -2
  209. data/repository/syntaxhighlighter/assets/scss/syntaxhighlighter/_shCoreMDUltra.scss +0 -2
  210. data/repository/syntaxhighlighter/assets/scss/syntaxhighlighter/_shCoreMidnight.scss +0 -2
  211. data/repository/syntaxhighlighter/assets/scss/syntaxhighlighter/_shCoreRDark.scss +0 -2
  212. data/repository/syntaxhighlighter/assets/scss/syntaxhighlighter/_shThemeDefault.scss +0 -7
  213. data/repository/syntaxhighlighter/assets/scss/syntaxhighlighter/_shThemeDjango.scss +0 -36
  214. data/repository/syntaxhighlighter/assets/scss/syntaxhighlighter/_shThemeEclipse.scss +0 -48
  215. data/repository/syntaxhighlighter/assets/scss/syntaxhighlighter/_shThemeEmacs.scss +0 -32
  216. data/repository/syntaxhighlighter/assets/scss/syntaxhighlighter/_shThemeFadeToGrey.scss +0 -36
  217. data/repository/syntaxhighlighter/assets/scss/syntaxhighlighter/_shThemeMDUltra.scss +0 -32
  218. data/repository/syntaxhighlighter/assets/scss/syntaxhighlighter/_shThemeMidnight.scss +0 -32
  219. data/repository/syntaxhighlighter/assets/scss/syntaxhighlighter/_shThemeRDark.scss +0 -32
  220. data/repository/syntaxhighlighter/assets/scss/syntaxhighlighter/_theme_template.scss +0 -120
  221. data/repository/syntaxhighlighter/shAutoloader.js +0 -17
  222. data/repository/syntaxhighlighter/shBrushAS3.js +0 -59
  223. data/repository/syntaxhighlighter/shBrushAppleScript.js +0 -75
  224. data/repository/syntaxhighlighter/shBrushBash.js +0 -59
  225. data/repository/syntaxhighlighter/shBrushCSharp.js +0 -65
  226. data/repository/syntaxhighlighter/shBrushColdFusion.js +0 -100
  227. data/repository/syntaxhighlighter/shBrushCpp.js +0 -97
  228. data/repository/syntaxhighlighter/shBrushCss.js +0 -91
  229. data/repository/syntaxhighlighter/shBrushDelphi.js +0 -55
  230. data/repository/syntaxhighlighter/shBrushDiff.js +0 -41
  231. data/repository/syntaxhighlighter/shBrushErlang.js +0 -52
  232. data/repository/syntaxhighlighter/shBrushGroovy.js +0 -67
  233. data/repository/syntaxhighlighter/shBrushJScript.js +0 -52
  234. data/repository/syntaxhighlighter/shBrushJava.js +0 -57
  235. data/repository/syntaxhighlighter/shBrushJavaFX.js +0 -58
  236. data/repository/syntaxhighlighter/shBrushPerl.js +0 -72
  237. data/repository/syntaxhighlighter/shBrushPhp.js +0 -88
  238. data/repository/syntaxhighlighter/shBrushPlain.js +0 -33
  239. data/repository/syntaxhighlighter/shBrushPowerShell.js +0 -74
  240. data/repository/syntaxhighlighter/shBrushPython.js +0 -64
  241. data/repository/syntaxhighlighter/shBrushRuby.js +0 -55
  242. data/repository/syntaxhighlighter/shBrushSass.js +0 -94
  243. data/repository/syntaxhighlighter/shBrushScala.js +0 -51
  244. data/repository/syntaxhighlighter/shBrushSql.js +0 -66
  245. data/repository/syntaxhighlighter/shBrushVb.js +0 -56
  246. data/repository/syntaxhighlighter/shBrushXml.js +0 -69
  247. data/repository/syntaxhighlighter/shCore.js +0 -17
  248. data/repository/syntaxhighlighter/shLegacy.js +0 -17
  249. data/spec/fixtures/global.js +0 -7
  250. data/spec/fixtures/global.module.js +0 -7
  251. data/spec/fixtures/myapplication.js +0 -576
  252. data/spec/fixtures/nin.js +0 -573
  253. data/spec/fixtures/ninjs.conf +0 -6
  254. data/spec/fixtures/test.elements.js +0 -4
  255. data/spec/fixtures/test.js +0 -15
  256. data/spec/fixtures/test.model.js +0 -3
  257. data/spec/fixtures/test.module.js +0 -10
  258. data/spec/fixtures/updated.myapplication.js +0 -27
  259. data/spec/fixtures/utilities.js +0 -162
  260. data/spec/helpers_spec.rb +0 -11
  261. data/spec/integration_spec.rb +0 -257
  262. data/spec/manifest_spec.rb +0 -8
  263. data/spec/ninjs_spec.rb +0 -36
  264. data/spec/notification_spec.rb +0 -27
  265. data/spec/spec_helper.rb +0 -5
  266. data/tmp/ff9e83aa019b712b90200b8d1b8fa0c7e14576af.json +0 -1
  267. data/tmp/metric_fu/_data/20110305.yml +0 -1548
  268. data/tmp/metric_fu/output/bluff-min.js +0 -1
  269. data/tmp/metric_fu/output/excanvas.js +0 -35
  270. data/tmp/metric_fu/output/js-class.js +0 -1
  271. data/tmp/metric_fu/output/lib_ninjs_dependencies.rb.html +0 -34
  272. data/tmp/metric_fu/output/lib_ninjs_helpers.rb.html +0 -34
  273. data/tmp/metric_fu/output/lib_ninjs_manifest.rb.html +0 -27
  274. data/tmp/metric_fu/output/rails_best_practices.js +0 -11
  275. data/tmp/metric_fu/scratch/rcov/rcov.txt +0 -1
@@ -1,10 +0,0 @@
1
- module Ninjs
2
- BASE_DIR = File.expand_path(File.join(File.dirname(__FILE__), '..'))
3
- LIB_DIR = File.expand_path(File.join(File.dirname(__FILE__)))
4
- ROOT_DIR = Dir.getwd
5
- VERSION = File.open("#{BASE_DIR}/VERSION").readlines.join("")
6
- end
7
-
8
- %w(dependencies configuration helpers manifest project notification generator command).each do |lib|
9
- require "#{Ninjs::LIB_DIR}/ninjs/#{lib}"
10
- end
@@ -1,91 +0,0 @@
1
- module Ninjs
2
- module Command
3
- def watch
4
- require "fssm"
5
-
6
- project_path = Dir.getwd << '/'
7
- raise "ninjs.conf was not located in #{project_path}" unless File.exists? "#{project_path}ninjs.conf"
8
-
9
- puts Ninjs::Notification.log "Ninjs are watching for changes. Press Ctrl-C to stop."
10
- project = Ninjs::Project.new
11
- project.update
12
-
13
- watch_dirs = Ninjs::Manifest.directories.reject { |dir| dir.match(/application|tests/) }
14
- watch_hash = Hash.new
15
-
16
- watch_dirs.each do |dir|
17
- watch_hash["#{project_path}#{dir}"] = "**/*.js"
18
- end
19
-
20
- watch_hash[project_path] = "**/*.conf"
21
- watch_hash["#{Ninjs::BASE_DIR}/repository"] = "**/*.js"
22
-
23
- FSSM.monitor do
24
-
25
- watch_hash.each do |dir, g|
26
-
27
- path "#{dir}" do
28
- glob g
29
-
30
- update do |base, relative|
31
- project.config.read if relative.match /conf$/
32
- puts Ninjs::Notification.event "change detected in #{relative}"
33
- project.update
34
- end
35
-
36
- create do |base, relative|
37
- puts Ninjs::Notification.event "#{relative} created"
38
- project.update
39
- end
40
- end
41
-
42
- end
43
-
44
- end
45
-
46
- end
47
-
48
- def create(name, directory = false)
49
- raise 'you must specify a project name: ninjs create ProjectName' if name.nil?
50
- project = directory ? Ninjs::Project.new(directory, name) : Ninjs::Project.new('/', name)
51
- project.create
52
- end
53
-
54
- def compile(compress_output = 'use_config')
55
- project_path = Dir.getwd << '/'
56
- raise "ninjs.conf was not located in #{project_path}" unless File.exists? "#{project_path}/ninjs.conf"
57
- project = Ninjs::Project.new
58
- project.config.output = compress_output ? 'compressed' : 'expanded' unless compress_output === 'use_config'
59
- project.update
60
- end
61
-
62
- def import(package)
63
- Ninjs::PackageManager.import(package)
64
- end
65
-
66
- def generate(config)
67
- begin
68
- conf_path = "#{Dir.getwd}/ninjs.conf"
69
- raise "ninjs.conf was not located in #{conf_path}" unless File.exists? "#{conf_path}"
70
- generator = Ninjs::Generator.new(config)
71
- generator.generate
72
- end
73
- end
74
-
75
- def update
76
- project_path = Dir.getwd << '/'
77
- raise "ninjs.conf was not located in #{project_path}" unless File.exists? "#{project_path}ninjs.conf"
78
-
79
- project = Ninjs::Project.new
80
- project.create_ninjs_lib_file
81
- project.create_utility_lib_file
82
- end
83
-
84
- module_function :create,
85
- :watch,
86
- :compile,
87
- :import,
88
- :generate,
89
- :update
90
- end
91
- end
@@ -1,72 +0,0 @@
1
- module Ninjs
2
- class Configuration
3
-
4
- attr_reader :name,
5
- :dependencies,
6
- :autoload,
7
- :asset_root,
8
- :src_dir,
9
- :dest_dir
10
-
11
- attr_accessor :output
12
-
13
- def initialize(project_path, name = '')
14
- @project_path = project_path
15
-
16
- @defaults = {
17
- :name => name,
18
- :output => 'expanded',
19
- :dependencies => ['"<jquery/latest>"'],
20
- :autoload => ['"../lib/utilities"'],
21
- :src_dir => 'modules',
22
- :dest_dir => 'application'
23
- }
24
-
25
- @asset_root = @project_path
26
-
27
- @defaults.each do |label, setting|
28
- instance_variable_set("@#{label}", setting)
29
- end
30
-
31
- if File.exists? "#{@project_path}ninjs.conf"
32
- read
33
- end
34
- end
35
-
36
- def create
37
- create_conf_file conf_content(@defaults)
38
- end
39
-
40
- def conf_content(options)
41
- content = String.new
42
- options.each do |option, value|
43
- content << "#{option}: #{value}\n" if value.kind_of? String
44
- content << "#{option}: [#{value.join(', ')}]\n" if value.kind_of? Array
45
- end
46
- content
47
- end
48
-
49
- def create_conf_file(content)
50
- File.open("#{@project_path}ninjs.conf", "w+") do |conf_file|
51
- conf_file << conf_content(@defaults)
52
- end
53
-
54
- puts Ninjs::Notification.notify "ninjs.conf created", :added
55
- end
56
-
57
- def read
58
- config = YAML.load_file("#{@project_path}ninjs.conf")
59
-
60
- @name = config['name']
61
- @output = config['output']
62
- @src_dir = config['src_dir']
63
- @dest_dir = config['dest_dir']
64
-
65
- @dependencies = config['dependencies'] || Array.new
66
- @autoload = config['autoload'] || Array.new
67
-
68
- @asset_root = config['asset_root'] unless config['ass'].nil?
69
- end
70
-
71
- end
72
- end
@@ -1,16 +0,0 @@
1
- begin
2
- require 'yaml'
3
- require 'jsmin'
4
- require 'tempfile'
5
- require 'sprockets'
6
- require 'fileutils'
7
- require 'time'
8
- rescue LoadError
9
- require 'rubygems'
10
- require 'yaml'
11
- require 'jsmin'
12
- require 'tempfile'
13
- require 'sprockets'
14
- require 'fileutils'
15
- require 'time'
16
- end
@@ -1,57 +0,0 @@
1
- module Ninjs
2
- class Generator
3
-
4
- attr_writer :alias, :app_name
5
-
6
- def initialize(config)
7
- @type = config[:type]
8
- @project = Ninjs::Project.new
9
- @name = config[:name]
10
- @module_name = config[:name].gsub(/^_/, '')
11
- @alias = config[:alias].nil? ? false : true
12
- @app_name = config[:alias] || @project.config.name
13
- @dest = config[:dest] || @project.config.src_dir.is_a?(String) ? @project.config.src_dir : @project.config.src_dir.first
14
- @dependencies = config[:dependencies] || { :elements => false, :model => false }
15
- end
16
-
17
- def generate
18
- generate_module_file if @type === 'module'
19
- generate_elements_file if @type === 'elements' || @dependencies[:elements]
20
- generate_model_file if @type === 'model' || @dependencies[:model]
21
- end
22
-
23
- def generate_module_file
24
- File.open "#{@project.project_path}#{@dest}/#{@name}.module.js", "w" do |file|
25
- file << "(function(#{@app_name if @alias}) {\n"
26
- file << "\tvar self = #{@app_name}.add_module('#{@name}');\n\n"
27
- file << %Q(\t//= require "../elements/#{@name.downcase}.elements"\n\n) if @dependencies[:elements] || @type === 'elements'
28
- file << %Q(\t//= require "../models/#{@name.downcase}.model\n\n) if @dependencies[:model] || @type === 'model'
29
- file << "\t#{@app_name}.#{@module_name}.actions = function() {\n\n\t};\n\n"
30
- file << "\t#{@app_name}.#{@module_name}.run();\n"
31
- file << "})(#{@project.config.name});" if @alias
32
- puts Ninjs::Notification.added "created #{@name.downcase}.module.js"
33
- end unless File.exists? "#{@project.project_path}#{@dest}/#{@name}.module.js"
34
-
35
- self
36
- end
37
-
38
- def generate_elements_file
39
- File.open("#{@project.project_path}elements/#{@module_name}" + ".elements.js", "w") do |file|
40
- file << "#{@app_name}.#{@module_name}.elements({\n\n});"
41
- puts Ninjs::Notification.added "created #{@module_name}.elements.js"
42
- end unless File.exists? "#{@project.project_path}elements/#{@module_name}.elements.js"
43
-
44
- self
45
- end
46
-
47
- def generate_model_file
48
- File.open "#{@project.project_path}models/#{@module_name}.model.js", "w" do |file|
49
- file << "#{@app_name}.#{@module_name}.set_data({\n\t\n});"
50
- puts Ninjs::Notification.added "created #{@module_name}.model.js"
51
- end unless File.exists? "#{@project.project_path}models/#{@module_name}.model.js"
52
-
53
- self
54
- end
55
-
56
- end
57
- end
@@ -1,17 +0,0 @@
1
- module Ninjs
2
- module Helpers
3
-
4
- def create_module_filename(module_name)
5
- module_name = module_name.split(/[\\\/]/).last
6
- split = module_name.split(/[\.\-\s]/)
7
- module_filename = String.new
8
- split.each do |piece|
9
- module_filename << piece unless piece.match(/^module$|^js$/i)
10
- end
11
- module_filename
12
- end
13
-
14
- module_function :create_module_filename
15
-
16
- end
17
- end
@@ -1,9 +0,0 @@
1
- module Ninjs
2
- module Manifest
3
- def directories
4
- %w(application elements lib models modules plugins tests tests/qunit)
5
- end
6
-
7
- module_function :directories
8
- end
9
- end
@@ -1,37 +0,0 @@
1
- module Ninjs
2
- class Notification
3
- @@growl_support = false
4
- @@indicators = {
5
- :none => "",
6
- :log => "\e[32m>>>\e[0m ",
7
- :event => "\e[33m<<<\e[0m ",
8
- :added => "\e[32m+++\e[0m ",
9
- :error => "\e[0;31m!!!\e[0m "
10
- }
11
-
12
- def self.notify(message, style)
13
- @@indicators[style] + message
14
- end
15
-
16
- def self.notice(message)
17
- self.notify(message, :none)
18
- end
19
-
20
- def self.log(message)
21
- self.notify(message, :log)
22
- end
23
-
24
- def self.event(message)
25
- self.notify(message, :event)
26
- end
27
-
28
- def self.added(message)
29
- self.notify(message, :added)
30
- end
31
-
32
- def self.error(message)
33
- self.notify(message, :error)
34
- end
35
-
36
- end
37
- end
@@ -1,233 +0,0 @@
1
- module Ninjs
2
- class Project
3
- attr_reader :app_filename,
4
- :project_path,
5
- :config
6
- attr_writer :config,
7
- :project_path,
8
- :app_filename
9
-
10
- def initialize(sub_dir = '/', name = '')
11
- path = add_slashes sub_dir
12
- @project_path = Dir.getwd + path
13
- @modules = Array.new
14
- @config = Ninjs::Configuration.new @project_path, name
15
- @app_filename = @config.name.downcase
16
-
17
- end
18
-
19
- def add_slashes(dir)
20
- dir += '/' unless dir.match(/\/$/)
21
- dir = '/' << dir unless dir.match(/^\//)
22
- dir
23
- end
24
-
25
- def create
26
- puts Ninjs::Notification.notice "Creating the #{@config.name} project in #{@project_path}"
27
- create_project_structure
28
- @config.create
29
- create_ninjs_lib_file
30
- create_utility_lib_file
31
- create_ninjs_application_file
32
- import_test_files
33
- end
34
-
35
- def create_project_structure
36
- Dir.mkdir "#{@project_path}" unless File.exists? "#{@project_path}"
37
- Ninjs::Manifest.directories.each do |folder|
38
- puts Ninjs::Notification.added "#{folder}/ created" unless File.exists? "#{@project_path}#{folder}"
39
- Dir.mkdir "#{@project_path}#{folder}" unless File.exists? "#{@project_path}#{folder}"
40
- end
41
- end
42
-
43
- def create_ninjs_lib_file
44
- operation = File.exists?("#{@project_path}lib/nin.js") ? 'updated' : 'created'
45
- ninjs_lib_secretary = Sprockets::Secretary.new(
46
- :root => "#{Ninjs::BASE_DIR}",
47
- :load_path => ["repository"],
48
- :source_files => ["repository/ninjs/core/nin.js"]
49
- )
50
-
51
- ninjs_lib_secretary.concatenation.save_to "#{@project_path}lib/nin.js"
52
-
53
- puts Ninjs::Notification.added "lib/nin.js #{operation}"
54
- end
55
-
56
- def create_utility_lib_file
57
- utility_lib_secretary = Sprockets::Secretary.new(
58
- :root => "#{Ninjs::BASE_DIR}",
59
- :load_path => ["repository"],
60
- :source_files => ["repository/ninjs/utilities/all.js"]
61
- )
62
-
63
- utility_lib_secretary.concatenation.save_to "#{@project_path}lib/utilities.js"
64
-
65
- puts Ninjs::Notification.added "lib/utilities.js created"
66
- end
67
-
68
- def create_ninjs_application_file
69
- filename = "#{@project_path}application/#{@app_filename}.js"
70
-
71
- File.open(filename, "w+") do |file|
72
- file << "//-- Ninjs #{Time.now.to_s} --//\n"
73
- file << File.open("#{@project_path}lib/nin.js", 'r').readlines.join('')
74
- file << "\nvar #{@config.name} = new NinjsApplication();"
75
- end
76
- end
77
-
78
- def import_test_files
79
- FileUtils.cp "#{Ninjs::BASE_DIR}/repository/ninjs/tests/index.html", "#{@project_path}tests"
80
- FileUtils.cp "#{Ninjs::BASE_DIR}/repository/ninjs/tests/ninjs.test.js", "#{@project_path}tests"
81
- FileUtils.cp "#{Ninjs::BASE_DIR}/repository/ninjs/tests/ninjs.utilities.test.js", "#{@project_path}tests"
82
- FileUtils.cp "#{Ninjs::BASE_DIR}/repository/ninjs/tests/qunit/qunit.js", "#{@project_path}tests/qunit"
83
- FileUtils.cp "#{Ninjs::BASE_DIR}/repository/ninjs/tests/qunit/qunit.css", "#{@project_path}tests/qunit"
84
- end
85
-
86
- def update
87
- get_updated_modules
88
- compile_modules
89
- update_application_file
90
- compress_application if @config.output == 'compressed'
91
- puts Ninjs::Notification.log "application updated" unless @errors
92
- @errors = false
93
- end
94
-
95
- def get_directory_script_files
96
- script_files = Array.new
97
- Dir["#{@project_path}**/*.js"].each do |file|
98
- script_files << file unless file.match(/application\/|tests\//)
99
- end
100
- end
101
-
102
- def get_files_timestamps(files)
103
- timestamped_files = Hash.new
104
- files.each do |file|
105
- timestamped_files["#{file}"] = File.new(file).mtime.to_s
106
- end
107
- timestamped_files
108
- end
109
-
110
- def get_updated_modules
111
- @modules = Array.new
112
- if @config.src_dir.is_a? Array
113
- @config.src_dir.each do |directory|
114
- get_directory_modules "#{@project_path}#{directory}/"
115
- end
116
- else
117
- get_directory_modules "#{@project_path}#{@config.src_dir}/"
118
- end
119
- end
120
-
121
- def get_directory_modules(directory)
122
- Dir["#{directory}*.js"].each do |file|
123
- module_filename = file.gsub(directory, '')
124
- @modules << "#{directory}#{module_filename}" unless module_filename.match(/^_/)
125
- end
126
- end
127
-
128
- def compile_modules
129
- @modules.each do |module_file|
130
- module_filename = Ninjs::Helpers.create_module_filename module_file
131
- create_module_file module_file, module_filename
132
- end
133
- end
134
-
135
- def create_module_filename(module_name)
136
- split = module_name.split(/[\.\-\s]/)
137
- module_filename = String.new
138
- split.each do |piece|
139
- module_filename << piece unless piece.match(/^module$|^js$/i)
140
- end
141
- module_filename
142
- end
143
-
144
- def create_module_file(module_file, module_name)
145
- begin
146
- ninjs_lib_secretary = Sprockets::Secretary.new(
147
- :root => "#{Ninjs::BASE_DIR}",
148
- :asset_root => @config.asset_root,
149
- :load_path => ["repository"],
150
- :source_files => ["#{module_file}"]
151
- )
152
-
153
- module_file = ninjs_lib_secretary.concatenation
154
- message = File.exists?("#{@project_path}#{@config.dest_dir}/#{module_name}.js") ? "\e[32m>>>\e[0m #{@config.dest_dir}/#{module_name}.js updated" : "\e[32m>>>\e[0m #{@config.dest_dir}/#{module_name}.js created"
155
- module_file.save_to "#{@project_path}#{@config.dest_dir}/#{module_name}.js"
156
- ninjs_lib_secretary.install_assets
157
-
158
- rescue Exception => error
159
- @errors = true
160
- puts Ninjs::Notification.error "Sprockets error: #{error.message}"
161
- end
162
- end
163
-
164
- def update_application_file
165
- application_file = "#{@project_path}#{@config.dest_dir}/#{@app_filename}.js"
166
-
167
- File.open(application_file, "w+") do |file|
168
- write_dependencies(file)
169
- write_core(file)
170
- write_autoload(file)
171
- end
172
-
173
- compile_application_file application_file
174
- end
175
-
176
- def write_dependencies(file)
177
- @config.dependencies.each do |dependency|
178
- file << "/*---------- #{dependency} ----------*/"
179
- file << "\n//= require #{dependency}\n\n" if dependency.match(/^\<.+\>$/)
180
- file << "\n//= require \"#{dependency}\"\n\n" if dependency.match(/^[^\<].+|[^\>]$/)
181
- end
182
- end
183
-
184
- def write_core(file)
185
- file << "/*---------- Ninjs core ../lib/nin.js ----------*/\n"
186
- file << "//= require \"../lib/nin.js\"\n\n"
187
- file << "\nvar #{@config.name} = new NinjsApplication();\n\n"
188
- end
189
-
190
- def write_autoload(file)
191
- @config.autoload.each do |auto_file|
192
- file << "/*---------- Ninjs autoload #{auto_file} ----------*/"
193
- file << "\n//= require #{auto_file}\n\n" if auto_file.match(/^\<.+\>$/)
194
- file << "\n//= require \"#{auto_file}\"\n\n" if auto_file.match(/^[^\<].+|[^\>]$/)
195
- end
196
- end
197
-
198
- def compile_application_file(file)
199
- begin
200
- ninjs_lib_secretary = Sprockets::Secretary.new(
201
- :root => "#{Ninjs::BASE_DIR}",
202
- :asset_root => @config.asset_root,
203
- :load_path => ["repository"],
204
- :source_files => ["#{file}"]
205
- )
206
-
207
- application_file = ninjs_lib_secretary.concatenation
208
- ninjs_lib_secretary.install_assets
209
- application_file.save_to "#{file}"
210
- rescue Exception => error
211
- @errors = true
212
- puts Ninjs::Notification.error "Sprockets error: #{error.message}"
213
- end
214
- end
215
-
216
- def compress_application
217
- application = @project_path + "#{@config.dest_dir}"
218
- modules = Dir.entries(application)
219
- modules.reject! { |file| file =~ /^\./ }
220
-
221
- modules.each do |module_file|
222
- full_path = application + "/#{module_file}"
223
- uncompressed = File.open(full_path, "r").readlines.join('')
224
- File.open(full_path, "w+") do |module_file|
225
- module_file << JSMin.minify(uncompressed)
226
- end
227
- end
228
- end
229
-
230
- end
231
- # class Project
232
- end
233
- #module Ninjs