ninjs 0.14.1 → 0.16.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (191) hide show
  1. data/.bundle/config +2 -2
  2. data/.travis.yml +1 -0
  3. data/Gemfile +1 -0
  4. data/Gemfile.lock +13 -11
  5. data/README.md +108 -93
  6. data/Rakefile +17 -7
  7. data/VERSION +1 -1
  8. data/bin/ninjs +24 -22
  9. data/lib/ninjs/command.rb +32 -21
  10. data/lib/ninjs/configuration.rb +35 -53
  11. data/lib/ninjs/generator.rb +6 -6
  12. data/lib/ninjs/notification.rb +5 -5
  13. data/lib/ninjs/project.rb +31 -25
  14. data/ninjs.gemspec +18 -142
  15. data/repository/ninjs/core/application.js +13 -24
  16. data/repository/ninjs/core/dom.js +87 -68
  17. data/repository/ninjs/core/existence.js +44 -105
  18. data/repository/ninjs/core/extend.js +11 -32
  19. data/repository/ninjs/core/module.js +53 -107
  20. data/repository/ninjs/core/nin.js +5 -7
  21. data/repository/ninjs/tests/extension.test.js +0 -10
  22. data/repository/ninjs/tests/index.html +19 -20
  23. data/repository/ninjs/tests/module.test.js +52 -56
  24. data/repository/ninjs/utilities/array.js +8 -8
  25. data/repository/ninjs/utilities/cookie.js +59 -0
  26. data/repository/ninjs/utilities/css.js +7 -7
  27. data/repository/ninjs/utilities/number.js +2 -2
  28. data/repository/ninjs/utilities/string.js +26 -26
  29. data/spec/cli_spec.rb +90 -88
  30. data/spec/command_spec.rb +104 -137
  31. data/spec/configuration_spec.rb +23 -37
  32. data/spec/fixtures/_global.module.js +9 -0
  33. data/spec/fixtures/compressed.myapp.js +23 -44
  34. data/spec/fixtures/foo.elements.js +1 -1
  35. data/spec/fixtures/foo.js +5 -5
  36. data/spec/fixtures/foo.model.js +1 -1
  37. data/spec/fixtures/foo.module.js +3 -3
  38. data/spec/fixtures/hello.elements.js +1 -1
  39. data/spec/fixtures/hello.js +5 -5
  40. data/spec/fixtures/hello.model.js +1 -1
  41. data/spec/fixtures/hello.module.js +3 -3
  42. data/spec/fixtures/myapp.initial.js +198 -329
  43. data/spec/fixtures/myapp.js +285 -357
  44. data/spec/fixtures/mymodule.alias.module.js +2 -2
  45. data/spec/fixtures/mymodule.dependencies.module.js +2 -2
  46. data/spec/fixtures/mymodule.elements.js +1 -1
  47. data/spec/fixtures/mymodule.model.js +1 -1
  48. data/spec/fixtures/mymodule.module.js +2 -2
  49. data/spec/fixtures/mymodule.module_alias.module.js +10 -0
  50. data/spec/fixtures/new.ninjs.conf +2 -0
  51. data/spec/fixtures/nin.js +198 -329
  52. data/spec/fixtures/ninjs.conf +2 -0
  53. data/spec/fixtures/updated.ninjs.conf +8 -0
  54. data/spec/generator_spec.rb +37 -26
  55. data/spec/ninjs_spec.rb +6 -6
  56. data/spec/project_spec.rb +229 -221
  57. data/spec/spec_helper.rb +3 -1
  58. data/spec/testspec_spec.rb +7 -0
  59. metadata +28 -145
  60. data/repository/json2.js +0 -482
  61. data/repository/modernizr/1.5.js +0 -28
  62. data/repository/modernizr/latest.js +0 -1
  63. data/repository/ninjs/docs/Data/ClassHierarchy.nd +0 -0
  64. data/repository/ninjs/docs/Data/ConfigFileInfo.nd +0 -0
  65. data/repository/ninjs/docs/Data/FileInfo.nd +0 -16
  66. data/repository/ninjs/docs/Data/ImageFileInfo.nd +0 -0
  67. data/repository/ninjs/docs/Data/ImageReferenceTable.nd +0 -0
  68. data/repository/ninjs/docs/Data/IndexInfo.nd +0 -0
  69. data/repository/ninjs/docs/Data/PreviousMenuState.nd +0 -0
  70. data/repository/ninjs/docs/Data/PreviousSettings.nd +0 -0
  71. data/repository/ninjs/docs/Data/SymbolTable.nd +0 -0
  72. data/repository/ninjs/docs/Languages.txt +0 -113
  73. data/repository/ninjs/docs/Menu.txt +0 -63
  74. data/repository/ninjs/docs/Topics.txt +0 -81
  75. data/repository/ninjs/docs/files/core/application-js.html +0 -44
  76. data/repository/ninjs/docs/files/core/existence-js.html +0 -60
  77. data/repository/ninjs/docs/files/core/extend-js.html +0 -55
  78. data/repository/ninjs/docs/files/core/module-js.html +0 -80
  79. data/repository/ninjs/docs/files/core/nin-js.html +0 -38
  80. data/repository/ninjs/docs/index.html +0 -1
  81. data/repository/ninjs/docs/index/Classes.html +0 -33
  82. data/repository/ninjs/docs/index/Files.html +0 -45
  83. data/repository/ninjs/docs/index/Functions.html +0 -65
  84. data/repository/ninjs/docs/index/General.html +0 -85
  85. data/repository/ninjs/docs/index/Variables.html +0 -45
  86. data/repository/ninjs/docs/javascript/main.js +0 -841
  87. data/repository/ninjs/docs/javascript/prettify.js +0 -1526
  88. data/repository/ninjs/docs/javascript/searchdata.js +0 -152
  89. data/repository/ninjs/docs/search/ClassesN.html +0 -20
  90. data/repository/ninjs/docs/search/FilesA.html +0 -20
  91. data/repository/ninjs/docs/search/FilesE.html +0 -20
  92. data/repository/ninjs/docs/search/FilesM.html +0 -20
  93. data/repository/ninjs/docs/search/FilesN.html +0 -20
  94. data/repository/ninjs/docs/search/FunctionsA.html +0 -20
  95. data/repository/ninjs/docs/search/FunctionsC.html +0 -20
  96. data/repository/ninjs/docs/search/FunctionsE.html +0 -20
  97. data/repository/ninjs/docs/search/FunctionsI.html +0 -20
  98. data/repository/ninjs/docs/search/FunctionsM.html +0 -20
  99. data/repository/ninjs/docs/search/FunctionsR.html +0 -20
  100. data/repository/ninjs/docs/search/FunctionsS.html +0 -20
  101. data/repository/ninjs/docs/search/FunctionsSymbols.html +0 -20
  102. data/repository/ninjs/docs/search/FunctionsU.html +0 -20
  103. data/repository/ninjs/docs/search/GeneralA.html +0 -20
  104. data/repository/ninjs/docs/search/GeneralC.html +0 -20
  105. data/repository/ninjs/docs/search/GeneralD.html +0 -20
  106. data/repository/ninjs/docs/search/GeneralE.html +0 -20
  107. data/repository/ninjs/docs/search/GeneralF.html +0 -20
  108. data/repository/ninjs/docs/search/GeneralI.html +0 -20
  109. data/repository/ninjs/docs/search/GeneralM.html +0 -20
  110. data/repository/ninjs/docs/search/GeneralN.html +0 -20
  111. data/repository/ninjs/docs/search/GeneralR.html +0 -20
  112. data/repository/ninjs/docs/search/GeneralS.html +0 -20
  113. data/repository/ninjs/docs/search/GeneralSymbols.html +0 -20
  114. data/repository/ninjs/docs/search/GeneralT.html +0 -20
  115. data/repository/ninjs/docs/search/GeneralU.html +0 -20
  116. data/repository/ninjs/docs/search/GeneralV.html +0 -20
  117. data/repository/ninjs/docs/search/NoResults.html +0 -15
  118. data/repository/ninjs/docs/search/VariablesD.html +0 -20
  119. data/repository/ninjs/docs/search/VariablesN.html +0 -20
  120. data/repository/ninjs/docs/search/VariablesR.html +0 -20
  121. data/repository/ninjs/docs/search/VariablesT.html +0 -20
  122. data/repository/ninjs/docs/styles/main.css +0 -828
  123. data/repository/nullconsole.js +0 -7
  124. data/repository/qunit/assets/css/qunit.css +0 -196
  125. data/repository/qunit/qunit.js +0 -1374
  126. data/repository/selectivizr/1.0.js +0 -5
  127. data/repository/selectivizr/latest.js +0 -1
  128. data/repository/syntaxhighlighter/all.js +0 -11
  129. data/repository/syntaxhighlighter/assets/css/syntaxhighlighter/shCore.css +0 -226
  130. data/repository/syntaxhighlighter/assets/css/syntaxhighlighter/shCoreDefault.css +0 -328
  131. data/repository/syntaxhighlighter/assets/css/syntaxhighlighter/shCoreDjango.css +0 -331
  132. data/repository/syntaxhighlighter/assets/css/syntaxhighlighter/shCoreEclipse.css +0 -339
  133. data/repository/syntaxhighlighter/assets/css/syntaxhighlighter/shCoreEmacs.css +0 -324
  134. data/repository/syntaxhighlighter/assets/css/syntaxhighlighter/shCoreFadeToGrey.css +0 -328
  135. data/repository/syntaxhighlighter/assets/css/syntaxhighlighter/shCoreMDUltra.css +0 -324
  136. data/repository/syntaxhighlighter/assets/css/syntaxhighlighter/shCoreMidnight.css +0 -324
  137. data/repository/syntaxhighlighter/assets/css/syntaxhighlighter/shCoreRDark.css +0 -324
  138. data/repository/syntaxhighlighter/assets/css/syntaxhighlighter/shThemeDefault.css +0 -117
  139. data/repository/syntaxhighlighter/assets/css/syntaxhighlighter/shThemeDjango.css +0 -120
  140. data/repository/syntaxhighlighter/assets/css/syntaxhighlighter/shThemeEclipse.css +0 -128
  141. data/repository/syntaxhighlighter/assets/css/syntaxhighlighter/shThemeEmacs.css +0 -113
  142. data/repository/syntaxhighlighter/assets/css/syntaxhighlighter/shThemeFadeToGrey.css +0 -117
  143. data/repository/syntaxhighlighter/assets/css/syntaxhighlighter/shThemeMDUltra.css +0 -113
  144. data/repository/syntaxhighlighter/assets/css/syntaxhighlighter/shThemeMidnight.css +0 -113
  145. data/repository/syntaxhighlighter/assets/css/syntaxhighlighter/shThemeRDark.css +0 -113
  146. data/repository/syntaxhighlighter/assets/scss/syntaxhighlighter/_shCore.scss +0 -216
  147. data/repository/syntaxhighlighter/assets/scss/syntaxhighlighter/_shCoreDefault.scss +0 -2
  148. data/repository/syntaxhighlighter/assets/scss/syntaxhighlighter/_shCoreDjango.scss +0 -2
  149. data/repository/syntaxhighlighter/assets/scss/syntaxhighlighter/_shCoreEclipse.scss +0 -2
  150. data/repository/syntaxhighlighter/assets/scss/syntaxhighlighter/_shCoreEmacs.scss +0 -2
  151. data/repository/syntaxhighlighter/assets/scss/syntaxhighlighter/_shCoreFadeToGrey.scss +0 -2
  152. data/repository/syntaxhighlighter/assets/scss/syntaxhighlighter/_shCoreMDUltra.scss +0 -2
  153. data/repository/syntaxhighlighter/assets/scss/syntaxhighlighter/_shCoreMidnight.scss +0 -2
  154. data/repository/syntaxhighlighter/assets/scss/syntaxhighlighter/_shCoreRDark.scss +0 -2
  155. data/repository/syntaxhighlighter/assets/scss/syntaxhighlighter/_shThemeDefault.scss +0 -7
  156. data/repository/syntaxhighlighter/assets/scss/syntaxhighlighter/_shThemeDjango.scss +0 -36
  157. data/repository/syntaxhighlighter/assets/scss/syntaxhighlighter/_shThemeEclipse.scss +0 -48
  158. data/repository/syntaxhighlighter/assets/scss/syntaxhighlighter/_shThemeEmacs.scss +0 -32
  159. data/repository/syntaxhighlighter/assets/scss/syntaxhighlighter/_shThemeFadeToGrey.scss +0 -36
  160. data/repository/syntaxhighlighter/assets/scss/syntaxhighlighter/_shThemeMDUltra.scss +0 -32
  161. data/repository/syntaxhighlighter/assets/scss/syntaxhighlighter/_shThemeMidnight.scss +0 -32
  162. data/repository/syntaxhighlighter/assets/scss/syntaxhighlighter/_shThemeRDark.scss +0 -32
  163. data/repository/syntaxhighlighter/assets/scss/syntaxhighlighter/_theme_template.scss +0 -120
  164. data/repository/syntaxhighlighter/shAutoloader.js +0 -17
  165. data/repository/syntaxhighlighter/shBrushAS3.js +0 -59
  166. data/repository/syntaxhighlighter/shBrushAppleScript.js +0 -75
  167. data/repository/syntaxhighlighter/shBrushBash.js +0 -59
  168. data/repository/syntaxhighlighter/shBrushCSharp.js +0 -65
  169. data/repository/syntaxhighlighter/shBrushColdFusion.js +0 -100
  170. data/repository/syntaxhighlighter/shBrushCpp.js +0 -97
  171. data/repository/syntaxhighlighter/shBrushCss.js +0 -91
  172. data/repository/syntaxhighlighter/shBrushDelphi.js +0 -55
  173. data/repository/syntaxhighlighter/shBrushDiff.js +0 -41
  174. data/repository/syntaxhighlighter/shBrushErlang.js +0 -52
  175. data/repository/syntaxhighlighter/shBrushGroovy.js +0 -67
  176. data/repository/syntaxhighlighter/shBrushJScript.js +0 -52
  177. data/repository/syntaxhighlighter/shBrushJava.js +0 -57
  178. data/repository/syntaxhighlighter/shBrushJavaFX.js +0 -58
  179. data/repository/syntaxhighlighter/shBrushPerl.js +0 -72
  180. data/repository/syntaxhighlighter/shBrushPhp.js +0 -88
  181. data/repository/syntaxhighlighter/shBrushPlain.js +0 -33
  182. data/repository/syntaxhighlighter/shBrushPowerShell.js +0 -74
  183. data/repository/syntaxhighlighter/shBrushPython.js +0 -64
  184. data/repository/syntaxhighlighter/shBrushRuby.js +0 -55
  185. data/repository/syntaxhighlighter/shBrushSass.js +0 -94
  186. data/repository/syntaxhighlighter/shBrushScala.js +0 -51
  187. data/repository/syntaxhighlighter/shBrushSql.js +0 -66
  188. data/repository/syntaxhighlighter/shBrushVb.js +0 -56
  189. data/repository/syntaxhighlighter/shBrushXml.js +0 -69
  190. data/repository/syntaxhighlighter/shCore.js +0 -17
  191. data/repository/syntaxhighlighter/shLegacy.js +0 -17
