xpcomcore-rubygem 0.5.3 → 0.6.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (34) hide show
  1. data/Rakefile +2 -0
  2. data/VERSION +1 -1
  3. data/ext/stub_runners/darwin/StubApp.app/Contents/Info.plist +32 -0
  4. data/ext/stub_runners/darwin/StubApp.app/Contents/MacOS/stub_runner +0 -0
  5. data/ext/stub_runners/darwin/StubApp.app/Contents/PkgInfo +1 -0
  6. data/ext/stub_runners/darwin/StubApp.app/Contents/Resources/.gitignore +0 -0
  7. data/ext/stub_runners/darwin/src/Makefile +7 -0
  8. data/ext/stub_runners/darwin/src/stub_runner.c +19 -0
  9. data/lib/xpcomcore-rubygem/building/stub_app_helpers.rb +61 -0
  10. data/lib/xpcomcore-rubygem/commands/generate/application.rb +17 -1
  11. data/lib/xpcomcore-rubygem/commands/launch.rb +98 -49
  12. data/lib/xpcomcore-rubygem/tasks/application_task.rb +13 -3
  13. data/templates/application/chrome/content/xul/main_window.xul.erb +1 -1
  14. data/templates/application/chrome/icons/default/default.png +0 -0
  15. data/templates/shared/xultestrunner_test_task.erb +7 -7
  16. data/xpcomcore/Rakefile +3 -3
  17. data/xpcomcore/build_properties.yml +1 -1
  18. data/xpcomcore/components/XPCOMCore.js +1 -1
  19. data/xpcomcore/components/XPCOMCoreCLH.js +28 -0
  20. data/xpcomcore/doc/files.html +1 -1
  21. data/xpcomcore/doc/index.html +1 -1
  22. data/xpcomcore/doc/symbols/_global_.html +1 -1
  23. data/xpcomcore/doc/symbols/error.html +1 -1
  24. data/xpcomcore/doc/symbols/file.html +1 -1
  25. data/xpcomcore/doc/symbols/file.nosuchfileerror.html +1 -1
  26. data/xpcomcore/doc/symbols/kernel.html +44 -1
  27. data/xpcomcore/doc/symbols/loaderror.html +1 -1
  28. data/xpcomcore/doc/symbols/selfconcepterror.html +1 -1
  29. data/xpcomcore/doc/symbols/src/lib_kernel.js.html +159 -149
  30. data/xpcomcore/doc/symbols/sys.html +1 -1
  31. data/xpcomcore/doc/symbols/xpcbuiltins.html +1 -1
  32. data/xpcomcore/lib/kernel.js +11 -1
  33. data/xpcomcore-rubygem.gemspec +17 -2
  34. metadata +31 -2
data/Rakefile CHANGED
@@ -29,6 +29,8 @@ begin
29
29
 
30
30
  gem.add_dependency "sys-uname"
31
31
  gem.add_dependency "cmdparse"
32
+ gem.add_dependency "plist"
33
+ gem.add_dependency "iniparse"
32
34
  gem.add_dependency "uuidtools", ">=2.0.0"
33
35
  gem.add_dependency "jeweler", "=1.2.1"
