xpcomcore-rubygem 0.3.2 → 0.5.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (148) hide show
  1. data/README.markdown +14 -0
  2. data/Rakefile +13 -11
  3. data/VERSION +1 -1
  4. data/bin/xpcomcore +7 -0
  5. data/lib/xpcomcore-rubygem.rb +9 -0
  6. data/lib/xpcomcore-rubygem/commands.rb +54 -0
  7. data/lib/xpcomcore-rubygem/commands/generate.rb +23 -0
  8. data/lib/xpcomcore-rubygem/commands/generate/application.rb +63 -0
  9. data/lib/xpcomcore-rubygem/commands/generate/jeweler_builder_command.rb +108 -0
  10. data/lib/xpcomcore-rubygem/commands/generate/library.rb +25 -0
  11. data/lib/xpcomcore-rubygem/commands/generate/template_helpers.rb +78 -0
  12. data/lib/xpcomcore-rubygem/commands/launch.rb +129 -0
  13. data/templates/application/application.ini.erb +12 -0
  14. data/templates/application/chrome/chrome.manifest.erb +1 -0
  15. data/templates/application/chrome/content/xul/main_window.xul.erb +6 -0
  16. data/{extension → templates/application}/components/bootstrapper.js +1 -1
  17. data/templates/application/defaults/preferences/prefs.js.erb +7 -0
  18. data/templates/shared/jsdoc_doc_task.erb +7 -0
  19. data/templates/shared/xultestrunner_test_task.erb +7 -0
  20. data/xpcomcore-rubygem.gemspec +48 -136
  21. data/xpcomcore/Rakefile +42 -19
  22. data/xpcomcore/bootstrapper.js +1 -3
  23. data/xpcomcore/{VERSION.yml → build_properties.yml} +3 -0
  24. data/xpcomcore/components/XPCOMCore.js +0 -2
  25. data/xpcomcore/doc/files.html +10 -10
  26. data/xpcomcore/doc/index.html +17 -17
  27. data/xpcomcore/doc/symbols/_global_.html +10 -9
  28. data/xpcomcore/doc/symbols/{Error.html → error.html} +10 -9
  29. data/xpcomcore/doc/symbols/{File.html → file.html} +13 -12
  30. data/xpcomcore/doc/symbols/{File.NoSuchFileError.html → file.nosuchfileerror.html} +13 -12
  31. data/xpcomcore/doc/symbols/{Kernel.html → kernel.html} +48 -47
  32. data/xpcomcore/doc/symbols/{LoadError.html → loaderror.html} +13 -12
  33. data/xpcomcore/doc/symbols/{SelfConceptError.html → selfconcepterror.html} +13 -12
  34. data/xpcomcore/doc/symbols/{Sys.html → sys.html} +12 -11
  35. data/xpcomcore/doc/symbols/{XPCBuiltins.html → xpcbuiltins.html} +11 -10
  36. metadata +61 -135
  37. data/README.rdoc +0 -18
  38. data/bin/xpcomcore-firefox +0 -4
  39. data/bin/xpcomcore-rubygem-install +0 -205
  40. data/extension/README.txt +0 -1
  41. data/extension/install.rdf +0 -16
  42. data/xpcomcore/etc/jsdoc-toolkit/README.txt +0 -186
  43. data/xpcomcore/etc/jsdoc-toolkit/app/frame.js +0 -33
  44. data/xpcomcore/etc/jsdoc-toolkit/app/frame/Chain.js +0 -102
  45. data/xpcomcore/etc/jsdoc-toolkit/app/frame/Dumper.js +0 -144
  46. data/xpcomcore/etc/jsdoc-toolkit/app/frame/Hash.js +0 -84
  47. data/xpcomcore/etc/jsdoc-toolkit/app/frame/Link.js +0 -153
  48. data/xpcomcore/etc/jsdoc-toolkit/app/frame/Namespace.js +0 -10
  49. data/xpcomcore/etc/jsdoc-toolkit/app/frame/Opt.js +0 -134
  50. data/xpcomcore/etc/jsdoc-toolkit/app/frame/Reflection.js +0 -26
  51. data/xpcomcore/etc/jsdoc-toolkit/app/frame/String.js +0 -93
  52. data/xpcomcore/etc/jsdoc-toolkit/app/frame/Testrun.js +0 -129
  53. data/xpcomcore/etc/jsdoc-toolkit/app/handlers/FOODOC.js +0 -26
  54. data/xpcomcore/etc/jsdoc-toolkit/app/handlers/XMLDOC.js +0 -26
  55. data/xpcomcore/etc/jsdoc-toolkit/app/handlers/XMLDOC/DomReader.js +0 -159
  56. data/xpcomcore/etc/jsdoc-toolkit/app/handlers/XMLDOC/XMLDoc.js +0 -16
  57. data/xpcomcore/etc/jsdoc-toolkit/app/handlers/XMLDOC/XMLParse.js +0 -292
  58. data/xpcomcore/etc/jsdoc-toolkit/app/lib/JSDOC.js +0 -104
  59. data/xpcomcore/etc/jsdoc-toolkit/app/lib/JSDOC/DocComment.js +0 -200
  60. data/xpcomcore/etc/jsdoc-toolkit/app/lib/JSDOC/DocTag.js +0 -294
  61. data/xpcomcore/etc/jsdoc-toolkit/app/lib/JSDOC/JsDoc.js +0 -126
  62. data/xpcomcore/etc/jsdoc-toolkit/app/lib/JSDOC/JsPlate.js +0 -109
  63. data/xpcomcore/etc/jsdoc-toolkit/app/lib/JSDOC/Lang.js +0 -144
  64. data/xpcomcore/etc/jsdoc-toolkit/app/lib/JSDOC/Parser.js +0 -145
  65. data/xpcomcore/etc/jsdoc-toolkit/app/lib/JSDOC/PluginManager.js +0 -33
  66. data/xpcomcore/etc/jsdoc-toolkit/app/lib/JSDOC/Symbol.js +0 -645
  67. data/xpcomcore/etc/jsdoc-toolkit/app/lib/JSDOC/SymbolSet.js +0 -241
  68. data/xpcomcore/etc/jsdoc-toolkit/app/lib/JSDOC/TextStream.js +0 -41
  69. data/xpcomcore/etc/jsdoc-toolkit/app/lib/JSDOC/Token.js +0 -18
  70. data/xpcomcore/etc/jsdoc-toolkit/app/lib/JSDOC/TokenReader.js +0 -332
  71. data/xpcomcore/etc/jsdoc-toolkit/app/lib/JSDOC/TokenStream.js +0 -133
  72. data/xpcomcore/etc/jsdoc-toolkit/app/lib/JSDOC/Util.js +0 -32
  73. data/xpcomcore/etc/jsdoc-toolkit/app/lib/JSDOC/Walker.js +0 -474
  74. data/xpcomcore/etc/jsdoc-toolkit/app/main.js +0 -111
  75. data/xpcomcore/etc/jsdoc-toolkit/app/plugins/commentSrcJson.js +0 -20
  76. data/xpcomcore/etc/jsdoc-toolkit/app/plugins/frameworkPrototype.js +0 -16
  77. data/xpcomcore/etc/jsdoc-toolkit/app/plugins/functionCall.js +0 -10
  78. data/xpcomcore/etc/jsdoc-toolkit/app/plugins/publishSrcHilite.js +0 -62
  79. data/xpcomcore/etc/jsdoc-toolkit/app/plugins/symbolLink.js +0 -10
  80. data/xpcomcore/etc/jsdoc-toolkit/app/plugins/tagParamConfig.js +0 -31
  81. data/xpcomcore/etc/jsdoc-toolkit/app/plugins/tagSynonyms.js +0 -43
  82. data/xpcomcore/etc/jsdoc-toolkit/app/run.js +0 -348
  83. data/xpcomcore/etc/jsdoc-toolkit/app/t/TestDoc.js +0 -144
  84. data/xpcomcore/etc/jsdoc-toolkit/app/t/runner.js +0 -13
  85. data/xpcomcore/etc/jsdoc-toolkit/app/test.js +0 -325
  86. data/xpcomcore/etc/jsdoc-toolkit/app/test/addon.js +0 -24
  87. data/xpcomcore/etc/jsdoc-toolkit/app/test/anon_inner.js +0 -14
  88. data/xpcomcore/etc/jsdoc-toolkit/app/test/augments.js +0 -31
  89. data/xpcomcore/etc/jsdoc-toolkit/app/test/augments2.js +0 -26
  90. data/xpcomcore/etc/jsdoc-toolkit/app/test/borrows.js +0 -46
  91. data/xpcomcore/etc/jsdoc-toolkit/app/test/borrows2.js +0 -23
  92. data/xpcomcore/etc/jsdoc-toolkit/app/test/config.js +0 -22
  93. data/xpcomcore/etc/jsdoc-toolkit/app/test/constructs.js +0 -18
  94. data/xpcomcore/etc/jsdoc-toolkit/app/test/encoding.js +0 -10
  95. data/xpcomcore/etc/jsdoc-toolkit/app/test/encoding_other.js +0 -12
  96. data/xpcomcore/etc/jsdoc-toolkit/app/test/event.js +0 -54
  97. data/xpcomcore/etc/jsdoc-toolkit/app/test/exports.js +0 -14
  98. data/xpcomcore/etc/jsdoc-toolkit/app/test/functions_anon.js +0 -39
  99. data/xpcomcore/etc/jsdoc-toolkit/app/test/functions_nested.js +0 -33
  100. data/xpcomcore/etc/jsdoc-toolkit/app/test/global.js +0 -13
  101. data/xpcomcore/etc/jsdoc-toolkit/app/test/globals.js +0 -25
  102. data/xpcomcore/etc/jsdoc-toolkit/app/test/ignore.js +0 -10
  103. data/xpcomcore/etc/jsdoc-toolkit/app/test/inner.js +0 -16
  104. data/xpcomcore/etc/jsdoc-toolkit/app/test/jsdoc_test.js +0 -477
  105. data/xpcomcore/etc/jsdoc-toolkit/app/test/lend.js +0 -33
  106. data/xpcomcore/etc/jsdoc-toolkit/app/test/memberof.js +0 -19
  107. data/xpcomcore/etc/jsdoc-toolkit/app/test/memberof_constructor.js +0 -17
  108. data/xpcomcore/etc/jsdoc-toolkit/app/test/module.js +0 -17
  109. data/xpcomcore/etc/jsdoc-toolkit/app/test/name.js +0 -19
  110. data/xpcomcore/etc/jsdoc-toolkit/app/test/namespace_nested.js +0 -23
  111. data/xpcomcore/etc/jsdoc-toolkit/app/test/nocode.js +0 -13
  112. data/xpcomcore/etc/jsdoc-toolkit/app/test/oblit_anon.js +0 -20
  113. data/xpcomcore/etc/jsdoc-toolkit/app/test/overview.js +0 -20
  114. data/xpcomcore/etc/jsdoc-toolkit/app/test/param_inline.js +0 -37
  115. data/xpcomcore/etc/jsdoc-toolkit/app/test/params_optional.js +0 -8
  116. data/xpcomcore/etc/jsdoc-toolkit/app/test/prototype.js +0 -17
  117. data/xpcomcore/etc/jsdoc-toolkit/app/test/prototype_nested.js +0 -9
  118. data/xpcomcore/etc/jsdoc-toolkit/app/test/prototype_oblit.js +0 -13
  119. data/xpcomcore/etc/jsdoc-toolkit/app/test/prototype_oblit_constructor.js +0 -24
  120. data/xpcomcore/etc/jsdoc-toolkit/app/test/public.js +0 -10
  121. data/xpcomcore/etc/jsdoc-toolkit/app/test/scripts/code.js +0 -5
  122. data/xpcomcore/etc/jsdoc-toolkit/app/test/scripts/notcode.txt +0 -5
  123. data/xpcomcore/etc/jsdoc-toolkit/app/test/shared.js +0 -42
  124. data/xpcomcore/etc/jsdoc-toolkit/app/test/shared2.js +0 -2
  125. data/xpcomcore/etc/jsdoc-toolkit/app/test/shortcuts.js +0 -22
  126. data/xpcomcore/etc/jsdoc-toolkit/app/test/static_this.js +0 -13
  127. data/xpcomcore/etc/jsdoc-toolkit/app/test/synonyms.js +0 -31
  128. data/xpcomcore/etc/jsdoc-toolkit/app/test/tosource.js +0 -23
  129. data/xpcomcore/etc/jsdoc-toolkit/app/test/variable_redefine.js +0 -14
  130. data/xpcomcore/etc/jsdoc-toolkit/changes.txt +0 -96
  131. data/xpcomcore/etc/jsdoc-toolkit/conf/sample.conf +0 -31
  132. data/xpcomcore/etc/jsdoc-toolkit/java/build.xml +0 -36
  133. data/xpcomcore/etc/jsdoc-toolkit/java/build_1.4.xml +0 -36
  134. data/xpcomcore/etc/jsdoc-toolkit/java/classes/js.jar +0 -0
  135. data/xpcomcore/etc/jsdoc-toolkit/java/src/JsDebugRun.java +0 -21
  136. data/xpcomcore/etc/jsdoc-toolkit/java/src/JsRun.java +0 -21
  137. data/xpcomcore/etc/jsdoc-toolkit/jsdebug.jar +0 -0
  138. data/xpcomcore/etc/jsdoc-toolkit/jsrun.jar +0 -0
  139. data/xpcomcore/etc/jsdoc-toolkit/jsrun.sh +0 -52
  140. data/xpcomcore/etc/jsdoc-toolkit/templates/jsdoc/allclasses.tmpl +0 -17
  141. data/xpcomcore/etc/jsdoc-toolkit/templates/jsdoc/allfiles.tmpl +0 -56
  142. data/xpcomcore/etc/jsdoc-toolkit/templates/jsdoc/class.tmpl +0 -646
  143. data/xpcomcore/etc/jsdoc-toolkit/templates/jsdoc/index.tmpl +0 -39
  144. data/xpcomcore/etc/jsdoc-toolkit/templates/jsdoc/publish.js +0 -200
  145. data/xpcomcore/etc/jsdoc-toolkit/templates/jsdoc/static/default.css +0 -162
  146. data/xpcomcore/etc/jsdoc-toolkit/templates/jsdoc/static/header.html +0 -2
  147. data/xpcomcore/etc/jsdoc-toolkit/templates/jsdoc/static/index.html +0 -19
  148. data/xpcomcore/etc/jsdoc-toolkit/templates/jsdoc/symbol.tmpl +0 -35
