xpcomcore-rubygem 0.2.0 → 0.3.0

Sign up to get free protection for your applications and to get access to all the features.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.2.0
1
+ 0.3.0
@@ -1,3 +1,36 @@
1
- var env = Components.classes["@mozilla.org/process/environment;1"].getService(Components.interfaces.nsIEnvironment);
2
- var xpcomcoreBootstrapper = env.exists('XPCOMCORE_BOOTSTRAP') && env.get('XPCOMCORE_BOOTSTRAP');
3
- if (xpcomcoreBootstrapper) { Components.utils.import("file://" + xpcomcoreBootstrapper); }
1
+ Components.utils.import("resource://gre/modules/XPCOMUtils.jsm");
2
+
3
+ // Singleton time
4
+ var XPCOMCoreBootstrapper = function() {
5
+ if (arguments.callee.__singletonInstance__) { return arguments.callee.__singletonInstance__; };
6
+ arguments.callee.__singletonInstance__ = this;
7
+ };
8
+
9
+ XPCOMCoreBootstrapper.prototype = {
10
+ bootstrapped: false,
11
+ classDescription: "XPCOMCore Bootstrapper Component",
12
+ contractID: "@conflagrationjs.org/xpcomcore/bootstrapper;1",
13
+ classID: Components.ID("{5412c380-b3b2-11de-8a39-0800200c9a66}"),
14
+ QueryInterface: XPCOMUtils.generateQI([Components.interfaces.nsIObserver]),
15
+ _xpcom_categories: [{category: "xpcom-startup"}],
16
+
17
+ observe: function(subject, topic, data) {
18
+ if (topic != "xpcom-startup") { return false; }
19
+ if (this.bootstrapped) {
20
+ dump("\n\nXPCOMCore already bootstrapped.\n\n");
21
+ } else {
22
+ var env = Components.classes["@mozilla.org/process/environment;1"].getService(Components.interfaces.nsIEnvironment);
23
+ var xpcomcoreBootstrapper = env.exists('XPCOMCORE_BOOTSTRAP') && env.get('XPCOMCORE_BOOTSTRAP');
24
+ if (xpcomcoreBootstrapper) {
25
+ dump("\n\nLoading XPCOMCore Bootstrapper from " + xpcomcoreBootstrapper + ".\n\n");
26
+ Components.utils.import("file://" + xpcomcoreBootstrapper);
27
+ dump("\n\nXPCOMCore bootstrapped.\n\n");
28
+ } else {
29
+ dump("\n\nNot loading XPCOMCore Bootstrapper.\n\n");
30
+ }
31
+ }
32
+ }
33
+
34
+ };
35
+
36
+ NSGetModule = function(compMgr, fileSpec) { return XPCOMUtils.generateModule([XPCOMCoreBootstrapper]); };
@@ -5,7 +5,7 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{xpcomcore-rubygem}
8
- s.version = "0.2.0"
8
+ s.version = "0.3.0"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["ggironda"]
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: xpcomcore-rubygem
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - ggironda