data/spec/command_spec.rb CHANGED
@@ -5,20 +5,20 @@ describe Ninjs::Command do
5
5
  context 'API' do
6
6
  before :each do
7
7
  suppress_output do
8
- @project = Ninjs::Project.new 'myapp'
8
+ @project = Ninjs::Project.new({ name: 'myapp', root: SPEC_DIR })
9
9
  @project.create
10
10
  end
11
11
  end
12
12
 
13
13
  after :each do
14
- FileUtils.rm_rf 'application'
15
- FileUtils.rm_rf 'modules'
16
- FileUtils.rm_rf 'elements'
17
- FileUtils.rm_rf 'models'
18
- FileUtils.rm_rf 'lib'
19
- FileUtils.rm_rf 'plugins'
20
- FileUtils.rm_rf 'tests'
21
- FileUtils.rm_rf 'ninjs.conf'
14
+ FileUtils.rm_rf "#{SPEC_DIR}/application"
15
+ FileUtils.rm_rf "#{SPEC_DIR}/modules"
16
+ FileUtils.rm_rf "#{SPEC_DIR}/elements"
17
+ FileUtils.rm_rf "#{SPEC_DIR}/models"
18
+ FileUtils.rm_rf "#{SPEC_DIR}/lib"
19
+ FileUtils.rm_rf "#{SPEC_DIR}/plugins"
20
+ FileUtils.rm_rf "#{SPEC_DIR}/tests"
21
+ FileUtils.rm_rf "#{SPEC_DIR}/ninjs.conf"
22
22
  end
