ninjs 0.16.2 → 0.16.3

Sign up to get free protection for your applications and to get access to all the features.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.16.2
1
+ 0.16.3
data/ninjs.gemspec CHANGED
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{ninjs}
8
- s.version = "0.16.2"
8
+ s.version = "0.16.3"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = [%q{Dayton Nolan}]
12
- s.date = %q{2011-10-27}
12
+ s.date = %q{2011-10-28}
13
13
  s.description = %q{Ninjs is a ruby application and small javascript framework that helps you build clean, modular javascript applications. Ninjs encourages "Good Parts" best practices and the Crockford school Module pattern (http://www.crockford.com/). The ninjs command line application is an automatic compiler, written in ruby, and based on the Sprockets library (http://getsprockets.org/).}
14
14
  s.email = %q{daytonn@gmail.com}
15
15
  s.executables = [%q{ninjs}]
@@ -72,146 +72,146 @@ unless = function(expression, callback, fallback) {
72
72
  }
73
73
  }
74
74
  };
75
- var dom = (function() {
76
- var userAgent = navigator.userAgent;
77
- var browser = {
78
- agent: userAgent,
79
- mozilla: (/mozilla/.test(userAgent.toLowerCase())) && !(/(compatible|webkit)/.test(userAgent.toLowerCase())),
80
- webkit: /webkit/.test(userAgent.toLowerCase()),
81
- firefox: /firefox/.test(userAgent.toLowerCase()),
82
- chrome: /webkit/.test(userAgent.toLowerCase()),
83
- safari: /safari/.test(userAgent.toLowerCase()),
84
- opera: /opera/.test(userAgent.toLowerCase()),
85
- msie: (/msie/.test(userAgent.toLowerCase())) && !(/opera/.test( userAgent.toLowerCase() ))
86
- };
87
-
88
- var readyBound = false;
89
- var isReady = false;
90
- var readyList = [];
91
-
92
- function domReady() {
93
- if (!isReady) {
94
- isReady = true;
95
- if (readyList) {
96
- for(var fn = 0; fn < readyList.length; fn++) {
97
- readyList[fn].call(window, []);
98
- }
99
- readyList = [];
100
- }
101
- }
102
- }
103
-
104
- function addLoadEvent(func) {
105
- var oldonload = window.onload;
106
- if (typeof window.onload != 'function') {
107
- window.onload = func;
108
- }
109
- else {
110
- window.onload = function() {
111
- if (oldonload) {
112
- oldonload();
113
- }
114
- func();
115
- };
116
- }
117
- }
118
-
119
- function bindReady() {
120
- if (readyBound) {
121
- return;
122
- }
123
-
124
- readyBound = true;
125
-
126
- if (document.addEventListener && !browser.opera) {
127
- document.addEventListener("DOMContentLoaded", domReady, false);
128
- }
129
-
130
- if (browser.msie && window == top) {
131
- (function() {
132
- if (isReady) {
133
- return;
134
- }
135
- try {
136
- document.documentElement.doScroll("left");
137
- } catch(error) {
138
- setTimeout(arguments.callee, 0);
139
- return;
140
- }
141
- domReady();
142
- })();
143
- }
144
-
145
- if (browser.opera) {
146
- document.addEventListener( "DOMContentLoaded", function () {
147
- if (isReady) {
148
- return;
149
- }
150
- for (var i = 0; i < document.styleSheets.length; i++) {
151
- if (document.styleSheets[i].disabled) {
152
- setTimeout( arguments.callee, 0 );
153
- return;
154
- }
155
- domReady();
156
- }
157
- }, false);
158
- }
75
+ var DomReady = window.DomReady = {},
76
+ userAgent = navigator.userAgent.toLowerCase(),
77
+ browser = {
78
+ version: (userAgent.match( /.+(?:rv|it|ra|ie)[\/: ]([\d.]+)/ ) || [])[1],
79
+ safari: /webkit/.test(userAgent),
80
+ opera: /opera/.test(userAgent),
81
+ msie: (/msie/.test(userAgent)) && (!/opera/.test( userAgent )),
82
+ mozilla: (/mozilla/.test(userAgent)) && (!/(compatible|webkit)/.test(userAgent))
83
+ },
84
+ readyBound = false,
85
+ isReady = false,
86
+ readyList = [];
87
+
88
+
89
+ function domReady() {
90
+ if(!isReady) {
91
+ isReady = true;
92
+
93
+ if(readyList) {
94
+ var length = readyList.length;
95
+ for(var fn = 0; fn < length; fn++) {
96
+ readyList[fn].call(window, []);
97
+ }
98
+
99
+ readyList = [];
100
+ }
101
+ }
102
+ };
159
103
 
160
- if (browser.safari) {
161
- var numStyles;
162
- (function() {
163
- if (isReady) {
164
- return;
165
- }
166
- if (document.readyState != "loaded" && document.readyState != "complete") {
167
- setTimeout( arguments.callee, 0 );
168
- return;
169
- }
170
- if (numStyles === undefined) {
171
- var links = document.getElementsByTagName("link");
172
- for (var i=0; i < links.length; i++) {
173
- if (links[i].getAttribute('rel') == 'stylesheet') {
174
- numStyles++;
175
- }
176
- }
177
- var styles = document.getElementsByTagName("style");
178
- numStyles += styles.length;
179
- }
180
- if (document.styleSheets.length != numStyles) {
181
- setTimeout( arguments.callee, 0 );
182
- return;
183
- }
104
+ function addLoadEvent(func) {
105
+ var oldonload = window.onload;
106
+ if (typeof window.onload != 'function') {
107
+ window.onload = func;
108
+ }
109
+ else {
110
+ window.onload = function() {
111
+ if (oldonload) {
112
+ oldonload();
113
+ }
114
+ func();
115
+ }
116
+ }
117
+ };
184
118
 
185
- domReady();
186
- })();
187
- }
119
+ function bindReady() {
120
+ if(readyBound) {
121
+ return;
122
+ }
123
+
124
+ readyBound = true;
125
+
126
+ if (document.addEventListener && !browser.opera) {
127
+ document.addEventListener("DOMContentLoaded", domReady, false);
128
+ }
129
+
130
+ if (browser.msie && window == top) (function() {
131
+ if (isReady) return;
132
+ try {
133
+ document.documentElement.doScroll("left");
134
+ }
135
+ catch(error) {
136
+ setTimeout(arguments.callee, 0);
137
+ return;
138
+ }
139
+ domReady();
140
+ })();
141
+
142
+ if(browser.opera) {
143
+ document.addEventListener( "DOMContentLoaded", function () {
144
+ if (isReady) return;
145
+ for (var i = 0; i < document.styleSheets.length; i++)
146
+ if (document.styleSheets[i].disabled) {
147
+ setTimeout( arguments.callee, 0 );
148
+ return;
149
+ }
150
+ domReady();
151
+ }, false);
152
+ }
153
+
154
+ if(browser.safari) {
155
+ var numStyles;
156
+ (function(){
157
+ if (isReady) return;
158
+
159
+ if (document.readyState != "loaded" && document.readyState != "complete") {
160
+ setTimeout( arguments.callee, 0 );
161
+ return;
162
+ }
163
+
164
+ if (numStyles === undefined) {
165
+ var links = document.getElementsByTagName("link");
166
+ for (var i=0; i < links.length; i++) {
167
+ if(links[i].getAttribute('rel') == 'stylesheet') {
168
+ numStyles++;
169
+ }
170
+ }
171
+
172
+ var styles = document.getElementsByTagName("style");
173
+ numStyles += styles.length;
174
+ }
175
+
176
+ if (document.styleSheets.length != numStyles) {
177
+ setTimeout( arguments.callee, 0 );
178
+ return;
179
+ }
180
+
181
+ domReady();
182
+ })();
183
+ }
184
+
185
+ addLoadEvent(domReady);
186
+ };
188
187
 
189
- addLoadEvent(domReady);
190
- }
188
+ DomReady.ready = function(fn, args) {
189
+ bindReady();
191
190
 
192
- return {
193
- bind: bindReady,
194
- is_ready: isReady,
195
- ready_list: readyList
196
- };
197
- })();
191
+ if (isReady) {
192
+ fn.call(window, []);
193
+ }
194
+ else {
195
+ readyList.push( function() { return fn.call(window, []); } );
196
+ }
197
+ };
198
198
 