data/README.rdoc DELETED
@@ -1,18 +0,0 @@
1
- = xpcomcore-rubygem
2
-
3
- Description goes here.
4
-
5
- == Note on Patches/Pull Requests
6
-
7
- * Fork the project.
8
- * Make your feature addition or bug fix.
9
- * Add tests for it. This is important so I don't break it in a
10
- future version unintentionally.
11
- * Commit, do not mess with rakefile, version, or history.
12
- (if you want to have your own version, that is fine but
13
- bump version in a commit by itself I can ignore when I pull)
14
- * Send me a pull request. Bonus points for topic branches.
15
-
16
- == Copyright
17
-
18
- Copyright (c) 2009 ggironda. See LICENSE for details.
@@ -1,4 +0,0 @@
1
- #!/usr/bin/env ruby
2
- require 'pathname'
3
- ENV['XPCOMCORE_BOOTSTRAP'] = (Pathname(__FILE__).parent.parent + "xpcomcore/bootstrapper.js").expand_path.to_s
4
- exec("firefox-bin", *ARGV)
@@ -1,205 +0,0 @@
1
- #!/usr/bin/env ruby
2
- require 'rubygems'
3
- require 'sys/uname'
4
- require 'pathname'
5
- require 'optparse'
6
- require 'rexml/document'
7
- require 'fileutils'
8
-
9
- class XPCOMCoreRubyGemInstaller
10
- attr_accessor :no_dry_run, :install_global, :install_local, :fix_path
11
-
12
- KnownAppIds = {'Firefox' => '{ec8030f7-c20a-464f-9b0e-13a3a9e97384}'}
13
- KnownVendors = %w[Mozilla]
14
- ScriptName = Pathname(__FILE__).basename
15
- SysName = Sys::Uname.sysname.downcase.to_sym
16
- InstallPathBuilders = {:linux => {}, :darwin => {}}
17
- GeckoCommands = %w[firefox-bin firefox xulrunner-bin]
18
- ProfilePath = Pathname("~/.profile").expand_path
19
-
20
- # Linux install path builders
21
- InstallPathBuilders[:linux][:global] = [
22
- lambda {|vendor,app,extension| Pathname("/usr/lib") + vendor + "extensions" + app + extension },
23
- lambda {|vendor,app,extension| Pathname("/usr/lib64") + vendor + "extensions" + app + extension },
24
- lambda {|vendor,app,extension| Pathname("/usr/share") + vendor + "extensions" + app + extension }
25
- ]
26
- InstallPathBuilders[:linux][:local] = [
27
- lambda {|vendor,app,extension| Pathname("~/.#{vendor}") + "extensions" + app + extension }
28
- ]
29
-
30
- # Mac OS X install path builders
31
- InstallPathBuilders[:darwin][:global] = [
32
- lambda {|vendor,app,extension| Pathname("/Library/Application Support") + vendor + "Extensions" + app + extension }
33
- ]
34
- InstallPathBuilders[:darwin][:local] = [
35
- lambda {|vendor,app,extension| Pathname("~/Library/Application Support") + vendor + "Extensions" + app + extension }
36
- ]
37
-
38
- GeckoLocations = {:linux => [], :darwin => []}
39
- GeckoLocations[:darwin] << Pathname("/Applications/Firefox.app/Contents/MacOS/firefox-bin")
40
- GeckoLocations[:darwin] << Pathname("/Library/Frameworks/XUL.framework/xulrunner-bin")
41
-
42
- def initialize(args, options = {})
43
- @args = args
44
- @options = options
45
- @option_parser = OptionParser.new do |opts|
46
- opts.banner = "Usage: #{ScriptName} [options]"
47
- opts.on("--install-global", "Install the XPCOMCore gem bootstrap code globally.", method(:install_global=))
48
- opts.on("--install-local", "Install the XPCOMCore gem bootstrap code for the current user only.", method(:install_local=))
49
- opts.on("--fix-path", "Checks the path for an executable Gecko installation and fixes it if necessary.", method(:fix_path=))
50
- opts.on("--do-it", "By default, we do a dry run and show the user what would happen. This forces the actual install.", method(:no_dry_run=))
51
- end
52
- end
53
-
54
- def dry_run?
55
- !no_dry_run
56
- end
57
-
58
- def go!
59
- @option_parser.parse(@args)
60
- install_opts = {:install_global => install_global, :install_local => install_local}
61
- if !install_opts.values.any?
62
- puts @option_parser
63
- exit(1)
64
- end
65
- read_install_manifest
66
- install_opts.each do |opt_name,value|
67
- send(:"do_#{opt_name}") if value
68
- log("All done!.")
69
- end
70
- rescue OptionParser::InvalidOption => e
71
- invalid_option(e)
72
- end
73
-
74
- private
75
-
76
- def invalid_option(exception)
77
- puts exception.message
78
- puts @option_parser
79
- exit(1)
80
- end
81
-
82
- def do_install_global
83
- do_install(:global) && rewrite_path
84
- end
85
-
86
- def do_install_local
87
- do_install(:local) && rewrite_path
88
- end
89
-
90
- def do_install(scope)
91
- each_vendor_and_app_name_and_app_id do |vendor, app_name, app_id|
92
- if install_extension(scope, vendor, app_id)
93
- next(true)
94
- else
95
- log("No app install location for application '#{app_name}' by vendor '#{vendor}' exists. Skipping.")
96
- next(false)
97
- end
98
- end.any?
99
- end
100
-
101
- def each_vendor_and_app_name_and_app_id
102
- KnownVendors.each do |vendor_name|
103
- KnownAppIds.each do |app_name, app_id|
104
- yield(vendor_name, app_name, app_id)
105
- end
106
- end
107
- end
108
-
109
- def install_extension(scope, vendor, app_id)
110
- raise "Couldn't read extension id from install manifest" if extension_id.empty?
111
- InstallPathBuilders[SysName][scope].select do |path_builder|
112
- log("Performing a #{scope} install...")
113
- install_path = path_builder[vendor, app_id, extension_id].expand_path
114
- if !install_path.parent.exist?
115
- log("Directory '#{install_path.parent}' doesn't exist - skipping installation to this location.")
116
- next(false)
117
- else
118
- copy_extension_to(install_path)
119
- next(true)
120
- end
121
- end.any?
122
- end
123
-
124
- def read_install_manifest
125
- manifest_contents = (@options[:extension_path] + "install.rdf").read
126
- @install_manifest = REXML::Document.new(manifest_contents)
127
- end
128
-
129
- def extension_path
130
- @options[:extension_path]
131
- end
132
-
133
- def extension_id
134
- @extension_id ||= @install_manifest.root.elements["Description/em:id"].text
135
- end
136
-
137
- def copy_extension_to(install_path)
138
- if install_path.parent.writable?
139
- log("Copying '#{extension_path}' to '#{install_path}'")
140
- copy_dir(extension_path, install_path)
141
- else
142
- log("Path '#{install_path}' isn't writable. Maybe you need to run this as root and try again if installing globally?")
143
- end
144
- end
145
-
146
- def log(str)
147
- puts("#{dry_run? ? "[DRY RUN]" : "[INSTALLER]"} #{str}")
148
- end
149
-
150
- def copy_dir(src_path, install_path)
151
- return false if dry_run?
152
- FileUtils.cp_r(src_path.expand_path.to_s + "/.", install_path.to_s)
153
- end
154
-
155
- def rewrite_path
156
- return false unless fix_path
157
- gecko_available = check_path
158
- rewrite_profile unless gecko_available
159
- end
160
-
161
- def check_path
162
- GeckoCommands.collect do |cmd|
163
- `#{cmd} -v 2>/dev/null`
164
- $? == 0
165
- end.any?
166
- end
167
-
168
- def rewrite_profile
169
- log("I couldn't find any of '#{GeckoCommands.join(", ")}'. Doing my best attempt to rectify this.")
170
- send(:"rewrite_profile_for_#{SysName}")
171
- end
172
-
173
- def rewrite_profile_for_linux
174
- log("Sorry. You're on your own here. Check your distribution's documentation for details - for example, Firefox may be installed under a different name.")
175
- end
176
-
177
- def rewrite_profile_for_darwin
178
- loc = GeckoLocations[:darwin].detect {|p| p.exist?}
179
- unless loc
180
- log("I can't find Firefox installed on your system. Sorry.")
181
- exit(1)
182
- end
183
- log("Awesome. I found a Gecko installation at '#{loc}'. Rewriting your .profile to include this in the $PATH.")
184
- rewrite_path_with_location(loc.parent)
185
- end
186
-
187
- def rewrite_path_with_location(path_entry)
188
- profile_entry = %Q[PATH="#{path_entry}:$PATH"]
189
- log("Adding .profile entry: #{profile_entry}")
190
- if dry_run?
191
- log("Not adding an entry due to running in dry run mode.")
192
- else
193
- ProfilePath.open("a") do |io|
194
- io << "\n"
195
- io.puts("# This and the following lines automatically added by xpcomcore-rubygem on #{Time.now}.")
196
- io.puts(profile_entry)
197
- end
198
- log(".profile entry added. You may need to source your .profile again or log in and out for it to take effect.")
199
- end
200
- end
201
-
202
- end
203
-
204
- installer = XPCOMCoreRubyGemInstaller.new(ARGV, :extension_path => (Pathname(__FILE__).parent.parent + "extension").expand_path)
205
- installer.go!
data/extension/README.txt DELETED
@@ -1 +0,0 @@
1
- This extension was installed by xpcomcore-rubygem. See http://github.com/gabrielg/xpcomcore-rubygem or http://conflagrationjs.org for details.
@@ -1,16 +0,0 @@
1
- <?xml version="1.0"?>
2
-
3
- <RDF xmlns="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:em="http://www.mozilla.org/2004/em-rdf#">
4
- <Description about="urn:mozilla:install-manifest">
5
- <em:id>xpcomcorebootstrapper@conflagrationjs.org</em:id>
6
- <em:version>0.1.0</em:version>
7
- <em:type>2</em:type>
8
- <em:targetApplication>
9
- <Description>
10
- <em:id>toolkit@mozilla.org</em:id>
11
- <em:minVersion>1.9.0</em:minVersion>
12
- </Description>
13
- </em:targetApplication>
14
- <em:name>XPCOMCore Bootstrapper Extension</em:name>
15
- </Description>
16
- </RDF>
@@ -1,186 +0,0 @@
1
- ======================================================================
2
-
3
- DESCRIPTION:
4
-
5
- This is the source code for JsDoc Toolkit, an automatic documentation
6
- generation tool for JavaScript. It is written in JavaScript and is run
7
- from a command line (or terminal) using the Java and Mozilla's Rhino
8
- JavaScript runtime engine.
9
-
10
- Using this tool you can automatically turn JavaDoc-like comments in
11
- your JavaScript source code into published output files, such as HTML
12
- or XML.
13
-
14
- For more information, to report a bug, or to browse the technical
15
- documentation for this tool please visit the official JsDoc Toolkit
16
- project homepage at http://code.google.com/p/jsdoc-toolkit/
17
-
18
- For the most up-to-date documentation on JsDoc Toolkit see the
19
- official wiki at http://code.google.com/p/jsdoc-toolkit/w/list
20
-
21
- ======================================================================
22
-
23
- REQUIREMENTS:
24
-
25
- JsDoc Toolkit is known to work with:
26
- java version "1.6.0_03"
27
- Java(TM) SE Runtime Environment (build 1.6.0_03-b05)
28
- on Windows XP,
29
- and java version "1.5.0_13"
30
- Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_13-b05-241)
31
- on Mac OS X 10.4.
32
-
33
- Other versions of java may or may not work with JsDoc Toolkit.
34
-
35
- ======================================================================
36
-
37
- USAGE:
38
-
39
- Running JsDoc Toolkit requires you to have Java installed on your
40
- computer. For more information see http://www.java.com/getjava/
41
-
42
- Before running the JsDoc Toolkit app you should change your current
43
- working directory to the jsdoc-toolkit folder. Then follow the
44
- examples below, or as shown on the project wiki.
45
-
46
- On a computer running Windows a valid command line to run JsDoc
47
- Toolkit might look like this:
48
-
49
- > java -jar jsrun.jar app\run.js -a -t=templates\jsdoc mycode.js
50
-
51
- On Mac OS X or Linux the same command would look like this:
52
-
53
- $ java -jar jsrun.jar app/run.js -a -t=templates/jsdoc mycode.js
54
-
55
- The above assumes your current working directory contains jsrun.jar,
56
- the "app" and "templates" subdirectories from the standard JsDoc
57
- Toolkit distribution and that the relative path to the code you wish
58
- to document is "mycode.js".
59
-
60
- The output documentation files will be saved to a new directory named
61
- "out" (by default) in the current directory, or if you specify a
62
- -d=somewhere_else option, to the somewhere_else directory.
63
-
64
- For help (usage notes) enter this on the command line:
65
-
66
- $ java -jar jsrun.jar app/run.js --help
67
-
68
- More information about the various command line options used by JsDoc
69
- Toolkit are available on the project wiki.
70
-
71
- ======================================================================
72
-
73
- RUNNING VIA SHELL SCRIPT
74
-
75
- Avi Deitcher has contributed the file jsrun.sh with the following usage notes:
76
-
77
- A script to simplify running jsdoc from the command-line, especially when
78
- running from within a development or build environment such as ant.
79
-
80
- Normally, to run jsdoc, you need a command-line as the following:
81
- java -Djsdoc.dir=/some/long/dir/path/to/jsdoc -jar
82
- /some/long/dir/path/to/jsdoc/jsrun.jar /some/long/dir/path/to/jsdoc/app/run.js
83
- -t=template -r=4 /some/long/dir/path/to/my/src/code
84
-
85
- This can get tedious to redo time and again, and difficult to use from within a
86
- build environment.
87
-
88
- To simplify the process, jsrun.sh will automatically run this path, as well as
89
- passing through any arguments.
90
-
91
- Usage: jsrun.sh <run.js arguments>
92
-
93
- All <run.js arguments> will be passed through.
94
- Additionally, jsrun.sh will take the following actions:
95
- 1) If the environment variable JSDOCDIR is set, it will add
96
- "-Djsdoc.dir=$JSDOCDIR" to the command-line
97
- 2) If the environment variable JSDOCTEMPLATEDIR is set, it will add
98
- "-Djsdoc.template.dir=$JSDOCTEMPLATEDIR" to the command-line
99
- 3) java with the appropriate path to jsrun.jar and run.js will be instantiated
100
-
101
- If not variables are set, it is assumed that the path to jsrun.jar and app/ is
102
- in the current working directory.
103
-
104
- Example:
105
- # jsrun.sh ./src/
106
- Assuming JSDOCDIR=/some/path/to/my/jsdoc will cause the following command to
107
- execute:
108
- java -Djsdoc.dir=/some/path/to/my/jsdoc -jar /some/path/to/my/jsdoc/jsrun.jar
109
- /some/path/to/my/jsdoc/app/run.js ./src/
110
-
111
- ======================================================================
112
-
113
- TESTING:
114
-
115
- To run the suite of unit tests included with JsDoc Toolkit enter this
116
- on the command line:
117
-
118
- $ java -jar jsrun.jar app/run.js -T
119
-
120
- To see a dump of the internal data structure that JsDoc Toolkit has
121
- built from your source files use this command:
122
-
123
- $ java -jar jsrun.jar app/run.js mycode.js -Z
124
-
125
- ======================================================================
126
-
127
- LICENSE:
128
-
129
- JSDoc.pm
130
-
131
- This project is based on the JSDoc.pm tool, created by Michael
132
- Mathews and Gabriel Reid. More information on JsDoc.pm can
133
- be found on the JSDoc.pm homepage: http://jsdoc.sourceforge.net/
134
-
135
- Complete documentation on JsDoc Toolkit can be found on the project
136
- wiki at http://code.google.com/p/jsdoc-toolkit/w/list
137
-
138
- Rhino
139
-
140
- Rhino (JavaScript in Java) is open source and licensed by Mozilla
141
- under the MPL 1.1 or later/GPL 2.0 or later licenses, the text of
142
- which is available at http://www.mozilla.org/MPL/
143
-
144
- You can obtain the source code for Rhino from the Mozilla web site at
145
- http://www.mozilla.org/rhino/download.html
146
-
147
- JsDoc Toolkit is a larger work that uses the Rhino JavaScript engine
148
- but is not derived from it in any way. The Rhino library is used
149
- without modification and without any claims whatsoever.
150
-
151
- The Rhino Debugger
152
-
153
- You can obtain more information about the Rhino Debugger from the
154
- Mozilla web site at http://www.mozilla.org/rhino/debugger.html
155
-
156
- JsDoc Toolkit is a larger work that uses the Rhino Debugger but
157
- is not derived from it in any way. The Rhino Debugger is used
158
- without modification and without any claims whatsoever.
159
-
160
- JsDoc Toolkit
161
-
162
- All code specific to JsDoc Toolkit are free, open source and licensed
163
- for use under the X11/MIT License.
164
-
165
- JsDoc Toolkit is Copyright (c)2009 Michael Mathews <micmath@gmail.com>
166
-
167
- This program is free software; you can redistribute it and/or
168
- modify it under the terms below.
169
-
170
- Permission is hereby granted, free of charge, to any person obtaining
171
- a copy of this software and associated documentation files (the
172
- "Software"), to deal in the Software without restriction, including
173
- without limitation the rights to use, copy, modify, merge, publish,
174
- distribute, sublicense, and/or sell copies of the Software, and to
175
- permit persons to whom the Software is furnished to do so, subject to
176
- the following conditions: The above copyright notice and this
177
- permission notice must be included in all copies or substantial
178
- portions of the Software.
179
-
180
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
181
- EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
182
- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
183
- IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
184
- CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
185
- TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
186
- SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@@ -1,33 +0,0 @@
1
- IO.include("frame/Opt.js");
2
- IO.include("frame/Chain.js");
3
- IO.include("frame/Link.js");
4
- IO.include("frame/String.js");
5
- IO.include("frame/Hash.js");
6
- IO.include("frame/Namespace.js");
7
- //IO.include("frame/Reflection.js");
8
-
9
- /** A few helper functions to make life a little easier. */
10
-
11
- function defined(o) {
12
- return (o !== undefined);
13
- }
14
-
15
- function copy(o) { // todo check for circular refs
16
- if (o == null || typeof(o) != 'object') return o;
17
- var c = new o.constructor();
18
- for(var p in o) c[p] = copy(o[p]);
19
- return c;
20
- }
21
-
22
- function isUnique(arr) {
23
- var l = arr.length;
24
- for(var i = 0; i < l; i++ ) {
25
- if (arr.lastIndexOf(arr[i]) > i) return false;
26
- }
27
- return true;
28
- }
29
-
30
- /** Returns the given string with all regex meta characters backslashed. */
31
- RegExp.escapeMeta = function(str) {
32
- return str.replace(/([$^\\\/()|?+*\[\]{}.-])/g, "\\$1");
33
- }