23
23
 
24
24
  it 'should have a watch command' do
@@ -44,190 +44,157 @@ describe Ninjs::Command do
44
44
 
45
45
  context 'Usage' do
46
46
  after :each do
47
- FileUtils.rm_rf 'application'
48
- FileUtils.rm_rf 'modules'
49
- FileUtils.rm_rf 'elements'
50
- FileUtils.rm_rf 'models'
51
- FileUtils.rm_rf 'lib'
52
- FileUtils.rm_rf 'plugins'
53
- FileUtils.rm_rf 'tests'
54
- FileUtils.rm_rf 'ninjs.conf'
55
- FileUtils.rm_rf 'js' if File.exists? 'js'
47
+ FileUtils.rm_rf "#{SPEC_DIR}/application"
48
+ FileUtils.rm_rf "#{SPEC_DIR}/modules"
49
+ FileUtils.rm_rf "#{SPEC_DIR}/elements"
50
+ FileUtils.rm_rf "#{SPEC_DIR}/models"
51
+ FileUtils.rm_rf "#{SPEC_DIR}/lib"
52
+ FileUtils.rm_rf "#{SPEC_DIR}/plugins"
53
+ FileUtils.rm_rf "#{SPEC_DIR}/tests"
54
+ FileUtils.rm_rf "#{SPEC_DIR}/ninjs.conf"
55
+ FileUtils.rm_rf "#{SPEC_DIR}/js" if File.exists? "#{SPEC_DIR}/js"
56
56
  end
57
57
 
58
58
  it 'should create a new application' do
59
- suppress_output { Ninjs::Command.create({ :name => 'myapp' }) }
59
+ suppress_output { Ninjs::Command.create({ name: 'myapp', root: SPEC_DIR }) }
60
60
 
61
- 'ninjs.conf'.should be_same_file_as 'fixtures/ninjs.conf'
61
+ "#{SPEC_DIR}/ninjs.conf".should be_same_file_as "#{SPEC_DIR}/fixtures/ninjs.conf"
62
62
 
