lacey-rails 0.4.0 → 0.5.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 562c88bfad178367751a8002f3370e913305a478
4
- data.tar.gz: 35808af3c1fbe1a01e6213b50d10d651f93674f0
3
+ metadata.gz: 959f0e0f56bebf58ae44da80650d76881ad0781f
4
+ data.tar.gz: 443177bcaaf532373e974976cfbed3ca6ad9a4c6
5
5
  SHA512:
6
- metadata.gz: f5214d28c2608a58ca8e7b6971cfb82d662c613b3ba5396c119b2b2c1f1068a20836afd22ab5518673c8ce1135cb5d8043303f366b35f4cdfb98e9d59848bb5a
7
- data.tar.gz: 35d160d59fc925e2614e9bb7bce79f3165868dfccda1ba441463c66bbd8ae6eb4d3e5e94fbbc2a7fcc8fef9292081e214f81e7ef0441dcdb5330ab54a204c21e
6
+ metadata.gz: 6f9bb9a831fbb261f3844c7a011711458172758a108b855888d0dd30f5f3c122faf501e19e009c9ee7fd9267788b44bbc695dfcc606852027227cff60ca59a80
7
+ data.tar.gz: 67f04083361175cc12e7e8c8bc5fc2db641c9f9176835fa94bfa23e9b881270fb6f1273f0c35857217d11a5cc4aa9085decaa43246f6b80066b38132411f6638
@@ -1,5 +1,5 @@
1
1
  module Lacey
2
2
  module Rails
3
- VERSION = '0.4.0'
3
+ VERSION = '0.5.0'
4
4
  end
5
5
  end
@@ -1,11 +1,26 @@
1
- Object.prototype.has_parent = Object.prototype.is_child = false;
2
-
3
- Object.prototype.inherits_from = function (klass) {
4
- this.prototype = new (Function.bind.apply(klass, arguments))();
5
- this.prototype.constructor = this;
6
- this.prototype.is_child = this.prototype.has_parent = true;
7
- };
8
-
1
+ var prototype = Object.prototype;
2
+
3
+ Object.defineProperty(prototype, 'has_parent', {
4
+ value: false,
5
+ writable: true,
6
+ enumerable: false
7
+ });
8
+
9
+ Object.defineProperty(prototype, 'is_child', {
10
+ value: false,
11
+ writable: true,
12
+ enumerable: false
13
+ });
14
+
15
+ Object.defineProperty(prototype, 'inherits_from', {
16
+ value: function (klass) {
17
+ this.prototype = new (Function.bind.apply(klass, arguments))();
18
+ this.prototype.constructor = this;
19
+ this.prototype.is_child = this.prototype.has_parent = true;
20
+ },
21
+ writable: true,
22
+ enumerable: false
23
+ });
9
24
  var LaceyApp,
10
25
  LaceyModule,
11
26
  modules,
@@ -79,7 +94,7 @@ validate_module_type = function (Module) {
79
94
  };
80
95
 
81
96
  validate_duplicated_module = function (module_name) {
82
- if (this.modules[module_name] !== void 0) {
97
+ if (this.modules.indexOf(module_name) !== -1) {
83
98
  throw 'DuplicateModuleError - your module has already been registered';
84
99
  }
85
100
 
@@ -111,7 +126,7 @@ LaceyModule = function (module_name, parent_module, Module) {
111
126
  LaceyModule.prototype.initialize = function () {
112
127
  var instance = this.get_instance();
113
128
 
114
- if (!this.initialized && (instance.initialize !== null) && typeof instance.initialize === 'function') {
129
+ if (!this.initialized && typeof instance.initialize === 'function') {
115
130
  instance.initialize();
116
131
  this.initialized = true;
117
132
  }
@@ -120,12 +135,12 @@ LaceyModule.prototype.initialize = function () {
120
135
  };
121
136
 
122
137
  validate_parent_module_name = function (parent_module) {
123
- if (modules[parent_module] === null) {
124
- throw 'InvalidParentModule - the parent module does not exist';
138
+ if (typeof modules[parent_module] === 'undefined') {
139
+ throw 'InvalidParentModuleError - the parent module does not exist';
125
140
  }
126
141
 
127
142
  return true;
128
143
  };
129
144
 
130
145
 
131
- window.LaceyApp = LaceyApp;
146
+ window.LaceyApp = LaceyApp;
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: lacey-rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.0
4
+ version: 0.5.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - alexzicat
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2016-04-01 00:00:00.000000000 Z
11
+ date: 2016-04-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler