yellow-brick-road 0.2.0 → 0.2.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (56) hide show
  1. data/README.rst +10 -5
  2. data/lib/yellow-brick-road/directive_processor.rb +10 -3
  3. data/lib/yellow-brick-road/version.rb +1 -1
  4. data/test/dummy/app/assets/javascripts/closure-deps.js +3 -3
  5. data/test/dummy/log/development.log +159 -0
  6. data/test/dummy/tmp/cache/assets/C1E/0C0/sprockets%2F9c2f7430126aff8d8514326208712832 +165 -0
  7. data/test/dummy/tmp/cache/assets/C29/5D0/sprockets%2F1498f4451d0836a53c7c302c49920996 +0 -0
  8. data/test/dummy/tmp/cache/assets/C7E/9F0/sprockets%2F89862076204c62c4593ac20de32da909 +6 -6
  9. data/test/dummy/tmp/cache/assets/CB4/5B0/sprockets%2Ff17618b71eca9a4621f68626572a75b2 +103 -0
  10. data/test/dummy/tmp/cache/assets/CC2/240/sprockets%2F9f41da672330830c3366594f7ff5e7f6 +590 -0
  11. data/test/dummy/tmp/cache/assets/CC4/2C0/sprockets%2F715db78c7d974ea64406ed9711793f42 +494 -0
  12. data/test/dummy/tmp/cache/assets/CE1/610/sprockets%2F50c01109ecf86153176ccf577595fab4 +53 -0
  13. data/test/dummy/tmp/cache/assets/CE1/C20/sprockets%2F58a7b0499656c97a2204b5821eadab84 +207 -0
  14. data/test/dummy/tmp/cache/assets/CE4/DE0/sprockets%2Fb3aab0604ee02598f339965ec583a746 +204 -0
  15. data/test/dummy/tmp/cache/assets/CE9/B00/sprockets%2F80b139f66661444d6a781bfe56aee076 +0 -0
  16. data/test/dummy/tmp/cache/assets/CEB/840/sprockets%2F38fe57c2a5963f36a49404f672cc707b +0 -0
  17. data/test/dummy/tmp/cache/assets/CEC/6C0/sprockets%2F01b982295748dbd09683557aebd358bd +0 -0
  18. data/test/dummy/tmp/cache/assets/CF0/140/sprockets%2F3974b046fe949e86ef851a0271eb9d50 +1545 -0
  19. data/test/dummy/tmp/cache/assets/D01/DF0/sprockets%2F2ce268622b41a173bb209465a2ced6b9 +806 -0
  20. data/test/dummy/tmp/cache/assets/D05/920/sprockets%2F909507434dcc270db4853e4c147f0aac +4 -5
  21. data/test/dummy/tmp/cache/assets/D0A/C10/sprockets%2Fd050d5ee6a2073aa708a26c589a4c974 +283 -0
  22. data/test/dummy/tmp/cache/assets/D0F/360/sprockets%2Fa18927874a5e02c58c14c5b5df19ec04 +300 -0
  23. data/test/dummy/tmp/cache/assets/D15/700/sprockets%2F2987192f402d2bdc72792b5ae17f9a2f +142 -0
  24. data/test/dummy/tmp/cache/assets/D15/F60/sprockets%2Fa28394e3f80365b5bc86794dd46daa22 +0 -0
  25. data/test/dummy/tmp/cache/assets/D1F/E60/sprockets%2Fe65796b72231e36f5573ce71e2c8bbf8 +511 -0
  26. data/test/dummy/tmp/cache/assets/D22/200/sprockets%2F874bd1079c304ae88fbec8434d6d7794 +187 -0
  27. data/test/dummy/tmp/cache/assets/D3B/6A0/sprockets%2Ff8a978a3672b4f7ba513303b91ad15fc +127 -0
  28. data/test/dummy/tmp/cache/assets/D3C/530/sprockets%2Fe6730ff143273d9a7471b4afc3e1c19d +0 -0
  29. data/test/dummy/tmp/cache/assets/D41/B30/sprockets%2Fba1b93913dd01d83ac9a96df334456f8 +0 -0
  30. data/test/dummy/tmp/cache/assets/D49/570/sprockets%2Fd76be81d59871518ea06d3668f2c4bbb +239 -0
  31. data/test/dummy/tmp/cache/assets/D49/DA0/sprockets%2Fa84f85a305cde80a4d53785d7be0892f +457 -0
  32. data/test/dummy/tmp/cache/assets/D5C/760/sprockets%2F5cd491e0f9106cfd4ec4938896c97de7 +256 -0
  33. data/test/dummy/tmp/cache/assets/D5C/A00/sprockets%2Fefe291b3012745251e2641defbe4cad0 +1529 -0
  34. data/test/dummy/tmp/cache/assets/D68/2B0/sprockets%2Fe51ab0aca893e08c40f9672edef71106 +0 -0
  35. data/test/dummy/tmp/cache/assets/D6E/EA0/sprockets%2Fb52cbc47414c9e60ad4c46824928fbbe +115 -0
  36. data/test/dummy/tmp/cache/assets/D70/0B0/sprockets%2F1ae574bacfb86b4d51281b5e47fe1892 +505 -0
  37. data/test/dummy/tmp/cache/assets/D75/A60/sprockets%2Fab64285176f11f975fb6bb40af8bce76 +0 -0
  38. data/test/dummy/tmp/cache/assets/D76/0A0/sprockets%2F3ad3bd078c47096b34d5bcce886d7b47 +794 -0
  39. data/test/dummy/tmp/cache/assets/D79/C00/sprockets%2F94449fa386c370a1ebd7628eba9afe72 +72 -0
  40. data/test/dummy/tmp/cache/assets/D7B/310/sprockets%2Ff56e44be18b2d65efda80e588e5229a4 +0 -0
  41. data/test/dummy/tmp/cache/assets/D84/210/sprockets%2Fabd0103ccec2b428ac62c94e4c40b384 +7 -8
  42. data/test/dummy/tmp/cache/assets/D95/D20/sprockets%2F05b19351f203fb1eadf8ef1f0e6f9a60 +173 -0
  43. data/test/dummy/tmp/cache/assets/D9F/250/sprockets%2F40dcbb8f852f0e6360c4afb1f39964eb +0 -0
  44. data/test/dummy/tmp/cache/assets/DA8/0E0/sprockets%2F1351359f5bbdb94ef7d247df9af38bd1 +2556 -0
  45. data/test/dummy/tmp/cache/assets/DB3/070/sprockets%2Fd98f91680433cec456e6eb7485dcfdbc +522 -0
  46. data/test/dummy/tmp/cache/assets/DC4/6E0/sprockets%2F72117f09fccb98e6aac4cd1124edae42 +2539 -0
  47. data/test/dummy/tmp/cache/assets/DCC/D50/sprockets%2F9b2b027991c15af6f8afeacdd183c14e +1260 -0
  48. data/test/dummy/tmp/cache/assets/DD9/FF0/sprockets%2Fdf5dcfe86e199b272742a52a4b7e5fbd +823 -0
  49. data/test/dummy/tmp/cache/assets/DE7/0D0/sprockets%2Fe4d9fe29b6d96cdeb070d9b595af83d7 +1354 -0
  50. data/test/dummy/tmp/cache/assets/E00/3A0/sprockets%2Fc1db8cbfbc94bd2736f9f067a4c06cc7 +811 -0
  51. data/test/dummy/tmp/cache/assets/E04/890/sprockets%2F2f5173deea6c795b8fdde723bb4b63af +0 -0
  52. data/test/dummy/tmp/cache/assets/E0C/C80/sprockets%2F55805edb5f27aaef88eef6632fd08ade +1277 -0
  53. data/test/dummy/tmp/cache/assets/E1B/CF0/sprockets%2Feb58b29b94f29d7da8d9fbe666e4a8dd +474 -0
  54. data/test/dummy/tmp/cache/assets/E1E/E00/sprockets%2Fb005d4fa3dc6cfc1c5098e0fdb3f6b2b +1371 -0
  55. data/test/dummy/tmp/cache/assets/E30/8E0/sprockets%2Fef4fdb83b3eefb027cbc8e19b274ec80 +607 -0
  56. metadata +96 -8