63
- File.directory?("application").should be_true
64
- File.directory?("elements").should be_true
65
- File.directory?("lib").should be_true
66
- File.directory?("models").should be_true
67
- File.directory?("modules").should be_true
68
- File.directory?("plugins").should be_true
69
- File.directory?("tests").should be_true
63
+ File.directory?("#{SPEC_DIR}/application").should be_true
64
+ File.directory?("#{SPEC_DIR}/elements").should be_true
65
+ File.directory?("#{SPEC_DIR}/lib").should be_true
66
+ File.directory?("#{SPEC_DIR}/models").should be_true
67
+ File.directory?("#{SPEC_DIR}/modules").should be_true
68
+ File.directory?("#{SPEC_DIR}/plugins").should be_true
69
+ File.directory?("#{SPEC_DIR}/tests").should be_true
70
70
 
71
- File.exists?(File.expand_path("lib/nin.js")).should be_true
72
- File.exists?(File.expand_path("lib/utilities.js")).should be_true
71
+ File.exists?("#{SPEC_DIR}/lib/nin.js").should be_true
72
+ File.exists?("#{SPEC_DIR}/lib/utilities.js").should be_true
73
73
 
74
- File.exists?(File.expand_path("application/myapp.js")).should be_true
75
- application_file_content = File.open("application/myapp.js").readlines
74
+ File.exists?("#{SPEC_DIR}/application/myapp.js").should be_true
75
+ application_file_content = File.open("#{SPEC_DIR}/application/myapp.js").readlines
76
76
  application_file_content.shift
77
- application_file_content.join('').should == File.open('fixtures/myapp.initial.js').readlines.join('')
77
+ application_file_content.join('').should == File.open("#{SPEC_DIR}/fixtures/myapp.initial.js").readlines.join('')
78
78
 
79
- File.exists?(File.expand_path("tests")).should be_true
80
- File.exists?(File.expand_path("tests/index.html")).should be_true
81
- File.exists?(File.expand_path("tests/application.test.js")).should be_true
82
- File.exists?(File.expand_path("tests/array.utilities.test.js")).should be_true
83
- File.exists?(File.expand_path("tests/existence.test.js")).should be_true
84
- File.exists?(File.expand_path("tests/extension.test.js")).should be_true
85
- File.exists?(File.expand_path("tests/module.test.js")).should be_true
86
- File.exists?(File.expand_path("tests/qspec.js")).should be_true
87
- File.exists?(File.expand_path("tests/string.utilities.test.js")).should be_true
79
+ File.exists?("#{SPEC_DIR}/tests").should be_true
80
+ File.exists?("#{SPEC_DIR}/tests/index.html").should be_true
81
+ File.exists?("#{SPEC_DIR}/tests/application.test.js").should be_true
82
+ File.exists?("#{SPEC_DIR}/tests/array.utilities.test.js").should be_true
83
+ File.exists?("#{SPEC_DIR}/tests/existence.test.js").should be_true
84
+ File.exists?("#{SPEC_DIR}/tests/extension.test.js").should be_true
85
+ File.exists?("#{SPEC_DIR}/tests/module.test.js").should be_true
86
+ File.exists?("#{SPEC_DIR}/tests/qspec.js").should be_true
87
+ File.exists?("#{SPEC_DIR}/tests/string.utilities.test.js").should be_true
88
88
  end
89
89
 
90
- it 'should create a new application in a subdirectory' do
91
- suppress_output { Ninjs::Command.create({ :name => 'myapp', :directory => 'js' }) }
92
-
93
- 'js/ninjs.conf'.should be_same_file_as 'fixtures/ninjs.conf'
94
-
95
- File.directory?("js/application").should be_true
96
- File.directory?("js/elements").should be_true
97
- File.directory?("js/lib").should be_true
98
- File.directory?("js/models").should be_true
99
- File.directory?("js/modules").should be_true
100
- File.directory?("js/plugins").should be_true
101
- File.directory?("js/tests").should be_true
102
-
103
- File.exists?(File.expand_path("js/lib/nin.js")).should be_true
104
- File.exists?(File.expand_path("js/lib/utilities.js")).should be_true
105
-
106
- File.exists?(File.expand_path("js/application/myapp.js")).should be_true
107
- application_file_content = File.open("js/application/myapp.js").readlines
108
- application_file_content.shift
109
- application_file_content.join('').should == File.open('fixtures/myapp.initial.js').readlines.join('')
110
-
111
- File.exists?(File.expand_path("js/tests")).should be_true
112
- File.exists?(File.expand_path("js/tests/index.html")).should be_true
113
- File.exists?(File.expand_path("js/tests/application.test.js")).should be_true
114
- File.exists?(File.expand_path("js/tests/array.utilities.test.js")).should be_true
115
- File.exists?(File.expand_path("js/tests/existence.test.js")).should be_true
116
- File.exists?(File.expand_path("js/tests/extension.test.js")).should be_true
117
- File.exists?(File.expand_path("js/tests/module.test.js")).should be_true
118
- File.exists?(File.expand_path("js/tests/qspec.js")).should be_true
119
- File.exists?(File.expand_path("js/tests/string.utilities.test.js")).should be_true
120
- end
121
-
122
90
  it 'should compile the application' do
123
- suppress_output { Ninjs::Command.create({ :name => 'myapp' }) }
124
-
125
- FileUtils.cp 'fixtures/hello.module.js', File.expand_path('modules')
126
- FileUtils.cp 'fixtures/hello.elements.js', File.expand_path('elements')
127
- FileUtils.cp 'fixtures/hello.model.js', File.expand_path('models')
128
- FileUtils.cp 'fixtures/foo.module.js', File.expand_path('modules')
129
- FileUtils.cp 'fixtures/foo.elements.js', File.expand_path('elements')
130
- FileUtils.cp 'fixtures/foo.model.js', File.expand_path('models')
91
+ suppress_output { Ninjs::Command.create({ name: 'myapp', root: SPEC_DIR }) }
131
92
 
132
- suppress_output { Ninjs::Command.compile }
133
-
134
- File.exists?('application/hello.js').should be_true
135
- File.exists?('application/foo.js').should be_true
93
+ FileUtils.cp "#{SPEC_DIR}/fixtures/hello.module.js", "#{SPEC_DIR}/modules"
94
+ FileUtils.cp "#{SPEC_DIR}/fixtures/hello.elements.js", "#{SPEC_DIR}/elements"
95
+ FileUtils.cp "#{SPEC_DIR}/fixtures/hello.model.js", "#{SPEC_DIR}/models"
96
+ FileUtils.cp "#{SPEC_DIR}/fixtures/foo.module.js", "#{SPEC_DIR}/modules"
97
+ FileUtils.cp "#{SPEC_DIR}/fixtures/foo.elements.js", "#{SPEC_DIR}/elements"
98
+ FileUtils.cp "#{SPEC_DIR}/fixtures/foo.model.js", "#{SPEC_DIR}/models"
99
+
100
+ suppress_output { Ninjs::Command.compile({ path: SPEC_DIR }) }
101
+
102
+ File.exists?("#{SPEC_DIR}/application/hello.js").should be_true
103
+ File.exists?("#{SPEC_DIR}/application/foo.js").should be_true
136
104
  end
