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.
Files changed (109) hide show
  1. data/README.rst +42 -20
  2. data/lib/generators/templates/yellow_brick_road.rb.erb +19 -0
  3. data/lib/generators/yellow_brick_road/install_generator.rb +14 -0
  4. data/lib/yellow-brick-road/config.rb +41 -8
  5. data/lib/yellow-brick-road/directive_processor.rb +6 -5
  6. data/lib/yellow-brick-road/engine.rb +2 -3
  7. data/lib/yellow-brick-road/soy_processor.rb +1 -1
  8. data/lib/yellow-brick-road/version.rb +1 -1
  9. data/test/dummy/app/assets/javascripts/closure-deps.js +1 -1
  10. data/test/dummy/config/initializers/yellow_brick_road.rb +18 -1
  11. data/test/dummy/log/development.log +2208 -0
  12. data/test/dummy/tmp/cache/assets/C33/E00/sprockets%2F50c54266987e056bca666f8951752841 +2556 -0
  13. data/test/dummy/tmp/cache/assets/C48/990/sprockets%2F182c7921a46c3b8603c7f5595a111407 +823 -0
  14. data/test/dummy/tmp/cache/assets/C53/B40/sprockets%2F48cf0c035092dc945559526a279061c6 +204 -0
  15. data/test/dummy/tmp/cache/assets/C60/DB0/sprockets%2F3f00684578f2a3246581db667309ed89 +187 -0
  16. data/test/dummy/tmp/cache/assets/C60/E40/sprockets%2F3c5422f721521f492a5f02ca00b70009 +457 -0
  17. data/test/dummy/tmp/cache/assets/C73/DE0/sprockets%2F21f1f4574326846114a3c106873cebc3 +0 -0
  18. data/test/dummy/tmp/cache/assets/C7E/9F0/sprockets%2F89862076204c62c4593ac20de32da909 +4 -4
  19. data/test/dummy/tmp/cache/assets/C80/6F0/sprockets%2F56459a0713f8610d7d261f8be93073a2 +115 -0
  20. data/test/dummy/tmp/cache/assets/C8D/E10/sprockets%2F34b84bc4732937f885707002eda3896e +511 -0
  21. data/test/dummy/tmp/cache/assets/C93/CB0/sprockets%2F539b403b24833ca478a6f5877f37687c +239 -0
  22. data/test/dummy/tmp/cache/assets/C9A/C70/sprockets%2F10933dc6d342f604514713510b9ef0ab +806 -0
  23. data/test/dummy/tmp/cache/assets/CA0/7C0/sprockets%2Ff591bc0af8f085501241305c04907d3e +590 -0
  24. data/test/dummy/tmp/cache/assets/CA1/4A0/sprockets%2F5a9ad311e7d225b530b597041714b1e9 +2539 -0
  25. data/test/dummy/tmp/cache/assets/CA7/310/sprockets%2F45664cf816315200b574e029fde6f10a +0 -0
  26. data/test/dummy/tmp/cache/assets/CA7/A80/sprockets%2F1f32590957635a5a4f35442bc22f4ca4 +0 -0
  27. data/test/dummy/tmp/cache/assets/CAE/1D0/sprockets%2F2e62c7733d38a817a1532a744c6287bd +72 -0
  28. data/test/dummy/tmp/cache/assets/CB2/3C0/sprockets%2F9c35c290501a896b82c31448a39f3d5d +142 -0
  29. data/test/dummy/tmp/cache/assets/CB3/F20/sprockets%2F558b00e493fb501f7d95761e7eb40273 +2539 -0
  30. data/test/dummy/tmp/cache/assets/CBE/550/sprockets%2Fd680cac830e0b3408ba910f0b0421147 +2 -2
  31. data/test/dummy/tmp/cache/assets/CCD/480/sprockets%2Ffe7e11511634a2d03e1a20980b4593cf +0 -0
  32. data/test/dummy/tmp/cache/assets/CD0/080/sprockets%2Ffd5cbb87741244521d013d11c55573fa +204 -0
  33. data/test/dummy/tmp/cache/assets/CD2/020/sprockets%2Ff97740ba22118a2c91e992aac041843b +811 -0
  34. data/test/dummy/tmp/cache/assets/CD8/D90/sprockets%2F55dd841661d646f0024261a08ecf8ec0 +823 -0
  35. data/test/dummy/tmp/cache/assets/CE3/0D0/sprockets%2F301f97a178fd839a81bd663a6e22b616 +811 -0
  36. data/test/dummy/tmp/cache/assets/CE4/330/sprockets%2Fbd23466639af99164ab8e1c93721f14b +127 -0
  37. data/test/dummy/tmp/cache/assets/CE6/8A0/sprockets%2F3c0e7c5fa31563c8e820d6771e09918d +103 -0
  38. data/test/dummy/tmp/cache/assets/CEB/120/sprockets%2F857a0dde6829f7a27b93a840e1c60469 +522 -0
  39. data/test/dummy/tmp/cache/assets/CEE/CF0/sprockets%2F376f94b987d8156056c4e1d38ec06bf0 +0 -0
  40. data/test/dummy/tmp/cache/assets/CF2/C10/sprockets%2Fc64ef8a9dd0a1c3101d662750105c11a +806 -0
  41. data/test/dummy/tmp/cache/assets/CF3/CD0/sprockets%2F4bb42a5a6b504190f10d20b1c5f93d54 +1529 -0
  42. data/test/dummy/tmp/cache/assets/CF6/890/sprockets%2F36007a87f140155b5a04f2ca6b262dcc +494 -0
  43. data/test/dummy/tmp/cache/assets/CF6/9D0/sprockets%2F34b7199e9d33994c8ec7a442d60ca985 +173 -0
  44. data/test/dummy/tmp/cache/assets/CFA/A90/sprockets%2F901ba405a6d6747f6412ed4d0e0ac620 +256 -0
  45. data/test/dummy/tmp/cache/assets/CFC/E70/sprockets%2F8ee639668b5f0e629fbe0d62d1394689 +173 -0
  46. data/test/dummy/tmp/cache/assets/D04/1B0/sprockets%2F418f2b3b6b08b320f6db268a0991c54c +0 -0
  47. data/test/dummy/tmp/cache/assets/D05/920/sprockets%2F909507434dcc270db4853e4c147f0aac +5 -4
  48. data/test/dummy/tmp/cache/assets/D07/DB0/sprockets%2F0c17d7dac64290e385c91eb6f1570b31 +511 -0
  49. data/test/dummy/tmp/cache/assets/D07/EE0/sprockets%2F4999982b09e0b786894fce44f5d783cc +1371 -0
  50. data/test/dummy/tmp/cache/assets/D09/380/sprockets%2F14383e18fa2faac6b561a29d8e132863 +0 -0
  51. data/test/dummy/tmp/cache/assets/D0D/200/sprockets%2F545a7e34cce1d4272d83d58fd4215d42 +1277 -0
  52. data/test/dummy/tmp/cache/assets/D0E/870/sprockets%2F84996444f4f1f3fdc0248131cfb1a3b6 +794 -0
  53. data/test/dummy/tmp/cache/assets/D15/F60/sprockets%2Fa28394e3f80365b5bc86794dd46daa22 +0 -0
  54. data/test/dummy/tmp/cache/assets/D18/950/sprockets%2Fcf650d67c5d431ffdb38552e562299b2 +474 -0
  55. data/test/dummy/tmp/cache/assets/D18/E10/sprockets%2Fec7c58f640556b401fcd66528352dc9d +474 -0
  56. data/test/dummy/tmp/cache/assets/D20/660/sprockets%2F0d2875475ced01df962f3d758cda7792 +103 -0
  57. data/test/dummy/tmp/cache/assets/D22/AB0/sprockets%2F0b08e7f81651aaf739a93d61ae99779c +283 -0
  58. data/test/dummy/tmp/cache/assets/D2E/B20/sprockets%2Feed5412a17a52b1a335925e2af1f75d3 +0 -0
  59. data/test/dummy/tmp/cache/assets/D36/700/sprockets%2Fd219bf9db2eacc105bb294755093a437 +505 -0
  60. data/test/dummy/tmp/cache/assets/D3B/A10/sprockets%2Fcf38b51682d84a04da7b8a7313de52c6 +207 -0
  61. data/test/dummy/tmp/cache/assets/D3C/0E0/sprockets%2Fe9d7aba138d602c4a6ac701bc9615977 +505 -0
  62. data/test/dummy/tmp/cache/assets/D3E/FF0/sprockets%2F6bd8ccd3e02f397c20f349d5c0960e51 +0 -0
  63. data/test/dummy/tmp/cache/assets/D41/B30/sprockets%2Fba1b93913dd01d83ac9a96df334456f8 +0 -0
  64. data/test/dummy/tmp/cache/assets/D41/DA0/sprockets%2Fe8d00810698a9fcee032022fefd084f7 +0 -0
  65. data/test/dummy/tmp/cache/assets/D44/CF0/sprockets%2Ffa31a45f04884493c909c5a67fcbdf23 +1371 -0
  66. data/test/dummy/tmp/cache/assets/D47/BE0/sprockets%2F0b5ebdf6dec160a264698e7f745061e8 +142 -0
  67. data/test/dummy/tmp/cache/assets/D4C/F30/sprockets%2Ff90155c10f59a3fe44959ac09bf817fe +2556 -0
  68. data/test/dummy/tmp/cache/assets/D4E/7C0/sprockets%2Ff01b58512d01eda23fd5cb23a2b28b60 +1529 -0
  69. data/test/dummy/tmp/cache/assets/D4E/860/sprockets%2F86eed0c77c47d0970345bbabb58d8939 +1277 -0
  70. data/test/dummy/tmp/cache/assets/D4E/C30/sprockets%2F52420c10c73ca310d026565eafdadb4e +1545 -0
  71. data/test/dummy/tmp/cache/assets/D4E/F60/sprockets%2F9893a3c5aeb1a9e77469f4751b4d3c3f +115 -0
  72. data/test/dummy/tmp/cache/assets/D4F/E60/sprockets%2F17ee65de1f78c3dd5c165a9867e810b6 +165 -0
  73. data/test/dummy/tmp/cache/assets/D57/0D0/sprockets%2Fa29e6e8106d9d5ed1e2889126cfbf877 +300 -0
  74. data/test/dummy/tmp/cache/assets/D5C/650/sprockets%2Fe1c381da3cc213a639e956ae3315a2bd +607 -0
  75. data/test/dummy/tmp/cache/assets/D61/860/sprockets%2Fbf032a3b4aad2c2e25704e65c966cf45 +794 -0
  76. data/test/dummy/tmp/cache/assets/D63/B20/sprockets%2F31fc70ce66bb80fb9421be34eb3b0287 +0 -0
  77. data/test/dummy/tmp/cache/assets/D64/D60/sprockets%2Fa544ea03bf0a45948a053ba76ec2a79f +239 -0
  78. data/test/dummy/tmp/cache/assets/D6B/F90/sprockets%2F66636712ecb1fcc777dccf7643a0e1b1 +127 -0
  79. data/test/dummy/tmp/cache/assets/D6E/AD0/sprockets%2Fc91cdc6a72c729d7a64119198b3d2eab +0 -0
  80. data/test/dummy/tmp/cache/assets/D6F/140/sprockets%2F9ddc51f4388dd5243a28dba1ce47572b +53 -0
  81. data/test/dummy/tmp/cache/assets/D72/800/sprockets%2F92baa375d54e16fe0a5c7f079a1ce992 +165 -0
  82. data/test/dummy/tmp/cache/assets/D74/220/sprockets%2F3f888bda53179cb945eab35fbd31a708 +53 -0
  83. data/test/dummy/tmp/cache/assets/D78/5F0/sprockets%2F638ed6af667d4fc5147f72ff34aa2d33 +0 -0
  84. data/test/dummy/tmp/cache/assets/D7D/640/sprockets%2F95a7c5580f957c31e1ab9d0773ed5fde +607 -0
  85. data/test/dummy/tmp/cache/assets/D84/210/sprockets%2Fabd0103ccec2b428ac62c94e4c40b384 +6 -5
  86. data/test/dummy/tmp/cache/assets/D89/020/sprockets%2Fa06df6166e70324e712e54b1cafca0ae +187 -0
  87. data/test/dummy/tmp/cache/assets/D8A/9F0/sprockets%2Fc06547ca33ee3d03be14ce045ae1c9e2 +207 -0
  88. data/test/dummy/tmp/cache/assets/D9E/B80/sprockets%2F9561df1d45c7ff4aa8ac3e2df0c99121 +0 -0
  89. data/test/dummy/tmp/cache/assets/DA3/F30/sprockets%2Fe015d6ccdfcf022e47c83d7906f728ae +457 -0
  90. data/test/dummy/tmp/cache/assets/DAE/190/sprockets%2F433c7b21968be8d1f9bfdbdf7a637c57 +0 -0
  91. data/test/dummy/tmp/cache/assets/DB3/600/sprockets%2F9b70ae73f15ba693886eeef4eb5d6c75 +0 -0
  92. data/test/dummy/tmp/cache/assets/DB4/510/sprockets%2F29cdae8e29c88fd9ddbd4831419560fe +1260 -0
  93. data/test/dummy/tmp/cache/assets/DC1/4A0/sprockets%2F0b63dfcf163f2faeb612724eb4545bcc +1354 -0
  94. data/test/dummy/tmp/cache/assets/DC4/C10/sprockets%2Fcf48f4cbad3db33146eab4c577c1d209 +300 -0
  95. data/test/dummy/tmp/cache/assets/DC4/CA0/sprockets%2Fd0da8a60ea4dc16b9fd3e2a50d88633c +0 -0
  96. data/test/dummy/tmp/cache/assets/DC7/8C0/sprockets%2F1ad68dcc9ef598d3811ba2ac5c0ea182 +1354 -0
  97. data/test/dummy/tmp/cache/assets/DC7/C00/sprockets%2Fba755ff3a81c3192f0e45a4f7c0c7dcb +0 -0
  98. data/test/dummy/tmp/cache/assets/DCA/760/sprockets%2F717c4cea10bf601090ffdfe4e668e4cb +283 -0
  99. data/test/dummy/tmp/cache/assets/DCA/DE0/sprockets%2F51dcced9ec2b3cd4b1cc2949f860c361 +590 -0
  100. data/test/dummy/tmp/cache/assets/DD7/E70/sprockets%2F2595d8c8d1d5f4deb096247fb3bfc7ab +256 -0
  101. data/test/dummy/tmp/cache/assets/DE1/9D0/sprockets%2F8befd77af580ee16ec42ec95b1766ff3 +1545 -0
  102. data/test/dummy/tmp/cache/assets/E00/D80/sprockets%2F9debc27161f7bccf2d84a36b8c36c4bf +522 -0
  103. data/test/dummy/tmp/cache/assets/E00/E60/sprockets%2Fac159b94b0a6d621e4f6cde9b4de87bb +0 -0
  104. data/test/dummy/tmp/cache/assets/E04/890/sprockets%2F2f5173deea6c795b8fdde723bb4b63af +0 -0
  105. data/test/dummy/tmp/cache/assets/E1B/D00/sprockets%2F886dff4afe55f9d3f8abe434f2689add +72 -0
  106. data/test/dummy/tmp/cache/assets/E1B/F20/sprockets%2Fa4bbc04eb83ebf94fd8134c3abd220dd +494 -0
  107. data/test/dummy/tmp/cache/assets/E71/0C0/sprockets%2F5ffdc0daa0a1f9638c787897ceefcdee +1260 -0
  108. metadata +186 -10
  109. data/test/dummy/tmp/pids/server.pid +0 -1
