ninjs 0.13.7 → 0.13.8

Sign up to get free protection for your applications and to get access to all the features.
Files changed (275) hide show
  1. data/.bundle/config +2 -0
  2. data/CNAME +1 -0
  3. data/Gemfile +13 -0
  4. data/Gemfile.lock +36 -0
  5. data/LICENSE +29 -0
  6. data/README.md +348 -0
  7. data/VERSION +1 -1
  8. data/bin/ninjs +211 -0
  9. data/lib/ninjs.rb +10 -0
  10. data/lib/ninjs/command.rb +88 -0
  11. data/lib/ninjs/configuration.rb +82 -0
  12. data/lib/ninjs/dependencies.rb +16 -0
  13. data/lib/ninjs/generator.rb +57 -0
  14. data/lib/ninjs/helpers.rb +17 -0
  15. data/lib/ninjs/manifest.rb +9 -0
  16. data/lib/ninjs/notification.rb +37 -0
  17. data/lib/ninjs/project.rb +214 -0
  18. data/ninjs.gemspec +294 -5
  19. data/repository/jquery/1.1.4.js +2508 -0
  20. data/repository/jquery/1.2.6.js +32 -0
  21. data/repository/jquery/1.3.2.js +19 -0
  22. data/repository/jquery/1.4.2.js +154 -0
  23. data/repository/jquery/1.4.3.js +166 -0
  24. data/repository/jquery/1.4.4.js +167 -0
  25. data/repository/jquery/1.5.js +16 -0
  26. data/repository/jquery/fancybox/1.3.1.js +1079 -0
  27. data/repository/jquery/fancybox/assets/1.3.1/css/fancybox.css +363 -0
  28. data/repository/jquery/fancybox/assets/1.3.1/images/fancybox/blank.gif +0 -0
  29. data/repository/jquery/fancybox/assets/1.3.1/images/fancybox/fancy_close.png +0 -0
  30. data/repository/jquery/fancybox/assets/1.3.1/images/fancybox/fancy_loading.png +0 -0
  31. data/repository/jquery/fancybox/assets/1.3.1/images/fancybox/fancy_nav_left.png +0 -0
  32. data/repository/jquery/fancybox/assets/1.3.1/images/fancybox/fancy_nav_right.png +0 -0
  33. data/repository/jquery/fancybox/assets/1.3.1/images/fancybox/fancy_shadow_e.png +0 -0
  34. data/repository/jquery/fancybox/assets/1.3.1/images/fancybox/fancy_shadow_n.png +0 -0
  35. data/repository/jquery/fancybox/assets/1.3.1/images/fancybox/fancy_shadow_ne.png +0 -0
  36. data/repository/jquery/fancybox/assets/1.3.1/images/fancybox/fancy_shadow_nw.png +0 -0
  37. data/repository/jquery/fancybox/assets/1.3.1/images/fancybox/fancy_shadow_s.png +0 -0
  38. data/repository/jquery/fancybox/assets/1.3.1/images/fancybox/fancy_shadow_se.png +0 -0
  39. data/repository/jquery/fancybox/assets/1.3.1/images/fancybox/fancy_shadow_sw.png +0 -0
  40. data/repository/jquery/fancybox/assets/1.3.1/images/fancybox/fancy_shadow_w.png +0 -0
  41. data/repository/jquery/fancybox/assets/1.3.1/images/fancybox/fancy_title_left.png +0 -0
  42. data/repository/jquery/fancybox/assets/1.3.1/images/fancybox/fancy_title_main.png +0 -0
  43. data/repository/jquery/fancybox/assets/1.3.1/images/fancybox/fancy_title_over.png +0 -0
  44. data/repository/jquery/fancybox/assets/1.3.1/images/fancybox/fancy_title_right.png +0 -0
  45. data/repository/jquery/fancybox/assets/1.3.1/images/fancybox/fancybox-x.png +0 -0
  46. data/repository/jquery/fancybox/assets/1.3.1/images/fancybox/fancybox-y.png +0 -0
  47. data/repository/jquery/fancybox/assets/1.3.1/images/fancybox/fancybox.png +0 -0
  48. data/repository/jquery/fancybox/assets/1.3.1/images/fancybox/jquery.easing-1.3.pack.js +72 -0
  49. data/repository/jquery/fancybox/latest.js +1 -0
  50. data/repository/jquery/latest.js +1 -0
  51. data/repository/jquery/mobile/1.0a3.js +123 -0
  52. data/repository/jquery/mobile/1.0a3/assets/css/jquery.mobile.css +1652 -0
  53. data/repository/jquery/mobile/1.0a3/assets/images/jquerymobile/ajax-loader.png +0 -0
  54. data/repository/jquery/mobile/1.0a3/assets/images/jquerymobile/form-check-off.png +0 -0
  55. data/repository/jquery/mobile/1.0a3/assets/images/jquerymobile/form-check-on.png +0 -0
  56. data/repository/jquery/mobile/1.0a3/assets/images/jquerymobile/form-radio-off.png +0 -0
  57. data/repository/jquery/mobile/1.0a3/assets/images/jquerymobile/form-radio-on.png +0 -0
  58. data/repository/jquery/mobile/1.0a3/assets/images/jquerymobile/icon-search-black.png +0 -0
  59. data/repository/jquery/mobile/1.0a3/assets/images/jquerymobile/icons-18-black.png +0 -0
  60. data/repository/jquery/mobile/1.0a3/assets/images/jquerymobile/icons-18-white.png +0 -0
  61. data/repository/jquery/mobile/1.0a3/assets/images/jquerymobile/icons-36-black.png +0 -0
  62. data/repository/jquery/mobile/1.0a3/assets/images/jquerymobile/icons-36-white.png +0 -0
  63. data/repository/jquery/mobile/latest.js +1 -0
  64. data/repository/jquery/mousewheel/3.0.2.js +11 -0
  65. data/repository/jquery/mousewheel/latest.js +1 -0
  66. data/repository/jquery/ui/1.8.7.js +783 -0
  67. data/repository/jquery/ui/assets/1.8.7/css/jqueryui/jquery.ui.accordion.css +19 -0
  68. data/repository/jquery/ui/assets/1.8.7/css/jqueryui/jquery.ui.all.css +11 -0
  69. data/repository/jquery/ui/assets/1.8.7/css/jqueryui/jquery.ui.autocomplete.css +53 -0
  70. data/repository/jquery/ui/assets/1.8.7/css/jqueryui/jquery.ui.base.css +11 -0
  71. data/repository/jquery/ui/assets/1.8.7/css/jqueryui/jquery.ui.button.css +38 -0
  72. data/repository/jquery/ui/assets/1.8.7/css/jqueryui/jquery.ui.core.css +41 -0
  73. data/repository/jquery/ui/assets/1.8.7/css/jqueryui/jquery.ui.datepicker.css +68 -0
  74. data/repository/jquery/ui/assets/1.8.7/css/jqueryui/jquery.ui.dialog.css +21 -0
  75. data/repository/jquery/ui/assets/1.8.7/css/jqueryui/jquery.ui.progressbar.css +11 -0
  76. data/repository/jquery/ui/assets/1.8.7/css/jqueryui/jquery.ui.resizable.css +20 -0
  77. data/repository/jquery/ui/assets/1.8.7/css/jqueryui/jquery.ui.selectable.css +10 -0
  78. data/repository/jquery/ui/assets/1.8.7/css/jqueryui/jquery.ui.slider.css +24 -0
  79. data/repository/jquery/ui/assets/1.8.7/css/jqueryui/jquery.ui.tabs.css +18 -0
  80. data/repository/jquery/ui/assets/1.8.7/css/jqueryui/jquery.ui.theme.css +252 -0
  81. data/repository/jquery/ui/assets/1.8.7/images/jqueryui/ui-bg_flat_0_aaaaaa_40x100.png +0 -0
  82. data/repository/jquery/ui/assets/1.8.7/images/jqueryui/ui-bg_flat_75_ffffff_40x100.png +0 -0
  83. data/repository/jquery/ui/assets/1.8.7/images/jqueryui/ui-bg_glass_55_fbf9ee_1x400.png +0 -0
  84. data/repository/jquery/ui/assets/1.8.7/images/jqueryui/ui-bg_glass_65_ffffff_1x400.png +0 -0
  85. data/repository/jquery/ui/assets/1.8.7/images/jqueryui/ui-bg_glass_75_dadada_1x400.png +0 -0
  86. data/repository/jquery/ui/assets/1.8.7/images/jqueryui/ui-bg_glass_75_e6e6e6_1x400.png +0 -0
  87. data/repository/jquery/ui/assets/1.8.7/images/jqueryui/ui-bg_glass_95_fef1ec_1x400.png +0 -0
  88. data/repository/jquery/ui/assets/1.8.7/images/jqueryui/ui-bg_highlight-soft_75_cccccc_1x100.png +0 -0
  89. data/repository/jquery/ui/assets/1.8.7/images/jqueryui/ui-icons_222222_256x240.png +0 -0
  90. data/repository/jquery/ui/assets/1.8.7/images/jqueryui/ui-icons_2e83ff_256x240.png +0 -0
  91. data/repository/jquery/ui/assets/1.8.7/images/jqueryui/ui-icons_454545_256x240.png +0 -0
  92. data/repository/jquery/ui/assets/1.8.7/images/jqueryui/ui-icons_888888_256x240.png +0 -0
  93. data/repository/jquery/ui/assets/1.8.7/images/jqueryui/ui-icons_cd0a0a_256x240.png +0 -0
  94. data/repository/jquery/ui/latest.js +1 -0
  95. data/repository/json2.js +482 -0
  96. data/repository/modernizr/1.5.js +28 -0
  97. data/repository/modernizr/latest.js +1 -0
  98. data/repository/ninjs/core/.core.pdoc.yaml +0 -0
  99. data/repository/ninjs/core/.existence.pdoc.yaml +12 -0
  100. data/repository/ninjs/core/.extend.pdoc.yaml +0 -0
  101. data/repository/ninjs/core/.nin.pdoc.yaml +0 -0
  102. data/repository/ninjs/core/application.js +47 -0
  103. data/repository/ninjs/core/existence.js +277 -0
  104. data/repository/ninjs/core/extend.js +77 -0
  105. data/repository/ninjs/core/module.js +135 -0
  106. data/repository/ninjs/core/nin.js +4 -0
  107. data/repository/ninjs/docs/Data/ClassHierarchy.nd +0 -0
  108. data/repository/ninjs/docs/Data/ConfigFileInfo.nd +0 -0
  109. data/repository/ninjs/docs/Data/FileInfo.nd +16 -0
  110. data/repository/ninjs/docs/Data/ImageFileInfo.nd +0 -0
  111. data/repository/ninjs/docs/Data/ImageReferenceTable.nd +0 -0
  112. data/repository/ninjs/docs/Data/IndexInfo.nd +0 -0
  113. data/repository/ninjs/docs/Data/PreviousMenuState.nd +0 -0
  114. data/repository/ninjs/docs/Data/PreviousSettings.nd +0 -0
  115. data/repository/ninjs/docs/Data/SymbolTable.nd +0 -0
  116. data/repository/ninjs/docs/Languages.txt +113 -0
  117. data/repository/ninjs/docs/Menu.txt +63 -0
  118. data/repository/ninjs/docs/Topics.txt +81 -0
  119. data/repository/ninjs/docs/files/core/application-js.html +44 -0
  120. data/repository/ninjs/docs/files/core/existence-js.html +60 -0
  121. data/repository/ninjs/docs/files/core/extend-js.html +55 -0
  122. data/repository/ninjs/docs/files/core/module-js.html +80 -0
  123. data/repository/ninjs/docs/files/core/nin-js.html +38 -0
  124. data/repository/ninjs/docs/index.html +1 -0
  125. data/repository/ninjs/docs/index/Classes.html +33 -0
  126. data/repository/ninjs/docs/index/Files.html +45 -0
  127. data/repository/ninjs/docs/index/Functions.html +65 -0
  128. data/repository/ninjs/docs/index/General.html +85 -0
  129. data/repository/ninjs/docs/index/Variables.html +45 -0
  130. data/repository/ninjs/docs/javascript/main.js +841 -0
  131. data/repository/ninjs/docs/javascript/prettify.js +1526 -0
  132. data/repository/ninjs/docs/javascript/searchdata.js +152 -0
  133. data/repository/ninjs/docs/search/ClassesN.html +20 -0
  134. data/repository/ninjs/docs/search/FilesA.html +20 -0
  135. data/repository/ninjs/docs/search/FilesE.html +20 -0
  136. data/repository/ninjs/docs/search/FilesM.html +20 -0
  137. data/repository/ninjs/docs/search/FilesN.html +20 -0
  138. data/repository/ninjs/docs/search/FunctionsA.html +20 -0
  139. data/repository/ninjs/docs/search/FunctionsC.html +20 -0
  140. data/repository/ninjs/docs/search/FunctionsE.html +20 -0
  141. data/repository/ninjs/docs/search/FunctionsI.html +20 -0
  142. data/repository/ninjs/docs/search/FunctionsM.html +20 -0
  143. data/repository/ninjs/docs/search/FunctionsR.html +20 -0
  144. data/repository/ninjs/docs/search/FunctionsS.html +20 -0
  145. data/repository/ninjs/docs/search/FunctionsSymbols.html +20 -0
  146. data/repository/ninjs/docs/search/FunctionsU.html +20 -0
  147. data/repository/ninjs/docs/search/GeneralA.html +20 -0
  148. data/repository/ninjs/docs/search/GeneralC.html +20 -0
  149. data/repository/ninjs/docs/search/GeneralD.html +20 -0
  150. data/repository/ninjs/docs/search/GeneralE.html +20 -0
  151. data/repository/ninjs/docs/search/GeneralF.html +20 -0
  152. data/repository/ninjs/docs/search/GeneralI.html +20 -0
  153. data/repository/ninjs/docs/search/GeneralM.html +20 -0
  154. data/repository/ninjs/docs/search/GeneralN.html +20 -0
  155. data/repository/ninjs/docs/search/GeneralR.html +20 -0
  156. data/repository/ninjs/docs/search/GeneralS.html +20 -0
  157. data/repository/ninjs/docs/search/GeneralSymbols.html +20 -0
  158. data/repository/ninjs/docs/search/GeneralT.html +20 -0
  159. data/repository/ninjs/docs/search/GeneralU.html +20 -0
  160. data/repository/ninjs/docs/search/GeneralV.html +20 -0
  161. data/repository/ninjs/docs/search/NoResults.html +15 -0
  162. data/repository/ninjs/docs/search/VariablesD.html +20 -0
  163. data/repository/ninjs/docs/search/VariablesN.html +20 -0
  164. data/repository/ninjs/docs/search/VariablesR.html +20 -0
  165. data/repository/ninjs/docs/search/VariablesT.html +20 -0
  166. data/repository/ninjs/docs/styles/main.css +828 -0
  167. data/repository/ninjs/extensions/jquery.elements.js +60 -0
  168. data/repository/ninjs/tests/index.html +21 -0
  169. data/repository/ninjs/tests/ninjs.test.js +188 -0
  170. data/repository/ninjs/tests/ninjs.utilities.test.js +137 -0
  171. data/repository/ninjs/tests/qunit/qunit.css +197 -0
  172. data/repository/ninjs/tests/qunit/qunit.js +1415 -0
  173. data/repository/ninjs/utilities/all.js +5 -0
  174. data/repository/ninjs/utilities/array.js +29 -0
  175. data/repository/ninjs/utilities/cookie.js +0 -0
  176. data/repository/ninjs/utilities/css.js +51 -0
  177. data/repository/ninjs/utilities/number.js +11 -0
  178. data/repository/ninjs/utilities/string.js +61 -0
  179. data/repository/nullconsole.js +7 -0
  180. data/repository/qunit/assets/css/qunit.css +196 -0
  181. data/repository/qunit/qunit.js +1374 -0
  182. data/repository/selectivizr/1.0.js +5 -0
  183. data/repository/selectivizr/latest.js +1 -0
  184. data/repository/syntaxhighlighter/all.js +11 -0
  185. data/repository/syntaxhighlighter/assets/css/syntaxhighlighter/shCore.css +226 -0
  186. data/repository/syntaxhighlighter/assets/css/syntaxhighlighter/shCoreDefault.css +328 -0
  187. data/repository/syntaxhighlighter/assets/css/syntaxhighlighter/shCoreDjango.css +331 -0
  188. data/repository/syntaxhighlighter/assets/css/syntaxhighlighter/shCoreEclipse.css +339 -0
  189. data/repository/syntaxhighlighter/assets/css/syntaxhighlighter/shCoreEmacs.css +324 -0
  190. data/repository/syntaxhighlighter/assets/css/syntaxhighlighter/shCoreFadeToGrey.css +328 -0
  191. data/repository/syntaxhighlighter/assets/css/syntaxhighlighter/shCoreMDUltra.css +324 -0
  192. data/repository/syntaxhighlighter/assets/css/syntaxhighlighter/shCoreMidnight.css +324 -0
  193. data/repository/syntaxhighlighter/assets/css/syntaxhighlighter/shCoreRDark.css +324 -0
  194. data/repository/syntaxhighlighter/assets/css/syntaxhighlighter/shThemeDefault.css +117 -0
  195. data/repository/syntaxhighlighter/assets/css/syntaxhighlighter/shThemeDjango.css +120 -0
  196. data/repository/syntaxhighlighter/assets/css/syntaxhighlighter/shThemeEclipse.css +128 -0
  197. data/repository/syntaxhighlighter/assets/css/syntaxhighlighter/shThemeEmacs.css +113 -0
  198. data/repository/syntaxhighlighter/assets/css/syntaxhighlighter/shThemeFadeToGrey.css +117 -0
  199. data/repository/syntaxhighlighter/assets/css/syntaxhighlighter/shThemeMDUltra.css +113 -0
  200. data/repository/syntaxhighlighter/assets/css/syntaxhighlighter/shThemeMidnight.css +113 -0
  201. data/repository/syntaxhighlighter/assets/css/syntaxhighlighter/shThemeRDark.css +113 -0
  202. data/repository/syntaxhighlighter/assets/scss/syntaxhighlighter/_shCore.scss +216 -0
  203. data/repository/syntaxhighlighter/assets/scss/syntaxhighlighter/_shCoreDefault.scss +2 -0
  204. data/repository/syntaxhighlighter/assets/scss/syntaxhighlighter/_shCoreDjango.scss +2 -0
  205. data/repository/syntaxhighlighter/assets/scss/syntaxhighlighter/_shCoreEclipse.scss +2 -0
  206. data/repository/syntaxhighlighter/assets/scss/syntaxhighlighter/_shCoreEmacs.scss +2 -0
  207. data/repository/syntaxhighlighter/assets/scss/syntaxhighlighter/_shCoreFadeToGrey.scss +2 -0
  208. data/repository/syntaxhighlighter/assets/scss/syntaxhighlighter/_shCoreMDUltra.scss +2 -0
  209. data/repository/syntaxhighlighter/assets/scss/syntaxhighlighter/_shCoreMidnight.scss +2 -0
  210. data/repository/syntaxhighlighter/assets/scss/syntaxhighlighter/_shCoreRDark.scss +2 -0
  211. data/repository/syntaxhighlighter/assets/scss/syntaxhighlighter/_shThemeDefault.scss +7 -0
  212. data/repository/syntaxhighlighter/assets/scss/syntaxhighlighter/_shThemeDjango.scss +36 -0
  213. data/repository/syntaxhighlighter/assets/scss/syntaxhighlighter/_shThemeEclipse.scss +48 -0
  214. data/repository/syntaxhighlighter/assets/scss/syntaxhighlighter/_shThemeEmacs.scss +32 -0
  215. data/repository/syntaxhighlighter/assets/scss/syntaxhighlighter/_shThemeFadeToGrey.scss +36 -0
  216. data/repository/syntaxhighlighter/assets/scss/syntaxhighlighter/_shThemeMDUltra.scss +32 -0
  217. data/repository/syntaxhighlighter/assets/scss/syntaxhighlighter/_shThemeMidnight.scss +32 -0
  218. data/repository/syntaxhighlighter/assets/scss/syntaxhighlighter/_shThemeRDark.scss +32 -0
  219. data/repository/syntaxhighlighter/assets/scss/syntaxhighlighter/_theme_template.scss +120 -0
  220. data/repository/syntaxhighlighter/shAutoloader.js +17 -0
  221. data/repository/syntaxhighlighter/shBrushAS3.js +59 -0
  222. data/repository/syntaxhighlighter/shBrushAppleScript.js +75 -0
  223. data/repository/syntaxhighlighter/shBrushBash.js +59 -0
  224. data/repository/syntaxhighlighter/shBrushCSharp.js +65 -0
  225. data/repository/syntaxhighlighter/shBrushColdFusion.js +100 -0
  226. data/repository/syntaxhighlighter/shBrushCpp.js +97 -0
  227. data/repository/syntaxhighlighter/shBrushCss.js +91 -0
  228. data/repository/syntaxhighlighter/shBrushDelphi.js +55 -0
  229. data/repository/syntaxhighlighter/shBrushDiff.js +41 -0
  230. data/repository/syntaxhighlighter/shBrushErlang.js +52 -0
  231. data/repository/syntaxhighlighter/shBrushGroovy.js +67 -0
  232. data/repository/syntaxhighlighter/shBrushJScript.js +52 -0
  233. data/repository/syntaxhighlighter/shBrushJava.js +57 -0
  234. data/repository/syntaxhighlighter/shBrushJavaFX.js +58 -0
  235. data/repository/syntaxhighlighter/shBrushPerl.js +72 -0
  236. data/repository/syntaxhighlighter/shBrushPhp.js +88 -0
  237. data/repository/syntaxhighlighter/shBrushPlain.js +33 -0
  238. data/repository/syntaxhighlighter/shBrushPowerShell.js +74 -0
  239. data/repository/syntaxhighlighter/shBrushPython.js +64 -0
  240. data/repository/syntaxhighlighter/shBrushRuby.js +55 -0
  241. data/repository/syntaxhighlighter/shBrushSass.js +94 -0
  242. data/repository/syntaxhighlighter/shBrushScala.js +51 -0
  243. data/repository/syntaxhighlighter/shBrushSql.js +66 -0
  244. data/repository/syntaxhighlighter/shBrushVb.js +56 -0
  245. data/repository/syntaxhighlighter/shBrushXml.js +69 -0
  246. data/repository/syntaxhighlighter/shCore.js +17 -0
  247. data/repository/syntaxhighlighter/shLegacy.js +17 -0
  248. data/spec/command_spec.rb +9 -0
  249. data/spec/configuration_spec.rb +70 -0
  250. data/spec/dependencies_spec.rb +27 -0
  251. data/spec/fixtures/autoload.js +3 -0
  252. data/spec/fixtures/changed.ninjs.conf +6 -0
  253. data/spec/fixtures/compressed.myapp.js +39 -0
  254. data/spec/fixtures/core.js +6 -0
  255. data/spec/fixtures/dependencies.js +3 -0
  256. data/spec/fixtures/foo.elements.js +3 -0
  257. data/spec/fixtures/foo.js +17 -0
  258. data/spec/fixtures/foo.model.js +3 -0
  259. data/spec/fixtures/foo.module.js +13 -0
  260. data/spec/fixtures/hello.elements.js +3 -0
  261. data/spec/fixtures/hello.js +17 -0
  262. data/spec/fixtures/hello.model.js +3 -0
  263. data/spec/fixtures/hello.module.js +13 -0
  264. data/spec/fixtures/myapp.initial.js +535 -0
  265. data/spec/fixtures/myapp.js +710 -0
  266. data/spec/fixtures/new.ninjs.conf +6 -0
  267. data/spec/fixtures/ninjs.conf +6 -0
  268. data/spec/generator_spec.rb +34 -0
  269. data/spec/helpers_spec.rb +11 -0
  270. data/spec/manifest_spec.rb +8 -0
  271. data/spec/ninjs_spec.rb +20 -0
  272. data/spec/notification_spec.rb +27 -0
  273. data/spec/project_spec.rb +239 -0
  274. data/spec/spec_helper.rb +29 -0
  275. metadata +294 -50