@@ -1,6 +1,6 @@
1
- o: ActiveSupport::Cache::Entry :@compressedF:@expires_in0:@created_atf1325549267.5141308: @value{ I" length:EFi-I" digest;
2
- F"%48752de6df41f88201d301a25fdc8db5I" source;
3
- FI"-goog.provide('myproject.start');
1
+ o: ActiveSupport::Cache::Entry :@compressedF:@expires_in0:@created_atf1325729945.591319: @value{ I" length:EFi+I" digest;
2
+ F"%5fd8ea10b2df41ae53be7cd85b39d635I" source;
3
+ FI"+goog.provide('myproject.start');
4
4
 
5
5
  goog.require('goog.dom');
6
6
 
@@ -25,7 +25,6 @@ myproject.start = function() {
25
25
 
26
26
  // Ensures the symbol will be visible after compiler renaming.
27
27
  goog.exportSymbol('myproject.start', myproject.start);
28
-
29
28
  ;
30
29
  FI"
31
- F"%248a73c34e61884045c09a9ebe446af4
30
+ F"%24fe72d2d0cee9414446be89de41e0a7
@@ -0,0 +1,283 @@
1
+ o: ActiveSupport::Cache::Entry :@compressedF:@expires_in0:@created_atf1325729947.500902: @value{ I" length:EFiA)I" digest;
2
+ F"%226247a455556e9cf216d2450ff3dca9I" source;
3
+ FI"A)// Copyright 2008 The Closure Library Authors. All Rights Reserved.
4
+ //
5
+ // Licensed under the Apache License, Version 2.0 (the "License");
6
+ // you may not use this file except in compliance with the License.
7
+ // You may obtain a copy of the License at
8
+ //
9
+ // http://www.apache.org/licenses/LICENSE-2.0
10
+ //
11
+ // Unless required by applicable law or agreed to in writing, software
12
+ // distributed under the License is distributed on an "AS-IS" BASIS,
13
+ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ // See the License for the specific language governing permissions and
15
+ // limitations under the License.
16
+
17
+ /**
18
+ * @fileoverview Utilities to check the preconditions, postconditions and
19
+ * invariants runtime.
20
+ *
21
+ * Methods in this package should be given special treatment by the compiler
22
+ * for type-inference. For example, <code>goog.asserts.assert(foo)</code>
23
+ * will restrict <code>foo</code> to a truthy value.
24
+ *
25
+ * The compiler has an option to disable asserts. So code like:
26
+ * <code>
27
+ * var x = goog.asserts.assert(foo()); goog.asserts.assert(bar());
28
+ * </code>
29
+ * will be transformed into:
30
+ * <code>
31
+ * var x = foo();
32
+ * </code>
33
+ * The compiler will leave in foo() (because its return value is used),
34
+ * but it will remove bar() because it assumes it does not have side-effects.
35
+ *
36
+ */
37
+
38
+
39
+ goog.provide('goog.asserts');
40
+ goog.provide('goog.asserts.AssertionError');
41
+
42
+ goog.require('goog.debug.Error');
43
+ goog.require('goog.string');
44
+
45
+
46
+ /**
47
+ * @define {boolean} Whether to strip out asserts or to leave them in.
48
+ */
49
+ goog.asserts.ENABLE_ASSERTS = goog.DEBUG;
50
+
51
+
52
+
53
+ /**
54
+ * Error object for failed assertions.
55
+ * @param {string} messagePattern The pattern that was used to form message.
56
+ * @param {!Array.<*>} messageArgs The items to substitute into the pattern.
57
+ * @constructor
58
+ * @extends {goog.debug.Error}
59
+ */
60
+ goog.asserts.AssertionError = function(messagePattern, messageArgs) {
61
+ messageArgs.unshift(messagePattern);
62
+ goog.debug.Error.call(this, goog.string.subs.apply(null, messageArgs));
63
+ // Remove the messagePattern afterwards to avoid permenantly modifying the
64
+ // passed in array.
65
+ messageArgs.shift();
66
+
67
+ /**
68
+ * The message pattern used to format the error message. Error handlers can
69
+ * use this to uniquely identify the assertion.
70
+ * @type {string}
71
+ */
72
+ this.messagePattern = messagePattern;
73
+ };
74
+ goog.inherits(goog.asserts.AssertionError, goog.debug.Error);
75
+
76
+
77
+ /** @override */
78
+ goog.asserts.AssertionError.prototype.name = 'AssertionError';
79
+
80
+
81
+ /**
82
+ * Throws an exception with the given message and "Assertion failed" prefixed
83
+ * onto it.
84
+ * @param {string} defaultMessage The message to use if givenMessage is empty.
85
+ * @param {Array.<*>} defaultArgs The substitution arguments for defaultMessage.
86
+ * @param {string|undefined} givenMessage Message supplied by the caller.
87
+ * @param {Array.<*>} givenArgs The substitution arguments for givenMessage.
88
+ * @throws {goog.asserts.AssertionError} When the value is not a number.
89
+ * @private
90
+ */
91
+ goog.asserts.doAssertFailure_ =
92
+ function(defaultMessage, defaultArgs, givenMessage, givenArgs) {
93
+ var message = 'Assertion failed';
94
+ if (givenMessage) {
95
+ message += ': ' + givenMessage;
96
+ var args = givenArgs;
97
+ } else if (defaultMessage) {
98
+ message += ': ' + defaultMessage;
99
+ args = defaultArgs;
100
+ }
101
+ // The '' + works around an Opera 10 bug in the unit tests. Without it,
102
+ // a stack trace is added to var message above. With this, a stack trace is
103
+ // not added until this line (it causes the extra garbage to be added after
104
+ // the assertion message instead of in the middle of it).
105
+ throw new goog.asserts.AssertionError('' + message, args || []);
106
+ };
107
+
108
+
109
+ /**
110
+ * Checks if the condition evaluates to true if goog.asserts.ENABLE_ASSERTS is
111
+ * true.
112
+ * @param {*} condition The condition to check.
113
+ * @param {string=} opt_message Error message in case of failure.
114
+ * @param {...*} var_args The items to substitute into the failure message.
115
+ * @return {*} The value of the condition.
116
+ * @throws {goog.asserts.AssertionError} When the condition evaluates to false.
117
+ */
118
+ goog.asserts.assert = function(condition, opt_message, var_args) {
119
+ if (goog.asserts.ENABLE_ASSERTS && !condition) {
120
+ goog.asserts.doAssertFailure_('', null, opt_message,
121
+ Array.prototype.slice.call(arguments, 2));
122
+ }
123
+ return condition;
124
+ };
125
+
126
+
127
+ /**
128
+ * Fails if goog.asserts.ENABLE_ASSERTS is true. This function is useful in case
129
+ * when we want to add a check in the unreachable area like switch-case
130
+ * statement:
131
+ *
132
+ * <pre>
133
+ * switch(type) {
134
+ * case FOO: doSomething(); break;
135
+ * case BAR: doSomethingElse(); break;
136
+ * default: goog.assert.fail('Unrecognized type: ' + type);
137
+ * // We have only 2 types - "default:" section is unreachable code.
138
+ * }
139
+ * </pre>
140
+ *
141
+ * @param {string=} opt_message Error message in case of failure.
142
+ * @param {...*} var_args The items to substitute into the failure message.
143
+ * @throws {goog.asserts.AssertionError} Failure.
144
+ */
145
+ goog.asserts.fail = function(opt_message, var_args) {
146
+ if (goog.asserts.ENABLE_ASSERTS) {
147
+ throw new goog.asserts.AssertionError(
148
+ 'Failure' + (opt_message ? ': ' + opt_message : ''),
149
+ Array.prototype.slice.call(arguments, 1));
150
+ }
151
+ };
152
+
153
+
154
+ /**
155
+ * Checks if the value is a number if goog.asserts.ENABLE_ASSERTS is true.
156
+ * @param {*} value The value to check.
157
+ * @param {string=} opt_message Error message in case of failure.
158
+ * @param {...*} var_args The items to substitute into the failure message.
159
+ * @return {number} The value, guaranteed to be a number when asserts enabled.
160
+ * @throws {goog.asserts.AssertionError} When the value is not a number.
161
+ */
162
+ goog.asserts.assertNumber = function(value, opt_message, var_args) {
163
+ if (goog.asserts.ENABLE_ASSERTS && !goog.isNumber(value)) {
164
+ goog.asserts.doAssertFailure_('Expected number but got %s: %s.',
165
+ [goog.typeOf(value), value], opt_message,
166
+ Array.prototype.slice.call(arguments, 2));
167
+ }
168
+ return /** @type {number} */ (value);
169
+ };
170
+
171
+
172
+ /**
173
+ * Checks if the value is a string if goog.asserts.ENABLE_ASSERTS is true.
174
+ * @param {*} value The value to check.
175
+ * @param {string=} opt_message Error message in case of failure.
176
+ * @param {...*} var_args The items to substitute into the failure message.
177
+ * @return {string} The value, guaranteed to be a string when asserts enabled.
178
+ * @throws {goog.asserts.AssertionError} When the value is not a string.
179
+ */
180
+ goog.asserts.assertString = function(value, opt_message, var_args) {
181
+ if (goog.asserts.ENABLE_ASSERTS && !goog.isString(value)) {
182
+ goog.asserts.doAssertFailure_('Expected string but got %s: %s.',
183
+ [goog.typeOf(value), value], opt_message,
184
+ Array.prototype.slice.call(arguments, 2));
185
+ }
186
+ return /** @type {string} */ (value);
187
+ };
188
+
189
+
190
+ /**
191
+ * Checks if the value is a function if goog.asserts.ENABLE_ASSERTS is true.
192
+ * @param {*} value The value to check.
193
+ * @param {string=} opt_message Error message in case of failure.
194
+ * @param {...*} var_args The items to substitute into the failure message.
195
+ * @return {!Function} The value, guaranteed to be a function when asserts
196
+ * enabled.
197
+ * @throws {goog.asserts.AssertionError} When the value is not a function.
198
+ */
199
+ goog.asserts.assertFunction = function(value, opt_message, var_args) {
200
+ if (goog.asserts.ENABLE_ASSERTS && !goog.isFunction(value)) {
201
+ goog.asserts.doAssertFailure_('Expected function but got %s: %s.',
202
+ [goog.typeOf(value), value], opt_message,
203
+ Array.prototype.slice.call(arguments, 2));
204
+ }
205
+ return /** @type {!Function} */ (value);
206
+ };
207
+
208
+
209
+ /**
210
+ * Checks if the value is an Object if goog.asserts.ENABLE_ASSERTS is true.
211
+ * @param {*} value The value to check.
212
+ * @param {string=} opt_message Error message in case of failure.
213
+ * @param {...*} var_args The items to substitute into the failure message.
214
+ * @return {!Object} The value, guaranteed to be a non-null object.
215
+ * @throws {goog.asserts.AssertionError} When the value is not an object.
216
+ */
217
+ goog.asserts.assertObject = function(value, opt_message, var_args) {
218
+ if (goog.asserts.ENABLE_ASSERTS && !goog.isObject(value)) {
219
+ goog.asserts.doAssertFailure_('Expected object but got %s: %s.',
220
+ [goog.typeOf(value), value],
221
+ opt_message, Array.prototype.slice.call(arguments, 2));
222
+ }
223
+ return /** @type {!Object} */ (value);
224
+ };
225
+
226
+
227
+ /**
228
+ * Checks if the value is an Array if goog.asserts.ENABLE_ASSERTS is true.
229
+ * @param {*} value The value to check.
230
+ * @param {string=} opt_message Error message in case of failure.
231
+ * @param {...*} var_args The items to substitute into the failure message.
232
+ * @return {!Array} The value, guaranteed to be a non-null array.
233
+ * @throws {goog.asserts.AssertionError} When the value is not an array.
234
+ */
235
+ goog.asserts.assertArray = function(value, opt_message, var_args) {
236
+ if (goog.asserts.ENABLE_ASSERTS && !goog.isArray(value)) {
237
+ goog.asserts.doAssertFailure_('Expected array but got %s: %s.',
238
+ [goog.typeOf(value), value], opt_message,
239
+ Array.prototype.slice.call(arguments, 2));
240
+ }
241
+ return /** @type {!Array} */ (value);
242
+ };
243
+
244
+
245
+ /**
246
+ * Checks if the value is a boolean if goog.asserts.ENABLE_ASSERTS is true.
247
+ * @param {*} value The value to check.
248
+ * @param {string=} opt_message Error message in case of failure.
249
+ * @param {...*} var_args The items to substitute into the failure message.
250
+ * @return {boolean} The value, guaranteed to be a boolean when asserts are
251
+ * enabled.
252
+ * @throws {goog.asserts.AssertionError} When the value is not a boolean.
253
+ */
254
+ goog.asserts.assertBoolean = function(value, opt_message, var_args) {
255
+ if (goog.asserts.ENABLE_ASSERTS && !goog.isBoolean(value)) {
256
+ goog.asserts.doAssertFailure_('Expected boolean but got %s: %s.',
257
+ [goog.typeOf(value), value], opt_message,
258
+ Array.prototype.slice.call(arguments, 2));
259
+ }
260
+ return /** @type {boolean} */ (value);
261
+ };
262
+
263
+
264
+ /**
265
+ * Checks if the value is an instance of the user-defined type if
266
+ * goog.asserts.ENABLE_ASSERTS is true.
267
+ * @param {*} value The value to check.
268
+ * @param {!Function} type A user-defined constructor.
269
+ * @param {string=} opt_message Error message in case of failure.
270
+ * @param {...*} var_args The items to substitute into the failure message.
271
+ * @throws {goog.asserts.AssertionError} When the value is not an instance of
272
+ * type.
273
+ */
274
+ goog.asserts.assertInstanceof = function(value, type, opt_message, var_args) {
275
+ if (goog.asserts.ENABLE_ASSERTS && !(value instanceof type)) {
276
+ goog.asserts.doAssertFailure_('instanceof check failed.', null,
277
+ opt_message, Array.prototype.slice.call(arguments, 3));
278
+ }
279
+ };
280
+
281
+ ;
282
+ FI"
283
+ F"%afda6db51ef4d85743b45670b92f46c6
@@ -0,0 +1,300 @@
1
+ o: ActiveSupport::Cache::Entry :@compressedF:@expires_in0:@created_atf1325729947.49437: @value{I"
2
+ class:EFI"BundledAsset;
3
+ FI"id;
4
+ F"%afda6db51ef4d85743b45670b92f46c6I"logical_path;
5
+ FI"$closure/goog/asserts/asserts.js;
6
+ TI"
7
+ F"�/Users/ali/.rvm/gems/ruby-1.9.3-p0/bundler/gems/closure-library-wrapper-031d1d0f0e50/vendor/closure-library/closure/goog/asserts/asserts.jsI"content_type;
8
+ FI"application/javascript;
9
+ FI"
10
+ mtime;
11
+ FI"2012-01-03T00:52:24+00:00;
12
+ FI" body;
13
+ FI"A)// Copyright 2008 The Closure Library Authors. All Rights Reserved.
14
+ //
15
+ // Licensed under the Apache License, Version 2.0 (the "License");
16
+ // you may not use this file except in compliance with the License.
17
+ // You may obtain a copy of the License at
18
+ //
19
+ // http://www.apache.org/licenses/LICENSE-2.0
20
+ //
21
+ // Unless required by applicable law or agreed to in writing, software
22
+ // distributed under the License is distributed on an "AS-IS" BASIS,
23
+ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
24
+ // See the License for the specific language governing permissions and
25
+ // limitations under the License.
26
+
27
+ /**
28
+ * @fileoverview Utilities to check the preconditions, postconditions and
29
+ * invariants runtime.
30
+ *
31
+ * Methods in this package should be given special treatment by the compiler
32
+ * for type-inference. For example, <code>goog.asserts.assert(foo)</code>
33
+ * will restrict <code>foo</code> to a truthy value.
34
+ *
35
+ * The compiler has an option to disable asserts. So code like:
36
+ * <code>
37
+ * var x = goog.asserts.assert(foo()); goog.asserts.assert(bar());
38
+ * </code>
39
+ * will be transformed into:
40
+ * <code>
41
+ * var x = foo();
42
+ * </code>
43
+ * The compiler will leave in foo() (because its return value is used),
44
+ * but it will remove bar() because it assumes it does not have side-effects.
45
+ *
46
+ */
47
+
48
+
49
+ goog.provide('goog.asserts');
50
+ goog.provide('goog.asserts.AssertionError');
51
+
52
+ goog.require('goog.debug.Error');
53
+ goog.require('goog.string');
54
+
55
+
56
+ /**
57
+ * @define {boolean} Whether to strip out asserts or to leave them in.
58
+ */
59
+ goog.asserts.ENABLE_ASSERTS = goog.DEBUG;
60
+
61
+
62
+
63
+ /**
64
+ * Error object for failed assertions.
65
+ * @param {string} messagePattern The pattern that was used to form message.
66
+ * @param {!Array.<*>} messageArgs The items to substitute into the pattern.
67
+ * @constructor
68
+ * @extends {goog.debug.Error}
69
+ */
70
+ goog.asserts.AssertionError = function(messagePattern, messageArgs) {
71
+ messageArgs.unshift(messagePattern);
72
+ goog.debug.Error.call(this, goog.string.subs.apply(null, messageArgs));
73
+ // Remove the messagePattern afterwards to avoid permenantly modifying the
74
+ // passed in array.
75
+ messageArgs.shift();
76
+
77
+ /**
78
+ * The message pattern used to format the error message. Error handlers can
79
+ * use this to uniquely identify the assertion.
80
+ * @type {string}
81
+ */
82
+ this.messagePattern = messagePattern;
83
+ };
84
+ goog.inherits(goog.asserts.AssertionError, goog.debug.Error);
85
+
86
+
87
+ /** @override */
88
+ goog.asserts.AssertionError.prototype.name = 'AssertionError';
89
+
90
+
91
+ /**
92
+ * Throws an exception with the given message and "Assertion failed" prefixed
93
+ * onto it.
94
+ * @param {string} defaultMessage The message to use if givenMessage is empty.
95
+ * @param {Array.<*>} defaultArgs The substitution arguments for defaultMessage.
96
+ * @param {string|undefined} givenMessage Message supplied by the caller.
97
+ * @param {Array.<*>} givenArgs The substitution arguments for givenMessage.
98
+ * @throws {goog.asserts.AssertionError} When the value is not a number.
99
+ * @private
100
+ */
101
+ goog.asserts.doAssertFailure_ =
102
+ function(defaultMessage, defaultArgs, givenMessage, givenArgs) {
103
+ var message = 'Assertion failed';
104
+ if (givenMessage) {
105
+ message += ': ' + givenMessage;
106
+ var args = givenArgs;
107
+ } else if (defaultMessage) {
108
+ message += ': ' + defaultMessage;
109
+ args = defaultArgs;
110
+ }
111
+ // The '' + works around an Opera 10 bug in the unit tests. Without it,
112
+ // a stack trace is added to var message above. With this, a stack trace is
113
+ // not added until this line (it causes the extra garbage to be added after
114
+ // the assertion message instead of in the middle of it).
115
+ throw new goog.asserts.AssertionError('' + message, args || []);
116
+ };
117
+
118
+
119
+ /**
120
+ * Checks if the condition evaluates to true if goog.asserts.ENABLE_ASSERTS is
121
+ * true.
122
+ * @param {*} condition The condition to check.
123
+ * @param {string=} opt_message Error message in case of failure.
124
+ * @param {...*} var_args The items to substitute into the failure message.
125
+ * @return {*} The value of the condition.
126
+ * @throws {goog.asserts.AssertionError} When the condition evaluates to false.
127
+ */
128
+ goog.asserts.assert = function(condition, opt_message, var_args) {
129
+ if (goog.asserts.ENABLE_ASSERTS && !condition) {
130
+ goog.asserts.doAssertFailure_('', null, opt_message,
131
+ Array.prototype.slice.call(arguments, 2));
132
+ }
133
+ return condition;
134
+ };
135
+
136
+
137
+ /**
138
+ * Fails if goog.asserts.ENABLE_ASSERTS is true. This function is useful in case
139
+ * when we want to add a check in the unreachable area like switch-case
140
+ * statement:
141
+ *
142
+ * <pre>
143
+ * switch(type) {
144
+ * case FOO: doSomething(); break;
145
+ * case BAR: doSomethingElse(); break;
146
+ * default: goog.assert.fail('Unrecognized type: ' + type);
147
+ * // We have only 2 types - "default:" section is unreachable code.
148
+ * }
149
+ * </pre>
150
+ *
151
+ * @param {string=} opt_message Error message in case of failure.
152
+ * @param {...*} var_args The items to substitute into the failure message.
153
+ * @throws {goog.asserts.AssertionError} Failure.
154
+ */
155
+ goog.asserts.fail = function(opt_message, var_args) {
156
+ if (goog.asserts.ENABLE_ASSERTS) {
157
+ throw new goog.asserts.AssertionError(
158
+ 'Failure' + (opt_message ? ': ' + opt_message : ''),
159
+ Array.prototype.slice.call(arguments, 1));
160
+ }
161
+ };
162
+
163
+
164
+ /**
165
+ * Checks if the value is a number if goog.asserts.ENABLE_ASSERTS is true.
166
+ * @param {*} value The value to check.
167
+ * @param {string=} opt_message Error message in case of failure.
168
+ * @param {...*} var_args The items to substitute into the failure message.
169
+ * @return {number} The value, guaranteed to be a number when asserts enabled.
170
+ * @throws {goog.asserts.AssertionError} When the value is not a number.
171
+ */
172
+ goog.asserts.assertNumber = function(value, opt_message, var_args) {
173
+ if (goog.asserts.ENABLE_ASSERTS && !goog.isNumber(value)) {
174
+ goog.asserts.doAssertFailure_('Expected number but got %s: %s.',
175
+ [goog.typeOf(value), value], opt_message,
176
+ Array.prototype.slice.call(arguments, 2));
177
+ }
178
+ return /** @type {number} */ (value);
179
+ };
180
+
181
+
182
+ /**
183
+ * Checks if the value is a string if goog.asserts.ENABLE_ASSERTS is true.
184
+ * @param {*} value The value to check.
185
+ * @param {string=} opt_message Error message in case of failure.
186
+ * @param {...*} var_args The items to substitute into the failure message.
187
+ * @return {string} The value, guaranteed to be a string when asserts enabled.
188
+ * @throws {goog.asserts.AssertionError} When the value is not a string.
189
+ */
190
+ goog.asserts.assertString = function(value, opt_message, var_args) {
191
+ if (goog.asserts.ENABLE_ASSERTS && !goog.isString(value)) {
192
+ goog.asserts.doAssertFailure_('Expected string but got %s: %s.',
193
+ [goog.typeOf(value), value], opt_message,
194
+ Array.prototype.slice.call(arguments, 2));
195
+ }
196
+ return /** @type {string} */ (value);
197
+ };
198
+
199
+
200
+ /**
201
+ * Checks if the value is a function if goog.asserts.ENABLE_ASSERTS is true.
202
+ * @param {*} value The value to check.
203
+ * @param {string=} opt_message Error message in case of failure.
204
+ * @param {...*} var_args The items to substitute into the failure message.
205
+ * @return {!Function} The value, guaranteed to be a function when asserts
206
+ * enabled.
207
+ * @throws {goog.asserts.AssertionError} When the value is not a function.
208
+ */
209
+ goog.asserts.assertFunction = function(value, opt_message, var_args) {
210
+ if (goog.asserts.ENABLE_ASSERTS && !goog.isFunction(value)) {
211
+ goog.asserts.doAssertFailure_('Expected function but got %s: %s.',
212
+ [goog.typeOf(value), value], opt_message,
213
+ Array.prototype.slice.call(arguments, 2));
214
+ }
215
+ return /** @type {!Function} */ (value);
216
+ };
217
+
218
+
219
+ /**
220
+ * Checks if the value is an Object if goog.asserts.ENABLE_ASSERTS is true.
221
+ * @param {*} value The value to check.
222
+ * @param {string=} opt_message Error message in case of failure.
223
+ * @param {...*} var_args The items to substitute into the failure message.
224
+ * @return {!Object} The value, guaranteed to be a non-null object.
225
+ * @throws {goog.asserts.AssertionError} When the value is not an object.
226
+ */
227
+ goog.asserts.assertObject = function(value, opt_message, var_args) {
228
+ if (goog.asserts.ENABLE_ASSERTS && !goog.isObject(value)) {
229
+ goog.asserts.doAssertFailure_('Expected object but got %s: %s.',
230
+ [goog.typeOf(value), value],
231
+ opt_message, Array.prototype.slice.call(arguments, 2));
232
+ }
233
+ return /** @type {!Object} */ (value);
234
+ };
235
+
236
+
237
+ /**
238
+ * Checks if the value is an Array if goog.asserts.ENABLE_ASSERTS is true.
239
+ * @param {*} value The value to check.
240
+ * @param {string=} opt_message Error message in case of failure.
241
+ * @param {...*} var_args The items to substitute into the failure message.
242
+ * @return {!Array} The value, guaranteed to be a non-null array.
243
+ * @throws {goog.asserts.AssertionError} When the value is not an array.
244
+ */
245
+ goog.asserts.assertArray = function(value, opt_message, var_args) {
246
+ if (goog.asserts.ENABLE_ASSERTS && !goog.isArray(value)) {
247
+ goog.asserts.doAssertFailure_('Expected array but got %s: %s.',
248
+ [goog.typeOf(value), value], opt_message,
249
+ Array.prototype.slice.call(arguments, 2));
250
+ }
251
+ return /** @type {!Array} */ (value);
252
+ };
253
+
254
+
255
+ /**
256
+ * Checks if the value is a boolean if goog.asserts.ENABLE_ASSERTS is true.
257
+ * @param {*} value The value to check.
258
+ * @param {string=} opt_message Error message in case of failure.
259
+ * @param {...*} var_args The items to substitute into the failure message.
260
+ * @return {boolean} The value, guaranteed to be a boolean when asserts are
261
+ * enabled.
262
+ * @throws {goog.asserts.AssertionError} When the value is not a boolean.
263
+ */
264
+ goog.asserts.assertBoolean = function(value, opt_message, var_args) {
265
+ if (goog.asserts.ENABLE_ASSERTS && !goog.isBoolean(value)) {
266
+ goog.asserts.doAssertFailure_('Expected boolean but got %s: %s.',
267
+ [goog.typeOf(value), value], opt_message,
268
+ Array.prototype.slice.call(arguments, 2));
269
+ }
270
+ return /** @type {boolean} */ (value);
271
+ };
272
+
273
+
274
+ /**
275
+ * Checks if the value is an instance of the user-defined type if
276
+ * goog.asserts.ENABLE_ASSERTS is true.
277
+ * @param {*} value The value to check.
278
+ * @param {!Function} type A user-defined constructor.
279
+ * @param {string=} opt_message Error message in case of failure.
280
+ * @param {...*} var_args The items to substitute into the failure message.
281
+ * @throws {goog.asserts.AssertionError} When the value is not an instance of
282
+ * type.
283
+ */
284
+ goog.asserts.assertInstanceof = function(value, type, opt_message, var_args) {
285
+ if (goog.asserts.ENABLE_ASSERTS && !(value instanceof type)) {
286
+ goog.asserts.doAssertFailure_('instanceof check failed.', null,
287
+ opt_message, Array.prototype.slice.call(arguments, 3));
288
+ }
289
+ };
290
+
291
+ ;
292
+ FI"asset_paths;
293
+ F["�/Users/ali/.rvm/gems/ruby-1.9.3-p0/bundler/gems/closure-library-wrapper-031d1d0f0e50/vendor/closure-library/closure/goog/asserts/asserts.jsI"dependency_paths;
294
+ F[{I" path;
295
+ F"�/Users/ali/.rvm/gems/ruby-1.9.3-p0/bundler/gems/closure-library-wrapper-031d1d0f0e50/vendor/closure-library/closure/goog/asserts/asserts.jsI"
296
+ mtime;
297
+ FIu: Time
298
+ T: offsetiI"hexdigest;
299
+ F"%c09bdc53388154b1db8b4425178cb6f0I"
300
+ F"%46dde6621c301f4928e3b34efee9e3b5