ninjs 0.13.6 → 0.13.7

Sign up to get free protection for your applications and to get access to all the features.
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,6 +0,0 @@
1
- name: MyApplication
2
- output: expanded
3
- dependencies: ["<jquery/latest>"]
4
- autoload: ["<ninjs/utilities/all>"]
5
- base_url: http://www.example.com/
6
- test_path: tests/
@@ -1,4 +0,0 @@
1
- $(document).ready(function() {
2
- MyApplication.TestModule.test_id = $('#test-element-with-id');
3
- console.log(MyApplication.TestModule.test_id);
4
- });
@@ -1,15 +0,0 @@
1
- MyApplication.add_module('TestModule');
2
-
3
- $(document).ready(function() {
4
- MyApplication.TestModule.test_id = $('#test-element-with-id');
5
- console.log(MyApplication.TestModule.test_id);
6
- });
7
- MyApplication.test_model = {
8
- some_data_member: 'some data value'
9
- };
10
-
11
- MyApplication.TestModule.actions = function() {
12
- console.log(MyApplication.TestModule.test_id.html());
13
- };
14
-
15
- MyApplication.TestModule.run();
@@ -1,3 +0,0 @@
1
- MyApplication.test_model = {
2
- some_data_member: 'some data value'
3
- };
@@ -1,10 +0,0 @@
1
- MyApplication.add_module('TestModule');
2
-
3
- //= require "../elements/test.elements.js"
4
- //= require "../models/test.model.js"
5
-
6
- MyApplication.TestModule.actions = function() {
7
- console.log(MyApplication.TestModule.test_id.html());
8
- };
9
-
10
- MyApplication.TestModule.run();
@@ -1,27 +0,0 @@
1
-
2
- if(is_defined===undefined){var is_defined=function(variable){return(variable===undefined)?false:true;};}
3
- if(!is_defined(is_undefined)){var is_undefined=function(variable){return(variable===undefined)?true:false;};}
4
- if(is_undefined(is_typeof)){var is_typeof=function(type,variable){try{if(is_undefined(type)){throw new SyntaxError("is_typeof(Type, variable): type is undefined");}
5
- if(is_undefined(variable)){throw new SyntaxError("is_typeof(Type, variable): variable is undefined");}
6
- return(variable.constructor==type)?true:false;}
7
- catch(error){document.write(error.message);}};}
8
- if(is_undefined(is_numeric)){var is_numeric=function(suspect){if(is_typeof(Number,suspect)){return true;}
9
- else{var pattern=/^-?\d+(?:\.\d*)?(?:e[+\-]?\d+)?$/i;return pattern.test(suspect);}};}
10
- if(is_undefined(die)){var die=function(last_words){if(is_undefined(last_words)){lastwords=''}
11
- document.write(lastwords)};}
12
- if(is_undefined(Object.prototype['method'])){Object.prototype.method=function(name,func){try{if(is_undefined(name)){throw new SyntaxError("Object.method(name, func): name is undefined");}
13
- if(is_undefined(func)){throw new SyntaxError("Object.method(name, func): func is undefined");}
14
- if(is_undefined(this.prototype[name])){this.prototype[name]=func;return this;}}
15
- catch(error){document.write(error.message);}};}
16
- if(is_undefined(Object.prototype['clone'])){Object.method('clone',function(){if(typeof this!=='object'||this===null){return this;}
17
- if(this instanceof Node||this instanceof NodeList||this instanceof NamedNodeMap){die('You cannot clone a Node, Nodelist or NamedNodeMap');}
18
- var clone=is_typeof(Array,this)?[]:{};for(var prop in this){if(this.hasOwnProperty(prop)){clone[prop]=this[prop];}}
19
- return clone;});}
20
- var JudoModule=function(){};JudoModule.method('actions',function(){});JudoModule.method('run',function(){this.actions();});var JudoApplication=function(){};JudoApplication.method('add_module',function(name){try{if(is_undefined(name)){throw new SyntaxError("JudoApplication.add_module(name): name is undefined");}
21
- if(is_defined(this[name])){throw new SyntaxError("JudoApplication.add_module(name): '"+name+"' already declared");}
22
- this[name]=new JudoModule();}
23
- catch(error){document.write(error.message);}});var Judo::Configuration=new JudoApplication();Array.method('is_empty',function(){return(this.length<1)?true:false;});Array.method('not_empty',function(){return(this.length>0)?true:false;});Array.method('each',function(callback){try{if(is_undefined(callback)){throw new SyntaxError("Array.each(callback): callback is undefined");}
24
- for(var i=0;i<this.length;i++){var args=[this[i],i];callback.apply(this,args);}}
25
- catch(error){document.write(error.message);}});Array.method('contains',function(suspect){var matches=[];this.each(function(value,index){if(value===suspect){matches.push(index);}});return matches.not_empty()?matches:false;});Array.method('shuffle',function(){var clone=this.clone();for(var j,x,i=clone.length;i;j=parseInt(Math.random()*i),x=clone[--i],clone[i]=clone[j],clone[j]=x);return clone;});String.method('is_empty',function(){return(this=='')?true:false;});String.method('not_empty',function(){return(this=='')?false:true;});String.method('is_number',function(){var pattern=/^(\.|-)?\d+(?:\.\d*)?(?:e[+\-]?\d+)?$/i;return pattern.test(this);});String.method('trim',function(){return this.replace(/^\s+|\s+$/g,"");});String.method('ltrim',function(){return this.replace(/^\s+/,"");});String.method('rtrim',function(){return this.replace(/\s+$/,"");});String.method('each',function(callback){try{if(is_undefined(callback)){throw new SyntaxError("String.each(callback): callback is undefined");}
26
- for(var i=0;i<this.length;i++){var args=[this.charAt(i),i];callback.apply(this,args);}}
27
- catch(error){document.write(error.message);}});String.method('capitalize',function(){return this.substr(0,1).toUpperCase()+this.substr(1);});String.method('reverse',function(){return this.split('').reverse().join('');});String.method('to_n',function(){return parseFloat(this);});String.method('pluck',function(needle){var pattern=new RegExp(needle,'g');return this.replace(pattern,'');});String.method('single_space',function(){var no_hard_spaces=this.replace(/\&nbsp\;/g,' ');return no_hard_spaces.replace(/\s+/g,' ');});String.method('compress',function(){return this.replace(/\s+/g,'');});String.method('shuffle',function(){return this.split('').shuffle().join('');})
@@ -1,162 +0,0 @@
1
- Array.method('is_empty', function() {
2
- return (this.length < 1) ? true : false;
3
- });
4
-
5
- Array.method('not_empty', function() {
6
- return (this.length > 0) ? true : false;
7
- });
8
-
9
- Array.method('each', function(callback) {
10
- try {
11
- if(is_undefined(callback)) {
12
- throw new SyntaxError("Array.each(callback): callback is undefined");
13
- }
14
-
15
- for (var i = 0; i < this.length; i++) {
16
- var args = [this[i], i];
17
- callback.apply(this, args);
18
- }
19
- }
20
- catch(error) {
21
- alert(error.message);
22
- }
23
- });
24
-
25
- Array.method('contains', function(suspect) {
26
- var matches = [];
27
- this.each(function(value, index) {
28
- if(value === suspect) {
29
- matches.push(index);
30
- }
31
- });
32
-
33
- return matches.not_empty() ? matches : false;
34
- });
35
- String.method('is_empty', function() {
36
- return (this.length < 1) ? true : false;
37
- });
38
-
39
- String.method('not_empty', function() {
40
- return (this.length < 1) ? false : true;
41
- });
42
-
43
- String.method('is_numeric', function() {
44
- var pattern = /^(\.|-)?\d+(?:\.\d*)?(?:e[+\-]?\d+)?$/i;
45
- return pattern.test(this);
46
- });
47
-
48
- String.method('trim', function() {
49
- return this.replace(/^\s+|\s+$/g, "");
50
- });
51
-
52
- String.method('ltrim', function() {
53
- return this.replace(/^\s+/,"");
54
- });
55
-
56
- String.method('rtrim', function() {
57
- return this.replace(/\s+$/,"");
58
- });
59
-
60
- String.method('each', function(callback) {
61
- try {
62
- if(is_undefined(callback)) {
63
- throw new SyntaxError("String.each(callback): callback is undefined");
64
- }
65
-
66
- for (var i = 0; i < this.length; i++) {
67
- var args = [this.charAt(i), i];
68
- callback.apply(this, args);
69
- }
70
- }
71
- catch(error) {
72
- alert(error.message);
73
- }
74
- });
75
-
76
- String.method('capitalize', function() {
77
- return this.substr(0, 1).toUpperCase() + this.substr(1);
78
- });
79
-
80
- String.method('reverse', function() {
81
- return this.split('').reverse().join('');
82
- });
83
-
84
- String.method('to_n', function() {
85
- return parseFloat(this);
86
- });
87
-
88
- String.method('pluck', function(needle) {
89
- var pattern = new RegExp(needle, 'g');
90
- return this.replace(pattern, '');
91
- });
92
-
93
- String.method('single_space', function() {
94
- var no_hard_spaces = this.replace(/\&nbsp\;/g, ' ');
95
- return no_hard_spaces.replace(/\s+/g, ' ');
96
- });
97
-
98
- String.method('compress', function() {
99
- return this.replace(/\s+/g, '');
100
- });
101
- Number.method('to_hex', function() {
102
- if (this === 0) {
103
- return "00";
104
- }
105
-
106
- var chars = "0123456789ABCDEF";
107
- var n = Math.max(0, this);
108
- n = Math.min(n, 255);
109
- n = Math.round(n);
110
- return chars.charAt((n - n % 16)/16) + chars.charAt(n % 16);
111
- });
112
- var CSS = function() {};
113
-
114
- CSS.rgb2hex = function(r,g,b) {
115
- pattern = /(\d{1,3})\,\s?(\d{1,3})\,\s?(\d{1,3})/gi;
116
- var rgb;
117
- if (is_typeof(String, r)) {
118
- rgb = r.match(pattern);
119
- rgb = rgb[0].split(',');
120
- }
121
- else {
122
- rgb = false;
123
- }
124
-
125
- if (rgb) {
126
- r = parseInt(rgb[0], 10);
127
- g = parseInt(rgb[1], 10);
128
- b = parseInt(rgb[2], 10);
129
- }
130
- else {
131
- r = parseInt(r, 10);
132
- g = parseInt(g, 10);
133
- b = parseInt(b, 10);
134
- }
135
- return '#' + r.to_hex() + g.to_hex() + b.to_hex();
136
- };
137
-
138
- CSS.hex2rgb = function(hex) {
139
- hex = hex.replace('#', '');
140
-
141
- var rgb = [];
142
-
143
- rgb[0] = parseInt(hex.substring(0,2), 16);
144
- rgb[1] = parseInt(hex.substring(2,4), 16);
145
- rgb[2] = parseInt(hex.substring(4,6), 16);
146
-
147
- rgb.red = rgb[0];
148
- rgb.green = rgb[1];
149
- rgb.blue = rgb[2];
150
-
151
- rgb.to_s = function() {
152
- return 'rgb(' + rgb.red +', ' + rgb.green + ', ' + rgb.blue + ')';
153
- };
154
-
155
- rgb.each = function(callback) {
156
- for (var i = 0; i < 3; i++) {
157
- callback.call(this, rgb[i]);
158
- }
159
- };
160
-
161
- return rgb;
162
- };
@@ -1,11 +0,0 @@
1
- require "spec_helper"
2
-
3
- describe Ninjs::Helpers do
4
- it 'should create a module filename from a POSIX path' do
5
- Ninjs::Helpers.create_module_filename('/some/path/some.module.js').should === 'some'
6
- end
7
-
8
- it 'should create a module filename from a Windows path' do
9
- Ninjs::Helpers.create_module_filename('D:\\\\some\path\some.module.js').should === 'some'
10
- end
11
- end
@@ -1,257 +0,0 @@
1
- require "spec_helper"
2
-
3
- describe Ninjs do
4
- context 'When instantiating a new project' do
5
- before :each do
6
- @spec_dir = File.expand_path(File.join(File.dirname(__FILE__))) + '/'
7
- @project_path = @spec_dir + 'js/'
8
- @new_project = Ninjs::Project.new 'spec/js', 'MyApplication'
9
- end
10
-
11
- it 'should have the correct app_filename' do
12
- @new_project.config.app_filename.should === 'myapplication'
13
- end
14
-
15
- it 'should have the correct project_path' do
16
- @new_project.project_path.should === @project_path
17
- end
18
-
19
- it 'should have a @config property' do
20
- @new_project.config.should_not be_nil
21
- end
22
-
23
- it 'should have the correct @config.name' do
24
- @new_project.config.name.should === 'MyApplication'
25
- end
26
-
27
- it 'should have the correct @config.output' do
28
- @new_project.config.output.should === 'expanded'
29
- end
30
-
31
- it 'should have the correct @config.dependencies' do
32
- @new_project.config.dependencies.should == ["<jquery/latest>"]
33
- end
34
-
35
- it 'should have the correct @config.autoload' do
36
- @new_project.config.autoload.should == ["<ninjs/utilities/all>"]
37
- end
38
-
39
- it 'should have the corect @config.base_url' do
40
- @new_project.config.base_url.should == 'http://www.example.com/'
41
- end
42
-
43
- it 'should have the correct @config.test_path' do
44
- @new_project.config.test_path.should == 'tests/'
45
- end
46
-
47
- it 'should respond to create' do
48
- @new_project.should respond_to :create
49
- end
50
-
51
- it 'should create the project directory' do
52
- @new_project.create
53
- File.exists?('/Volumes/Storage/Development/ninjs/spec/js').should be_true
54
- end
55
-
56
- it 'should have created the Ninjs::Manifest directories' do
57
- Ninjs::Manifest.directories.each do |folder|
58
- File.exists?("#{@project_path}#{folder}").should be_true
59
- end
60
- end
61
-
62
- it 'should have created a config file' do
63
- File.exists?("#{@project_path}ninjs.conf").should be_true
64
- end
65
-
66
- it 'should have created the application file' do
67
- File.exists?("#{@project_path}application/myapplication.js").should be_true
68
- end
69
-
70
- it 'should have created the /lib/nin.js file' do
71
- File.exists?("#{@project_path}lib/nin.js")
72
- end
73
-
74
- it 'should have created the /lib/utilities.js file' do
75
- File.exists?("#{@project_path}lib/utilities.js").should be_true
76
- end
77
-
78
- it 'should have created the /tests/index.html file' do
79
- File.exists?("#{@project_path}tests/index.html").should be_true
80
- end
81
-
82
- it 'should have created the /tests/ninjs.test.js file' do
83
- File.exists?("#{@project_path}tests/ninjs.test.js").should be_true
84
- end
85
-
86
- it 'should have created the /tests/ninjs.utilties.test.js file' do
87
- File.exists?("#{@project_path}tests/ninjs.utilities.test.js").should be_true
88
- end
89
-
90
- it 'should have the correct config file content' do
91
- expected_conf_file = File.open('/Volumes/Storage/Development/ninjs/spec/fixtures/ninjs.conf', 'r')
92
- expected_conf_content = expected_conf_file.readlines
93
- expected_conf_file.close
94
-
95
- ninjs_conf_file = File.open("#{@project_path}ninjs.conf", 'r')
96
- ninjs_conf_content = ninjs_conf_file.readlines
97
- ninjs_conf_file.close
98
-
99
- ninjs_conf_content.should === expected_conf_content
100
- end
101
-
102
- it 'should have the correct application file content' do
103
- expected_file = File.open('/Volumes/Storage/Development/ninjs/spec/fixtures/myapplication.js', 'r')
104
- expected_content = expected_file.readlines
105
-
106
- # .shift is to remove the generated comment which should never match
107
- expected_content.shift
108
- expected_file.close
109
-
110
- actual_file = File.open("#{@project_path}application/myapplication.js", 'r')
111
- actual_content = actual_file.readlines
112
- actual_content.shift
113
- actual_file.close
114
-
115
- actual_content.should === expected_content
116
- end
117
-
118
- it 'should have the correct /lib/nin.js content' do
119
- expected_ninjs_lib_file = File.open('/Volumes/Storage/Development/ninjs/spec/fixtures/nin.js', "r")
120
- expected_ninjs_lib_content= expected_ninjs_lib_file.readlines
121
- expected_ninjs_lib_file.close
122
-
123
- ninjs_lib_file = File.open("#{@project_path}lib/nin.js", "r")
124
- ninjs_lib_content = ninjs_lib_file.readlines
125
- ninjs_lib_file.close
126
-
127
- ninjs_lib_content.should === expected_ninjs_lib_content
128
- end
129
-
130
- it 'should have the correct /lib/utilities.js' do
131
- expected_utility_lib_file = File.open("/Volumes/Storage/Development/ninjs/spec/fixtures/utilities.js", "r")
132
- expected_utility_lib_content = expected_utility_lib_file.readlines
133
- expected_utility_lib_file.close
134
-
135
- utility_lib_file = File.open("#{@project_path}lib/utilities.js", "r")
136
- utility_lib_content = utility_lib_file.readlines
137
- utility_lib_file.close
138
-
139
- utility_lib_content.should === expected_utility_lib_content
140
- end
141
-
142
- context 'and a project is updated' do
143
-
144
- before :each do
145
- @path = Dir.getwd
146
- @project = Ninjs::Project.new 'spec/js/'
147
-
148
- FileUtils.cp("#{@path}/spec/fixtures/global.module.js", "#{@path}/spec/js/modules") unless File.exists?("#{@path}/spec/js/modules/global.module.js")
149
- FileUtils.cp("#{@path}/spec/fixtures/test.module.js", "#{@path}/spec/js/modules") unless File.exists?("#{@path}/spec/js/modules/test.module.js")
150
- FileUtils.cp("#{@path}/spec/fixtures/test.elements.js", "#{@path}/spec/js/elements") unless File.exists?("#{@path}/spec/js/elements/test.elements.js")
151
- FileUtils.cp("#{@path}/spec/fixtures/test.model.js", "#{@path}/spec/js/models") unless File.exists?("#{@path}/spec/js/models/test.model.js")
152
- @project.update
153
- end
154
-
155
- it 'should have created the /application/global.js module' do
156
- File.exists?("#{@path}/spec/js/application/global.js").should be_true
157
- end
158
-
159
- it 'should have created the /application/test.js module' do
160
- File.exists?("#{@path}/spec/js/application/test.js").should be_true
161
- end
162
-
163
- it 'should have the correct /application/global.js content' do
164
- expected_global_file = File.open("#{@path}/spec/fixtures/global.js", "r")
165
- expected_global_content = expected_global_file.readlines
166
- expected_global_file.close
167
-
168
- actual_global_file = File.open("#{@path}/spec/js/application/global.js", "r")
169
- actual_global_content = actual_global_file.readlines
170
- actual_global_file.close
171
-
172
- actual_global_content.should == expected_global_content
173
- end
174
-
175
- it 'should have the correct /application/test.js content' do
176
- expected_test_file = File.open("#{@path}/spec/fixtures/test.js", "r")
177
- expected_test_content = expected_test_file.readlines
178
- expected_test_file.close
179
-
180
- actual_test_file = File.open("#{@path}/spec/js/application/test.js", "r")
181
- actual_test_content = actual_test_file.readlines
182
- actual_test_file.close
183
-
184
- actual_test_content.should == expected_test_content
185
- end
186
- end
187
-
188
- end# context When instantiating a new project
189
-
190
- context 'When instantiating a project from a config file' do
191
- before :each do
192
- @spec_dir = File.expand_path(File.join(File.dirname(__FILE__))) + '/'
193
- @project_path = @spec_dir + 'js/'
194
- @existing_project = Ninjs::Project.new 'spec/js'
195
- end
196
-
197
- it 'should have the correct app_filename' do
198
- @existing_project.config.app_filename.should === 'myapplication'
199
- end
200
-
201
- it 'should have the correct project_path' do
202
- @existing_project.project_path.should === @project_path
203
- end
204
-
205
- it 'should have the correct @config.name' do
206
- @existing_project.config.name.should === 'MyApplication'
207
- end
208
-
209
- it 'should have the correct @config.output' do
210
- @existing_project.config.output === 'expanded'
211
- end
212
-
213
- it 'should have the correct @config.dependencies' do
214
- @existing_project.config.dependencies.should == ["<jquery/latest>"]
215
- end
216
-
217
- it 'should have the correct @config.autoload' do
218
- @existing_project.config.autoload.should == ["<ninjs/utilities/all>"]
219
- end
220
-
221
- it 'should have the corect @config.base_url' do
222
- @existing_project.config.base_url == 'http://www.example.com/'
223
- end
224
-
225
- it 'should have the correct @config.test_path' do
226
- @existing_project.config.test_path == 'tests/'
227
- end
228
-
229
- it 'should not need a hack to delete all the files' do
230
- File.delete("#{@project_path}ninjs.conf") if File.exists?("#{@project_path}ninjs.conf")
231
- File.delete("#{@project_path}application/myapplication.js") if File.exists?("#{@project_path}application/myapplication.js")
232
- File.delete("#{@project_path}application/global.js") if File.exists?("#{@project_path}application/global.js")
233
- File.delete("#{@project_path}application/test.js") if File.exists?("#{@project_path}application/test.js")
234
- File.delete("#{@project_path}elements/test.elements.js") if File.exists?("#{@project_path}elements/test.elements.js")
235
- File.delete("#{@project_path}models/test.model.js") if File.exists?("#{@project_path}models/test.model.js")
236
- File.delete("#{@project_path}lib/nin.js") if File.exists?("#{@project_path}lib/nin.js")
237
- File.delete("#{@project_path}lib/utilities.js") if File.exists?("#{@project_path}lib/utilities.js")
238
- File.delete("#{@project_path}tests/index.html") if File.exists?("#{@project_path}tests/index.html")
239
- File.delete("#{@project_path}tests/ninjs.test.js") if File.exists?("#{@project_path}tests/ninjs.test.js")
240
- File.delete("#{@project_path}tests/ninjs.utilities.test.js") if File.exists?("#{@project_path}tests/ninjs.utilities.test.js")
241
- File.delete("#{@project_path}tests/qunit/qunit.css") if File.exists?("#{@project_path}tests/qunit/qunit.css")
242
- File.delete("#{@project_path}tests/qunit/qunit.js") if File.exists?("#{@project_path}tests/qunit/qunit.js")
243
- Dir.delete("#{@project_path}tests/qunit") if File.exists?("#{@project_path}tests/qunit")
244
- File.delete("#{@project_path}modules/global.module.js") if File.exists?("#{@project_path}modules/global.module.js")
245
- File.delete("#{@project_path}modules/test.module.js") if File.exists?("#{@project_path}modules/test.module.js")
246
-
247
- Ninjs::Manifest.directories.each do |folder|
248
- Dir.delete("#{@project_path}#{folder}") if File.exists? "#{@project_path}#{folder}"
249
- end
250
-
251
- Dir.delete('/Volumes/Storage/Development/ninjs/spec/js') if File.exists?('/Volumes/Storage/Development/ninjs/spec/js')
252
- true.should be_true
253
- end
254
-
255
- end
256
-
257
- end