34
36
  gem.add_development_dependency "colored"
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.5.3
1
+ 0.6.0
@@ -0,0 +1,32 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
3
+ <plist version="1.0">
4
+ <dict>
5
+ <key>CFBundleDevelopmentRegion</key>
6
+ <string>English</string>
7
+ <key>CFBundleExecutable</key>
8
+ <string>stub_runner</string>
9
+ <key>CFBundleGetInfoString</key>
10
+ <string>StubApp 1.0.0, © 1998-2009 Contributors</string>
11
+ <key>CFBundleIconFile</key>
12
+ <string>stubapp</string>
13
+ <key>CFBundleIdentifier</key>
14
+ <string>org.conflagrationjs.stubapp</string>
15
+ <key>CFBundleInfoDictionaryVersion</key>
16
+ <string>6.0</string>
17
+ <key>CFBundleName</key>
18
+ <string>StubApp</string>
19
+ <key>CFBundlePackageType</key>
20
+ <string>APPL</string>
21
+ <key>CFBundleShortVersionString</key>
22
+ <string>1.0.0</string>
23
+ <key>CFBundleSignature</key>
24
+ <string>XPCC</string>
25
+ <key>CFBundleVersion</key>
26
+ <string>1.0.0</string>
27
+ <key>NSAppleScriptEnabled</key>
28
+ <true/>
29
+ <key>CGDisableCoalescedUpdates</key>
30
+ <true/>
31
+ </dict>
32
+ </plist>
@@ -0,0 +1,7 @@
1
+ stub_runner: stub_runner.c
2
+ gcc -O2 -Wall -force_cpusubtype_ALL -mmacosx-version-min=10.4 -arch i386 -arch ppc stub_runner.c -o stub_runner
3
+
4
+ .PHONY: clean
5
+
6
+ clean:
7
+ rm -f stub_runner
@@ -0,0 +1,19 @@
1
+ #include <stdlib.h>
2
+ #include <stdio.h>
3
+ #include <unistd.h>
4
+
5
+ int main (int argc, const char * argv[]) {
6
+ char *executable = NULL;
7
+ char *exec_args[argc + 1];
8
+ int i;
9
+
10
+ executable = getenv("REAL_EXECUTABLE");
11
+ exec_args[0] = executable;
12
+
13
+ for (i = 1; i < argc; i++) {
14
+ exec_args[i] = (char *) argv[i];
15
+ }
16
+
17
+ exec_args[argc] = NULL;
18
+ return execv(executable, exec_args);
19
+ }
@@ -0,0 +1,61 @@
1
+ require 'iniparse'
2
+ require 'plist'
3
+
4
+ module XPCOMCore
5
+ module Building
6
+ module StubAppHelpers
7
+ class AppUpdater
8
+ IconPath = "chrome/icons/default/default.png"
9
+ IconConverter = "png2icns"
10
+
11
+ def initialize(options)
12
+ @xul_app_path = options[:xul_app_path]
13
+ @stub_dir = options[:stub_dir]
14
+ end
15
+
16
+ def update
17
+ app_ini = IniParse.parse((@xul_app_path + "application.ini").read)
18
+ app_section = app_ini['App']
19
+ check_for_and_set_app_dir(app_section['Name'])
20
+ rewrite_plist(:name => app_section['Name'], :version => app_section['Version'], :id => app_section['ID'], :vendor => app_section['Vendor'])
21
+ generate_icon(:name => app_section['Name'])
22
+ end
23
+
24
+ private
25
+
26
+ def check_for_and_set_app_dir(app_name)
27
+ app_dir = (@stub_dir + "#{app_name}.app")
28
+ raise "Stub App dir for #{app_name} does not exist." unless app_dir.exist?
29
+ @app_dir = app_dir
30
+ end
31
+
32
+ def rewrite_plist(options)
33
+ existing_plist = Plist::parse_xml((@app_dir + "Contents/Info.plist").to_s)
34
+ existing_plist['CFBundleGetInfoString'] = "%s %s © #{Date.today.year} %s" % options.values_at(:name, :version, :vendor)
35
+ existing_plist['CFBundleIconFile'] = options[:name].downcase
36
+ existing_plist['CFBundleIdentifier'] = appleize_id(options[:id])
37
+ existing_plist['CFBundleName'] = options[:name]
38
+ existing_plist['CFBundleShortVersionString'] = options[:version]
39
+ existing_plist['CFBundleVersion'] = options[:version]
40
+ existing_plist.save_plist((@app_dir + "Contents/Info.plist").to_s)
41
+ end
42
+
43
+ def appleize_id(mozilla_vendor)
44
+ mozilla_vendor.sub('@', '.').split('.').reverse.collect {|p| p.downcase}.join('.')
45
+ end
46
+
47
+ def generate_icon(options)
48
+ converter_installed = system("which", IconConverter)
49
+ if converter_installed
50
+ icon_file = @xul_app_path + IconPath
51
+ return nil unless icon_file.exist?
52
+ system(IconConverter, (@app_dir + "Contents/Resources" + "#{options[:name].downcase}.icns").expand_path.to_s, icon_file.expand_path.to_s)
53
+ else
54
+ puts "#{IconConverter} is not installed - install it to auto generate icons for Mac users."
55
+ end
56
+ end
57
+
58
+ end # AppUpdater
59
+ end # StubAppHelpers
60
+ end # Building
61
+ end # XPCOMCore
@@ -1,12 +1,16 @@
1
1
  require "xpcomcore-rubygem/commands/generate/jeweler_builder_command"
