yellow-brick-road 0.1.2 → 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- data/README.rst +42 -20
- data/lib/generators/templates/yellow_brick_road.rb.erb +19 -0
- data/lib/generators/yellow_brick_road/install_generator.rb +14 -0
- data/lib/yellow-brick-road/config.rb +41 -8
- data/lib/yellow-brick-road/directive_processor.rb +6 -5
- data/lib/yellow-brick-road/engine.rb +2 -3
- data/lib/yellow-brick-road/soy_processor.rb +1 -1
- data/lib/yellow-brick-road/version.rb +1 -1
- data/test/dummy/app/assets/javascripts/closure-deps.js +1 -1
- data/test/dummy/config/initializers/yellow_brick_road.rb +18 -1
- data/test/dummy/log/development.log +2208 -0
- data/test/dummy/tmp/cache/assets/C33/E00/sprockets%2F50c54266987e056bca666f8951752841 +2556 -0
- data/test/dummy/tmp/cache/assets/C48/990/sprockets%2F182c7921a46c3b8603c7f5595a111407 +823 -0
- data/test/dummy/tmp/cache/assets/C53/B40/sprockets%2F48cf0c035092dc945559526a279061c6 +204 -0
- data/test/dummy/tmp/cache/assets/C60/DB0/sprockets%2F3f00684578f2a3246581db667309ed89 +187 -0
- data/test/dummy/tmp/cache/assets/C60/E40/sprockets%2F3c5422f721521f492a5f02ca00b70009 +457 -0
- data/test/dummy/tmp/cache/assets/C73/DE0/sprockets%2F21f1f4574326846114a3c106873cebc3 +0 -0
- data/test/dummy/tmp/cache/assets/C7E/9F0/sprockets%2F89862076204c62c4593ac20de32da909 +4 -4
- data/test/dummy/tmp/cache/assets/C80/6F0/sprockets%2F56459a0713f8610d7d261f8be93073a2 +115 -0
- data/test/dummy/tmp/cache/assets/C8D/E10/sprockets%2F34b84bc4732937f885707002eda3896e +511 -0
- data/test/dummy/tmp/cache/assets/C93/CB0/sprockets%2F539b403b24833ca478a6f5877f37687c +239 -0
- data/test/dummy/tmp/cache/assets/C9A/C70/sprockets%2F10933dc6d342f604514713510b9ef0ab +806 -0
- data/test/dummy/tmp/cache/assets/CA0/7C0/sprockets%2Ff591bc0af8f085501241305c04907d3e +590 -0
- data/test/dummy/tmp/cache/assets/CA1/4A0/sprockets%2F5a9ad311e7d225b530b597041714b1e9 +2539 -0
- data/test/dummy/tmp/cache/assets/CA7/310/sprockets%2F45664cf816315200b574e029fde6f10a +0 -0
- data/test/dummy/tmp/cache/assets/CA7/A80/sprockets%2F1f32590957635a5a4f35442bc22f4ca4 +0 -0
- data/test/dummy/tmp/cache/assets/CAE/1D0/sprockets%2F2e62c7733d38a817a1532a744c6287bd +72 -0
- data/test/dummy/tmp/cache/assets/CB2/3C0/sprockets%2F9c35c290501a896b82c31448a39f3d5d +142 -0
- data/test/dummy/tmp/cache/assets/CB3/F20/sprockets%2F558b00e493fb501f7d95761e7eb40273 +2539 -0
- data/test/dummy/tmp/cache/assets/CBE/550/sprockets%2Fd680cac830e0b3408ba910f0b0421147 +2 -2
- data/test/dummy/tmp/cache/assets/CCD/480/sprockets%2Ffe7e11511634a2d03e1a20980b4593cf +0 -0
- data/test/dummy/tmp/cache/assets/CD0/080/sprockets%2Ffd5cbb87741244521d013d11c55573fa +204 -0
- data/test/dummy/tmp/cache/assets/CD2/020/sprockets%2Ff97740ba22118a2c91e992aac041843b +811 -0
- data/test/dummy/tmp/cache/assets/CD8/D90/sprockets%2F55dd841661d646f0024261a08ecf8ec0 +823 -0
- data/test/dummy/tmp/cache/assets/CE3/0D0/sprockets%2F301f97a178fd839a81bd663a6e22b616 +811 -0
- data/test/dummy/tmp/cache/assets/CE4/330/sprockets%2Fbd23466639af99164ab8e1c93721f14b +127 -0
- data/test/dummy/tmp/cache/assets/CE6/8A0/sprockets%2F3c0e7c5fa31563c8e820d6771e09918d +103 -0
- data/test/dummy/tmp/cache/assets/CEB/120/sprockets%2F857a0dde6829f7a27b93a840e1c60469 +522 -0
- data/test/dummy/tmp/cache/assets/CEE/CF0/sprockets%2F376f94b987d8156056c4e1d38ec06bf0 +0 -0
- data/test/dummy/tmp/cache/assets/CF2/C10/sprockets%2Fc64ef8a9dd0a1c3101d662750105c11a +806 -0
- data/test/dummy/tmp/cache/assets/CF3/CD0/sprockets%2F4bb42a5a6b504190f10d20b1c5f93d54 +1529 -0
- data/test/dummy/tmp/cache/assets/CF6/890/sprockets%2F36007a87f140155b5a04f2ca6b262dcc +494 -0
- data/test/dummy/tmp/cache/assets/CF6/9D0/sprockets%2F34b7199e9d33994c8ec7a442d60ca985 +173 -0
- data/test/dummy/tmp/cache/assets/CFA/A90/sprockets%2F901ba405a6d6747f6412ed4d0e0ac620 +256 -0
- data/test/dummy/tmp/cache/assets/CFC/E70/sprockets%2F8ee639668b5f0e629fbe0d62d1394689 +173 -0
- data/test/dummy/tmp/cache/assets/D04/1B0/sprockets%2F418f2b3b6b08b320f6db268a0991c54c +0 -0
- data/test/dummy/tmp/cache/assets/D05/920/sprockets%2F909507434dcc270db4853e4c147f0aac +5 -4
- data/test/dummy/tmp/cache/assets/D07/DB0/sprockets%2F0c17d7dac64290e385c91eb6f1570b31 +511 -0
- data/test/dummy/tmp/cache/assets/D07/EE0/sprockets%2F4999982b09e0b786894fce44f5d783cc +1371 -0
- data/test/dummy/tmp/cache/assets/D09/380/sprockets%2F14383e18fa2faac6b561a29d8e132863 +0 -0
- data/test/dummy/tmp/cache/assets/D0D/200/sprockets%2F545a7e34cce1d4272d83d58fd4215d42 +1277 -0
- data/test/dummy/tmp/cache/assets/D0E/870/sprockets%2F84996444f4f1f3fdc0248131cfb1a3b6 +794 -0
- data/test/dummy/tmp/cache/assets/D15/F60/sprockets%2Fa28394e3f80365b5bc86794dd46daa22 +0 -0
- data/test/dummy/tmp/cache/assets/D18/950/sprockets%2Fcf650d67c5d431ffdb38552e562299b2 +474 -0
- data/test/dummy/tmp/cache/assets/D18/E10/sprockets%2Fec7c58f640556b401fcd66528352dc9d +474 -0
- data/test/dummy/tmp/cache/assets/D20/660/sprockets%2F0d2875475ced01df962f3d758cda7792 +103 -0
- data/test/dummy/tmp/cache/assets/D22/AB0/sprockets%2F0b08e7f81651aaf739a93d61ae99779c +283 -0
- data/test/dummy/tmp/cache/assets/D2E/B20/sprockets%2Feed5412a17a52b1a335925e2af1f75d3 +0 -0
- data/test/dummy/tmp/cache/assets/D36/700/sprockets%2Fd219bf9db2eacc105bb294755093a437 +505 -0
- data/test/dummy/tmp/cache/assets/D3B/A10/sprockets%2Fcf38b51682d84a04da7b8a7313de52c6 +207 -0
- data/test/dummy/tmp/cache/assets/D3C/0E0/sprockets%2Fe9d7aba138d602c4a6ac701bc9615977 +505 -0
- data/test/dummy/tmp/cache/assets/D3E/FF0/sprockets%2F6bd8ccd3e02f397c20f349d5c0960e51 +0 -0
- data/test/dummy/tmp/cache/assets/D41/B30/sprockets%2Fba1b93913dd01d83ac9a96df334456f8 +0 -0
- data/test/dummy/tmp/cache/assets/D41/DA0/sprockets%2Fe8d00810698a9fcee032022fefd084f7 +0 -0
- data/test/dummy/tmp/cache/assets/D44/CF0/sprockets%2Ffa31a45f04884493c909c5a67fcbdf23 +1371 -0
- data/test/dummy/tmp/cache/assets/D47/BE0/sprockets%2F0b5ebdf6dec160a264698e7f745061e8 +142 -0
- data/test/dummy/tmp/cache/assets/D4C/F30/sprockets%2Ff90155c10f59a3fe44959ac09bf817fe +2556 -0
- data/test/dummy/tmp/cache/assets/D4E/7C0/sprockets%2Ff01b58512d01eda23fd5cb23a2b28b60 +1529 -0
- data/test/dummy/tmp/cache/assets/D4E/860/sprockets%2F86eed0c77c47d0970345bbabb58d8939 +1277 -0
- data/test/dummy/tmp/cache/assets/D4E/C30/sprockets%2F52420c10c73ca310d026565eafdadb4e +1545 -0
- data/test/dummy/tmp/cache/assets/D4E/F60/sprockets%2F9893a3c5aeb1a9e77469f4751b4d3c3f +115 -0
- data/test/dummy/tmp/cache/assets/D4F/E60/sprockets%2F17ee65de1f78c3dd5c165a9867e810b6 +165 -0
- data/test/dummy/tmp/cache/assets/D57/0D0/sprockets%2Fa29e6e8106d9d5ed1e2889126cfbf877 +300 -0
- data/test/dummy/tmp/cache/assets/D5C/650/sprockets%2Fe1c381da3cc213a639e956ae3315a2bd +607 -0
- data/test/dummy/tmp/cache/assets/D61/860/sprockets%2Fbf032a3b4aad2c2e25704e65c966cf45 +794 -0
- data/test/dummy/tmp/cache/assets/D63/B20/sprockets%2F31fc70ce66bb80fb9421be34eb3b0287 +0 -0
- data/test/dummy/tmp/cache/assets/D64/D60/sprockets%2Fa544ea03bf0a45948a053ba76ec2a79f +239 -0
- data/test/dummy/tmp/cache/assets/D6B/F90/sprockets%2F66636712ecb1fcc777dccf7643a0e1b1 +127 -0
- data/test/dummy/tmp/cache/assets/D6E/AD0/sprockets%2Fc91cdc6a72c729d7a64119198b3d2eab +0 -0
- data/test/dummy/tmp/cache/assets/D6F/140/sprockets%2F9ddc51f4388dd5243a28dba1ce47572b +53 -0
- data/test/dummy/tmp/cache/assets/D72/800/sprockets%2F92baa375d54e16fe0a5c7f079a1ce992 +165 -0
- data/test/dummy/tmp/cache/assets/D74/220/sprockets%2F3f888bda53179cb945eab35fbd31a708 +53 -0
- data/test/dummy/tmp/cache/assets/D78/5F0/sprockets%2F638ed6af667d4fc5147f72ff34aa2d33 +0 -0
- data/test/dummy/tmp/cache/assets/D7D/640/sprockets%2F95a7c5580f957c31e1ab9d0773ed5fde +607 -0
- data/test/dummy/tmp/cache/assets/D84/210/sprockets%2Fabd0103ccec2b428ac62c94e4c40b384 +6 -5
- data/test/dummy/tmp/cache/assets/D89/020/sprockets%2Fa06df6166e70324e712e54b1cafca0ae +187 -0
- data/test/dummy/tmp/cache/assets/D8A/9F0/sprockets%2Fc06547ca33ee3d03be14ce045ae1c9e2 +207 -0
- data/test/dummy/tmp/cache/assets/D9E/B80/sprockets%2F9561df1d45c7ff4aa8ac3e2df0c99121 +0 -0
- data/test/dummy/tmp/cache/assets/DA3/F30/sprockets%2Fe015d6ccdfcf022e47c83d7906f728ae +457 -0
- data/test/dummy/tmp/cache/assets/DAE/190/sprockets%2F433c7b21968be8d1f9bfdbdf7a637c57 +0 -0
- data/test/dummy/tmp/cache/assets/DB3/600/sprockets%2F9b70ae73f15ba693886eeef4eb5d6c75 +0 -0
- data/test/dummy/tmp/cache/assets/DB4/510/sprockets%2F29cdae8e29c88fd9ddbd4831419560fe +1260 -0
- data/test/dummy/tmp/cache/assets/DC1/4A0/sprockets%2F0b63dfcf163f2faeb612724eb4545bcc +1354 -0
- data/test/dummy/tmp/cache/assets/DC4/C10/sprockets%2Fcf48f4cbad3db33146eab4c577c1d209 +300 -0
- data/test/dummy/tmp/cache/assets/DC4/CA0/sprockets%2Fd0da8a60ea4dc16b9fd3e2a50d88633c +0 -0
- data/test/dummy/tmp/cache/assets/DC7/8C0/sprockets%2F1ad68dcc9ef598d3811ba2ac5c0ea182 +1354 -0
- data/test/dummy/tmp/cache/assets/DC7/C00/sprockets%2Fba755ff3a81c3192f0e45a4f7c0c7dcb +0 -0
- data/test/dummy/tmp/cache/assets/DCA/760/sprockets%2F717c4cea10bf601090ffdfe4e668e4cb +283 -0
- data/test/dummy/tmp/cache/assets/DCA/DE0/sprockets%2F51dcced9ec2b3cd4b1cc2949f860c361 +590 -0
- data/test/dummy/tmp/cache/assets/DD7/E70/sprockets%2F2595d8c8d1d5f4deb096247fb3bfc7ab +256 -0
- data/test/dummy/tmp/cache/assets/DE1/9D0/sprockets%2F8befd77af580ee16ec42ec95b1766ff3 +1545 -0
- data/test/dummy/tmp/cache/assets/E00/D80/sprockets%2F9debc27161f7bccf2d84a36b8c36c4bf +522 -0
- data/test/dummy/tmp/cache/assets/E00/E60/sprockets%2Fac159b94b0a6d621e4f6cde9b4de87bb +0 -0
- data/test/dummy/tmp/cache/assets/E04/890/sprockets%2F2f5173deea6c795b8fdde723bb4b63af +0 -0
- data/test/dummy/tmp/cache/assets/E1B/D00/sprockets%2F886dff4afe55f9d3f8abe434f2689add +72 -0
- data/test/dummy/tmp/cache/assets/E1B/F20/sprockets%2Fa4bbc04eb83ebf94fd8134c3abd220dd +494 -0
- data/test/dummy/tmp/cache/assets/E71/0C0/sprockets%2F5ffdc0daa0a1f9638c787897ceefcdee +1260 -0
- metadata +186 -10
- data/test/dummy/tmp/pids/server.pid +0 -1
@@ -0,0 +1,607 @@
|
|
1
|
+
o: ActiveSupport::Cache::Entry :@compressedF:@expires_in0:@created_atf1325538162.1668139:@value{I"
|
2
|
+
class:EFI"BundledAsset;
|
3
|
+
FI"id;
|
4
|
+
F"%76eb0e28a0105e721e708f9e6abe6757I"logical_path;
|
5
|
+
FI""closure/goog/object/object.js;
|
6
|
+
TI"
|
7
|
+
F"n/Volumes/Development/dev-web/closure-library-wrapper/vendor/closure-library/closure/goog/object/object.jsI"content_type;
|
8
|
+
FI"application/javascript;
|
9
|
+
FI"
|
10
|
+
mtime;
|
11
|
+
FI"2012-01-02T16:18:52+00:00;
|
12
|
+
FI" body;
|
13
|
+
FI"�A// Copyright 2006 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 for manipulating objects/maps/hashes.
|
29
|
+
*/
|
30
|
+
|
31
|
+
|
32
|
+
goog.provide('goog.object');
|
33
|
+
|
34
|
+
|
35
|
+
/**
|
36
|
+
* Calls a function for each element in an object/map/hash.
|
37
|
+
*
|
38
|
+
* @param {Object} obj The object over which to iterate.
|
39
|
+
* @param {Function} f The function to call for every element. This function
|
40
|
+
* takes 3 arguments (the element, the index and the object)
|
41
|
+
* and the return value is irrelevant.
|
42
|
+
* @param {Object=} opt_obj This is used as the 'this' object within f.
|
43
|
+
*/
|
44
|
+
goog.object.forEach = function(obj, f, opt_obj) {
|
45
|
+
for (var key in obj) {
|
46
|
+
f.call(opt_obj, obj[key], key, obj);
|
47
|
+
}
|
48
|
+
};
|
49
|
+
|
50
|
+
|
51
|
+
/**
|
52
|
+
* Calls a function for each element in an object/map/hash. If that call returns
|
53
|
+
* true, adds the element to a new object.
|
54
|
+
*
|
55
|
+
* @param {Object} obj The object over which to iterate.
|
56
|
+
* @param {Function} f The function to call for every element. This
|
57
|
+
* function takes 3 arguments (the element, the index and the object)
|
58
|
+
* and should return a boolean. If the return value is true the
|
59
|
+
* element is added to the result object. If it is false the
|
60
|
+
* element is not included.
|
61
|
+
* @param {Object=} opt_obj This is used as the 'this' object within f.
|
62
|
+
* @return {!Object} a new object in which only elements that passed the test
|
63
|
+
* are present.
|
64
|
+
*/
|
65
|
+
goog.object.filter = function(obj, f, opt_obj) {
|
66
|
+
var res = {};
|
67
|
+
for (var key in obj) {
|
68
|
+
if (f.call(opt_obj, obj[key], key, obj)) {
|
69
|
+
res[key] = obj[key];
|
70
|
+
}
|
71
|
+
}
|
72
|
+
return res;
|
73
|
+
};
|
74
|
+
|
75
|
+
|
76
|
+
/**
|
77
|
+
* For every element in an object/map/hash calls a function and inserts the
|
78
|
+
* result into a new object.
|
79
|
+
*
|
80
|
+
* @param {Object} obj The object over which to iterate.
|
81
|
+
* @param {Function} f The function to call for every element. This function
|
82
|
+
* takes 3 arguments (the element, the index and the object)
|
83
|
+
* and should return something. The result will be inserted
|
84
|
+
* into a new object.
|
85
|
+
* @param {Object=} opt_obj This is used as the 'this' object within f.
|
86
|
+
* @return {!Object} a new object with the results from f.
|
87
|
+
*/
|
88
|
+
goog.object.map = function(obj, f, opt_obj) {
|
89
|
+
var res = {};
|
90
|
+
for (var key in obj) {
|
91
|
+
res[key] = f.call(opt_obj, obj[key], key, obj);
|
92
|
+
}
|
93
|
+
return res;
|
94
|
+
};
|
95
|
+
|
96
|
+
|
97
|
+
/**
|
98
|
+
* Calls a function for each element in an object/map/hash. If any
|
99
|
+
* call returns true, returns true (without checking the rest). If
|
100
|
+
* all calls return false, returns false.
|
101
|
+
*
|
102
|
+
* @param {Object} obj The object to check.
|
103
|
+
* @param {Function} f The function to call for every element. This function
|
104
|
+
* takes 3 arguments (the element, the index and the object) and should
|
105
|
+
* return a boolean.
|
106
|
+
* @param {Object=} opt_obj This is used as the 'this' object within f.
|
107
|
+
* @return {boolean} true if any element passes the test.
|
108
|
+
*/
|
109
|
+
goog.object.some = function(obj, f, opt_obj) {
|
110
|
+
for (var key in obj) {
|
111
|
+
if (f.call(opt_obj, obj[key], key, obj)) {
|
112
|
+
return true;
|
113
|
+
}
|
114
|
+
}
|
115
|
+
return false;
|
116
|
+
};
|
117
|
+
|
118
|
+
|
119
|
+
/**
|
120
|
+
* Calls a function for each element in an object/map/hash. If
|
121
|
+
* all calls return true, returns true. If any call returns false, returns
|
122
|
+
* false at this point and does not continue to check the remaining elements.
|
123
|
+
*
|
124
|
+
* @param {Object} obj The object to check.
|
125
|
+
* @param {Function} f The function to call for every element. This function
|
126
|
+
* takes 3 arguments (the element, the index and the object) and should
|
127
|
+
* return a boolean.
|
128
|
+
* @param {Object=} opt_obj This is used as the 'this' object within f.
|
129
|
+
* @return {boolean} false if any element fails the test.
|
130
|
+
*/
|
131
|
+
goog.object.every = function(obj, f, opt_obj) {
|
132
|
+
for (var key in obj) {
|
133
|
+
if (!f.call(opt_obj, obj[key], key, obj)) {
|
134
|
+
return false;
|
135
|
+
}
|
136
|
+
}
|
137
|
+
return true;
|
138
|
+
};
|
139
|
+
|
140
|
+
|
141
|
+
/**
|
142
|
+
* Returns the number of key-value pairs in the object map.
|
143
|
+
*
|
144
|
+
* @param {Object} obj The object for which to get the number of key-value
|
145
|
+
* pairs.
|
146
|
+
* @return {number} The number of key-value pairs in the object map.
|
147
|
+
*/
|
148
|
+
goog.object.getCount = function(obj) {
|
149
|
+
// JS1.5 has __count__ but it has been deprecated so it raises a warning...
|
150
|
+
// in other words do not use. Also __count__ only includes the fields on the
|
151
|
+
// actual object and not in the prototype chain.
|
152
|
+
var rv = 0;
|
153
|
+
for (var key in obj) {
|
154
|
+
rv++;
|
155
|
+
}
|
156
|
+
return rv;
|
157
|
+
};
|
158
|
+
|
159
|
+
|
160
|
+
/**
|
161
|
+
* Returns one key from the object map, if any exists.
|
162
|
+
* For map literals the returned key will be the first one in most of the
|
163
|
+
* browsers (a know exception is Konqueror).
|
164
|
+
*
|
165
|
+
* @param {Object} obj The object to pick a key from.
|
166
|
+
* @return {string|undefined} The key or undefined if the object is empty.
|
167
|
+
*/
|
168
|
+
goog.object.getAnyKey = function(obj) {
|
169
|
+
for (var key in obj) {
|
170
|
+
return key;
|
171
|
+
}
|
172
|
+
};
|
173
|
+
|
174
|
+
|
175
|
+
/**
|
176
|
+
* Returns one value from the object map, if any exists.
|
177
|
+
* For map literals the returned value will be the first one in most of the
|
178
|
+
* browsers (a know exception is Konqueror).
|
179
|
+
*
|
180
|
+
* @param {Object} obj The object to pick a value from.
|
181
|
+
* @return {*} The value or undefined if the object is empty.
|
182
|
+
*/
|
183
|
+
goog.object.getAnyValue = function(obj) {
|
184
|
+
for (var key in obj) {
|
185
|
+
return obj[key];
|
186
|
+
}
|
187
|
+
};
|
188
|
+
|
189
|
+
|
190
|
+
/**
|
191
|
+
* Whether the object/hash/map contains the given object as a value.
|
192
|
+
* An alias for goog.object.containsValue(obj, val).
|
193
|
+
*
|
194
|
+
* @param {Object} obj The object in which to look for val.
|
195
|
+
* @param {*} val The object for which to check.
|
196
|
+
* @return {boolean} true if val is present.
|
197
|
+
*/
|
198
|
+
goog.object.contains = function(obj, val) {
|
199
|
+
return goog.object.containsValue(obj, val);
|
200
|
+
};
|
201
|
+
|
202
|
+
|
203
|
+
/**
|
204
|
+
* Returns the values of the object/map/hash.
|
205
|
+
*
|
206
|
+
* @param {Object} obj The object from which to get the values.
|
207
|
+
* @return {!Array} The values in the object/map/hash.
|
208
|
+
*/
|
209
|
+
goog.object.getValues = function(obj) {
|
210
|
+
var res = [];
|
211
|
+
var i = 0;
|
212
|
+
for (var key in obj) {
|
213
|
+
res[i++] = obj[key];
|
214
|
+
}
|
215
|
+
return res;
|
216
|
+
};
|
217
|
+
|
218
|
+
|
219
|
+
/**
|
220
|
+
* Returns the keys of the object/map/hash.
|
221
|
+
*
|
222
|
+
* @param {Object} obj The object from which to get the keys.
|
223
|
+
* @return {!Array.<string>} Array of property keys.
|
224
|
+
*/
|
225
|
+
goog.object.getKeys = function(obj) {
|
226
|
+
var res = [];
|
227
|
+
var i = 0;
|
228
|
+
for (var key in obj) {
|
229
|
+
res[i++] = key;
|
230
|
+
}
|
231
|
+
return res;
|
232
|
+
};
|
233
|
+
|
234
|
+
|
235
|
+
/**
|
236
|
+
* Get a value from an object multiple levels deep. This is useful for
|
237
|
+
* pulling values from deeply nested objects, such as JSON responses.
|
238
|
+
* Example usage: getValueByKeys(jsonObj, 'foo', 'entries', 3)
|
239
|
+
*
|
240
|
+
* @param {!Object} obj An object to get the value from. Can be array-like.
|
241
|
+
* @param {...(string|number|!Array.<number|string>)} var_args A number of keys
|
242
|
+
* (as strings, or nubmers, for array-like objects). Can also be
|
243
|
+
* specified as a single array of keys.
|
244
|
+
* @return {*} The resulting value. If, at any point, the value for a key
|
245
|
+
* is undefined, returns undefined.
|
246
|
+
*/
|
247
|
+
goog.object.getValueByKeys = function(obj, var_args) {
|
248
|
+
var isArrayLike = goog.isArrayLike(var_args);
|
249
|
+
var keys = isArrayLike ? var_args : arguments;
|
250
|
+
|
251
|
+
// Start with the 2nd parameter for the variable parameters syntax.
|
252
|
+
for (var i = isArrayLike ? 0 : 1; i < keys.length; i++) {
|
253
|
+
obj = obj[keys[i]];
|
254
|
+
if (!goog.isDef(obj)) {
|
255
|
+
break;
|
256
|
+
}
|
257
|
+
}
|
258
|
+
|
259
|
+
return obj;
|
260
|
+
};
|
261
|
+
|
262
|
+
|
263
|
+
/**
|
264
|
+
* Whether the object/map/hash contains the given key.
|
265
|
+
*
|
266
|
+
* @param {Object} obj The object in which to look for key.
|
267
|
+
* @param {*} key The key for which to check.
|
268
|
+
* @return {boolean} true If the map contains the key.
|
269
|
+
*/
|
270
|
+
goog.object.containsKey = function(obj, key) {
|
271
|
+
return key in obj;
|
272
|
+
};
|
273
|
+
|
274
|
+
|
275
|
+
/**
|
276
|
+
* Whether the object/map/hash contains the given value. This is O(n).
|
277
|
+
*
|
278
|
+
* @param {Object} obj The object in which to look for val.
|
279
|
+
* @param {*} val The value for which to check.
|
280
|
+
* @return {boolean} true If the map contains the value.
|
281
|
+
*/
|
282
|
+
goog.object.containsValue = function(obj, val) {
|
283
|
+
for (var key in obj) {
|
284
|
+
if (obj[key] == val) {
|
285
|
+
return true;
|
286
|
+
}
|
287
|
+
}
|
288
|
+
return false;
|
289
|
+
};
|
290
|
+
|
291
|
+
|
292
|
+
/**
|
293
|
+
* Searches an object for an element that satisfies the given condition and
|
294
|
+
* returns its key.
|
295
|
+
* @param {Object} obj The object to search in.
|
296
|
+
* @param {function(*, string, Object): boolean} f The function to call for
|
297
|
+
* every element. Takes 3 arguments (the value, the key and the object) and
|
298
|
+
* should return a boolean.
|
299
|
+
* @param {Object=} opt_this An optional "this" context for the function.
|
300
|
+
* @return {string|undefined} The key of an element for which the function
|
301
|
+
* returns true or undefined if no such element is found.
|
302
|
+
*/
|
303
|
+
goog.object.findKey = function(obj, f, opt_this) {
|
304
|
+
for (var key in obj) {
|
305
|
+
if (f.call(opt_this, obj[key], key, obj)) {
|
306
|
+
return key;
|
307
|
+
}
|
308
|
+
}
|
309
|
+
return undefined;
|
310
|
+
};
|
311
|
+
|
312
|
+
|
313
|
+
/**
|
314
|
+
* Searches an object for an element that satisfies the given condition and
|
315
|
+
* returns its value.
|
316
|
+
* @param {Object} obj The object to search in.
|
317
|
+
* @param {function(*, string, Object): boolean} f The function to call for
|
318
|
+
* every element. Takes 3 arguments (the value, the key and the object) and
|
319
|
+
* should return a boolean.
|
320
|
+
* @param {Object=} opt_this An optional "this" context for the function.
|
321
|
+
* @return {*} The value of an element for which the function returns true or
|
322
|
+
* undefined if no such element is found.
|
323
|
+
*/
|
324
|
+
goog.object.findValue = function(obj, f, opt_this) {
|
325
|
+
var key = goog.object.findKey(obj, f, opt_this);
|
326
|
+
return key && obj[key];
|
327
|
+
};
|
328
|
+
|
329
|
+
|
330
|
+
/**
|
331
|
+
* Whether the object/map/hash is empty.
|
332
|
+
*
|
333
|
+
* @param {Object} obj The object to test.
|
334
|
+
* @return {boolean} true if obj is empty.
|
335
|
+
*/
|
336
|
+
goog.object.isEmpty = function(obj) {
|
337
|
+
for (var key in obj) {
|
338
|
+
return false;
|
339
|
+
}
|
340
|
+
return true;
|
341
|
+
};
|
342
|
+
|
343
|
+
|
344
|
+
/**
|
345
|
+
* Removes all key value pairs from the object/map/hash.
|
346
|
+
*
|
347
|
+
* @param {Object} obj The object to clear.
|
348
|
+
*/
|
349
|
+
goog.object.clear = function(obj) {
|
350
|
+
for (var i in obj) {
|
351
|
+
delete obj[i];
|
352
|
+
}
|
353
|
+
};
|
354
|
+
|
355
|
+
|
356
|
+
/**
|
357
|
+
* Removes a key-value pair based on the key.
|
358
|
+
*
|
359
|
+
* @param {Object} obj The object from which to remove the key.
|
360
|
+
* @param {*} key The key to remove.
|
361
|
+
* @return {boolean} Whether an element was removed.
|
362
|
+
*/
|
363
|
+
goog.object.remove = function(obj, key) {
|
364
|
+
var rv;
|
365
|
+
if ((rv = key in obj)) {
|
366
|
+
delete obj[key];
|
367
|
+
}
|
368
|
+
return rv;
|
369
|
+
};
|
370
|
+
|
371
|
+
|
372
|
+
/**
|
373
|
+
* Adds a key-value pair to the object. Throws an exception if the key is
|
374
|
+
* already in use. Use set if you want to change an existing pair.
|
375
|
+
*
|
376
|
+
* @param {Object} obj The object to which to add the key-value pair.
|
377
|
+
* @param {string} key The key to add.
|
378
|
+
* @param {*} val The value to add.
|
379
|
+
*/
|
380
|
+
goog.object.add = function(obj, key, val) {
|
381
|
+
if (key in obj) {
|
382
|
+
throw Error('The object already contains the key "' + key + '"');
|
383
|
+
}
|
384
|
+
goog.object.set(obj, key, val);
|
385
|
+
};
|
386
|
+
|
387
|
+
|
388
|
+
/**
|
389
|
+
* Returns the value for the given key.
|
390
|
+
*
|
391
|
+
* @param {Object} obj The object from which to get the value.
|
392
|
+
* @param {string} key The key for which to get the value.
|
393
|
+
* @param {*=} opt_val The value to return if no item is found for the given
|
394
|
+
* key (default is undefined).
|
395
|
+
* @return {*} The value for the given key.
|
396
|
+
*/
|
397
|
+
goog.object.get = function(obj, key, opt_val) {
|
398
|
+
if (key in obj) {
|
399
|
+
return obj[key];
|
400
|
+
}
|
401
|
+
return opt_val;
|
402
|
+
};
|
403
|
+
|
404
|
+
|
405
|
+
/**
|
406
|
+
* Adds a key-value pair to the object/map/hash.
|
407
|
+
*
|
408
|
+
* @param {Object} obj The object to which to add the key-value pair.
|
409
|
+
* @param {string} key The key to add.
|
410
|
+
* @param {*} value The value to add.
|
411
|
+
*/
|
412
|
+
goog.object.set = function(obj, key, value) {
|
413
|
+
obj[key] = value;
|
414
|
+
};
|
415
|
+
|
416
|
+
|
417
|
+
/**
|
418
|
+
* Adds a key-value pair to the object/map/hash if it doesn't exist yet.
|
419
|
+
*
|
420
|
+
* @param {Object} obj The object to which to add the key-value pair.
|
421
|
+
* @param {string} key The key to add.
|
422
|
+
* @param {*} value The value to add if the key wasn't present.
|
423
|
+
* @return {*} The value of the entry at the end of the function.
|
424
|
+
*/
|
425
|
+
goog.object.setIfUndefined = function(obj, key, value) {
|
426
|
+
return key in obj ? obj[key] : (obj[key] = value);
|
427
|
+
};
|
428
|
+
|
429
|
+
|
430
|
+
/**
|
431
|
+
* Does a flat clone of the object.
|
432
|
+
*
|
433
|
+
* @param {Object} obj Object to clone.
|
434
|
+
* @return {!Object} Clone of the input object.
|
435
|
+
*/
|
436
|
+
goog.object.clone = function(obj) {
|
437
|
+
// We cannot use the prototype trick because a lot of methods depend on where
|
438
|
+
// the actual key is set.
|
439
|
+
|
440
|
+
var res = {};
|
441
|
+
for (var key in obj) {
|
442
|
+
res[key] = obj[key];
|
443
|
+
}
|
444
|
+
return res;
|
445
|
+
// We could also use goog.mixin but I wanted this to be independent from that.
|
446
|
+
};
|
447
|
+
|
448
|
+
|
449
|
+
/**
|
450
|
+
* Clones a value. The input may be an Object, Array, or basic type. Objects and
|
451
|
+
* arrays will be cloned recursively.
|
452
|
+
*
|
453
|
+
* WARNINGS:
|
454
|
+
* <code>goog.object.unsafeClone</code> does not detect reference loops. Objects
|
455
|
+
* that refer to themselves will cause infinite recursion.
|
456
|
+
*
|
457
|
+
* <code>goog.object.unsafeClone</code> is unaware of unique identifiers, and
|
458
|
+
* copies UIDs created by <code>getUid</code> into cloned results.
|
459
|
+
*
|
460
|
+
* @param {*} obj The value to clone.
|
461
|
+
* @return {*} A clone of the input value.
|
462
|
+
*/
|
463
|
+
goog.object.unsafeClone = function(obj) {
|
464
|
+
var type = goog.typeOf(obj);
|
465
|
+
if (type == 'object' || type == 'array') {
|
466
|
+
if (obj.clone) {
|
467
|
+
return obj.clone();
|
468
|
+
}
|
469
|
+
var clone = type == 'array' ? [] : {};
|
470
|
+
for (var key in obj) {
|
471
|
+
clone[key] = goog.object.unsafeClone(obj[key]);
|
472
|
+
}
|
473
|
+
return clone;
|
474
|
+
}
|
475
|
+
|
476
|
+
return obj;
|
477
|
+
};
|
478
|
+
|
479
|
+
|
480
|
+
/**
|
481
|
+
* Returns a new object in which all the keys and values are interchanged
|
482
|
+
* (keys become values and values become keys). If multiple keys map to the
|
483
|
+
* same value, the chosen transposed value is implementation-dependent.
|
484
|
+
*
|
485
|
+
* @param {Object} obj The object to transpose.
|
486
|
+
* @return {!Object} The transposed object.
|
487
|
+
*/
|
488
|
+
goog.object.transpose = function(obj) {
|
489
|
+
var transposed = {};
|
490
|
+
for (var key in obj) {
|
491
|
+
transposed[obj[key]] = key;
|
492
|
+
}
|
493
|
+
return transposed;
|
494
|
+
};
|
495
|
+
|
496
|
+
|
497
|
+
/**
|
498
|
+
* The names of the fields that are defined on Object.prototype.
|
499
|
+
* @type {Array.<string>}
|
500
|
+
* @private
|
501
|
+
*/
|
502
|
+
goog.object.PROTOTYPE_FIELDS_ = [
|
503
|
+
'constructor',
|
504
|
+
'hasOwnProperty',
|
505
|
+
'isPrototypeOf',
|
506
|
+
'propertyIsEnumerable',
|
507
|
+
'toLocaleString',
|
508
|
+
'toString',
|
509
|
+
'valueOf'
|
510
|
+
];
|
511
|
+
|
512
|
+
|
513
|
+
/**
|
514
|
+
* Extends an object with another object.
|
515
|
+
* This operates 'in-place'; it does not create a new Object.
|
516
|
+
*
|
517
|
+
* Example:
|
518
|
+
* var o = {};
|
519
|
+
* goog.object.extend(o, {a: 0, b: 1});
|
520
|
+
* o; // {a: 0, b: 1}
|
521
|
+
* goog.object.extend(o, {c: 2});
|
522
|
+
* o; // {a: 0, b: 1, c: 2}
|
523
|
+
*
|
524
|
+
* @param {Object} target The object to modify.
|
525
|
+
* @param {...Object} var_args The objects from which values will be copied.
|
526
|
+
*/
|
527
|
+
goog.object.extend = function(target, var_args) {
|
528
|
+
var key, source;
|
529
|
+
for (var i = 1; i < arguments.length; i++) {
|
530
|
+
source = arguments[i];
|
531
|
+
for (key in source) {
|
532
|
+
target[key] = source[key];
|
533
|
+
}
|
534
|
+
|
535
|
+
// For IE the for-in-loop does not contain any properties that are not
|
536
|
+
// enumerable on the prototype object (for example isPrototypeOf from
|
537
|
+
// Object.prototype) and it will also not include 'replace' on objects that
|
538
|
+
// extend String and change 'replace' (not that it is common for anyone to
|
539
|
+
// extend anything except Object).
|
540
|
+
|
541
|
+
for (var j = 0; j < goog.object.PROTOTYPE_FIELDS_.length; j++) {
|
542
|
+
key = goog.object.PROTOTYPE_FIELDS_[j];
|
543
|
+
if (Object.prototype.hasOwnProperty.call(source, key)) {
|
544
|
+
target[key] = source[key];
|
545
|
+
}
|
546
|
+
}
|
547
|
+
}
|
548
|
+
};
|
549
|
+
|
550
|
+
|
551
|
+
/**
|
552
|
+
* Creates a new object built from the key-value pairs provided as arguments.
|
553
|
+
* @param {...*} var_args If only one argument is provided and it is an array
|
554
|
+
* then this is used as the arguments, otherwise even arguments are used as
|
555
|
+
* the property names and odd arguments are used as the property values.
|
556
|
+
* @return {!Object} The new object.
|
557
|
+
* @throws {Error} If there are uneven number of arguments or there is only one
|
558
|
+
* non array argument.
|
559
|
+
*/
|
560
|
+
goog.object.create = function(var_args) {
|
561
|
+
var argLength = arguments.length;
|
562
|
+
if (argLength == 1 && goog.isArray(arguments[0])) {
|
563
|
+
return goog.object.create.apply(null, arguments[0]);
|
564
|
+
}
|
565
|
+
|
566
|
+
if (argLength % 2) {
|
567
|
+
throw Error('Uneven number of arguments');
|
568
|
+
}
|
569
|
+
|
570
|
+
var rv = {};
|
571
|
+
for (var i = 0; i < argLength; i += 2) {
|
572
|
+
rv[arguments[i]] = arguments[i + 1];
|
573
|
+
}
|
574
|
+
return rv;
|
575
|
+
};
|
576
|
+
|
577
|
+
|
578
|
+
/**
|
579
|
+
* Creates a new object where the property names come from the arguments but
|
580
|
+
* the value is always set to true
|
581
|
+
* @param {...*} var_args If only one argument is provided and it is an array
|
582
|
+
* then this is used as the arguments, otherwise the arguments are used
|
583
|
+
* as the property names.
|
584
|
+
* @return {!Object} The new object.
|
585
|
+
*/
|
586
|
+
goog.object.createSet = function(var_args) {
|
587
|
+
var argLength = arguments.length;
|
588
|
+
if (argLength == 1 && goog.isArray(arguments[0])) {
|
589
|
+
return goog.object.createSet.apply(null, arguments[0]);
|
590
|
+
}
|
591
|
+
|
592
|
+
var rv = {};
|
593
|
+
for (var i = 0; i < argLength; i++) {
|
594
|
+
rv[arguments[i]] = true;
|
595
|
+
}
|
596
|
+
return rv;
|
597
|
+
};
|
598
|
+
;
|
599
|
+
FI"asset_paths;
|
600
|
+
F["n/Volumes/Development/dev-web/closure-library-wrapper/vendor/closure-library/closure/goog/object/object.jsI"dependency_paths;
|
601
|
+
F[{I" path;
|
602
|
+
F"n/Volumes/Development/dev-web/closure-library-wrapper/vendor/closure-library/closure/goog/object/object.jsI"
|
603
|
+
mtime;
|
604
|
+
FIu: Time
|
605
|
+
T:offsetiI"hexdigest;
|
606
|
+
F"%4087c42e0c92911b0a435909f540d43eI"
|
607
|
+
F"%46dde6621c301f4928e3b34efee9e3b5
|