@@ -0,0 +1,103 @@
1
+ o: ActiveSupport::Cache::Entry :@compressedF:@expires_in0:@created_atf1325549268.20489: @value{ I" length:EFi�
2
+ I" digest;
3
+ F"%b7f2f9f2118221772fcf6fca3140bf0aI" source;
4
+ FI"�
5
+ // Copyright 2007 The Closure Library Authors. All Rights Reserved.
6
+ //
7
+ // Licensed under the Apache License, Version 2.0 (the "License");
8
+ // you may not use this file except in compliance with the License.
9
+ // You may obtain a copy of the License at
10
+ //
11
+ // http://www.apache.org/licenses/LICENSE-2.0
12
+ //
13
+ // Unless required by applicable law or agreed to in writing, software
14
+ // distributed under the License is distributed on an "AS-IS" BASIS,
15
+ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16
+ // See the License for the specific language governing permissions and
17
+ // limitations under the License.
18
+
19
+ /**
20
+ * @fileoverview Detection of JScript version.
21
+ *
22
+ * @author arv@google.com (Erik Arvidsson)
23
+ */
24
+
25
+
26
+
27
+ goog.provide('goog.userAgent.jscript');
28
+
29
+ goog.require('goog.string');
30
+
31
+
32
+ /**
33
+ * @define {boolean} True if it is known at compile time that the runtime
34
+ * environment will not be using JScript.
35
+ */
36
+ goog.userAgent.jscript.ASSUME_NO_JSCRIPT = false;
37
+
38
+
39
+ /**
40
+ * Initializer for goog.userAgent.jscript. Detects if the user agent is using
41
+ * Microsoft JScript and which version of it.
42
+ *
43
+ * This is a named function so that it can be stripped via the jscompiler
44
+ * option for stripping types.
45
+ * @private
46
+ */
47
+ goog.userAgent.jscript.init_ = function() {
48
+ var hasScriptEngine = 'ScriptEngine' in goog.global;
49
+
50
+ /**
51
+ * @type {boolean}
52
+ * @private
53
+ */
54
+ goog.userAgent.jscript.DETECTED_HAS_JSCRIPT_ =
55
+ hasScriptEngine && goog.global['ScriptEngine']() == 'JScript';
56
+
57
+ /**
58
+ * @type {string}
59
+ * @private
60
+ */
61
+ goog.userAgent.jscript.DETECTED_VERSION_ =
62
+ goog.userAgent.jscript.DETECTED_HAS_JSCRIPT_ ?
63
+ (goog.global['ScriptEngineMajorVersion']() + '.' +
64
+ goog.global['ScriptEngineMinorVersion']() + '.' +
65
+ goog.global['ScriptEngineBuildVersion']()) :
66
+ '0';
67
+ };
68
+
69
+ if (!goog.userAgent.jscript.ASSUME_NO_JSCRIPT) {
70
+ goog.userAgent.jscript.init_();
71
+ }
72
+
73
+
74
+ /**
75
+ * Whether we detect that the user agent is using Microsoft JScript.
76
+ * @type {boolean}
77
+ */
78
+ goog.userAgent.jscript.HAS_JSCRIPT = goog.userAgent.jscript.ASSUME_NO_JSCRIPT ?
79
+ false : goog.userAgent.jscript.DETECTED_HAS_JSCRIPT_;
80
+
81
+
82
+ /**
83
+ * The installed version of JScript.
84
+ * @type {string}
85
+ */
86
+ goog.userAgent.jscript.VERSION = goog.userAgent.jscript.ASSUME_NO_JSCRIPT ?
87
+ '0' : goog.userAgent.jscript.DETECTED_VERSION_;
88
+
89
+
90
+ /**
91
+ * Whether the installed version of JScript is as new or newer than a given
92
+ * version.
93
+ * @param {string} version The version to check.
94
+ * @return {boolean} Whether the installed version of JScript is as new or
95
+ * newer than the given version.
96
+ */
97
+ goog.userAgent.jscript.isVersion = function(version) {
98
+ return goog.string.compareVersions(goog.userAgent.jscript.VERSION,
99
+ version) >= 0;
100
+ };
101
+ ;
102
+ FI"
103
+ F"%f4151024d8ac039c5f8b0fb51f64c396
@@ -0,0 +1,283 @@
1
+ o: ActiveSupport::Cache::Entry :@compressedF:@expires_in0:@created_atf1325549267.8163252: @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"%8fdaa672a24ca9cfc9d99b6dfeb27be4
@@ -0,0 +1,505 @@
1
+ o: ActiveSupport::Cache::Entry :@compressedF:@expires_in0:@created_atf1325549267.913858: @value{ I" length:EFi�7I" digest;
2
+ F"%de5002c9a817c1c580dec5d601b58b2cI" source;
3
+ FI"�7// Copyright 2006 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 Rendering engine detection.
19
+ * @see <a href="http://www.useragentstring.com/">User agent strings</a>
20
+ * For information on the browser brand (such as Safari versus Chrome), see
21
+ * goog.userAgent.product.
22
+ * @see ../demos/useragent.html
23
+ */
24
+
25
+
26
+ goog.provide('goog.userAgent');
27
+
28
+ goog.require('goog.string');
29
+
30
+
31
+ /**
32
+ * @define {boolean} Whether we know at compile-time that the browser is IE.
33
+ */
34
+ goog.userAgent.ASSUME_IE = false;
35
+
36
+
37
+ /**
38
+ * @define {boolean} Whether we know at compile-time that the browser is GECKO.
39
+ */
40
+ goog.userAgent.ASSUME_GECKO = false;
41
+
42
+
43
+ /**
44
+ * @define {boolean} Whether we know at compile-time that the browser is WEBKIT.
45
+ */
46
+ goog.userAgent.ASSUME_WEBKIT = false;
47
+
48
+
49
+ /**
50
+ * @define {boolean} Whether we know at compile-time that the browser is a
51
+ * mobile device running WebKit e.g. iPhone or Android.
52
+ */
53
+ goog.userAgent.ASSUME_MOBILE_WEBKIT = false;
54
+
55
+
56
+ /**
57
+ * @define {boolean} Whether we know at compile-time that the browser is OPERA.
58
+ */
59
+ goog.userAgent.ASSUME_OPERA = false;
60
+
61
+
62
+ /**
63
+ * @define {boolean} Whether the {@code goog.userAgent.isVersion} function will
64
+ * return true for any version.
65
+ */
66
+ goog.userAgent.ASSUME_ANY_VERSION = false;
67
+
68
+
69
+ /**
70
+ * Whether we know the browser engine at compile-time.
71
+ * @type {boolean}
72
+ * @private
73
+ */
74
+ goog.userAgent.BROWSER_KNOWN_ =
75
+ goog.userAgent.ASSUME_IE ||
76
+ goog.userAgent.ASSUME_GECKO ||
77
+ goog.userAgent.ASSUME_MOBILE_WEBKIT ||
78
+ goog.userAgent.ASSUME_WEBKIT ||
79
+ goog.userAgent.ASSUME_OPERA;
80
+
81
+
82
+ /**
83
+ * Returns the userAgent string for the current browser.
84
+ * Some user agents (I'm thinking of you, Gears WorkerPool) do not expose a
85
+ * navigator object off the global scope. In that case we return null.
86
+ *
87
+ * @return {?string} The userAgent string or null if there is none.
88
+ */
89
+ goog.userAgent.getUserAgentString = function() {
90
+ return goog.global['navigator'] ? goog.global['navigator'].userAgent : null;
91
+ };
92
+
93
+
94
+ /**
95
+ * @return {Object} The native navigator object.
96
+ */
97
+ goog.userAgent.getNavigator = function() {
98
+ // Need a local navigator reference instead of using the global one,
99
+ // to avoid the rare case where they reference different objects.
100
+ // (goog.gears.FakeWorkerPool, for example).
101
+ return goog.global['navigator'];
102
+ };
103
+
104
+
105
+ /**
106
+ * Initializer for goog.userAgent.
107
+ *
108
+ * This is a named function so that it can be stripped via the jscompiler
109
+ * option for stripping types.
110
+ * @private
111
+ */
112
+ goog.userAgent.init_ = function() {
113
+ /**
114
+ * Whether the user agent string denotes Opera.
115
+ * @type {boolean}
116
+ * @private
117
+ */
118
+ goog.userAgent.detectedOpera_ = false;
119
+
120
+ /**
121
+ * Whether the user agent string denotes Internet Explorer. This includes
122
+ * other browsers using Trident as its rendering engine. For example AOL
123
+ * and Netscape 8
124
+ * @type {boolean}
125
+ * @private
126
+ */
127
+ goog.userAgent.detectedIe_ = false;
128
+
129
+ /**
130
+ * Whether the user agent string denotes WebKit. WebKit is the rendering
131
+ * engine that Safari, Android and others use.
132
+ * @type {boolean}
133
+ * @private
134
+ */
135
+ goog.userAgent.detectedWebkit_ = false;
136
+
137
+ /**
138
+ * Whether the user agent string denotes a mobile device.
139
+ * @type {boolean}
140
+ * @private
141
+ */
142
+ goog.userAgent.detectedMobile_ = false;
143
+
144
+ /**
145
+ * Whether the user agent string denotes Gecko. Gecko is the rendering
146
+ * engine used by Mozilla, Mozilla Firefox, Camino and many more.
147
+ * @type {boolean}
148
+ * @private
149
+ */
150
+ goog.userAgent.detectedGecko_ = false;
151
+
152
+ var ua;
153
+ if (!goog.userAgent.BROWSER_KNOWN_ &&
154
+ (ua = goog.userAgent.getUserAgentString())) {
155
+ var navigator = goog.userAgent.getNavigator();
156
+ goog.userAgent.detectedOpera_ = ua.indexOf('Opera') == 0;
157
+ goog.userAgent.detectedIe_ = !goog.userAgent.detectedOpera_ &&
158
+ ua.indexOf('MSIE') != -1;
159
+ goog.userAgent.detectedWebkit_ = !goog.userAgent.detectedOpera_ &&
160
+ ua.indexOf('WebKit') != -1;
161
+ // WebKit also gives navigator.product string equal to 'Gecko'.
162
+ goog.userAgent.detectedMobile_ = goog.userAgent.detectedWebkit_ &&
163
+ ua.indexOf('Mobile') != -1;
164
+ goog.userAgent.detectedGecko_ = !goog.userAgent.detectedOpera_ &&
165
+ !goog.userAgent.detectedWebkit_ && navigator.product == 'Gecko';
166
+ }
167
+ };
168
+
169
+
170
+ if (!goog.userAgent.BROWSER_KNOWN_) {
171
+ goog.userAgent.init_();
172
+ }
173
+
174
+
175
+ /**
176
+ * Whether the user agent is Opera.
177
+ * @type {boolean}
178
+ */
179
+ goog.userAgent.OPERA = goog.userAgent.BROWSER_KNOWN_ ?
180
+ goog.userAgent.ASSUME_OPERA : goog.userAgent.detectedOpera_;
181
+
182
+
183
+ /**
184
+ * Whether the user agent is Internet Explorer. This includes other browsers
185
+ * using Trident as its rendering engine. For example AOL and Netscape 8
186
+ * @type {boolean}
187
+ */
188
+ goog.userAgent.IE = goog.userAgent.BROWSER_KNOWN_ ?
189
+ goog.userAgent.ASSUME_IE : goog.userAgent.detectedIe_;
190
+
191
+
192
+ /**
193
+ * Whether the user agent is Gecko. Gecko is the rendering engine used by
194
+ * Mozilla, Mozilla Firefox, Camino and many more.
195
+ * @type {boolean}
196
+ */
197
+ goog.userAgent.GECKO = goog.userAgent.BROWSER_KNOWN_ ?
198
+ goog.userAgent.ASSUME_GECKO :
199
+ goog.userAgent.detectedGecko_;
200
+
201
+
202
+ /**
203
+ * Whether the user agent is WebKit. WebKit is the rendering engine that
204
+ * Safari, Android and others use.
205
+ * @type {boolean}
206
+ */
207
+ goog.userAgent.WEBKIT = goog.userAgent.BROWSER_KNOWN_ ?
208
+ goog.userAgent.ASSUME_WEBKIT || goog.userAgent.ASSUME_MOBILE_WEBKIT :
209
+ goog.userAgent.detectedWebkit_;
210
+
211
+
212
+ /**
213
+ * Whether the user agent is running on a mobile device.
214
+ * @type {boolean}
215
+ */
216
+ goog.userAgent.MOBILE = goog.userAgent.ASSUME_MOBILE_WEBKIT ||
217
+ goog.userAgent.detectedMobile_;
218
+
219
+
220
+ /**
221
+ * Used while transitioning code to use WEBKIT instead.
222
+ * @type {boolean}
223
+ * @deprecated Use {@link goog.userAgent.product.SAFARI} instead.
224
+ * TODO(nicksantos): Delete this from goog.userAgent.
225
+ */
226
+ goog.userAgent.SAFARI = goog.userAgent.WEBKIT;
227
+
228
+
229
+ /**
230
+ * @return {string} the platform (operating system) the user agent is running
231
+ * on. Default to empty string because navigator.platform may not be defined
232
+ * (on Rhino, for example).
233
+ * @private
234
+ */
235
+ goog.userAgent.determinePlatform_ = function() {
236
+ var navigator = goog.userAgent.getNavigator();
237
+ return navigator && navigator.platform || '';
238
+ };
239
+
240
+
241
+ /**
242
+ * The platform (operating system) the user agent is running on. Default to
243
+ * empty string because navigator.platform may not be defined (on Rhino, for
244
+ * example).
245
+ * @type {string}
246
+ */
247
+ goog.userAgent.PLATFORM = goog.userAgent.determinePlatform_();
248
+
249
+
250
+ /**
251
+ * @define {boolean} Whether the user agent is running on a Macintosh operating
252
+ * system.
253
+ */
254
+ goog.userAgent.ASSUME_MAC = false;
255
+
256
+
257
+ /**
258
+ * @define {boolean} Whether the user agent is running on a Windows operating
259
+ * system.
260
+ */
261
+ goog.userAgent.ASSUME_WINDOWS = false;
262
+
263
+
264
+ /**
265
+ * @define {boolean} Whether the user agent is running on a Linux operating
266
+ * system.
267
+ */
268
+ goog.userAgent.ASSUME_LINUX = false;
269
+
270
+
271
+ /**
272
+ * @define {boolean} Whether the user agent is running on a X11 windowing
273
+ * system.
274
+ */
275
+ goog.userAgent.ASSUME_X11 = false;
276
+
277
+
278
+ /**
279
+ * @type {boolean}
280
+ * @private
281
+ */
282
+ goog.userAgent.PLATFORM_KNOWN_ =
283
+ goog.userAgent.ASSUME_MAC ||
284
+ goog.userAgent.ASSUME_WINDOWS ||
285
+ goog.userAgent.ASSUME_LINUX ||
286
+ goog.userAgent.ASSUME_X11;
287
+
288
+
289
+ /**
290
+ * Initialize the goog.userAgent constants that define which platform the user
291
+ * agent is running on.
292
+ * @private
293
+ */
294
+ goog.userAgent.initPlatform_ = function() {
295
+ /**
296
+ * Whether the user agent is running on a Macintosh operating system.
297
+ * @type {boolean}
298
+ * @private
299
+ */
300
+ goog.userAgent.detectedMac_ = goog.string.contains(goog.userAgent.PLATFORM,
301
+ 'Mac');
302
+
303
+ /**
304
+ * Whether the user agent is running on a Windows operating system.
305
+ * @type {boolean}
306
+ * @private
307
+ */
308
+ goog.userAgent.detectedWindows_ = goog.string.contains(
309
+ goog.userAgent.PLATFORM, 'Win');
310
+
311
+ /**
312
+ * Whether the user agent is running on a Linux operating system.
313
+ * @type {boolean}
314
+ * @private
315
+ */
316
+ goog.userAgent.detectedLinux_ = goog.string.contains(goog.userAgent.PLATFORM,
317
+ 'Linux');
318
+
319
+ /**
320
+ * Whether the user agent is running on a X11 windowing system.
321
+ * @type {boolean}
322
+ * @private
323
+ */
324
+ goog.userAgent.detectedX11_ = !!goog.userAgent.getNavigator() &&
325
+ goog.string.contains(goog.userAgent.getNavigator()['appVersion'] || '',
326
+ 'X11');
327
+ };
328
+
329
+
330
+ if (!goog.userAgent.PLATFORM_KNOWN_) {
331
+ goog.userAgent.initPlatform_();
332
+ }
333
+
334
+
335
+ /**
336
+ * Whether the user agent is running on a Macintosh operating system.
337
+ * @type {boolean}
338
+ */
339
+ goog.userAgent.MAC = goog.userAgent.PLATFORM_KNOWN_ ?
340
+ goog.userAgent.ASSUME_MAC : goog.userAgent.detectedMac_;
341
+
342
+
343
+ /**
344
+ * Whether the user agent is running on a Windows operating system.
345
+ * @type {boolean}
346
+ */
347
+ goog.userAgent.WINDOWS = goog.userAgent.PLATFORM_KNOWN_ ?
348
+ goog.userAgent.ASSUME_WINDOWS : goog.userAgent.detectedWindows_;
349
+
350
+
351
+ /**
352
+ * Whether the user agent is running on a Linux operating system.
353
+ * @type {boolean}
354
+ */
355
+ goog.userAgent.LINUX = goog.userAgent.PLATFORM_KNOWN_ ?
356
+ goog.userAgent.ASSUME_LINUX : goog.userAgent.detectedLinux_;
357
+
358
+
359
+ /**
360
+ * Whether the user agent is running on a X11 windowing system.
361
+ * @type {boolean}
362
+ */
363
+ goog.userAgent.X11 = goog.userAgent.PLATFORM_KNOWN_ ?
364
+ goog.userAgent.ASSUME_X11 : goog.userAgent.detectedX11_;
365
+
366
+
367
+ /**
368
+ * @return {string} The string that describes the version number of the user
369
+ * agent.
370
+ * @private
371
+ */
372
+ goog.userAgent.determineVersion_ = function() {
373
+ // All browsers have different ways to detect the version and they all have
374
+ // different naming schemes.
375
+
376
+ // version is a string rather than a number because it may contain 'b', 'a',
377
+ // and so on.
378
+ var version = '', re;
379
+
380
+ if (goog.userAgent.OPERA && goog.global['opera']) {
381
+ var operaVersion = goog.global['opera'].version;
382
+ version = typeof operaVersion == 'function' ? operaVersion() : operaVersion;
383
+ } else {
384
+ if (goog.userAgent.GECKO) {
385
+ re = /rv\:([^\);]+)(\)|;)/;
386
+ } else if (goog.userAgent.IE) {
387
+ re = /MSIE\s+([^\);]+)(\)|;)/;
388
+ } else if (goog.userAgent.WEBKIT) {
389
+ // WebKit/125.4
390
+ re = /WebKit\/(\S+)/;
391
+ }
392
+ if (re) {
393
+ var arr = re.exec(goog.userAgent.getUserAgentString());
394
+ version = arr ? arr[1] : '';
395
+ }
396
+ }
397
+ if (goog.userAgent.IE) {
398
+ // IE9 can be in document mode 9 but be reporting an inconsistent user agent
399
+ // version. If it is identifying as a version lower than 9 we take the
400
+ // documentMode as the version instead. IE8 has similar behavior.
401
+ // It is recommended to set the X-UA-Compatible header to ensure that IE9
402
+ // uses documentMode 9.
403
+ var docMode = goog.userAgent.getDocumentMode_();
404
+ if (docMode > parseFloat(version)) {
405
+ return String(docMode);
406
+ }
407
+ }
408
+ return version;
409
+ };
410
+
411
+
412
+ /**
413
+ * @return {number|undefined} Returns the document mode (for testing).
414
+ * @private
415
+ */
416
+ goog.userAgent.getDocumentMode_ = function() {
417
+ // NOTE(user): goog.userAgent may be used in context where there is no DOM.
418
+ var doc = goog.global['document'];
419
+ return doc ? doc['documentMode'] : undefined;
420
+ };
421
+
422
+
423
+ /**
424
+ * The version of the user agent. This is a string because it might contain
425
+ * 'b' (as in beta) as well as multiple dots.
426
+ * @type {string}
427
+ */
428
+ goog.userAgent.VERSION = goog.userAgent.determineVersion_();
429
+
430
+
431
+ /**
432
+ * Compares two version numbers.
433
+ *
434
+ * @param {string} v1 Version of first item.
435
+ * @param {string} v2 Version of second item.
436
+ *
437
+ * @return {number} 1 if first argument is higher
438
+ * 0 if arguments are equal
439
+ * -1 if second argument is higher.
440
+ * @deprecated Use goog.string.compareVersions.
441
+ */
442
+ goog.userAgent.compare = function(v1, v2) {
443
+ return goog.string.compareVersions(v1, v2);
444
+ };
445
+
446
+
447
+ /**
448
+ * Cache for {@link goog.userAgent.isVersion}. Calls to compareVersions are
449
+ * surprisingly expensive and as a browsers version number is unlikely to change
450
+ * during a session we cache the results.
451
+ * @type {Object}
452
+ * @private
453
+ */
454
+ goog.userAgent.isVersionCache_ = {};
455
+
456
+
457
+ /**
458
+ * Whether the user agent version is higher or the same as the given version.
459
+ * NOTE: When checking the version numbers for Firefox and Safari, be sure to
460
+ * use the engine's version, not the browser's version number. For example,
461
+ * Firefox 3.0 corresponds to Gecko 1.9 and Safari 3.0 to Webkit 522.11.
462
+ * Opera and Internet Explorer versions match the product release number.<br>
463
+ * @see <a href="http://en.wikipedia.org/wiki/Safari_version_history">
464
+ * Webkit</a>
465
+ * @see <a href="http://en.wikipedia.org/wiki/Gecko_engine">Gecko</a>
466
+ *
467
+ * @param {string|number} version The version to check.
468
+ * @return {boolean} Whether the user agent version is higher or the same as
469
+ * the given version.
470
+ */
471
+ goog.userAgent.isVersion = function(version) {
472
+ return goog.userAgent.ASSUME_ANY_VERSION ||
473
+ goog.userAgent.isVersionCache_[version] ||
474
+ (goog.userAgent.isVersionCache_[version] =
475
+ goog.string.compareVersions(goog.userAgent.VERSION, version) >= 0);
476
+ };
477
+
478
+
479
+ /**
480
+ * Cache for {@link goog.userAgent.isDocumentMode}.
481
+ * Browsers document mode version number is unlikely to change during a session
482
+ * we cache the results.
483
+ * @type {Object}
484
+ * @private
485
+ */
486
+ goog.userAgent.isDocumentModeCache_ = {};
487
+
488
+
489
+ /**
490
+ * Whether the IE effective document mode is higher or the same as the given
491
+ * document mode version.
492
+ * NOTE: Only for IE, return false for another browser.
493
+ *
494
+ * @param {number} documentMode The document mode version to check.
495
+ * @return {boolean} Whether the IE effective document mode is higher or the
496
+ * same as the given version.
497
+ */
498
+ goog.userAgent.isDocumentMode = function(documentMode) {
499
+ return goog.userAgent.isDocumentModeCache_[documentMode] ||
500
+ (goog.userAgent.isDocumentModeCache_[documentMode] = goog.userAgent.IE &&
501
+ document.documentMode && document.documentMode >= documentMode);
502
+ };
503
+ ;
504
+ FI"
505
+ F"%9873840a2ceec64d32f30fec3506394b