2
2
  require 'uuidtools'
3
+ require 'fileutils'
3
4
 
4
5
  module XPCOMCore
5
6
  class CommandParser
6
7
  class GenerateCommand
7
-
8
+ # TODO - move a bunch of stuff like gem_name and project_path to instance vars.
9
+ # Also move out the stub application copying stuff.
10
+ # Really, just clean this up in general.
8
11
  class ApplicationCommand < JewelerBuilderCommand
9
12
  BuilderTaskCode = "require 'xpcomcore-rubygem/tasks/application_task.rb'\nXPCOMCore::Tasks::ApplicationTask.new"
13
+ StubRoot = XPCOMCore::GemRoot + "ext/stub_runners"
10
14
 
11
15
  def initialize
12
16
  super('application', false) # Doesn't take subcommands
@@ -23,6 +27,18 @@ module XPCOMCore
23
27
  add_xpcomcore_application_build_task(rakefile)
24
28
  end
25
29
  copy_template_application(gem_name, project_path)
30
+ copy_stub_application(gem_name, project_path)
31
+ end
32
+
33
+ # FIXME / TODO - we only know how to deal with Darwin stub apps for now.
34
+ # Also, this code is messy and crap.
35
+ def copy_stub_application(gem_name, project_path)
36
+ stub_app_name = gem_name.capitalize
37
+ dest_app = (project_path + "xpcomcore/stub_runners/#{stub_app_name}.app").expand_path
38
+ dest_app.mkpath
39
+ stub_app = (StubRoot + "darwin/StubApp.app").expand_path
40
+ FileUtils.cp_r(stub_app.to_s + "/.", dest_app.expand_path.to_s)
41
+ system(%Q[cd "#{project_path}" && rake version:write && rake xpcomcore:update_app])
26
42
  end
27
43
 
28
44
  def add_xpcomcore_application_build_task(rakefile)
@@ -2,6 +2,7 @@ require 'rubygems'
2
2
  require 'xpcomcore-rubygem/commands'
3
3
  require 'sys/uname'
4
4
  require 'pathname'
5
+ require 'iniparse'
5
6
 
6
7
  module XPCOMCore
7
8
  class CommandParser
@@ -12,39 +13,102 @@ module XPCOMCore
12
13
  reason 'Application not found'
13
14
  end
14
15
 
15
- class XULRunnerNotFoundError < CmdParse::ParseError
16
- reason 'XULRunner not found'
17
- end
18
-
19
- GemAppRelativePath = "xpcomcore/app/application.ini"
20
- CurrentPlatform = Sys::Uname.sysname.downcase.to_sym
21
-
22
- # FIXME - clean up this xulrunnerlocator crap that takes up like half the class
23
- XULRunnerLocators = {:firefox => {}, :xulrunner => {}}
24
- XULRunnerLocators[:firefox][:unix] = [lambda { `which firefox-bin`}, lambda { `which firefox`}]
25
- XULRunnerLocators[:xulrunner][:unix] = [lambda { `which xulrunner-bin`}, lambda { `which xulrunner`}]
26
-
27
- # Linux uses the default UNIX locators
28
- XULRunnerLocators[:firefox][:linux] = XULRunnerLocators[:firefox][:unix]
29
- XULRunnerLocators[:xulrunner][:linux] = XULRunnerLocators[:xulrunner][:unix]
16
+ class BaseLauncher
17
+ class XULRunnerNotFoundError < CmdParse::ParseError
18
+ reason 'XULRunner not found'
19
+ end
20
+
21
+ def initialize(options)
22
+ @options = options
23
+ end
24
+
25
+ def launch
26
+ ENV['XPCOMCORE'] = ENV['XPCOMCORE'] || XPCOMCore::BootstrapperLocation.to_s
27
+ XPCOMCore::CommandParser.log("Using XPCOMCore bootstrapper at '#{ENV['XPCOMCORE']}'")
28
+ end
29
+
30
+ private
31
+
32
+ def launch_xre(xre_location)
33
+ XPCOMCore::CommandParser.log("Launching XUL application using XULRunner '#{xre_location}' from '#{@options[:ini_path].expand_path}'")
34
+ exec(xre_location, *["-app", @options[:ini_path].expand_path.to_s, "-no-remote", *@options[:args]])
35
+ end
36
+
37
+ def raise_xulrunner_not_found(search_location, runner_type)
38
+ raise(XULRunnerNotFoundError, "Sorry, we couldn't find #{runner_type}. We checked in #{search_location} but it didn't seem to be there.")
39
+ end
40
+
41
+ end # BaseLauncher
30
42
 
