xultestrunner 0.2.8

Sign up to get free protection for your applications and to get access to all the features.
Files changed (153) hide show
  1. data/.gitignore +2 -0
  2. data/.gitmodules +3 -0
  3. data/LICENSE +21 -0
  4. data/README +17 -0
  5. data/Rakefile +50 -0
  6. data/VERSION +1 -0
  7. data/bin/xultest +13 -0
  8. data/lib/xultestrunner.rb +1 -0
  9. data/xulapp/application.ini +9 -0
  10. data/xulapp/chrome/chrome.manifest +2 -0
  11. data/xulapp/chrome/content/interface/boot.xul +20 -0
  12. data/xulapp/chrome/content/interface/testharness.html +30 -0
  13. data/xulapp/chrome/content/lib/xultestcase.js +140 -0
  14. data/xulapp/chrome/content/lib/xultestrunner.js +120 -0
  15. data/xulapp/chrome/content/vendor/prototype/LICENSE +16 -0
  16. data/xulapp/chrome/content/vendor/prototype/prototype.js +4874 -0
  17. data/xulapp/chrome/content/vendor/scriptaculous/LICENSE +20 -0
  18. data/xulapp/chrome/content/vendor/scriptaculous/test.css +90 -0
  19. data/xulapp/chrome/content/vendor/scriptaculous/unittest.js +566 -0
  20. data/xulapp/chrome/content/vendor/xpcomcore/LICENSE +21 -0
  21. data/xulapp/chrome/content/vendor/xpcomcore/README +27 -0
  22. data/xulapp/chrome/content/vendor/xpcomcore/Rakefile +83 -0
  23. data/xulapp/chrome/content/vendor/xpcomcore/VERSION.yml +5 -0
  24. data/xulapp/chrome/content/vendor/xpcomcore/bootstrapper.js +32 -0
  25. data/xulapp/chrome/content/vendor/xpcomcore/components/XPCOMCore.js +120 -0
  26. data/xulapp/chrome/content/vendor/xpcomcore/doc/files.html +241 -0
  27. data/xulapp/chrome/content/vendor/xpcomcore/doc/index.html +243 -0
  28. data/xulapp/chrome/content/vendor/xpcomcore/doc/symbols/Error.html +256 -0
  29. data/xulapp/chrome/content/vendor/xpcomcore/doc/symbols/Kernel.html +1030 -0
  30. data/xulapp/chrome/content/vendor/xpcomcore/doc/symbols/LoadError.html +319 -0
  31. data/xulapp/chrome/content/vendor/xpcomcore/doc/symbols/SelfConceptError.html +319 -0
  32. data/xulapp/chrome/content/vendor/xpcomcore/doc/symbols/_global_.html +316 -0
  33. data/xulapp/chrome/content/vendor/xpcomcore/doc/symbols/src/lib_file.js.html +53 -0
  34. data/xulapp/chrome/content/vendor/xpcomcore/doc/symbols/src/lib_kernel.js.html +251 -0
  35. data/xulapp/chrome/content/vendor/xpcomcore/etc/jsdoc-toolkit/README.txt +186 -0
  36. data/xulapp/chrome/content/vendor/xpcomcore/etc/jsdoc-toolkit/app/frame.js +33 -0
  37. data/xulapp/chrome/content/vendor/xpcomcore/etc/jsdoc-toolkit/app/frame/Chain.js +102 -0
  38. data/xulapp/chrome/content/vendor/xpcomcore/etc/jsdoc-toolkit/app/frame/Dumper.js +144 -0
  39. data/xulapp/chrome/content/vendor/xpcomcore/etc/jsdoc-toolkit/app/frame/Hash.js +84 -0
  40. data/xulapp/chrome/content/vendor/xpcomcore/etc/jsdoc-toolkit/app/frame/Link.js +153 -0
  41. data/xulapp/chrome/content/vendor/xpcomcore/etc/jsdoc-toolkit/app/frame/Namespace.js +10 -0
  42. data/xulapp/chrome/content/vendor/xpcomcore/etc/jsdoc-toolkit/app/frame/Opt.js +134 -0
  43. data/xulapp/chrome/content/vendor/xpcomcore/etc/jsdoc-toolkit/app/frame/Reflection.js +26 -0
  44. data/xulapp/chrome/content/vendor/xpcomcore/etc/jsdoc-toolkit/app/frame/String.js +93 -0
  45. data/xulapp/chrome/content/vendor/xpcomcore/etc/jsdoc-toolkit/app/frame/Testrun.js +129 -0
  46. data/xulapp/chrome/content/vendor/xpcomcore/etc/jsdoc-toolkit/app/handlers/FOODOC.js +26 -0
  47. data/xulapp/chrome/content/vendor/xpcomcore/etc/jsdoc-toolkit/app/handlers/XMLDOC.js +26 -0
  48. data/xulapp/chrome/content/vendor/xpcomcore/etc/jsdoc-toolkit/app/handlers/XMLDOC/DomReader.js +159 -0
  49. data/xulapp/chrome/content/vendor/xpcomcore/etc/jsdoc-toolkit/app/handlers/XMLDOC/XMLDoc.js +16 -0
  50. data/xulapp/chrome/content/vendor/xpcomcore/etc/jsdoc-toolkit/app/handlers/XMLDOC/XMLParse.js +292 -0
  51. data/xulapp/chrome/content/vendor/xpcomcore/etc/jsdoc-toolkit/app/lib/JSDOC.js +104 -0
  52. data/xulapp/chrome/content/vendor/xpcomcore/etc/jsdoc-toolkit/app/lib/JSDOC/DocComment.js +200 -0
  53. data/xulapp/chrome/content/vendor/xpcomcore/etc/jsdoc-toolkit/app/lib/JSDOC/DocTag.js +294 -0
  54. data/xulapp/chrome/content/vendor/xpcomcore/etc/jsdoc-toolkit/app/lib/JSDOC/JsDoc.js +126 -0
  55. data/xulapp/chrome/content/vendor/xpcomcore/etc/jsdoc-toolkit/app/lib/JSDOC/JsPlate.js +109 -0
  56. data/xulapp/chrome/content/vendor/xpcomcore/etc/jsdoc-toolkit/app/lib/JSDOC/Lang.js +144 -0
  57. data/xulapp/chrome/content/vendor/xpcomcore/etc/jsdoc-toolkit/app/lib/JSDOC/Parser.js +145 -0
  58. data/xulapp/chrome/content/vendor/xpcomcore/etc/jsdoc-toolkit/app/lib/JSDOC/PluginManager.js +33 -0
  59. data/xulapp/chrome/content/vendor/xpcomcore/etc/jsdoc-toolkit/app/lib/JSDOC/Symbol.js +645 -0
  60. data/xulapp/chrome/content/vendor/xpcomcore/etc/jsdoc-toolkit/app/lib/JSDOC/SymbolSet.js +241 -0
  61. data/xulapp/chrome/content/vendor/xpcomcore/etc/jsdoc-toolkit/app/lib/JSDOC/TextStream.js +41 -0
  62. data/xulapp/chrome/content/vendor/xpcomcore/etc/jsdoc-toolkit/app/lib/JSDOC/Token.js +18 -0
  63. data/xulapp/chrome/content/vendor/xpcomcore/etc/jsdoc-toolkit/app/lib/JSDOC/TokenReader.js +332 -0
  64. data/xulapp/chrome/content/vendor/xpcomcore/etc/jsdoc-toolkit/app/lib/JSDOC/TokenStream.js +133 -0
  65. data/xulapp/chrome/content/vendor/xpcomcore/etc/jsdoc-toolkit/app/lib/JSDOC/Util.js +32 -0
  66. data/xulapp/chrome/content/vendor/xpcomcore/etc/jsdoc-toolkit/app/lib/JSDOC/Walker.js +474 -0
  67. data/xulapp/chrome/content/vendor/xpcomcore/etc/jsdoc-toolkit/app/main.js +111 -0
  68. data/xulapp/chrome/content/vendor/xpcomcore/etc/jsdoc-toolkit/app/plugins/commentSrcJson.js +20 -0
  69. data/xulapp/chrome/content/vendor/xpcomcore/etc/jsdoc-toolkit/app/plugins/frameworkPrototype.js +16 -0
  70. data/xulapp/chrome/content/vendor/xpcomcore/etc/jsdoc-toolkit/app/plugins/functionCall.js +10 -0
  71. data/xulapp/chrome/content/vendor/xpcomcore/etc/jsdoc-toolkit/app/plugins/publishSrcHilite.js +62 -0
  72. data/xulapp/chrome/content/vendor/xpcomcore/etc/jsdoc-toolkit/app/plugins/symbolLink.js +10 -0
  73. data/xulapp/chrome/content/vendor/xpcomcore/etc/jsdoc-toolkit/app/plugins/tagParamConfig.js +31 -0
  74. data/xulapp/chrome/content/vendor/xpcomcore/etc/jsdoc-toolkit/app/plugins/tagSynonyms.js +43 -0
  75. data/xulapp/chrome/content/vendor/xpcomcore/etc/jsdoc-toolkit/app/run.js +348 -0
  76. data/xulapp/chrome/content/vendor/xpcomcore/etc/jsdoc-toolkit/app/t/TestDoc.js +144 -0
  77. data/xulapp/chrome/content/vendor/xpcomcore/etc/jsdoc-toolkit/app/t/runner.js +13 -0
  78. data/xulapp/chrome/content/vendor/xpcomcore/etc/jsdoc-toolkit/app/test.js +325 -0
  79. data/xulapp/chrome/content/vendor/xpcomcore/etc/jsdoc-toolkit/app/test/addon.js +24 -0
  80. data/xulapp/chrome/content/vendor/xpcomcore/etc/jsdoc-toolkit/app/test/anon_inner.js +14 -0
  81. data/xulapp/chrome/content/vendor/xpcomcore/etc/jsdoc-toolkit/app/test/augments.js +31 -0
  82. data/xulapp/chrome/content/vendor/xpcomcore/etc/jsdoc-toolkit/app/test/augments2.js +26 -0
  83. data/xulapp/chrome/content/vendor/xpcomcore/etc/jsdoc-toolkit/app/test/borrows.js +46 -0
  84. data/xulapp/chrome/content/vendor/xpcomcore/etc/jsdoc-toolkit/app/test/borrows2.js +23 -0
  85. data/xulapp/chrome/content/vendor/xpcomcore/etc/jsdoc-toolkit/app/test/config.js +22 -0
  86. data/xulapp/chrome/content/vendor/xpcomcore/etc/jsdoc-toolkit/app/test/constructs.js +18 -0
  87. data/xulapp/chrome/content/vendor/xpcomcore/etc/jsdoc-toolkit/app/test/encoding.js +10 -0
  88. data/xulapp/chrome/content/vendor/xpcomcore/etc/jsdoc-toolkit/app/test/encoding_other.js +12 -0
  89. data/xulapp/chrome/content/vendor/xpcomcore/etc/jsdoc-toolkit/app/test/event.js +54 -0
  90. data/xulapp/chrome/content/vendor/xpcomcore/etc/jsdoc-toolkit/app/test/exports.js +14 -0
  91. data/xulapp/chrome/content/vendor/xpcomcore/etc/jsdoc-toolkit/app/test/functions_anon.js +39 -0
  92. data/xulapp/chrome/content/vendor/xpcomcore/etc/jsdoc-toolkit/app/test/functions_nested.js +33 -0
  93. data/xulapp/chrome/content/vendor/xpcomcore/etc/jsdoc-toolkit/app/test/global.js +13 -0
  94. data/xulapp/chrome/content/vendor/xpcomcore/etc/jsdoc-toolkit/app/test/globals.js +25 -0
  95. data/xulapp/chrome/content/vendor/xpcomcore/etc/jsdoc-toolkit/app/test/ignore.js +10 -0
  96. data/xulapp/chrome/content/vendor/xpcomcore/etc/jsdoc-toolkit/app/test/inner.js +16 -0
  97. data/xulapp/chrome/content/vendor/xpcomcore/etc/jsdoc-toolkit/app/test/jsdoc_test.js +477 -0
  98. data/xulapp/chrome/content/vendor/xpcomcore/etc/jsdoc-toolkit/app/test/lend.js +33 -0
  99. data/xulapp/chrome/content/vendor/xpcomcore/etc/jsdoc-toolkit/app/test/memberof.js +19 -0
  100. data/xulapp/chrome/content/vendor/xpcomcore/etc/jsdoc-toolkit/app/test/memberof_constructor.js +17 -0
  101. data/xulapp/chrome/content/vendor/xpcomcore/etc/jsdoc-toolkit/app/test/module.js +17 -0
  102. data/xulapp/chrome/content/vendor/xpcomcore/etc/jsdoc-toolkit/app/test/name.js +19 -0
  103. data/xulapp/chrome/content/vendor/xpcomcore/etc/jsdoc-toolkit/app/test/namespace_nested.js +23 -0
  104. data/xulapp/chrome/content/vendor/xpcomcore/etc/jsdoc-toolkit/app/test/nocode.js +13 -0
  105. data/xulapp/chrome/content/vendor/xpcomcore/etc/jsdoc-toolkit/app/test/oblit_anon.js +20 -0
  106. data/xulapp/chrome/content/vendor/xpcomcore/etc/jsdoc-toolkit/app/test/overview.js +20 -0
  107. data/xulapp/chrome/content/vendor/xpcomcore/etc/jsdoc-toolkit/app/test/param_inline.js +37 -0
  108. data/xulapp/chrome/content/vendor/xpcomcore/etc/jsdoc-toolkit/app/test/params_optional.js +8 -0
  109. data/xulapp/chrome/content/vendor/xpcomcore/etc/jsdoc-toolkit/app/test/prototype.js +17 -0
  110. data/xulapp/chrome/content/vendor/xpcomcore/etc/jsdoc-toolkit/app/test/prototype_nested.js +9 -0
  111. data/xulapp/chrome/content/vendor/xpcomcore/etc/jsdoc-toolkit/app/test/prototype_oblit.js +13 -0
  112. data/xulapp/chrome/content/vendor/xpcomcore/etc/jsdoc-toolkit/app/test/prototype_oblit_constructor.js +24 -0
  113. data/xulapp/chrome/content/vendor/xpcomcore/etc/jsdoc-toolkit/app/test/public.js +10 -0
  114. data/xulapp/chrome/content/vendor/xpcomcore/etc/jsdoc-toolkit/app/test/scripts/code.js +5 -0
  115. data/xulapp/chrome/content/vendor/xpcomcore/etc/jsdoc-toolkit/app/test/scripts/notcode.txt +5 -0
  116. data/xulapp/chrome/content/vendor/xpcomcore/etc/jsdoc-toolkit/app/test/shared.js +42 -0
  117. data/xulapp/chrome/content/vendor/xpcomcore/etc/jsdoc-toolkit/app/test/shared2.js +2 -0
  118. data/xulapp/chrome/content/vendor/xpcomcore/etc/jsdoc-toolkit/app/test/shortcuts.js +22 -0
  119. data/xulapp/chrome/content/vendor/xpcomcore/etc/jsdoc-toolkit/app/test/static_this.js +13 -0
  120. data/xulapp/chrome/content/vendor/xpcomcore/etc/jsdoc-toolkit/app/test/synonyms.js +31 -0
  121. data/xulapp/chrome/content/vendor/xpcomcore/etc/jsdoc-toolkit/app/test/tosource.js +23 -0
  122. data/xulapp/chrome/content/vendor/xpcomcore/etc/jsdoc-toolkit/app/test/variable_redefine.js +14 -0
  123. data/xulapp/chrome/content/vendor/xpcomcore/etc/jsdoc-toolkit/changes.txt +96 -0
  124. data/xulapp/chrome/content/vendor/xpcomcore/etc/jsdoc-toolkit/conf/sample.conf +31 -0
  125. data/xulapp/chrome/content/vendor/xpcomcore/etc/jsdoc-toolkit/java/build.xml +36 -0
  126. data/xulapp/chrome/content/vendor/xpcomcore/etc/jsdoc-toolkit/java/build_1.4.xml +36 -0
  127. data/xulapp/chrome/content/vendor/xpcomcore/etc/jsdoc-toolkit/java/classes/js.jar +0 -0
  128. data/xulapp/chrome/content/vendor/xpcomcore/etc/jsdoc-toolkit/java/src/JsDebugRun.java +21 -0
  129. data/xulapp/chrome/content/vendor/xpcomcore/etc/jsdoc-toolkit/java/src/JsRun.java +21 -0
  130. data/xulapp/chrome/content/vendor/xpcomcore/etc/jsdoc-toolkit/jsdebug.jar +0 -0
  131. data/xulapp/chrome/content/vendor/xpcomcore/etc/jsdoc-toolkit/jsrun.jar +0 -0
  132. data/xulapp/chrome/content/vendor/xpcomcore/etc/jsdoc-toolkit/jsrun.sh +52 -0
  133. data/xulapp/chrome/content/vendor/xpcomcore/etc/jsdoc-toolkit/templates/jsdoc/allclasses.tmpl +17 -0
  134. data/xulapp/chrome/content/vendor/xpcomcore/etc/jsdoc-toolkit/templates/jsdoc/allfiles.tmpl +56 -0
  135. data/xulapp/chrome/content/vendor/xpcomcore/etc/jsdoc-toolkit/templates/jsdoc/class.tmpl +646 -0
  136. data/xulapp/chrome/content/vendor/xpcomcore/etc/jsdoc-toolkit/templates/jsdoc/index.tmpl +39 -0
  137. data/xulapp/chrome/content/vendor/xpcomcore/etc/jsdoc-toolkit/templates/jsdoc/publish.js +200 -0
  138. data/xulapp/chrome/content/vendor/xpcomcore/etc/jsdoc-toolkit/templates/jsdoc/static/default.css +162 -0
  139. data/xulapp/chrome/content/vendor/xpcomcore/etc/jsdoc-toolkit/templates/jsdoc/static/header.html +2 -0
  140. data/xulapp/chrome/content/vendor/xpcomcore/etc/jsdoc-toolkit/templates/jsdoc/static/index.html +19 -0
  141. data/xulapp/chrome/content/vendor/xpcomcore/etc/jsdoc-toolkit/templates/jsdoc/symbol.tmpl +35 -0
  142. data/xulapp/chrome/content/vendor/xpcomcore/lib/file.js +46 -0
  143. data/xulapp/chrome/content/vendor/xpcomcore/lib/kernel.js +244 -0
  144. data/xulapp/chrome/content/vendor/xpcomcore/test/file_test.js +16 -0
  145. data/xulapp/chrome/content/vendor/xpcomcore/test/fixtures/love.js +1 -0
  146. data/xulapp/chrome/content/vendor/xpcomcore/test/fixtures/mad_love.js +1 -0
  147. data/xulapp/chrome/content/vendor/xpcomcore/test/fixtures/mad_world.js +1 -0
  148. data/xulapp/chrome/content/vendor/xpcomcore/test/fixtures/syntax_error.js +1 -0
  149. data/xulapp/chrome/content/vendor/xpcomcore/test/kernel_test.js +88 -0
  150. data/xulapp/components/bootstrap.js +93 -0
  151. data/xulapp/defaults/preferences/prefs.js +14 -0
  152. data/xultestrunner.gemspec +190 -0
  153. metadata +207 -0