137
-
105
+
138
106
  it 'should update the application' do
139
- suppress_output { Ninjs::Command.create({ :name => 'myapp' }) }
140
-
141
- File.open('lib/nin.js', 'w+') do |file|
107
+ suppress_output { Ninjs::Command.create({ name: 'myapp', root: SPEC_DIR }) }
108
+
109
+ File.open("#{SPEC_DIR}/lib/nin.js", 'w+') do |file|
142
110
  file << 'changed'
143
111
  end
144
-
145
- suppress_output { Ninjs::Command.update }
146
-
147
- 'lib/nin.js'.should be_same_file_as 'fixtures/nin.js'
112
+
113
+ suppress_output { Ninjs::Command.update(SPEC_DIR) }
114
+
115
+ "#{SPEC_DIR}/lib/nin.js".should be_same_file_as "#{SPEC_DIR}/fixtures/nin.js"
148
116
  end
149
117
 
150
118
  it 'should generate a module file' do
151
119
  suppress_output do
152
- Ninjs::Command.create({ :name => 'myapp' })
120
+ Ninjs::Command.create({ name: 'myapp', root: SPEC_DIR })
153
121
  Ninjs::Command.generate({
154
- :project => Ninjs::Project.new,
155
- :type => 'module',
156
- :name => 'mymodule',
157
- :alias => nil,
158
- :dest => nil,
159
- :dependencies => nil
122
+ project: Ninjs::Project.new({ root: SPEC_DIR }),
123
+ type: 'module',
124
+ name: 'mymodule',
125
+ alias: nil,
126
+ dest: nil,
127
+ dependencies: nil
160
128
  })
161
129
  end
162
130
 
163
- 'modules/mymodule.module.js'.should be_same_file_as 'fixtures/mymodule.module.js'
131
+ "#{SPEC_DIR}/modules/mymodule.module.js".should be_same_file_as "#{SPEC_DIR}/fixtures/mymodule.module.js"
164
132
  end
165
133
 
166
134
  it 'should generate a module file with an alias' do
167
135
  suppress_output do
168
- Ninjs::Command.create({ :name => 'myapp' })
136
+ Ninjs::Command.create({ name: 'myapp', root: SPEC_DIR })
169
137
  Ninjs::Command.generate({
170
- :project => Ninjs::Project.new,
171
- :type => 'module',
172
- :name => 'mymodule',
173
- :alias => 'app',
174
- :dest => nil,
175
- :dependencies => nil
138
+ project: Ninjs::Project.new({ root: SPEC_DIR }),
139
+ type: 'module',
140
+ name: 'mymodule',
141
+ alias: 'app',
142
+ dest: nil,
143
+ dependencies: nil
176
144
  })
177
145
  end
178
146
 
179
- 'modules/mymodule.module.js'.should be_same_file_as 'fixtures/mymodule.alias.module.js'
147
+ "#{SPEC_DIR}/modules/mymodule.module.js".should be_same_file_as "#{SPEC_DIR}/fixtures/mymodule.alias.module.js"
180
148
  end
181
149
 
182
150
  it 'should generate an elements file' do
183
151
  suppress_output do
184
- Ninjs::Command.create({ :name => 'myapp' })
152
+ Ninjs::Command.create({ name: 'myapp', root: SPEC_DIR })
185
153
  Ninjs::Command.generate({
186
- :project => Ninjs::Project.new,
187
- :type => 'elements',
188
- :name => 'mymodule',
189
- :alias => nil,
190
- :dest => nil,
191
- :dependencies => nil
154
+ project: Ninjs::Project.new({ root: SPEC_DIR }),
155
+ type: 'elements',
156
+ name: 'mymodule',
157
+ alias: nil,
158
+ dest: nil,
159
+ dependencies: nil
192
160
  })
193
161
  end
194
162
 
195
- 'elements/mymodule.elements.js'.should be_same_file_as 'fixtures/mymodule.elements.js'
163
+ "#{SPEC_DIR}/elements/mymodule.elements.js".should be_same_file_as "#{SPEC_DIR}/fixtures/mymodule.elements.js"
196
164
  end
197
165
 
198
166
  it 'should generate a model file' do
199
167
  suppress_output do
200
- Ninjs::Command.create({ :name => 'myapp' })
168
+ Ninjs::Command.create({ name: 'myapp', root: SPEC_DIR })
201
169
  Ninjs::Command.generate({
202
- :project => Ninjs::Project.new,
203
- :type => 'model',
204
- :name => 'mymodule',
205
- :alias => nil,
206
- :dest => nil,
207
- :dependencies => nil
170
+ project: Ninjs::Project.new({ root: SPEC_DIR }),
171
+ type: 'model',
172
+ name: 'mymodule',
173
+ alias: nil,
174
+ dest: nil,
175
+ dependencies: nil
208
176
  })
209
177
  end
210
178
 
211
- 'models/mymodule.model.js'.should be_same_file_as 'fixtures/mymodule.model.js'
179
+ "#{SPEC_DIR}/models/mymodule.model.js".should be_same_file_as "#{SPEC_DIR}/fixtures/mymodule.model.js"
212
180
  end
213
181
 
214
182
  it 'should generate a module file with dependencies' do
215
183
  suppress_output do
216
- Ninjs::Command.create({ :name => 'myapp' })
184
+ Ninjs::Command.create({ name: 'myapp', root: SPEC_DIR })
217
185
  Ninjs::Command.generate({
218
- :project => Ninjs::Project.new,
219
- :type => 'module',
220
- :name => 'mymodule',
221
- :alias => nil,
222
- :dest => nil,
223
- :dependencies => { :elements => true, :model => true }
186
+ project: Ninjs::Project.new({ root: SPEC_DIR }),
187
+ type: 'module',
188
+ name: 'mymodule',
189
+ alias: nil,
190
+ dest: nil,
191
+ dependencies: { elements: true, model: true }
224
192
  })
225
193
  end
226
194
 