@@ -0,0 +1,28 @@
1
+ /*!
2
+ * Modernizr JavaScript library 1.5
3
+ * http://www.modernizr.com/
4
+ *
5
+ * Copyright (c) 2009-2010 Faruk Ates - http://farukat.es/
6
+ * Dual-licensed under the BSD and MIT licenses.
7
+ * http://www.modernizr.com/license/
8
+ *
9
+ * Featuring major contributions by
10
+ * Paul Irish - http://paulirish.com
11
+ */
12
+ window.Modernizr=function(i,e,I){function C(a,b){for(var c in a)if(m[a[c]]!==I&&(!b||b(a[c],D)))return true}function r(a,b){var c=a.charAt(0).toUpperCase()+a.substr(1);return!!C([a,"Webkit"+c,"Moz"+c,"O"+c,"ms"+c,"Khtml"+c],b)}function P(){j[E]=function(a){for(var b=0,c=a.length;b<c;b++)J[a[b]]=!!(a[b]in n);return J}("autocomplete autofocus list placeholder max min multiple pattern required step".split(" "));j[Q]=function(a){for(var b=0,c,h=a.length;b<h;b++){n.setAttribute("type",a[b]);if(c=n.type!==
13
+ "text"){n.value=K;/tel|search/.test(n.type)||(c=/url|email/.test(n.type)?n.checkValidity&&n.checkValidity()===false:n.value!=K)}L[a[b]]=!!c}return L}("search tel url email datetime date month week time datetime-local number range color".split(" "))}var j={},s=e.documentElement,D=e.createElement("modernizr"),m=D.style,n=e.createElement("input"),E="input",Q=E+"types",K=":)",M=Object.prototype.toString,y=" -o- -moz- -ms- -webkit- -khtml- ".split(" "),d={},L={},J={},N=[],u=function(){var a={select:"input",
14
+ change:"input",submit:"form",reset:"form",error:"img",load:"img",abort:"img"},b={};return function(c,h){var t=arguments.length==1;if(t&&b[c])return b[c];h=h||document.createElement(a[c]||"div");c="on"+c;var g=c in h;if(!g&&h.setAttribute){h.setAttribute(c,"return;");g=typeof h[c]=="function"}h=null;return t?(b[c]=g):g}}(),F={}.hasOwnProperty,O;O=typeof F!=="undefined"&&typeof F.call!=="undefined"?function(a,b){return F.call(a,b)}:function(a,b){return b in a&&typeof a.constructor.prototype[b]==="undefined"};
15
+ d.canvas=function(){return!!e.createElement("canvas").getContext};d.canvastext=function(){return!!(d.canvas()&&typeof e.createElement("canvas").getContext("2d").fillText=="function")};d.geolocation=function(){return!!navigator.geolocation};d.crosswindowmessaging=function(){return!!i.postMessage};d.websqldatabase=function(){var a=!!i.openDatabase;if(a)try{a=!!openDatabase("testdb","1.0","html5 test db",2E5)}catch(b){a=false}return a};d.indexedDB=function(){return!!i.indexedDB};d.hashchange=function(){return u("hashchange",
16
+ i)&&(document.documentMode===I||document.documentMode>7)};d.historymanagement=function(){return!!(i.history&&history.pushState)};d.draganddrop=function(){return u("drag")&&u("dragstart")&&u("dragenter")&&u("dragover")&&u("dragleave")&&u("dragend")&&u("drop")};d.websockets=function(){return"WebSocket"in i};d.rgba=function(){m.cssText="background-color:rgba(150,255,150,.5)";return(""+m.backgroundColor).indexOf("rgba")!==-1};d.hsla=function(){m.cssText="background-color:hsla(120,40%,100%,.5)";return(""+
17
+ m.backgroundColor).indexOf("rgba")!==-1};d.multiplebgs=function(){m.cssText="background:url(//:),url(//:),red url(//:)";return/(url\s*\(.*?){3}/.test(m.background)};d.backgroundsize=function(){return r("backgroundSize")};d.borderimage=function(){return r("borderImage")};d.borderradius=function(){return r("borderRadius","",function(a){return(""+a).indexOf("orderRadius")!==-1})};d.boxshadow=function(){return r("boxShadow")};d.opacity=function(){var a=y.join("opacity:.5;")+"";m.cssText=a;return(""+m.opacity).indexOf("0.5")!==
18
+ -1};d.cssanimations=function(){return r("animationName")};d.csscolumns=function(){return r("columnCount")};d.cssgradients=function(){var a=("background-image:"+y.join("gradient(linear,left top,right bottom,from(#9f9),to(white));background-image:")+y.join("linear-gradient(left top,#9f9, white);background-image:")).slice(0,-17);m.cssText=a;return(""+m.backgroundImage).indexOf("gradient")!==-1};d.cssreflections=function(){return r("boxReflect")};d.csstransforms=function(){return!!C(["transformProperty",
19
+ "WebkitTransform","MozTransform","OTransform","msTransform"])};d.csstransforms3d=function(){var a=!!C(["perspectiveProperty","WebkitPerspective","MozPerspective","OPerspective","msPerspective"]);if(a){var b=document.createElement("style"),c=e.createElement("div");b.textContent="@media ("+y.join("transform-3d),(")+"modernizr){#modernizr{height:3px}}";e.getElementsByTagName("head")[0].appendChild(b);c.id="modernizr";s.appendChild(c);a=c.offsetHeight===3;b.parentNode.removeChild(b);c.parentNode.removeChild(c)}return a};
20
+ d.csstransitions=function(){return r("transitionProperty")};d.fontface=function(){var a;if(/*@cc_on@if(@_jscript_version>=5)!@end@*/0)a=true;else{var b=e.createElement("style"),c=e.createElement("span"),h,t=false,g=e.body,o,w;b.textContent="@font-face{font-family:testfont;src:url('data:font/ttf;base64,AAEAAAAMAIAAAwBAT1MvMliohmwAAADMAAAAVmNtYXCp5qrBAAABJAAAANhjdnQgACICiAAAAfwAAAAEZ2FzcP//AAMAAAIAAAAACGdseWYv5OZoAAACCAAAANxoZWFk69bnvwAAAuQAAAA2aGhlYQUJAt8AAAMcAAAAJGhtdHgGDgC4AAADQAAAABRsb2NhAIQAwgAAA1QAAAAMbWF4cABVANgAAANgAAAAIG5hbWUgXduAAAADgAAABPVwb3N03NkzmgAACHgAAAA4AAECBAEsAAUAAAKZAswAAACPApkCzAAAAesAMwEJAAACAAMDAAAAAAAAgAACbwAAAAoAAAAAAAAAAFBmRWQAAAAgqS8DM/8zAFwDMwDNAAAABQAAAAAAAAAAAAMAAAADAAAAHAABAAAAAABGAAMAAQAAAK4ABAAqAAAABgAEAAEAAgAuqQD//wAAAC6pAP///9ZXAwAAAAAAAAACAAAABgBoAAAAAAAvAAEAAAAAAAAAAAAAAAAAAAABAAIAAAAAAAAAAgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAEACoAAAAGAAQAAQACAC6pAP//AAAALqkA////1lcDAAAAAAAAAAIAAAAiAogAAAAB//8AAgACACIAAAEyAqoAAwAHAC6xAQAvPLIHBADtMrEGBdw8sgMCAO0yALEDAC88sgUEAO0ysgcGAfw8sgECAO0yMxEhESczESMiARDuzMwCqv1WIgJmAAACAFUAAAIRAc0ADwAfAAATFRQWOwEyNj0BNCYrASIGARQGKwEiJj0BNDY7ATIWFX8aIvAiGhoi8CIaAZIoN/43KCg3/jcoAWD0JB4eJPQkHh7++EY2NkbVRjY2RgAAAAABAEH/+QCdAEEACQAANjQ2MzIWFAYjIkEeEA8fHw8QDxwWFhwWAAAAAQAAAAIAAIuYbWpfDzz1AAsEAAAAAADFn9IuAAAAAMWf0i797/8zA4gDMwAAAAgAAgAAAAAAAAABAAADM/8zAFwDx/3v/98DiAABAAAAAAAAAAAAAAAAAAAABQF2ACIAAAAAAVUAAAJmAFUA3QBBAAAAKgAqACoAWgBuAAEAAAAFAFAABwBUAAQAAgAAAAEAAQAAAEAALgADAAMAAAAQAMYAAQAAAAAAAACLAAAAAQAAAAAAAQAhAIsAAQAAAAAAAgAFAKwAAQAAAAAAAwBDALEAAQAAAAAABAAnAPQAAQAAAAAABQAKARsAAQAAAAAABgAmASUAAQAAAAAADgAaAUsAAwABBAkAAAEWAWUAAwABBAkAAQBCAnsAAwABBAkAAgAKAr0AAwABBAkAAwCGAscAAwABBAkABABOA00AAwABBAkABQAUA5sAAwABBAkABgBMA68AAwABBAkADgA0A/tDb3B5cmlnaHQgMjAwOSBieSBEYW5pZWwgSm9obnNvbi4gIFJlbGVhc2VkIHVuZGVyIHRoZSB0ZXJtcyBvZiB0aGUgT3BlbiBGb250IExpY2Vuc2UuIEtheWFoIExpIGdseXBocyBhcmUgcmVsZWFzZWQgdW5kZXIgdGhlIEdQTCB2ZXJzaW9uIDMuYmFlYzJhOTJiZmZlNTAzMiAtIHN1YnNldCBvZiBKdXJhTGlnaHRiYWVjMmE5MmJmZmU1MDMyIC0gc3Vic2V0IG9mIEZvbnRGb3JnZSAyLjAgOiBKdXJhIExpZ2h0IDogMjMtMS0yMDA5YmFlYzJhOTJiZmZlNTAzMiAtIHN1YnNldCBvZiBKdXJhIExpZ2h0VmVyc2lvbiAyIGJhZWMyYTkyYmZmZTUwMzIgLSBzdWJzZXQgb2YgSnVyYUxpZ2h0aHR0cDovL3NjcmlwdHMuc2lsLm9yZy9PRkwAQwBvAHAAeQByAGkAZwBoAHQAIAAyADAAMAA5ACAAYgB5ACAARABhAG4AaQBlAGwAIABKAG8AaABuAHMAbwBuAC4AIAAgAFIAZQBsAGUAYQBzAGUAZAAgAHUAbgBkAGUAcgAgAHQAaABlACAAdABlAHIAbQBzACAAbwBmACAAdABoAGUAIABPAHAAZQBuACAARgBvAG4AdAAgAEwAaQBjAGUAbgBzAGUALgAgAEsAYQB5AGEAaAAgAEwAaQAgAGcAbAB5AHAAaABzACAAYQByAGUAIAByAGUAbABlAGEAcwBlAGQAIAB1AG4AZABlAHIAIAB0AGgAZQAgAEcAUABMACAAdgBlAHIAcwBpAG8AbgAgADMALgBiAGEAZQBjADIAYQA5ADIAYgBmAGYAZQA1ADAAMwAyACAALQAgAHMAdQBiAHMAZQB0ACAAbwBmACAASgB1AHIAYQBMAGkAZwBoAHQAYgBhAGUAYwAyAGEAOQAyAGIAZgBmAGUANQAwADMAMgAgAC0AIABzAHUAYgBzAGUAdAAgAG8AZgAgAEYAbwBuAHQARgBvAHIAZwBlACAAMgAuADAAIAA6ACAASgB1AHIAYQAgAEwAaQBnAGgAdAAgADoAIAAyADMALQAxAC0AMgAwADAAOQBiAGEAZQBjADIAYQA5ADIAYgBmAGYAZQA1ADAAMwAyACAALQAgAHMAdQBiAHMAZQB0ACAAbwBmACAASgB1AHIAYQAgAEwAaQBnAGgAdABWAGUAcgBzAGkAbwBuACAAMgAgAGIAYQBlAGMAMgBhADkAMgBiAGYAZgBlADUAMAAzADIAIAAtACAAcwB1AGIAcwBlAHQAIABvAGYAIABKAHUAcgBhAEwAaQBnAGgAdABoAHQAdABwADoALwAvAHMAYwByAGkAcAB0AHMALgBzAGkAbAAuAG8AcgBnAC8ATwBGAEwAAAAAAgAAAAAAAP+BADMAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAAAAQACAQIAEQt6ZXJva2F5YWhsaQ==')}";
21
+ e.getElementsByTagName("head")[0].appendChild(b);c.setAttribute("style","font:99px _,arial,helvetica;position:absolute;visibility:hidden");if(!g){g=s.appendChild(e.createElement("fontface"));t=true}c.innerHTML="........";c.id="fonttest";g.appendChild(c);h=c.offsetWidth*c.offsetHeight;c.style.font="99px testfont,_,arial,helvetica";a=h!==c.offsetWidth*c.offsetHeight;var v=function(){if(g.parentNode){a=j.fontface=h!==c.offsetWidth*c.offsetHeight;s.className=s.className.replace(/(no-)?fontface\b/,"")+
22
+ (a?" ":" no-")+"fontface"}};setTimeout(v,75);setTimeout(v,150);addEventListener("load",function(){v();(w=true)&&o&&o(a);setTimeout(function(){t||(g=c);g.parentNode.removeChild(g);b.parentNode.removeChild(b)},50)},false)}j._fontfaceready=function(p){w||a?p(a):(o=p)};return a||h!==c.offsetWidth};d.video=function(){var a=e.createElement("video"),b=!!a.canPlayType;if(b){b=new Boolean(b);b.ogg=a.canPlayType('video/ogg; codecs="theora"');b.h264=a.canPlayType('video/mp4; codecs="avc1.42E01E"');b.webm=a.canPlayType('video/webm; codecs="vp8, vorbis"')}return b};
23
+ d.audio=function(){var a=e.createElement("audio"),b=!!a.canPlayType;if(b){b=new Boolean(b);b.ogg=a.canPlayType('audio/ogg; codecs="vorbis"');b.mp3=a.canPlayType("audio/mpeg;");b.wav=a.canPlayType('audio/wav; codecs="1"');b.m4a=a.canPlayType("audio/x-m4a;")||a.canPlayType("audio/aac;")}return b};d.localStorage=function(){return"localStorage"in i&&i.localStorage!==null};d.sessionStorage=function(){try{return"sessionStorage"in i&&i.sessionStorage!==null}catch(a){return false}};d.webworkers=function(){return!!i.Worker};
24
+ d.applicationCache=function(){var a=i.applicationCache;return!!(a&&typeof a.status!="undefined"&&typeof a.update=="function"&&typeof a.swapCache=="function")};d.svg=function(){return!!e.createElementNS&&!!e.createElementNS("http://www.w3.org/2000/svg","svg").createSVGRect};d.smil=function(){return!!e.createElementNS&&/SVG/.test(M.call(e.createElementNS("http://www.w3.org/2000/svg","animate")))};d.svgclippaths=function(){return!!e.createElementNS&&/SVG/.test(M.call(e.createElementNS("http://www.w3.org/2000/svg",
25
+ "clipPath")))};for(var z in d)if(O(d,z))N.push(((j[z.toLowerCase()]=d[z]())?"":"no-")+z.toLowerCase());j[E]||P();j.addTest=function(a,b){a=a.toLowerCase();if(!j[a]){b=!!b();s.className+=" "+(b?"":"no-")+a;j[a]=b;return j}};m.cssText="";D=n=null;(function(){var a=e.createElement("div");a.innerHTML="<elem></elem>";return a.childNodes.length!==1})()&&function(a,b){function c(f,k){if(o[f])o[f].styleSheet.cssText+=k;else{var l=t[G],q=b[A]("style");q.media=f;l.insertBefore(q,l[G]);o[f]=q;c(f,k)}}function h(f,
26
+ k){for(var l=new RegExp("\\b("+w+")\\b(?!.*[;}])","gi"),q=function(B){return".iepp_"+B},x=-1;++x<f.length;){k=f[x].media||k;h(f[x].imports,k);c(k,f[x].cssText.replace(l,q))}}for(var t=b.documentElement,g=b.createDocumentFragment(),o={},w="abbr|article|aside|audio|canvas|command|datalist|details|figure|figcaption|footer|header|hgroup|keygen|mark|meter|nav|output|progress|section|source|summary|time|video",v=w.split("|"),p=[],H=-1,G="firstChild",A="createElement";++H<v.length;){b[A](v[H]);g[A](v[H])}g=
27
+ g.appendChild(b[A]("div"));a.attachEvent("onbeforeprint",function(){for(var f,k=b.getElementsByTagName("*"),l,q,x=new RegExp("^"+w+"$","i"),B=-1;++B<k.length;)if((f=k[B])&&(q=f.nodeName.match(x))){l=new RegExp("^\\s*<"+q+"(.*)\\/"+q+">\\s*$","i");g.innerHTML=f.outerHTML.replace(/\r|\n/g," ").replace(l,f.currentStyle.display=="block"?"<div$1/div>":"<span$1/span>");l=g.childNodes[0];l.className+=" iepp_"+q;l=p[p.length]=[f,l];f.parentNode.replaceChild(l[1],l[0])}h(b.styleSheets,"all")});a.attachEvent("onafterprint",
28
+ function(){for(var f=-1,k;++f<p.length;)p[f][1].parentNode.replaceChild(p[f][0],p[f][1]);for(k in o)t[G].removeChild(o[k]);o={};p=[]})}(this,e);j._enableHTML5=true;j._version="1.5";s.className=s.className.replace(/\bno-js\b/,"")+" js";s.className+=" "+N.join(" ");return j}(this,this.document);
@@ -0,0 +1 @@
1
+ //= require "1.5"
File without changes
@@ -0,0 +1,12 @@
1
+ ---
2
+ id: "is_defined"
3
+ type: class method
4
+ line_number: 5
5
+ description: |
6
+
7
+
8
+ signatures:
9
+ -
10
+ signature: ".is_defined(suspect)"
11
+ return_value: "Any"
12
+ file: /Volumes/Storage/Development/ninjs/repository/ninjs/core/existence.js
File without changes
File without changes
@@ -0,0 +1,47 @@
1
+ /*
2
+ File: application.js
3
+
4
+ Class: NinjsApplication
5
+ An NinjsApplication object serves as your application's namespace and includes a utility to add modules to the application object.
6
+
7
+ See Also:
8
+ <NinjsModule>
9
+ */
10
+
11
+ var NinjsApplication = function(base_url, tests_path) {
12
+ if(is_defined(tests_path)) {
13
+ this.tests_path = tests_path;
14
+ }
15
+
16
+ if(is_defined(base_url)) {
17
+ this.site_url = function(path) {
18
+ var path = path || '';
19
+ return base_url + path;
20
+ };
21
+ }
22
+ };
23
+
24
+ /*
25
+ Method: add_module
26
+ Adds a NinjsModule to the application.
27
+
28
+ Parameters:
29
+ name - the name of the module
30
+
31
+ > myapp.add_module('my_module');
32
+ */
33
+ NinjsApplication.method('add_module', function(name) {
34
+ if (is_undefined(name)) {
35
+ throw new SyntaxError("NinjsApplication.add_module(name): name is undefined");
36
+ }
37
+
38
+ if (is_defined(this[name])) {
39
+ throw new SyntaxError("NinjsApplication.add_module(name): '" + name + "' already declared");
40
+ }
41
+
42
+ if (this.name === name) {
43
+ throw new SyntaxError("NinjsApplication.add_module(name): a module cannot have the same name as the application");
44
+ }
45
+
46
+ return this[name] = new NinjsModule(name);
47
+ });
@@ -0,0 +1,277 @@
1
+ /* File: existence.js */
2
+ if (is_defined === undefined) {
3
+ /*
4
+ Function: is_defined
5
+ Checks if a variable is undefined. This is a convenience method to enhance clarity in your conditions.
6
+
7
+ Parameters:
8
+ suspect - suspect variable to test
9
+
10
+ Returns:
11
+ bool
12
+
13
+ See Also:
14
+
15
+ <is_undefined>
16
+ */
17
+ var is_defined = function(suspect) {
18
+ return ((suspect === undefined) || (suspect === null)) ? false : true;
19
+ };
20
+ }
21
+
22
+ if (!is_defined(is_undefined)) {
23
+ /*
24
+ Function: is_undefined
25
+ Checks if a variable is defined. This is a convenience method to enhance clarity in your conditions.
26
+
27
+ Parameters:
28
+ suspect - suspect variable to test
29
+
30
+ Returns:
31
+ bool
32
+
33
+ See Also:
34
+
35
+ <is_defined>
36
+ */
37
+ var is_undefined = function(suspect) {
38
+ return (suspect === undefined) ? true : false;
39
+ };
40
+ }
41
+
42
+ if (is_undefined(is_typeof)) {
43
+ /*
44
+ Function: is_typeof
45
+ Strict type checking by comparing constructors.
46
+ (Pro Javascript Techniques, John Resig, Apress p.24 Listing 2-8: Example of using the constructor property to determine the type of an object http://amzn.to/fTsDRg)
47
+ Parameters:
48
+ type - The type you expect (ie. String, Number, Array (note: without quotes): is_typeof(String, 'hello'): // true)
49
+ suspect - The suspect variable to check against type
50
+
51
+ Returns:
52
+ bool
53
+
54
+ See Also:
55
+ <is_numeric>,
56
+ <is_string>,
57
+ <is_array>,
58
+ <is_number>,
59
+ <is_date>,
60
+ <is_bool>,
61
+ <is_regex>
62
+ */
63
+ var is_typeof = function(type, suspect) {
64
+ if (is_undefined(type)) {
65
+ throw new SyntaxError("is_typeof(Type, suspect): type is undefined");
66
+ }
67
+ if (is_undefined(suspect)) {
68
+ throw new SyntaxError("is_typeof(Type, suspect): suspect is undefined");
69
+ }
70
+
71
+ return (suspect.constructor == type) ? true : false;
72
+ };
73
+ }
74
+
75
+ if (is_undefined(is_numeric)) {
76
+ /*
77
+ Function: is_numeric
78
+ Determine if the suspect string represents a numeric value.
79
+ (JavaScript: The Good Parts, Douglas Crockford, O'Reilly p.69 Chapter 7: Regular Expressions An Example)
80
+ Parameters:
81
+ suspect - variable to check for numeric value
82
+
83
+ Returns:
84
+ bool
85
+
86
+ See Also:
87
+ <is_number>
88
+ */
89
+ var is_numeric = function(suspect) {
90
+ if(is_typeof(Number, suspect)) {
91
+ return true;
92
+ }
93
+ else {
94
+ var pattern = /^-?\d+(?:\.\d*)?(?:e[+\-]?\d+)?$/i;
95
+ return pattern.test(suspect);
96
+ }
97
+ };
98
+ }
99
+
100
+ if (is_undefined(is_string)) {
101
+ /*
102
+ Function: is_string
103
+ Determine the suspect is a String. This is a proxy method for is_typeof(String, suspect).
104
+
105
+ Parameters:
106
+ suspect - supect variable to test
107
+
108
+ Returns:
109
+ bool
110
+
111
+ See Also:
112
+ <is_typeof>,
113
+ <is_numeric>,
114
+ <is_array>,
115
+ <is_number>,
116
+ <is_date>,
117
+ <is_bool>,
118
+ <is_regex>
119
+ */
120
+ var is_string = function(suspect) {
121
+ return is_typeof(String, suspect);
122
+ };
123
+ }
124
+
125
+ if (is_undefined(is_array)) {
126
+ /*
127
+ Function: is_array
128
+ Determine if the suspect is an Array. This is a proxy method for is_typeof(Array, suspect).
129
+
130
+ Parameters:
131
+ suspect - suspect variable to test
132
+
133
+ Returns:
134
+ bool
135
+
136
+ See Also:
137
+ <is_typeof>,
138
+ <is_numeric>,
139
+ <is_string>,
140
+ <is_number>,
141
+ <is_date>,
142
+ <is_bool>,
143
+ <is_regex>
144
+ */
145
+ var is_array = function(suspect) {
146
+ return is_typeof(Array, suspect);
147
+ };
148
+ }
149
+
150
+ if (is_undefined(is_number)) {
151
+ /*
152
+ Function: is_number
153
+ Determines if the suspect is a Number. This is a proxy method for is_typeof(Number, suspect).
154
+
155
+ Parameters:
156
+ suspect - suspect variable to test
157
+
158
+ Returns:
159
+ bool
160
+
161
+ See Also:
162
+ <is_typeof>,
163
+ <is_numeric>,
164
+ <is_string>,
165
+ <is_array>,
166
+ <is_date>,
167
+ <is_bool>,
168
+ <is_regex>
169
+ */
170
+ var is_number = function(suspect) {
171
+ return is_typeof(Number, suspect);
172
+ };
173
+ }
174
+
175
+ if (is_undefined(is_date)) {
176
+ /*
177
+ Function: is_date
178
+ Determines if the suspect is a Date. This is a proxy method for is_typeof(Date, suspect).
179
+
180
+ Parameters:
181
+ suspect - suspect variable to test
182
+
183
+ Returns:
184
+ bool
185
+
186
+ See Also:
187
+ <is_typeof>,
188
+ <is_numeric>,
189
+ <is_string>,
190
+ <is_array>,
191
+ <is_number>,
192
+ <is_bool>,
193
+ <is_regex>
194
+ */
195
+ var is_date = function(suspect) {
196
+ return is_typeof(Date, suspect);
197
+ };
198
+ }
199
+
200
+ if (is_undefined(is_bool)) {
201
+ /*
202
+ Function: is_bool
203
+ Determines if the suspect is a Boolean. This is a proxy method for is_typeof(Boolean, suspect).
204
+
205
+ Parameters:
206
+ suspect - suspect variable to test
207
+
208
+ Returns:
209
+ bool
210
+
211
+ See Also:
212
+ <is_typeof>,
213
+ <is_numeric>,
214
+ <is_string>,
215
+ <is_array>,
216
+ <is_number>,
217
+ <is_regex>
218
+ */
219
+ var is_bool = function(suspect) {
220
+ return is_typeof(Boolean, suspect);
221
+ };
222
+ }
223
+
224
+ if (is_undefined(is_regex)) {
225
+ /*
226
+ Function: is_regex
227
+ Determines if the suspect is a RegExp. This is a proxy method for is_typeof(RegExp, suspect).
228
+
229
+ Parameters:
230
+ suspect - suspect variable to test
231
+
232
+ Returns:
233
+ bool
234
+
235
+ See Also:
236
+ <is_typeof>,
237
+ <is_numeric>,
238
+ <is_string>,
239
+ <is_array>,
240
+ <is_number>,
241
+ <is_bool>
242
+ */
243
+ var is_regex = function(suspect) {
244
+ return is_typeof(RegExp, suspect);
245
+ };
246
+ }
247
+
248
+
249
+ if (is_undefined(is_empty)) {
250
+ /*
251
+ Function: is_empty
252
+ Determined if the suspect's length is less than one.
253
+
254
+ Parameters:
255
+ suspect - suspect variable to test
256
+
257
+ Returns: bool
258
+ */
259
+ var is_empty = function(suspect) {
260
+ return suspect.length === 0;
261
+ };
262
+ }
263
+
264
+ if (is_undefined(is_not_empty)) {
265
+ /*
266
+ Function: is_not_empty
267
+ Determined if the suspect's length is greater than one.
268
+
269
+ Parameters:
270
+ suspect - suspect variable to test
271
+
272
+ Returns: bool
273
+ */
274
+ var is_not_empty = function(suspect) {
275
+ return suspect.length >= 1;
276
+ };
277
+ }
@@ -0,0 +1,77 @@
1
+ /* File: extend.js */
2
+ //= require "existence"
3
+
4
+ if (is_undefined(Function.prototype['method'])) {
5
+ /*
6
+ Function: method
7
+ Method to add a method to an object (ie. String.method('my_method', my_func); // 'hello'.my_method())
8
+
9
+ Parameters:
10
+ name - name of the method
11
+ func - function definition
12
+
13
+ Returns:
14
+ this (chainable)
15
+
16
+ > String.method('custom_method', function() {
17
+ > // define custom_method
18
+ > });
19
+ >
20
+ > "hello".custom_method();
21
+ */
22
+ Function.prototype.method = function(name, func) {
23
+ if (is_undefined(name)) {
24
+ throw new SyntaxError("Object.method(name, func): name is undefined");
25
+ }
26
+
27
+ if (is_undefined(func)) {
28
+ throw new SyntaxError("Object.method(name, func): func is undefined");
29
+ }
30
+
31
+ if (is_undefined(this.prototype[name])) {
32
+ this.prototype[name] = func;
33
+ return this;
34
+ }
35
+ };
36
+ }
37
+
38
+ if (is_undefined(unless)) {
39
+ /*
40
+ Function: unless
41
+ Function to better express negative conditions (ie. if (!something))
42
+
43
+ Parameters:
44
+ expression - expression to be tested
45
+ callback - function to be executed unless expression is true (see how that works)
46
+ fallback - function to be executed if the expression is false (optional)
47
+
48
+ Returns:
49
+ undefined
50
+
51
+ > unless(test_expression === 'some condition',
52
+ > function() {
53
+ > alert('we do something');
54
+ > },
55
+ > function() {
56
+ > alert('we can do something if it meets the condition too');
57
+ > }
58
+ > );
59
+ */
60
+ var unless = function(expression, callback, fallback) {
61
+ if (is_undefined(expression)) {
62
+ throw new SyntaxError("unless(expression, callback[, fallback]): expression is undefined");
63
+ }
64
+
65
+ if (is_undefined(callback)) {
66
+ throw new SyntaxError("unless(expression, callback[, fallback]): callback is undefined");
67
+ }
68
+
69
+ // This kind of expression is exactly why we NEED unless
70
+ if (!expression) {
71
+ callback.call(this);
72
+ }
73
+ else if (is_defined(fallback)) {
74
+ fallback.call(this);
75
+ }
76
+ };
77
+ }