@@ -0,0 +1,21 @@
1
+ The MIT License
2
+
3
+ Copyright (c) <2009> <Gabriel Gironda>
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in
13
+ all copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
+ THE SOFTWARE.
@@ -0,0 +1,27 @@
1
+ XPCOMCore
2
+ =========
3
+
4
+ A standard library like Ruby's, only for JavaScript (with XPCOM access).
5
+
6
+ Installation
7
+ ============
8
+
9
+ Check out / submodule in / whatever the code to a place of your choosing. Then load it from an XPCOM component like so:
10
+
11
+ Components.utils.import("resource://app/chrome/content/vendor/xpcomcore/bootstrapper.js");
12
+
13
+ Then, to pull XPCOMCore into your scope, do this lovely little trick:
14
+
15
+ XPCOMCore({scope: this});
16
+
17
+ If you wish to not automatically mix in the `Kernel` module, pass another argument like so:
18
+
19
+ XPCOMCore({scope: this, importKernel: false});
20
+
21
+ Then, whenever you want to make use of XPCOMCore (say, from a XUL window), do the same deal. For example:
22
+
23
+ <script type="text/javascript">XPCOMCore({scope: this});</script>
24
+
25
+ Then you'll have access to methods such as load() and require() and whatever else is defined in Kernel.
26
+
27
+ - Gabriel Gironda
@@ -0,0 +1,83 @@
1
+ require 'pathname'
2
+ require 'yaml'
3
+ here = (Pathname(__FILE__).parent.expand_path)
4
+
5
+ task :test do
6
+ ENV['XPCOMCORE'] = Pathname(__FILE__).parent.expand_path.to_s
7
+ exec(ENV['XULTEST'] || "xultest", "-testDir", (Pathname(__FILE__).parent + "test/").expand_path.to_s)
8
+ end
9
+
10
+ task :default => :test
11
+
12
+ namespace :docs do
13
+ doc_dir = here + "doc"
14
+ jsdoc_loc = here + "etc/jsdoc-toolkit"
15
+
16
+ desc "Builds the documentation"
17
+ task :build do
18
+ raise "java does not seem to be in your PATH." if `which java`.chomp.empty?
19
+ system(%Q[java -jar "#{jsdoc_loc}/jsrun.jar" "#{jsdoc_loc}/app/run.js" -r -a -t="#{jsdoc_loc}/templates/jsdoc" -d="#{doc_dir}" lib])
20
+ end
21
+
22
+ task :clean do
23
+ system(%Q[cd "#{here}" && git rm -rf "doc/*"])
24
+ FileUtils.rm_rf(doc_dir)
25
+ FileUtils.mkdir(doc_dir)
26
+ end
27
+
28
+ task :commit do
29
+ system(%Q[cd "#{here}" && git add "doc" && git commit -m "Updating docs"])
30
+ end
31
+
32
+ task :update_gh_pages do
33
+ current_branch = `cd "#{here}" && git branch 2> /dev/null | grep -e '\\* ' | sed 's/^..\\(.*\\)/\\1/'`.chomp
34
+ system(%Q[cd "#{here}" && git checkout gh-pages && git rm -rf doc && git checkout master doc && git add doc && git commit -m "Updating docs for GH pages" && git checkout -f #{current_branch}])
35
+ end
36
+
37
+ end
38
+
39
+ task :build => ['version:update_files', 'docs:clean', 'docs:build', 'docs:commit', 'docs:update_gh_pages']
40
+
41
+
42
+ task :release => :build do
43
+ system(%Q[cd #{here} && git push])
44
+ end
45
+
46
+ namespace :version do
47
+ version_file = here + "VERSION.yml"
48
+
49
+ task :update_files do
50
+ component_file = (Pathname(__FILE__).parent + "components/XPCOMCore.js").expand_path
51
+ current = YAML.load_file(version_file.to_s)
52
+ version_string = "#{current['version']['major']}.#{current['version']['minor']}.#{current['version']['patch']}"
53
+ js_marker_comment = "// DO NOT REMOVE THIS COMMENT OR MOVE THIS LINE. THIS LINE IS AUTO-GENERATED FROM A RAKE TASK. @XPCOMCORE_VERSION@"
54
+ js_version_string = "var XPCOMCoreVersion = '#{version_string}'; #{js_marker_comment}\n"
55
+ new_file = component_file.readlines.collect do |line|
56
+ next line unless line =~ /@XPCOMCORE_VERSION@/
57
+ js_version_string
58
+ end
59
+
60
+ component_file.open('w') { |f| f << new_file.join }
61
+ puts "Updated '#{component_file}' to reflect VERSION.yml"
62
+ system(%Q[cd "#{here}" && git add "#{component_file}" && git commit -m "Updating version to '#{version_string}'" "#{component_file}"])
63
+ end
64
+
65
+ namespace :bump do
66
+ bumper = lambda do |version_part|
67
+ current = YAML.load_file(version_file.to_s)
68
+ puts "Current version is: #{current['version']['major']}.#{current['version']['minor']}.#{current['version']['patch']}"
69
+ current['version'][version_part] += 1
70
+ version_file.open('w') { |f| f << YAML.dump(current) }
71
+ puts "Current version is now: #{current['version']['major']}.#{current['version']['minor']}.#{current['version']['patch']}"
72
+ end
73
+
74
+ desc "Bumps the major version"
75
+ task(:major) { bumper.call('major') }
76
+
77
+ desc "Bumps the minor version"
78
+ task(:minor) { bumper.call('minor') }
79
+
80
+ desc "Bumps the patch version"
81
+ task(:patch) { bumper.call('patch') }
82
+ end
83
+ end
@@ -0,0 +1,5 @@
1
+ ---
2
+ version:
3
+ major: 0
4
+ patch: 1
5
+ minor: 3
@@ -0,0 +1,32 @@
1
+ const requiredMinGeckoVersion = '1.9.0';
2
+ var EXPORTED_SYMBOLS = ["XPCOMCore", "XPCOMCoreConfig"];
3
+
4
+ const $Cc = Components.classes;
5
+ const $Ci = Components.interfaces;
6
+
7
+ var checkGeckoVersion = function() {
8
+ var versionComparator = $Cc["@mozilla.org/xpcom/version-comparator;1"].getService($Ci.nsIVersionComparator);
9
+ var appInfo = $Cc["@mozilla.org/xre/app-info;1"].getService($Ci.nsIXULAppInfo);
10
+ if (versionComparator.compare(appInfo.platformVersion, requiredMinGeckoVersion) < 0) {
11
+ throw("Gecko version '" + appInfo.platformVersion + "' is unable to use XPCOMCore.");
12
+ }
13
+ };
14
+
15
+ // Check we're even compatible with this version of Gecko before doing anything else.
16
+ checkGeckoVersion();
17
+
18
+ // Set up a resource substitution for our current directory location
19
+ var ioService = $Cc["@mozilla.org/network/io-service;1"].getService($Ci.nsIIOService);
20
+ var resProt = ioService.getProtocolHandler("resource").QueryInterface($Ci.nsIResProtocolHandler);
21
+ var currentDir = ioService.newURI(Components.stack.filename, null, null).QueryInterface($Ci.nsIFileURL).file.parent;
22
+ resProt.setSubstitution("xpcomcore", ioService.newFileURI(currentDir));
23
+
24
+ // Register our XPCOM Components
25
+ var componentsDir = ioService.newURI("resource://xpcomcore/components", null, null).QueryInterface($Ci.nsIFileURL).file;
26
+ Components.manager.QueryInterface($Ci.nsIComponentRegistrar).autoRegister(componentsDir);
27
+
28
+ // Now we're registered, export a reference to the service for the component that's bootstrapping us,
29
+ // since "Javascript global property"/"Javascript global constructor" don't get exported into the
30
+ // BackstagePass environment.
31
+ const XPCOMCore = $Cc["@conflagrationjs.org/xpcomcore/core-constructor;1"].createInstance();
32
+ const XPCOMCoreConfig = $Cc["@conflagrationjs.org/xpcomcore/core;1"].createInstance();
@@ -0,0 +1,120 @@
1
+ var XPCOMCoreVersion = '0.3.1'; // DO NOT REMOVE THIS COMMENT OR MOVE THIS LINE. THIS LINE IS AUTO-GENERATED FROM A RAKE TASK. @XPCOMCORE_VERSION@
2
+ Components.utils.import("resource://gre/modules/XPCOMUtils.jsm");
3
+
4
+ const $Cc = Components.classes;
5
+ const $Ci = Components.interfaces;
6
+
7
+ var ioService = $Cc["@mozilla.org/network/io-service;1"].getService($Ci.nsIIOService);
8
+ var libRoot = ioService.newURI("resource://xpcomcore/lib", null, null).QueryInterface($Ci.nsIFileURL).file.path;
9
+
10
+ // NOTE - XPCOMCore is a singleton
11
+ var XPCOMCore = function() {
12
+ if (arguments.callee.__singletonInstance__) { return arguments.callee.__singletonInstance__; };
13
+
14
+ // Private method that does the work of loading the XPCOMCore kernel
15
+ // into the given scope.
16
+ var loadKernel = function(importScope) {
17
+ var loader = $Cc["@mozilla.org/moz/jssubscript-loader;1"].getService($Ci.mozIJSSubScriptLoader);
18
+ loader.loadSubScript("resource://xpcomcore/lib/kernel.js", importScope);
19
+ };
20
+
21
+ // Private method to actually kick off the importing of kernel into the given
22
+ // import scope.
23
+ var import = function(importScope, importKernel) {
24
+ if (importScope.__XPCOMCoreLoaded__) {
25
+ return false;
26
+ } else {
27
+ loadKernel(importScope);
28
+ // FIXME - defineGetter explodes when it's a 'Window' object for some reason. Fine for
29
+ // ChromeWindow and fine for BackstagePass though. Weird.
30
+ // importScope.__defineGetter__('__XPCOMCoreLoaded__', function() { return true; });
31
+ importScope.__XPCOMCoreLoaded__ = true;
32
+ // Automatically mix Kernel into the scope if importKernel is true
33
+ if (importKernel) { importScope.Kernel(importScope); };
34
+ return true;
35
+ }
36
+ };
37
+
38
+ // FIXME - hack. hijacking the nsIWritableVariant interface so we can have a constructor that works
39
+ // FIXME - and to boot, for reasons i dont understand, we wrap the scope in another object, hence the options
40
+ // hash. which might be useful anyway.
41
+ this.setFromVariant = function(options) {
42
+ if (!options.scope) { return false; }
43
+ return import(options.scope, !(options.importKernel === false));
44
+ };
45
+
46
+ arguments.callee.__singletonInstance__ = this;
47
+ // HACK HACK HACK - this is so we can get a reference to the real constructor
48
+ // from the bootstrapper.
49
+ this.__specialConstructor__ = arguments.callee;
50
+ };
51
+
52
+ // FIXME - maybe? might not really be a 'bug'
53
+ // Bahaha - we rely on http://mxr.mozilla.org/mozilla1.8/source/js/src/xpconnect/src/xpcwrappedjsclass.cpp#528
54
+ // (as written about in http://weblogs.mozillazine.org/weirdal/archives/019778.html) to expose a getProperty
55
+ // method on this object to allow for getting arbitrary properties.
56
+ var XPCOMCoreInterfaces = [$Ci.nsIClassInfo, $Ci.nsIPropertyBag, $Ci.nsIWritableVariant];
57
+
58
+ XPCOMCore.prototype = {
59
+ classDescription: "XPCOMCore Core Object",
60
+ contractID: "@conflagrationjs.org/xpcomcore/core;1",
61
+ classID: Components.ID("{f562f600-9c25-11de-8a39-0800200c9a66}"),
62
+ QueryInterface: XPCOMUtils.generateQI(XPCOMCoreInterfaces),
63
+ _xpcom_categories: [{category: "JavaScript global property", entry: "XPCOMCoreConfig"}],
64
+
65
+ // implemented for nsIClassInfo
66
+ getInterfaces: function(aCountRef) {
67
+ aCountRef.value = XPCOMCoreInterfaces.length;
68
+ return XPCOMCoreInterfaces;
69
+ },
70
+
71
+ // implemented for nsIClassInfo
72
+ getHelperForLanguage: function(aLanguage) { return null; },
73
+
74
+ // implemented for nsIClassInfo
75
+ implementationLanguage: $Ci.nsIProgrammingLanguage.JAVASCRIPT,
76
+
77
+ // implemented for nsIClassInfo
78
+ flags: $Ci.nsIClassInfo.SINGLETON,
79
+
80
+ get version() { return new String(XPCOMCoreVersion); },
81
+ get libRoot() { return new String(libRoot); }
82
+
83
+ };
84
+
85
+ var XPCOMCoreConstructorInterfaces = [$Ci.nsIClassInfo, $Ci.nsIXPCConstructor, $Ci.nsIXPCScriptable];
86
+
87
+ // Singleton
88
+ var XPCOMCoreConstructor = function() {
89
+ if (arguments.callee.__singletonInstance__) { return arguments.callee.__singletonInstance__; };
90
+ var ctor = Components.Constructor("@conflagrationjs.org/xpcomcore/core;1", Components.interfaces.nsIWritableVariant, "setFromVariant");
91
+ arguments.callee.__singletonInstance__ = ctor;
92
+ return ctor;
93
+ };
94
+
95
+ XPCOMCoreConstructor.prototype = {
96
+ classDescription: "XPCOMCore Core Object Constructor Hack",
97
+ contractID: "@conflagrationjs.org/xpcomcore/core-constructor;1",
98
+ classID: Components.ID("{b5762b40-a0ec-11de-8a39-0800200c9a66}"),
99
+ QueryInterface: XPCOMUtils.generateQI(XPCOMCoreConstructorInterfaces),
100
+ _xpcom_categories: [{category: "JavaScript global property", entry: "XPCOMCore"}],
101
+
102
+ // implemented for nsIClassInfo
103
+ getInterfaces: function(aCountRef) {
104
+ aCountRef.value = XPCOMCoreConstructorInterfaces.length;
105
+ return XPCOMCoreConstructorInterfaces;
106
+ },
107
+
108
+ // implemented for nsIClassInfo
109
+ getHelperForLanguage: function(aLanguage) { return null; },
110
+
111
+ // implemented for nsIClassInfo
112
+ implementationLanguage: $Ci.nsIProgrammingLanguage.JAVASCRIPT,
113
+
114
+ // implemented for nsIClassInfo
115
+ flags: $Ci.nsIClassInfo.SINGLETON
116
+ }
117
+
118
+ NSGetModule = function(compMgr, fileSpec) {
119
+ return XPCOMUtils.generateModule([XPCOMCore, XPCOMCoreConstructor]);
120
+ };
@@ -0,0 +1,241 @@
1
+ <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
2
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
3
+ <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
4
+ <head>
5
+ <meta http-equiv="content-type" content="text/html; charset=utf-8"" />
6
+
7
+ <title>JsDoc Reference - File Index</title>
8
+ <meta name="generator" content="JsDoc Toolkit" />
9
+
10
+ <style type="text/css">
11
+ /* default.css */
12
+ body
13
+ {
14
+ font: 12px "Lucida Grande", Tahoma, Arial, Helvetica, sans-serif;
15
+ width: 800px;
16
+ }
17
+
18
+ .header
19
+ {
20
+ clear: both;
21
+ background-color: #ccc;
22
+ padding: 8px;
23
+ }
24
+
25
+ h1
26
+ {
27
+ font-size: 150%;
28
+ font-weight: bold;
29
+ padding: 0;
30
+ margin: 1em 0 0 .3em;
31
+ }
32
+
33
+ hr
34
+ {
35
+ border: none 0;
36
+ border-top: 1px solid #7F8FB1;
37
+ height: 1px;
38
+ }
39
+
40
+ pre.code
41
+ {
42
+ display: block;
43
+ padding: 8px;
44
+ border: 1px dashed #ccc;
45
+ }
46
+
47
+ #index
48
+ {
49
+ margin-top: 24px;
50
+ float: left;
51
+ width: 160px;
52
+ position: absolute;
53
+ left: 8px;
54
+ background-color: #F3F3F3;
55
+ padding: 8px;
56
+ }
57
+
58
+ #content
59
+ {
60
+ margin-left: 190px;
61
+ width: 600px;
62
+ }
63
+
64
+ .classList
65
+ {
66
+ list-style-type: none;
67
+ padding: 0;
68
+ margin: 0 0 0 8px;
69
+ font-family: arial, sans-serif;
70
+ font-size: 1em;
71
+ overflow: auto;
72
+ }
73
+
74
+ .classList li
75
+ {
76
+ padding: 0;
77
+ margin: 0 0 8px 0;
78
+ }
79
+
80
+ .summaryTable { width: 100%; }
81
+
82
+ h1.classTitle
83
+ {
84
+ font-size:170%;
85
+ line-height:130%;
86
+ }
87
+
88
+ h2 { font-size: 110%; }
89
+ caption, div.sectionTitle
90
+ {
91
+ background-color: #7F8FB1;
92
+ color: #fff;
93
+ font-size:130%;
94
+ text-align: left;
95
+ padding: 2px 6px 2px 6px;
96
+ border: 1px #7F8FB1 solid;
97
+ }
98
+
99
+ div.sectionTitle { margin-bottom: 8px; }
100
+ .summaryTable thead { display: none; }
101
+
102
+ .summaryTable td
103
+ {
104
+ vertical-align: top;
105
+ padding: 4px;
106
+ border-bottom: 1px #7F8FB1 solid;
107
+ border-right: 1px #7F8FB1 solid;
108
+ }
109
+
110
+ /*col#summaryAttributes {}*/
111
+ .summaryTable td.attributes
112
+ {
113
+ border-left: 1px #7F8FB1 solid;
114
+ width: 140px;
115
+ text-align: right;
116
+ }
117
+
118
+ td.attributes, .fixedFont
119
+ {
120
+ line-height: 15px;
121
+ color: #002EBE;
122
+ font-family: "Courier New",Courier,monospace;
123
+ font-size: 13px;
124
+ }
125
+
126
+ .summaryTable td.nameDescription
127
+ {
128
+ text-align: left;
129
+ font-size: 13px;
130
+ line-height: 15px;
131
+ }
132
+
133
+ .summaryTable td.nameDescription, .description
134
+ {
135
+ line-height: 15px;
136
+ padding: 4px;
137
+ padding-left: 4px;
138
+ }
139
+
140
+ .summaryTable { margin-bottom: 8px; }
141
+
142
+ ul.inheritsList
143
+ {
144
+ list-style: square;
145
+ margin-left: 20px;
146
+ padding-left: 0;
147
+ }
148
+
149
+ .detailList {
150
+ margin-left: 20px;
151
+ line-height: 15px;
152
+ }
153
+ .detailList dt { margin-left: 20px; }
154
+
155
+ .detailList .heading
156
+ {
157
+ font-weight: bold;
158
+ padding-bottom: 6px;
159
+ margin-left: 0;
160
+ }
161
+
162
+ .light, td.attributes, .light a:link, .light a:visited
163
+ {
164
+ color: #777;
165
+ font-style: italic;
166
+ }
167
+
168
+ .fineprint
169
+ {
170
+ text-align: right;
171
+ font-size: 10px;
172
+ }
173
+ </style>
174
+ </head>
175
+
176
+ <body>
177
+ <div id="header">
178
+ </div>
179
+
180
+ <div id="index">
181
+ <div align="center"><a href="index.html">Class Index</a>
182
+ | <a href="files.html">File Index</a></div>
183
+ <hr />
184
+ <h2>Classes</h2>
185
+ <ul class="classList">
186
+
187
+ <li><i><a href="symbols/_global_.html">_global_</a></i></li>
188
+
189
+ <li><a href="symbols/Error.html">Error</a></li>
190
+
191
+ <li><a href="symbols/Kernel.html">Kernel</a></li>
192
+
193
+ <li><a href="symbols/LoadError.html">LoadError</a></li>
194
+
195
+ <li><a href="symbols/SelfConceptError.html">SelfConceptError</a></li>
196
+
197
+ </ul>
198
+ <hr />
199
+ </div>
200
+
201
+ <div id="content">
202
+ <h1 class="classTitle">File Index</h1>
203
+
204
+
205
+ <div>
206
+ <h2><a href="symbols/src/lib_kernel.js.html">kernel.js</a></h2>
207
+
208
+ This file specifies a set of globally useful features/shortcuts
209
+ and defines our "Kernel" object, which is the base for doing a lot of simple
210
+ things with XPCOMCore such as loading in other files and printing to the
211
+ console.
212
+ <dl>
213
+
214
+
215
+
216
+
217
+ </dl>
218
+ </div>
219
+ <hr />
220
+
221
+ <div>
222
+ <h2><a href="symbols/src/lib_file.js.html">file.js</a></h2>
223
+
224
+ This file defines the implementation of our File object.
225
+ <dl>
226
+
227
+
228
+
229
+
230
+ </dl>
231
+ </div>
232
+ <hr />
233
+
234
+
235
+ </div>
236
+ <div class="fineprint" style="clear:both">
237
+
238
+ Documentation generated by <a href="http://code.google.com/p/jsdoc-toolkit/" target="_blankt">JsDoc Toolkit</a> 2.3.0 on Sat Oct 03 2009 19:31:42 GMT-0500 (CDT)
239
+ </div>
240
+ </body>
241
+ </html>