227
- 'modules/mymodule.module.js'.should be_same_file_as 'fixtures/mymodule.dependencies.module.js'
228
- 'elements/mymodule.elements.js'.should be_same_file_as 'fixtures/mymodule.elements.js'
229
- 'models/mymodule.model.js'.should be_same_file_as 'fixtures/mymodule.model.js'
195
+ "#{SPEC_DIR}/modules/mymodule.module.js".should be_same_file_as "#{SPEC_DIR}/fixtures/mymodule.dependencies.module.js"
196
+ "#{SPEC_DIR}/elements/mymodule.elements.js".should be_same_file_as "#{SPEC_DIR}/fixtures/mymodule.elements.js"
197
+ "#{SPEC_DIR}/models/mymodule.model.js".should be_same_file_as "#{SPEC_DIR}/fixtures/mymodule.model.js"
230
198
  end
231
- end
232
- # Usage
199
+ end # Usage
233
200
  end
@@ -3,7 +3,7 @@ require "spec_helper"
3
3
  describe Ninjs::Configuration do
4
4
  context 'Instantiation' do
5
5
  before :each do
6
- suppress_output { @config = Ninjs::Configuration.new File.expand_path(Dir.getwd) }
6
+ suppress_output { @config = Ninjs::Configuration.new SPEC_DIR }
7
7
  end
8
8
 
9
9
  it 'should exist' do
@@ -11,60 +11,46 @@ describe Ninjs::Configuration do
11
11
  end
12
12
 
13
13
  it 'should have a root variable' do
14
- @config.root.should == File.expand_path(Dir.getwd)
14
+ @config.root.should == SPEC_DIR
15
15
  end
16
16
 
17
- it 'should have a setting setter method' do
18
- @config.setting(:name, 'someapp')
19
- @config.name.should == 'someapp'
20
- end
21
-
22
- it 'should have a settings hash' do
23
- @config.settings.has_key?(:name).should be_true
24
- @config.settings[:name].should == 'application'
25
-
26
- @config.settings.has_key?(:src_dir).should be_true
27
- @config.settings[:src_dir].should == 'modules'
28
-
29
- @config.settings.has_key?(:dest_dir).should be_true
30
- @config.settings[:dest_dir].should == 'application'
31
-
32
- @config.settings.has_key?(:output).should be_true
33
- @config.settings[:output].should == 'expanded'
34
-
35
- @config.settings.has_key?(:dependencies).should be_true
36
- @config.settings[:dependencies].should == ['<jquery/latest>']
37
-
38
- @config.settings.has_key?(:autoload).should be_true
39
- @config.settings[:autoload].should == ['../lib/utilities']
40
- end
41
-
42
17
  it 'should have the correct default instance variables' do
43
- @config.root.should == File.expand_path(Dir.getwd)
18
+ @config.root.should == SPEC_DIR
44
19
  @config.name.should == 'application'
45
20
  @config.output.should == "expanded"
46
- @config.asset_root.should == @config.root
21
+ @config.asset_root.should == File.expand_path('../', SPEC_DIR)
47
22
  @config.dependencies.should == ["<jquery/latest>"]
48
23
  @config.autoload.should == ["../lib/utilities"]
49
24
  @config.src_dir.should == "modules"
50
25
  @config.dest_dir.should == "application"
26
+ @config.module_alias.should == "mod"
51
27
  end
52
- end
53
-
28
+ end # Instantiation
29
+
54
30
  context "New config" do
55
31
  before :each do
56
32
  suppress_output do
57
- @config = Ninjs::Configuration.new File.expand_path(Dir.getwd)
33
+ @config = Ninjs::Configuration.new SPEC_DIR
58
34
  @config.write
59
35
  end
60
36
  end
61
-
37
+
62
38
  after :each do
63
- File.delete 'ninjs.conf'
39
+ File.delete "#{SPEC_DIR}/ninjs.conf"
64
40
  end
65
-
41
+
66
42
  it 'should create a configuration file from defaults' do
67
- 'ninjs.conf'.should be_same_file_as 'fixtures/new.ninjs.conf'
43
+ "#{SPEC_DIR}/ninjs.conf".should be_same_file_as "#{SPEC_DIR}/fixtures/new.ninjs.conf"
68
44
  end
69
- end
45
+
46
+ it 'should read properties to config' do
47
+ File.open("#{SPEC_DIR}/ninjs.conf", "w+") do |file|
48
+ file << File.open("#{SPEC_DIR}/fixtures/updated.ninjs.conf").readlines.join("")
49
+ end
50
+
51
+ @config.read
52
+ @config.asset_root.should == File.expand_path(SPEC_DIR)
53
+ end
54
+ end # New config
55
+
70
56
  end
@@ -0,0 +1,9 @@
1
+ (function(app) {
2
+ var mod = app.add_module('global');
3
+
4
+ mod.actions = function() {
5
+
6
+ };
7
+
8
+ mod.run();
9
+ })(myapp);
@@ -1,59 +1,38 @@
1
1
 