199
199
  NinjsDOM = function() {
200
200
  this.cached_selectors = {};
201
201
  };
202
202
 
203
203
  NinjsDOM.prototype.ready = function(fn, args) {
204
- dom.bind();
204
+ bindReady();
205
205
 
206
- if (dom.is_ready()) {
206
+ if (isReady) {
207
207
  fn.call(window, args || []);
208
208
  }
209
209
  else {
210
- dom.ready_list.push( function() { return fn.call(window, args || []); } );
210
+ readyList.push( function() { return fn.call(window, args || []); } );
211
211
  }
212
212
  };
213
213
 
214
- dom.bind();
214
+ bindReady();
215
215
  NinjsModule = function(name) {
216
216
  this.dom = new NinjsDOM(this);
217
217
  this.data = {};
data/spec/fixtures/nin.js CHANGED
@@ -72,146 +72,146 @@ unless = function(expression, callback, fallback) {
72
72
  }
73
73
  }
74
74
  };
75
- var dom = (function() {
76
- var userAgent = navigator.userAgent;
77
- var browser = {
78
- agent: userAgent,
79
- mozilla: (/mozilla/.test(userAgent.toLowerCase())) && !(/(compatible|webkit)/.test(userAgent.toLowerCase())),
80
- webkit: /webkit/.test(userAgent.toLowerCase()),
81
- firefox: /firefox/.test(userAgent.toLowerCase()),
82
- chrome: /webkit/.test(userAgent.toLowerCase()),
83
- safari: /safari/.test(userAgent.toLowerCase()),
84
- opera: /opera/.test(userAgent.toLowerCase()),
85
- msie: (/msie/.test(userAgent.toLowerCase())) && !(/opera/.test( userAgent.toLowerCase() ))
86
- };
87
-
88
- var readyBound = false;
89
- var isReady = false;
90
- var readyList = [];
91
-
92
- function domReady() {
93
- if (!isReady) {
94
- isReady = true;
95
- if (readyList) {
96
- for(var fn = 0; fn < readyList.length; fn++) {
97
- readyList[fn].call(window, []);
98
- }
99
- readyList = [];
100
- }
101
- }
102
- }
103
-
104
- function addLoadEvent(func) {
105
- var oldonload = window.onload;
106
- if (typeof window.onload != 'function') {
107
- window.onload = func;
108
- }
109
- else {
110
- window.onload = function() {
111
- if (oldonload) {
112
- oldonload();
113
- }
114
- func();
115
- };
116
- }
117
- }
118
-
119
- function bindReady() {
120
- if (readyBound) {
121
- return;
122
- }
123
-
124
- readyBound = true;
125
-
126
- if (document.addEventListener && !browser.opera) {
127
- document.addEventListener("DOMContentLoaded", domReady, false);
128
- }
129
-
130
- if (browser.msie && window == top) {
131
- (function() {
132
- if (isReady) {
133
- return;
134
- }
135
- try {
136
- document.documentElement.doScroll("left");
137
- } catch(error) {
138
- setTimeout(arguments.callee, 0);
139
- return;
140
- }
141
- domReady();
142
- })();
143
- }
144
-
145
- if (browser.opera) {
146
- document.addEventListener( "DOMContentLoaded", function () {
147
- if (isReady) {
148
- return;
149
- }
150
- for (var i = 0; i < document.styleSheets.length; i++) {
151
- if (document.styleSheets[i].disabled) {
152
- setTimeout( arguments.callee, 0 );
153
- return;
154
- }
155
- domReady();
156
- }
157
- }, false);
158
- }
75
+ var DomReady = window.DomReady = {},
76
+ userAgent = navigator.userAgent.toLowerCase(),
77
+ browser = {
78
+ version: (userAgent.match( /.+(?:rv|it|ra|ie)[\/: ]([\d.]+)/ ) || [])[1],
79
+ safari: /webkit/.test(userAgent),
80
+ opera: /opera/.test(userAgent),
81
+ msie: (/msie/.test(userAgent)) && (!/opera/.test( userAgent )),
82
+ mozilla: (/mozilla/.test(userAgent)) && (!/(compatible|webkit)/.test(userAgent))
83
+ },
84
+ readyBound = false,
85
+ isReady = false,
86
+ readyList = [];
87
+
88
+
89
+ function domReady() {
90
+ if(!isReady) {
91
+ isReady = true;
92
+
93
+ if(readyList) {
94
+ var length = readyList.length;
95
+ for(var fn = 0; fn < length; fn++) {
96
+ readyList[fn].call(window, []);
97
+ }
98
+
99
+ readyList = [];
100
+ }
101
+ }
102
+ };
159
103
 
160
- if (browser.safari) {
161
- var numStyles;
162
- (function() {
163
- if (isReady) {
164
- return;
165
- }
166
- if (document.readyState != "loaded" && document.readyState != "complete") {
167
- setTimeout( arguments.callee, 0 );
168
- return;
169
- }
170
- if (numStyles === undefined) {
171
- var links = document.getElementsByTagName("link");
172
- for (var i=0; i < links.length; i++) {
173
- if (links[i].getAttribute('rel') == 'stylesheet') {
174
- numStyles++;
175
- }
176
- }
177
- var styles = document.getElementsByTagName("style");
178
- numStyles += styles.length;
179
- }
180
- if (document.styleSheets.length != numStyles) {
181
- setTimeout( arguments.callee, 0 );
182
- return;
183
- }
104
+ function addLoadEvent(func) {
105
+ var oldonload = window.onload;
106
+ if (typeof window.onload != 'function') {
107
+ window.onload = func;
108
+ }
109
+ else {
110
+ window.onload = function() {
111
+ if (oldonload) {
112
+ oldonload();
113
+ }
114
+ func();
115
+ }
116
+ }
117
+ };
184
118
 
185
- domReady();
186
- })();
187
- }
119
+ function bindReady() {
120
+ if(readyBound) {
121
+ return;
122
+ }
123
+
124
+ readyBound = true;
125
+
126
+ if (document.addEventListener && !browser.opera) {
127
+ document.addEventListener("DOMContentLoaded", domReady, false);
128
+ }
129
+
130
+ if (browser.msie && window == top) (function() {
131
+ if (isReady) return;
132
+ try {
133
+ document.documentElement.doScroll("left");
134
+ }
135
+ catch(error) {
136
+ setTimeout(arguments.callee, 0);
137
+ return;
138
+ }
139
+ domReady();
140
+ })();
141
+
142
+ if(browser.opera) {
143
+ document.addEventListener( "DOMContentLoaded", function () {
144
+ if (isReady) return;
145
+ for (var i = 0; i < document.styleSheets.length; i++)
146
+ if (document.styleSheets[i].disabled) {
147
+ setTimeout( arguments.callee, 0 );
148
+ return;
149
+ }
150
+ domReady();
151
+ }, false);
152
+ }
153
+
154
+ if(browser.safari) {
155
+ var numStyles;
156
+ (function(){
157
+ if (isReady) return;
158
+
159
+ if (document.readyState != "loaded" && document.readyState != "complete") {
160
+ setTimeout( arguments.callee, 0 );
161
+ return;
162
+ }
163
+
164
+ if (numStyles === undefined) {
165
+ var links = document.getElementsByTagName("link");
166
+ for (var i=0; i < links.length; i++) {
167
+ if(links[i].getAttribute('rel') == 'stylesheet') {
168
+ numStyles++;
169
+ }
170
+ }
171
+
172
+ var styles = document.getElementsByTagName("style");
173
+ numStyles += styles.length;
174
+ }
175
+
176
+ if (document.styleSheets.length != numStyles) {
177
+ setTimeout( arguments.callee, 0 );
178
+ return;
179
+ }
180
+
181
+ domReady();
182
+ })();
183
+ }
184
+
185
+ addLoadEvent(domReady);
186
+ };
188
187
 
189
- addLoadEvent(domReady);
190
- }
188
+ DomReady.ready = function(fn, args) {
189
+ bindReady();
191
190
 
192
- return {
193
- bind: bindReady,
194
- is_ready: isReady,
195
- ready_list: readyList
196
- };
197
- })();
191
+ if (isReady) {
192
+ fn.call(window, []);
193
+ }
194
+ else {
195
+ readyList.push( function() { return fn.call(window, []); } );
196
+ }
197
+ };
198
198
 