31
- # Darwin does some extra magic
32
- XULRunnerLocators[:firefox][:darwin] = XULRunnerLocators[:firefox][:unix] + [
33
- lambda do
43
+ class DarwinLauncher < BaseLauncher
44
+ StubLocationRelativeToIni = "../../stub_runners/%s.app"
45
+
46
+ def launch
47
+ super
48
+ xre_location = send(:"locate_#{@options[:runner_type]}")
49
+ if stub_location = find_stub
50
+ launch_from_stub(xre_location, stub_location)
51
+ else
52
+ launch_xre(xre_location)
53
+ end
54
+ end
55
+
56
+ private
57
+
58
+ def launch_from_stub(xre_location, stub_location)
59
+ ENV['REAL_EXECUTABLE'] = xre_location.to_s
60
+ XPCOMCore::CommandParser.log("Launching XUL application using stub '#{stub_location}' and XULRunner '#{xre_location}' from '#{@options[:ini_path].expand_path}'")
61
+ exec("open", stub_location.to_s, "-W", "--args", *["-app", @options[:ini_path].expand_path.to_s, "-no-remote", *@options[:args]])
62
+ end
63
+
64
+ def find_stub
65
+ parsed_ini = IniParse.parse(@options[:ini_path].read)
66
+ app_name = parsed_ini['App']['Name']
67
+ stub_path = (@options[:ini_path] + (StubLocationRelativeToIni % app_name)).expand_path
68
+ stub_path.exist? ? stub_path : nil
69
+ end
70
+
71
+ def locate_firefox
34
72
  applications = `osascript -e 'POSIX path of (path to applications folder)'`.strip
35
- firefox_bin = Pathname(applications) + "Firefox.app/Contents/MacOS/firefox-bin"
36
- firefox_bin.exist? ? firefox_bin.expand_path.to_s : ''
73
+ firefox_bin = (Pathname(applications) + "Firefox.app/Contents/MacOS/firefox-bin").expand_path
74
+ firefox_bin.exist? ? firefox_bin.to_s : raise_xulrunner_not_found(firefox_bin, "Firefox")
37
75
  end
38
- ]
39
-
40
- XULRunnerLocators[:xulrunner][:darwin] = XULRunnerLocators[:xulrunner][:unix] + [
41
- lambda do
76
+
77
+ def locate_xulrunner
42
78
  library = `osascript -e 'POSIX path of (path to library folder)'`.strip
43
- xulrunner_bin = Pathname(library) + "Frameworks/XUL.framework/xulrunner-bin"
44
- xulrunner_bin.exist? ? xulrunner_bin.expand_path.to_s : ''
79
+ xulrunner_bin = (Pathname(library) + "Frameworks/XUL.framework/xulrunner-bin").expand_path
80
+ xulrunner_bin.exist? ? xulrunner_bin.to_s : raise_xulrunner_not_found(xulrunner_bin, "XULRunner")
45
81
  end
46
- ]
47
82
 
83
+ end # DarwinLauncher
84
+
85
+ class LinuxLauncher < BaseLauncher
86
+
87
+ def launch
88
+ xre_location = send(:"locate_#{@options[:runner_type]}")
89
+ launch_xre(xre_location)
90
+ end
91
+
92
+ private
93
+
94
+ def locate_firefox
95
+ firefox_bin = [`which firefox-bin`, `which firefox`].detect do |path|
96
+ !path.strip.empty?
97
+ end
98
+ firefox_bin ? firefox_bin.strip : raise_xulrunner_not_found("$PATH", "Firefox")
99
+ end
100
+
101
+ def locate_xulrunner
102
+ xulrunner_bin = [`which xulrunner-bin`, `which xulrunner`].detect do |path|
103
+ !path.strip.empty?
104
+ end
105
+ xulrunner_bin ? xulrunner_bin.strip : raise_xulrunner_not_found("$PATH", "XULRunner")
106
+ end
107
+
108
+ end # LinuxLauncher
109
+
110
+ GemAppRelativePath = "xpcomcore/app/application.ini"
111
+ CurrentPlatform = Sys::Uname.sysname.downcase.to_sym
48
112
 