2
- (function(){if(window.is_defined===undefined){window.is_defined=function(suspect){return((suspect===undefined)||(suspect===null))?false:true;};}
3
- if(!is_defined(window.is_undefined)){window.is_undefined=function(suspect){return(suspect===undefined)?true:false;};}
4
- if(is_undefined(window.is_typeof)){window.is_typeof=function(type,suspect){if(is_undefined(type)){throw new SyntaxError("is_typeof(Type, suspect): type is undefined");}
2
+ is_defined=function(suspect){return((suspect===undefined)||(suspect===null))?false:true;};is_undefined=function(suspect){return(suspect===undefined)?true:false;};is_typeof=function(type,suspect){if(is_undefined(type)){throw new SyntaxError("is_typeof(Type, suspect): type is undefined");}
5
3
  if(is_undefined(suspect)){throw new SyntaxError("is_typeof(Type, suspect): suspect is undefined");}
6
- return(suspect.constructor==type)?true:false;};}
7
- if(is_undefined(window.is_numeric)){window.is_numeric=function(suspect){if(is_typeof(Number,suspect)){return true;}
8
- else{var pattern=/^-?\d+(?:\.\d*)?(?:e[+\-]?\d+)?$/i;return pattern.test(suspect);}};}
9
- if(is_undefined(window.is_string)){window.is_string=function(suspect){return is_typeof(String,suspect);};}
10
- if(is_undefined(window.is_array)){window.is_array=function(suspect){return is_typeof(Array,suspect);};}
11
- if(is_undefined(window.is_number)){window.is_number=function(suspect){return is_typeof(Number,suspect);};}
12
- if(is_undefined(window.is_date)){window.is_date=function(suspect){return is_typeof(Date,suspect);};}
13
- if(is_undefined(window.is_bool)){window.is_bool=function(suspect){return is_typeof(Boolean,suspect);};}
14
- if(is_undefined(window.is_regex)){window.is_regex=function(suspect){return is_typeof(RegExp,suspect);};}
15
- if(is_undefined(window.is_empty)){window.is_empty=function(suspect){return suspect.length===0;};}
16
- if(is_undefined(window.is_not_empty)){window.is_not_empty=function(suspect){return suspect.length>=1;};}
17
- if(is_undefined(Function.prototype['method'])){Function.prototype.method=function(name,func){if(is_undefined(name)){throw new SyntaxError("Object.method(name, func): name is undefined");}
18
- if(is_undefined(func)){throw new SyntaxError("Object.method(name, func): func is undefined");}
19
- if(is_undefined(this.prototype[name])){this.prototype[name]=func;return this;}};}
20
- if(is_undefined(window.unless)){window.unless=function(expression,callback,fallback){if(is_undefined(expression)){throw new SyntaxError("unless(expression, callback[, fallback]): expression is undefined");}
21
- if(is_undefined(callback)){throw new SyntaxError("unless(expression, callback[, fallback]): callback is undefined");}
22
- if(!expression){callback.call(this);}
23
- else if(is_defined(fallback)){fallback.call(this);}};}
24
- if(is_undefined(Function.prototype['method'])){Function.prototype.method=function(name,func){if(is_undefined(name)){throw new SyntaxError("Object.method(name, func): name is undefined");}
25
- if(is_undefined(func)){throw new SyntaxError("Object.method(name, func): func is undefined");}
26
- if(is_undefined(this.prototype[name])){this.prototype[name]=func;return this;}};}
27
- if(is_undefined(window.unless)){window.unless=function(expression,callback,fallback){if(is_undefined(expression)){throw new SyntaxError("unless(expression, callback[, fallback]): expression is undefined");}
28
- if(is_undefined(callback)){throw new SyntaxError("unless(expression, callback[, fallback]): callback is undefined");}
29
- if(!expression){callback.call(this);}
30
- else if(is_defined(fallback)){fallback.call(this);}};}
31
- var userAgent=navigator.userAgent;var browser={agent:userAgent,mozilla:(/mozilla/.test(userAgent.toLowerCase()))&&(!/(compatible|webkit)/.test(userAgent.toLowerCase())),webkit:/webkit/.test(userAgent.toLowerCase()),firefox:/firefox/.test(userAgent.toLowerCase()),chrome:/webkit/.test(userAgent.toLowerCase()),safari:/safari/.test(userAgent.toLowerCase()),opera:/opera/.test(userAgent.toLowerCase()),msie:(/msie/.test(userAgent.toLowerCase()))&&(!/opera/.test(userAgent.toLowerCase()))};var readyBound=false;var isReady=false;var readyList=[];function domReady(){if(!isReady){isReady=true;if(readyList){for(var fn=0;fn<readyList.length;fn++){readyList[fn].call(window,[]);}
4
+ return(suspect.constructor==type)?true:false;};is_numeric=function(suspect){if(is_typeof(Number,suspect)){return true;}
5
+ else{var pattern=/^-?\d+(?:\.\d*)?(?:e[+\-]?\d+)?$/i;return pattern.test(suspect);}};is_string=function(suspect){return is_typeof(String,suspect);};is_array=function(suspect){return is_typeof(Array,suspect);};is_number=function(suspect){return is_typeof(Number,suspect);};is_date=function(suspect){return is_typeof(Date,suspect);};is_bool=function(suspect){return is_typeof(Boolean,suspect);};is_regex=function(suspect){return is_typeof(RegExp,suspect);};is_empty=function(suspect){return suspect.length===0;};is_not_empty=function(suspect){return suspect.length>=1;};unless=function(expression,callback,fallback){if(is_undefined(callback)){throw new SyntaxError("unless(expression, callback[, fallback]): callback is undefined");}
6
+ if(!!!expression){callback.call(this);}
7
+ else{if(is_defined(fallback)){fallback.call(this);}}};var dom=(function(){var userAgent=navigator.userAgent;var browser={agent:userAgent,mozilla:(/mozilla/.test(userAgent.toLowerCase()))&&!(/(compatible|webkit)/.test(userAgent.toLowerCase())),webkit:/webkit/.test(userAgent.toLowerCase()),firefox:/firefox/.test(userAgent.toLowerCase()),chrome:/webkit/.test(userAgent.toLowerCase()),safari:/safari/.test(userAgent.toLowerCase()),opera:/opera/.test(userAgent.toLowerCase()),msie:(/msie/.test(userAgent.toLowerCase()))&&!(/opera/.test(userAgent.toLowerCase()))};var readyBound=false;var isReady=false;var readyList=[];function domReady(){if(!isReady){isReady=true;if(readyList){for(var fn=0;fn<readyList.length;fn++){readyList[fn].call(window,[]);}
32
8
  readyList=[];}}}
33
- function addLoadEvent(func){var oldonload=window.onload;if(typeof window.onload!='function'){window.onload=func;}else{window.onload=function(){if(oldonload){oldonload();}
34
- func();}}};function bindReady(){if(readyBound){return;}
9
+ function addLoadEvent(func){var oldonload=window.onload;if(typeof window.onload!='function'){window.onload=func;}
10
+ else{window.onload=function(){if(oldonload){oldonload();}
11
+ func();};}}
12
+ function bindReady(){if(readyBound){return;}
35
13
  readyBound=true;if(document.addEventListener&&!browser.opera){document.addEventListener("DOMContentLoaded",domReady,false);}
36
- if(browser.msie&&window==top)(function(){if(isReady)return;try{document.documentElement.doScroll("left");}catch(error){setTimeout(arguments.callee,0);return;}
37
- domReady();})();if(browser.opera){document.addEventListener("DOMContentLoaded",function(){if(isReady)return;for(var i=0;i<document.styleSheets.length;i++)
38
- if(document.styleSheets[i].disabled){setTimeout(arguments.callee,0);return;}
39
- domReady();},false);}
40
- if(browser.safari){var numStyles;(function(){if(isReady)return;if(document.readyState!="loaded"&&document.readyState!="complete"){setTimeout(arguments.callee,0);return;}
14
+ if(browser.msie&&window==top){(function(){if(isReady){return;}
15
+ try{document.documentElement.doScroll("left");}catch(error){setTimeout(arguments.callee,0);return;}
16
+ domReady();})();}
17
+ if(browser.opera){document.addEventListener("DOMContentLoaded",function(){if(isReady){return;}
18
+ for(var i=0;i<document.styleSheets.length;i++){if(document.styleSheets[i].disabled){setTimeout(arguments.callee,0);return;}
19
+ domReady();}},false);}
20
+ if(browser.safari){var numStyles;(function(){if(isReady){return;}
21
+ if(document.readyState!="loaded"&&document.readyState!="complete"){setTimeout(arguments.callee,0);return;}
41
22
  if(numStyles===undefined){var links=document.getElementsByTagName("link");for(var i=0;i<links.length;i++){if(links[i].getAttribute('rel')=='stylesheet'){numStyles++;}}
42
23
  var styles=document.getElementsByTagName("style");numStyles+=styles.length;}
43
24
  if(document.styleSheets.length!=numStyles){setTimeout(arguments.callee,0);return;}
44
25
  domReady();})();}
45
- addLoadEvent(domReady);};window.NinjsDOM=function(){this.cached_selectors={};};NinjsDOM.method('ready',function(fn,args){bindReady();if(isReady){fn.call(window,[]);}
46
- else{readyList.push(function(){return fn.call(window,[]);});}});bindReady();window.NinjsModule=function(name){this.dom=new NinjsDOM(this);this.browser=browser;this.data={};this.name=name;this.run_tests=false;this.tests=[];};NinjsModule.method('actions',function(){});NinjsModule.method('run',function(){var mod=this;this.dom.ready(function(){mod.execute();});});NinjsModule.method('execute',function(){if(this.run_tests){this._run_tests();}
47
- this.actions();});NinjsModule.method('elements',function(elements){if(is_undefined(elements)){if(is_typeof(Object,elements)){throw new SyntaxError("NinjsModule.elements(elements): elements is undefined");}
26
+ addLoadEvent(domReady);}
27
+ return{bind:bindReady,is_ready:isReady,ready_list:readyList};})();NinjsDOM=function(){this.cached_selectors={};};NinjsDOM.prototype.ready=function(fn,args){dom.bind();if(dom.is_ready()){fn.call(window,args||[]);}
28
+ else{dom.ready_list.push(function(){return fn.call(window,args||[]);});}};dom.bind();NinjsModule=function(name){this.dom=new NinjsDOM(this);this.data={};this.name=name;};NinjsModule.prototype.actions=function(){};NinjsModule.prototype.run=function(){var mod=this;this.dom.ready(function(){mod.execute();});};NinjsModule.prototype.execute=function(){this.actions();};NinjsModule.prototype.elements=function(elements){if(is_undefined(elements)){if(is_typeof(Object,elements)){throw new SyntaxError("NinjsModule.elements(elements): elements is undefined");}
48
29
  else if(is_string(elements)){throw new SyntaxError("NinjsModule.elements(name): name is undefined");}}
49
30
  if(is_string(elements)){var name=elements;return this.dom.cached_selectors[name];}
50
- else{var dom=this.dom;dom.ready(function(){for(var key in elements){if(elements.hasOwnProperty(key)){dom.cached_selectors[key]=elements[key];}}});}});NinjsModule.method('set_data',function(key,value){if(is_undefined(key)){throw new SyntaxError('NinjsModule.set_data(key, value): key is undefined');}
31
+ else{var dom=this.dom;dom.ready(function(){for(var key in elements){if(elements.hasOwnProperty(key)){dom.cached_selectors[key]=elements[key];}}});}};NinjsModule.prototype.set_data=function(key,value){if(is_undefined(key)){throw new SyntaxError('NinjsModule.set_data(key, value): key is undefined');}
51
32
  if(is_typeof(String,key)&&is_undefined(value)){throw new SyntaxError('NinjsModule.set_data(key, value): value is undefined');}
52
33
  if(is_typeof(String,key)){this.data[key]=value;}
53
34
  else if(is_typeof(Object,key)){var data=key;for(var property in data){this.data[property]=data[property];}}
54
- return this;});NinjsModule.method('add_test',function(test_file){this.tests.push(test_file);});NinjsModule.method('_run_tests',function(){var test_template=[];test_template.push('<div class="test-results" title="Test Results">');test_template.push('<h1 id="qunit-header">'+this.name+' module tests</h1>');test_template.push('<h2 id="qunit-banner"></h2>');test_template.push('<h2 id="qunit-userAgent"></h2>');test_template.push('<ol id="qunit-tests"></ol>');test_template.push('</div>');var qunit_dependencies='<script src="'+_.tests_path+'qunit/qunit.js"></script>';$.getScript(_.tests_path+'qunit/qunit.js');var qunit_styles='<link rel="stylesheet" href="'+_.tests_path+'qunit/qunit.css">';$('body').append(qunit_styles);$('body').append(test_template.join("\n"));this.tests.each(function(test){$.getScript(_.tests_path+test+'.test.js',function(){var test_results_dialog=$('.test-results');var height=$(window).height()-200;var width=$(window).width()-300;try{test_results_dialog.dialog({width:width,height:height,autoOpen:false,buttons:{"Thanks buddy":function(){test_results_dialog.dialog('close');}}});var failed=$('.failed');console.log(failed.html());test_results_dialog.dialog('open');}
55
- catch(error){alert("Test harness requires jQueryUI");}});});});window.NinjsApplication=function(base_url,tests_path){if(is_defined(tests_path)){this.tests_path=tests_path;}
56
- if(is_defined(base_url)){this.site_url=function(path){var path=path||'';return base_url+path;};}};NinjsApplication.method('add_module',function(name){if(is_undefined(name)){throw new SyntaxError("NinjsApplication.add_module(name): name is undefined");}
35
+ return this;};NinjsApplication=function(){};NinjsApplication.prototype.add_module=function(name){if(is_undefined(name)){throw new SyntaxError("NinjsApplication.add_module(name): name is undefined");}
57
36
  if(is_defined(this[name])){throw new SyntaxError("NinjsApplication.add_module(name): '"+name+"' already declared");}
58
37
  if(this.name===name){throw new SyntaxError("NinjsApplication.add_module(name): a module cannot have the same name as the application");}
59
- return this[name]=new NinjsModule(name);});})();var myapp=new NinjsApplication();
38
+ return this[name]=new NinjsModule(name);};var myapp=new NinjsApplication();