199
199
  NinjsDOM = function() {
200
200
  this.cached_selectors = {};
201
201
  };
202
202
 
203
203
  NinjsDOM.prototype.ready = function(fn, args) {
204
- dom.bind();
204
+ bindReady();
205
205
 
206
- if (dom.is_ready()) {
206
+ if (isReady) {
207
207
  fn.call(window, args || []);
208
208
  }
209
209
  else {
210
- dom.ready_list.push( function() { return fn.call(window, args || []); } );
210
+ readyList.push( function() { return fn.call(window, args || []); } );
211
211
  }
212
212
  };
213
213
 
214
- dom.bind();
214
+ bindReady();
215
215
  NinjsModule = function(name) {
216
216
  this.dom = new NinjsDOM(this);
217
217
  this.data = {};
data/spec/project_spec.rb CHANGED
@@ -144,7 +144,7 @@ describe Ninjs::Project do
144
144
  File.exists?("#{SPEC_DIR}/Rakefile").should be_true
145
145
  end
146
146
  end # Project Creation
147
-
147
+ =begin
148
148
  context 'Project management' do
149
149
  before :each do
150
150
  suppress_output do
@@ -258,4 +258,5 @@ describe Ninjs::Project do
258
258
  end
259
259
 
260
260
  end # Project management
261
+ =end
261
262
  end
metadata CHANGED
@@ -2,7 +2,7 @@
2
2
  name: ninjs
3
3
  version: !ruby/object:Gem::Version
4
4
  prerelease:
5
- version: 0.16.2
5
+ version: 0.16.3
6
6
  platform: ruby
7
7
  authors:
8
8
  - Dayton Nolan
@@ -10,7 +10,7 @@ autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
12
 
13
- date: 2011-10-27 00:00:00 Z
13
+ date: 2011-10-28 00:00:00 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: fssm
@@ -355,7 +355,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
355
355
  requirements:
356
356
  - - ">="
357
357
  - !ruby/object:Gem::Version
358
- hash: 4215172574797245996
358
+ hash: -3496350730608908011
359
359
  segments:
360
360
  - 0
361
361
  version: "0"