49
113
  def initialize
50
114
  super('launch', false, # Doesn't take subcommands
@@ -69,34 +133,19 @@ module XPCOMCore
69
133
  end
70
134
 
71
135
  def runner_type
72
- use_xulrunner ? :xulrunner : :firefox
136
+ use_xulrunner? ? :xulrunner : :firefox
73
137
  end
74
138
 
75
139
  private
76
140
 
77
141
  def launch_app(application_ini_path, args)
78
- xulrunner_path = find_xulrunner
79
- if xulrunner_path
80
- XPCOMCore::CommandParser.log("Launching XUL application using '#{xulrunner_path}' from '#{application_ini_path}'")
81
- set_env_and_launch(xulrunner_path, application_ini_path, args)
82
- else
83
- raise(XULRunnerNotFoundError, "A valid XULRunner executable could not be found.")
84
- end
85
- end
86
-
87
- def set_env_and_launch(xulrunner_bin, application_ini, args)
88
- ENV['XPCOMCORE'] = ENV['XPCOMCORE'] || XPCOMCore::BootstrapperLocation.to_s
89
- XPCOMCore::CommandParser.log("Using XPCOMCore bootstrapper at '#{ENV['XPCOMCORE']}'")
90
- exec(xulrunner_bin, *["-app", application_ini, *args])
142
+ launcher_class = self.class.const_get(:"#{CurrentPlatform.to_s.capitalize}Launcher")
143
+ launcher = launcher_class.new(:ini_path => application_ini_path, :runner_type => runner_type, :args => args)
144
+ launcher.launch
145
+ rescue NameError => e
146
+ puts "Probably couldn't get a launcher for your platform. Sorry. #{e}"
91
147
  end
92
-
93
- def find_xulrunner
94
- XULRunnerLocators[runner_type][CurrentPlatform].any? do |locator|
95
- location = locator.call.strip
96
- location.empty? ? nil : (break(location))
97
- end
98
- end
99
-
148
+
100
149
  def find_app(app_path)
101
150
  fs_path = Pathname(Dir.pwd) + app_path + "application.ini"
102
151
  if fs_path.exist?
@@ -1,14 +1,17 @@
1
1
  require 'rake'
2
2
  require 'xpcomcore-rubygem'
3
3
  require 'uuidtools'
4
+ require 'xpcomcore-rubygem/building/stub_app_helpers'
4
5
 
6
+ # TODO - update this to use iniparse.
5
7
  module XPCOMCore
6
8
  module Tasks
7
9
  class ApplicationTask
8
- IniLocation = "xpcomcore/app/application.ini"
10
+ AppLocation = "xpcomcore/app"
11
+ IniLocation = "#{AppLocation}/application.ini"
9
12
 
10
- def initialize(task_name = "xpcomcore:update_xul_application")
11
- desc("Updates the embedded XUL application's application.ini file for release.")
13
+ def initialize(task_name = "xpcomcore:update_app")
14
+ desc("Updates the embedded XUL application's application.ini file for release and generates any stub apps necessary.")
12
15
  task(task_name) { self.invoke }
13
16
  # Adds this as a dependency to gemspec so it updates along with it.
14
17
  task(:gemspec => task_name)
@@ -21,10 +24,17 @@ module XPCOMCore
21
24
  write_build_id(f)
22
25
  write_version(f)
23
26
  end
27
+ update_stub_app
24
28
  end
25
29
 
26
30
  private
27
31
 
32
+ def update_stub_app
33
+ updater = XPCOMCore::Building::StubAppHelpers::AppUpdater.new(:xul_app_path => Pathname(AppLocation).expand_path,
34
+ :stub_dir => Pathname("xpcomcore/stub_runners").expand_path)
35
+ updater.update
36
+ end
37
+
28
38
  def write_build_id(file)
29
39
  file.rewind
30
40
  contents = file.read
@@ -1,6 +1,6 @@
1
1
  <?xml version="1.0"?>
2
2
  <?xml-stylesheet href="chrome://global/skin/" type="text/css"?>
3
3
 
4
- <window id="main" title="My App" width="300" height="300" xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
4
+ <window id="main_window" title="My App" width="300" height="300" xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
5
5
  <caption label="Hello World from <%=@app_name%>"/>
6
6
  </window>
@@ -1,7 +1,7 @@
1
- gem 'xultestrunner'
2
- require 'xultestrunner/test_task'
3
- XULTestRunner::TestTask.new(<%=@task_name.inspect%>) do |test|
4
- <% @test_libs.each do |test_lib|%>test.libs << <%=test_lib.inspect%>
5
- <% end %>
6
- test.pattern = <%= @test_pattern.inspect %>
7
- end
1
+ #gem 'xultestrunner'
2
+ #require 'xultestrunner/test_task'
3
+ #XULTestRunner::TestTask.new(<%=@task_name.inspect%>) do |test|
4
+ # <% @test_libs.each do |test_lib|%>test.libs << <%=test_lib.inspect%>
5
+ # <% end %>
6
+ # test.pattern = <%= @test_pattern.inspect %>
7
+ #end
data/xpcomcore/Rakefile CHANGED
@@ -8,8 +8,8 @@ require 'english'
8
8
  here = (Pathname(__FILE__).parent.expand_path)
9
9
 
10
10
  task :test do
11
- ENV['XPCOMCORE'] = Pathname(__FILE__).parent.expand_path.to_s
12
- exec(ENV['XULTEST'] || "xultest", "-testDir", (Pathname(__FILE__).parent + "test/").expand_path.to_s)
11
+ ENV['XPCOMCORE'] = (Pathname(__FILE__).parent.expand_path + "bootstrapper.js").to_s
12
+ exec(ENV['XULTEST'] || "xultest", "--", "-testDir", (Pathname(__FILE__).parent + "test/").expand_path.to_s)
13
13
  end
14
14
 
15
15
  task :default => :test
@@ -20,7 +20,7 @@ namespace :docs do
20
20
 
21
21
  JsDocToolkit::DocTask.new(:build) do |doc|
22
22
  doc.jsdoc_dir = 'doc'
23
- doc.jsdoc_files = 'lib'
23
+ doc.jsdoc_files << 'lib'
24
24
  end
25
25
 
26
26
  task :clean do
@@ -3,5 +3,5 @@ gecko:
3
3
  min_version: 1.9.0
4
4
  version:
5
5
  major: 0
6
- patch: 1
7
6
  minor: 5
7
+ patch: 2
@@ -1,5 +1,5 @@
1
1
  Components.utils.import("resource://gre/modules/XPCOMUtils.jsm");
2
- var XPCOMCoreVersion = '0.5.1'; // DO NOT REMOVE THIS COMMENT OR MOVE THIS LINE. THIS LINE IS AUTO-GENERATED FROM A RAKE TASK. @XPCOMCORE_VERSION@
2
+ var XPCOMCoreVersion = '0.5.2'; // DO NOT REMOVE THIS COMMENT OR MOVE THIS LINE. THIS LINE IS AUTO-GENERATED FROM A RAKE TASK. @XPCOMCORE_VERSION@
3
3
  const $Cc = Components.classes;
4
4
  const $Ci = Components.interfaces;
5
5
 
@@ -0,0 +1,28 @@
1
+ Components.utils.import("resource://gre/modules/XPCOMUtils.jsm");
2
+ const Cc = Components.classes;
3
+ const Ci = Components.interfaces;
4
+
5
+ var XPCOMCoreCommandLineHandler = function() {
6
+ if (arguments.callee.__singletonInstance__) { return arguments.callee.__singletonInstance__; };
7
+ this.wrappedJSObject = this;
8
+ arguments.callee.__singletonInstance__ = this;
9
+ };
10
+
11
+ XPCOMCoreCommandLineHandler.prototype = {
12
+ args: [],
13
+ classDescription: "XPCOMCore Command Line Handler",
14
+ contractID: "@conflagrationjs.org/xpcomcore/generic-command-line-handler-clh;1",
15
+ classID: Components.ID("{b5730df0-b859-11de-8a39-0800200c9a66}"),
16
+ helpInfo: "",
17
+ QueryInterface: XPCOMUtils.generateQI([Ci.nsIObserver, Ci.nsICommandLineHandler]),
18
+ _xpcom_categories: [{category: "command-line-handler", entry: "a-xpcomcore"}],
19
+
20
+ handle: function(cmdLine) {
21
+ for (var i = 0; i < cmdLine.length; i++) { this.args.push(cmdLine.getArgument(i)); }
22
+ }
23
+
24
+ };
25
+
26
+ NSGetModule = function(compMgr, fileSpec) {
27
+ return XPCOMUtils.generateModule([XPCOMCoreCommandLineHandler]);
28
+ };
@@ -269,7 +269,7 @@ This file defines the implementation of our File object.
269
269
  </div>
270
270
  <div class="fineprint" style="clear:both">
271
271
 
272
- Documentation generated by <a href="http://code.google.com/p/jsdoc-toolkit/" target="_blankt">JsDoc Toolkit</a> 2.3.2 on Sun Oct 11 2009 20:30:22 GMT-0500 (CDT)
272
+ Documentation generated by <a href="http://code.google.com/p/jsdoc-toolkit/" target="_blankt">JsDoc Toolkit</a> 2.3.2 on Tue Oct 13 2009 19:57:08 GMT-0500 (CDT)
273
273
  </div>
274
274
  </body>
275
275
  </html>
@@ -269,7 +269,7 @@ build the rest of XPCOMCore on top of.
269
269
  </div>
270
270
  <div class="fineprint" style="clear:both">
271
271
 
272
- Documentation generated by <a href="http://code.google.com/p/jsdoc-toolkit/" target="_blankt">JsDoc Toolkit</a> 2.3.2 on Sun Oct 11 2009 20:30:22 GMT-0500 (CDT)
272
+ Documentation generated by <a href="http://code.google.com/p/jsdoc-toolkit/" target="_blankt">JsDoc Toolkit</a> 2.3.2 on Tue Oct 13 2009 19:57:08 GMT-0500 (CDT)
273
273
  </div>
274
274
  </body>
275
275
  </html>
@@ -259,7 +259,7 @@ ul.inheritsList
259
259
  <!-- ============================== footer ================================= -->
260
260
  <div class="fineprint" style="clear:both">
261
261
 
262
- Documentation generated by <a href="http://code.google.com/p/jsdoc-toolkit/" target="_blank">JsDoc Toolkit</a> 2.3.2 on Sun Oct 11 2009 20:30:21 GMT-0500 (CDT)
262
+ Documentation generated by <a href="http://code.google.com/p/jsdoc-toolkit/" target="_blank">JsDoc Toolkit</a> 2.3.2 on Tue Oct 13 2009 19:57:08 GMT-0500 (CDT)
263
263
  </div>
264
264
  </body>
265
265
  </html>
@@ -259,7 +259,7 @@ ul.inheritsList
259
259
  <!-- ============================== footer ================================= -->
260
260
  <div class="fineprint" style="clear:both">
261
261
 
262
- Documentation generated by <a href="http://code.google.com/p/jsdoc-toolkit/" target="_blank">JsDoc Toolkit</a> 2.3.2 on Sun Oct 11 2009 20:30:21 GMT-0500 (CDT)
262
+ Documentation generated by <a href="http://code.google.com/p/jsdoc-toolkit/" target="_blank">JsDoc Toolkit</a> 2.3.2 on Tue Oct 13 2009 19:57:08 GMT-0500 (CDT)
263
263
  </div>
264
264
  </body>
265
265
  </html>
@@ -446,7 +446,7 @@ from the specified file
446
446
  <!-- ============================== footer ================================= -->
447
447
  <div class="fineprint" style="clear:both">
448
448
 
449
- Documentation generated by <a href="http://code.google.com/p/jsdoc-toolkit/" target="_blank">JsDoc Toolkit</a> 2.3.2 on Sun Oct 11 2009 20:30:21 GMT-0500 (CDT)
449
+ Documentation generated by <a href="http://code.google.com/p/jsdoc-toolkit/" target="_blank">JsDoc Toolkit</a> 2.3.2 on Tue Oct 13 2009 19:57:08 GMT-0500 (CDT)
450
450
  </div>
451
451
  </body>
452
452
  </html>
@@ -329,7 +329,7 @@ ul.inheritsList
329
329
  <!-- ============================== footer ================================= -->
330
330
  <div class="fineprint" style="clear:both">
331
331
 
332
- Documentation generated by <a href="http://code.google.com/p/jsdoc-toolkit/" target="_blank">JsDoc Toolkit</a> 2.3.2 on Sun Oct 11 2009 20:30:21 GMT-0500 (CDT)
332
+ Documentation generated by <a href="http://code.google.com/p/jsdoc-toolkit/" target="_blank">JsDoc Toolkit</a> 2.3.2 on Tue Oct 13 2009 19:57:08 GMT-0500 (CDT)
333
333
  </div>
334
334
  </body>
335
335
  </html>
@@ -363,6 +363,15 @@ have been loaded through <a href="../symbols/kernel.html#require">Kernel#require
363
363
  </thead>
364
364
  <tbody>
365
365
 
366
+ <tr>
367
+ <td class="attributes">&nbsp;</td>
368
+ <td class="nameDescription">
369
+ <div class="fixedFont"><b><a href="../symbols/kernel.html#$ARGV">$ARGV</a></b>()
370
+ </div>
371
+ <div class="description">Returns the command line arguments this instance of the GRE was started with.</div>
372
+ </td>
373
+ </tr>
374
+
366
375
  <tr>
367
376
  <td class="attributes">&nbsp;</td>
368
377
  <td class="nameDescription">
@@ -676,6 +685,40 @@ have been loaded through <a href="../symbols/kernel.html#require">Kernel#require
676
685
  Method Detail
677
686
  </div>
678
687
 
688
+ <a name="$ARGV"> </a>
689
+ <div class="fixedFont">
690
+
691
+ <span class="light">{Array}</span>
692
+ <b>$ARGV</b>()
693
+
694
+ </div>
695
+ <div class="description">
696
+ Returns the command line arguments this instance of the GRE was started with.
697
+ NOTE: This doesn't play nicely with remoting to existing instances, but for now,
698
+ we don't really care about that.
699
+
700
+
701
+ </div>
702
+
703
+
704
+
705
+
706
+
707
+
708
+
709
+
710
+ <dl class="detailList">
711
+ <dt class="heading">Returns:</dt>
712
+
713
+ <dd><span class="light fixedFont">{Array}</span> </dd>
714
+
715
+ </dl>
716
+
717
+
718
+
719
+
720
+ <hr />
721
+
679
722
  <a name="$CURRENT_DIRECTORY"> </a>
680
723
  <div class="fixedFont">
681
724
 
@@ -1093,7 +1136,7 @@ in <a href="../symbols/kernel.html#$LOAD_PATH">Kernel#$LOAD_PATH</a>.</dd>
1093
1136
  <!-- ============================== footer ================================= -->
1094
1137
  <div class="fineprint" style="clear:both">
1095
1138
 
1096
- Documentation generated by <a href="http://code.google.com/p/jsdoc-toolkit/" target="_blank">JsDoc Toolkit</a> 2.3.2 on Sun Oct 11 2009 20:30:21 GMT-0500 (CDT)
1139
+ Documentation generated by <a href="http://code.google.com/p/jsdoc-toolkit/" target="_blank">JsDoc Toolkit</a> 2.3.2 on Tue Oct 13 2009 19:57:08 GMT-0500 (CDT)
1097
1140
  </div>
1098
1141
  </body>
1099
1142
  </html>
@@ -329,7 +329,7 @@ ul.inheritsList
329
329
  <!-- ============================== footer ================================= -->
330
330
  <div class="fineprint" style="clear:both">
331
331
 
332
- Documentation generated by <a href="http://code.google.com/p/jsdoc-toolkit/" target="_blank">JsDoc Toolkit</a> 2.3.2 on Sun Oct 11 2009 20:30:22 GMT-0500 (CDT)
332
+ Documentation generated by <a href="http://code.google.com/p/jsdoc-toolkit/" target="_blank">JsDoc Toolkit</a> 2.3.2 on Tue Oct 13 2009 19:57:08 GMT-0500 (CDT)
333
333
  </div>
334
334
  </body>
335
335
  </html>
@@ -329,7 +329,7 @@ ul.inheritsList
329
329
  <!-- ============================== footer ================================= -->
330
330
  <div class="fineprint" style="clear:both">
331
331
 
332
- Documentation generated by <a href="http://code.google.com/p/jsdoc-toolkit/" target="_blank">JsDoc Toolkit</a> 2.3.2 on Sun Oct 11 2009 20:30:22 GMT-0500 (CDT)
332
+ Documentation generated by <a href="http://code.google.com/p/jsdoc-toolkit/" target="_blank">JsDoc Toolkit</a> 2.3.2 on Tue Oct 13 2009 19:57:08 GMT-0500 (CDT)
333
333
  </div>
334
334
  </body>
335
335
  </html>