activesupport 2.0.5 → 2.1.0
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of activesupport might be problematic. Click here for more details.
- data/CHANGELOG +183 -5
- data/lib/active_support.rb +6 -2
- data/lib/active_support/base64.rb +5 -0
- data/lib/active_support/basic_object.rb +23 -4
- data/lib/active_support/buffered_logger.rb +17 -3
- data/lib/active_support/cache.rb +145 -0
- data/lib/active_support/cache/compressed_mem_cache_store.rb +15 -0
- data/lib/active_support/cache/drb_store.rb +15 -0
- data/lib/active_support/cache/file_store.rb +70 -0
- data/lib/active_support/cache/mem_cache_store.rb +100 -0
- data/lib/active_support/cache/memory_store.rb +38 -0
- data/lib/active_support/callbacks.rb +275 -0
- data/lib/active_support/core_ext/array/access.rb +2 -4
- data/lib/active_support/core_ext/array/conversions.rb +89 -5
- data/lib/active_support/core_ext/array/extract_options.rb +2 -1
- data/lib/active_support/core_ext/array/grouping.rb +3 -8
- data/lib/active_support/core_ext/array/random_access.rb +1 -1
- data/lib/active_support/core_ext/base64.rb +4 -0
- data/lib/active_support/core_ext/base64/encoding.rb +13 -0
- data/lib/active_support/core_ext/benchmark.rb +12 -0
- data/lib/active_support/core_ext/bigdecimal.rb +4 -0
- data/lib/active_support/core_ext/bigdecimal/conversions.rb +39 -4
- data/lib/active_support/core_ext/blank.rb +5 -2
- data/lib/active_support/core_ext/class/attribute_accessors.rb +7 -1
- data/lib/active_support/core_ext/class/delegating_attributes.rb +7 -1
- data/lib/active_support/core_ext/class/inheritable_attributes.rb +1 -1
- data/lib/active_support/core_ext/class/removal.rb +26 -0
- data/lib/active_support/core_ext/date/calculations.rb +28 -1
- data/lib/active_support/core_ext/date/conversions.rb +1 -0
- data/lib/active_support/core_ext/date_time.rb +2 -0
- data/lib/active_support/core_ext/date_time/calculations.rb +37 -2
- data/lib/active_support/core_ext/date_time/conversions.rb +27 -14
- data/lib/active_support/core_ext/enumerable.rb +16 -9
- data/lib/active_support/core_ext/exception.rb +8 -0
- data/lib/active_support/core_ext/file.rb +6 -6
- data/lib/active_support/core_ext/hash/conversions.rb +26 -8
- data/lib/active_support/core_ext/hash/indifferent_access.rb +35 -0
- data/lib/active_support/core_ext/hash/reverse_merge.rb +4 -1
- data/lib/active_support/core_ext/integer/even_odd.rb +10 -5
- data/lib/active_support/core_ext/integer/inflections.rb +0 -1
- data/lib/active_support/core_ext/kernel/daemonizing.rb +2 -10
- data/lib/active_support/core_ext/kernel/reporting.rb +8 -0
- data/lib/active_support/core_ext/module/attr_internal.rb +4 -3
- data/lib/active_support/core_ext/module/attribute_accessors.rb +11 -1
- data/lib/active_support/core_ext/module/delegation.rb +5 -3
- data/lib/active_support/core_ext/module/inclusion.rb +19 -0
- data/lib/active_support/core_ext/module/introspection.rb +50 -16
- data/lib/active_support/core_ext/module/loading.rb +10 -0
- data/lib/active_support/core_ext/numeric.rb +3 -1
- data/lib/active_support/core_ext/numeric/conversions.rb +19 -0
- data/lib/active_support/core_ext/object/instance_variables.rb +52 -0
- data/lib/active_support/core_ext/object/misc.rb +1 -1
- data/lib/active_support/core_ext/process.rb +1 -0
- data/lib/active_support/core_ext/process/daemon.rb +25 -0
- data/lib/active_support/core_ext/range/conversions.rb +5 -1
- data/lib/active_support/core_ext/range/include_range.rb +8 -0
- data/lib/active_support/core_ext/range/overlaps.rb +3 -0
- data/lib/active_support/core_ext/string.rb +5 -10
- data/lib/active_support/core_ext/string/access.rb +72 -48
- data/lib/active_support/core_ext/string/conversions.rb +4 -4
- data/lib/active_support/core_ext/string/filters.rb +26 -0
- data/lib/active_support/core_ext/string/inflections.rb +56 -64
- data/lib/active_support/core_ext/string/iterators.rb +4 -0
- data/lib/active_support/core_ext/string/starts_ends_with.rb +12 -4
- data/lib/active_support/core_ext/string/unicode.rb +14 -7
- data/lib/active_support/core_ext/symbol.rb +1 -1
- data/lib/active_support/core_ext/time.rb +2 -0
- data/lib/active_support/core_ext/time/calculations.rb +75 -23
- data/lib/active_support/core_ext/time/conversions.rb +22 -35
- data/lib/active_support/core_ext/time/zones.rb +86 -0
- data/lib/active_support/dependencies.rb +92 -80
- data/lib/active_support/deprecation.rb +2 -16
- data/lib/active_support/duration.rb +4 -4
- data/lib/active_support/gzip.rb +25 -0
- data/lib/active_support/inflector.rb +92 -69
- data/lib/active_support/json.rb +17 -25
- data/lib/active_support/json/decoding.rb +1 -1
- data/lib/active_support/json/encoders/date.rb +11 -2
- data/lib/active_support/json/encoders/date_time.rb +11 -2
- data/lib/active_support/json/encoders/enumerable.rb +2 -2
- data/lib/active_support/json/encoders/hash.rb +3 -6
- data/lib/active_support/json/encoders/object.rb +1 -1
- data/lib/active_support/json/encoders/string.rb +8 -2
- data/lib/active_support/json/encoders/time.rb +11 -2
- data/lib/active_support/json/encoding.rb +0 -1
- data/lib/active_support/multibyte/chars.rb +8 -6
- data/lib/active_support/multibyte/handlers/utf8_handler.rb +11 -11
- data/lib/active_support/ordered_hash.rb +43 -0
- data/lib/active_support/ordered_options.rb +0 -38
- data/lib/active_support/test_case.rb +10 -2
- data/lib/active_support/testing/default.rb +3 -6
- data/lib/active_support/testing/setup_and_teardown.rb +93 -0
- data/lib/active_support/time_with_zone.rb +283 -0
- data/lib/active_support/values/time_zone.rb +336 -123
- data/lib/active_support/vendor.rb +12 -0
- data/lib/active_support/vendor/memcache-client-1.5.0/memcache.rb +849 -0
- data/lib/active_support/vendor/tzinfo-0.3.8/tzinfo.rb +33 -0
- data/lib/active_support/vendor/tzinfo-0.3.8/tzinfo/data_timezone.rb +47 -0
- data/lib/active_support/vendor/tzinfo-0.3.8/tzinfo/data_timezone_info.rb +226 -0
- data/lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/Africa/Algiers.rb +55 -0
- data/lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/Africa/Cairo.rb +219 -0
- data/lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/Africa/Casablanca.rb +38 -0
- data/lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/Africa/Harare.rb +18 -0
- data/lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/Africa/Johannesburg.rb +25 -0
- data/lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/Africa/Monrovia.rb +22 -0
- data/lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/Africa/Nairobi.rb +23 -0
- data/lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/America/Argentina/Buenos_Aires.rb +166 -0
- data/lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/America/Argentina/San_Juan.rb +170 -0
- data/lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/America/Bogota.rb +23 -0
- data/lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/America/Caracas.rb +23 -0
- data/lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/America/Chicago.rb +283 -0
- data/lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/America/Chihuahua.rb +136 -0
- data/lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/America/Denver.rb +204 -0
- data/lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/America/Godthab.rb +161 -0
- data/lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/America/Guatemala.rb +27 -0
- data/lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/America/Halifax.rb +274 -0
- data/lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/America/Indiana/Indianapolis.rb +149 -0
- data/lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/America/Juneau.rb +194 -0
- data/lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/America/La_Paz.rb +22 -0
- data/lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/America/Lima.rb +35 -0
- data/lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/America/Los_Angeles.rb +232 -0
- data/lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/America/Mazatlan.rb +139 -0
- data/lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/America/Mexico_City.rb +144 -0
- data/lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/America/Monterrey.rb +131 -0
- data/lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/America/New_York.rb +282 -0
- data/lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/America/Phoenix.rb +30 -0
- data/lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/America/Regina.rb +74 -0
- data/lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/America/Santiago.rb +205 -0
- data/lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/America/St_Johns.rb +288 -0
- data/lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/America/Tijuana.rb +196 -0
- data/lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/Asia/Almaty.rb +67 -0
- data/lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/Asia/Baghdad.rb +73 -0
- data/lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/Asia/Baku.rb +161 -0
- data/lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/Asia/Bangkok.rb +20 -0
- data/lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/Asia/Chongqing.rb +33 -0
- data/lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/Asia/Dhaka.rb +27 -0
- data/lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/Asia/Hong_Kong.rb +87 -0
- data/lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/Asia/Irkutsk.rb +165 -0
- data/lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/Asia/Jakarta.rb +30 -0
- data/lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/Asia/Jerusalem.rb +163 -0
- data/lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/Asia/Kabul.rb +20 -0
- data/lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/Asia/Kamchatka.rb +163 -0
- data/lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/Asia/Karachi.rb +28 -0
- data/lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/Asia/Katmandu.rb +20 -0
- data/lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/Asia/Kolkata.rb +25 -0
- data/lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/Asia/Krasnoyarsk.rb +163 -0
- data/lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/Asia/Kuala_Lumpur.rb +31 -0
- data/lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/Asia/Kuwait.rb +18 -0
- data/lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/Asia/Magadan.rb +163 -0
- data/lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/Asia/Muscat.rb +18 -0
- data/lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/Asia/Novosibirsk.rb +164 -0
- data/lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/Asia/Rangoon.rb +24 -0
- data/lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/Asia/Riyadh.rb +18 -0
- data/lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/Asia/Seoul.rb +34 -0
- data/lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/Asia/Shanghai.rb +35 -0
- data/lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/Asia/Singapore.rb +33 -0
- data/lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/Asia/Taipei.rb +59 -0
- data/lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/Asia/Tashkent.rb +47 -0
- data/lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/Asia/Tbilisi.rb +78 -0
- data/lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/Asia/Tehran.rb +121 -0
- data/lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/Asia/Tokyo.rb +30 -0
- data/lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/Asia/Ulaanbaatar.rb +65 -0
- data/lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/Asia/Urumqi.rb +33 -0
- data/lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/Asia/Vladivostok.rb +164 -0
- data/lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/Asia/Yakutsk.rb +163 -0
- data/lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/Asia/Yekaterinburg.rb +165 -0
- data/lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/Asia/Yerevan.rb +165 -0
- data/lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/Atlantic/Azores.rb +270 -0
- data/lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/Atlantic/Cape_Verde.rb +23 -0
- data/lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/Atlantic/South_Georgia.rb +18 -0
- data/lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/Australia/Adelaide.rb +187 -0
- data/lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/Australia/Brisbane.rb +35 -0
- data/lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/Australia/Darwin.rb +29 -0
- data/lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/Australia/Hobart.rb +193 -0
- data/lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/Australia/Melbourne.rb +185 -0
- data/lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/Australia/Perth.rb +37 -0
- data/lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/Australia/Sydney.rb +185 -0
- data/lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/Etc/UTC.rb +16 -0
- data/lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/Europe/Amsterdam.rb +228 -0
- data/lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/Europe/Athens.rb +185 -0
- data/lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/Europe/Belgrade.rb +163 -0
- data/lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/Europe/Berlin.rb +188 -0
- data/lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/Europe/Bratislava.rb +13 -0
- data/lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/Europe/Brussels.rb +232 -0
- data/lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/Europe/Bucharest.rb +181 -0
- data/lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/Europe/Budapest.rb +197 -0
- data/lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/Europe/Copenhagen.rb +179 -0
- data/lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/Europe/Dublin.rb +276 -0
- data/lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/Europe/Helsinki.rb +163 -0
- data/lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/Europe/Istanbul.rb +218 -0
- data/lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/Europe/Kiev.rb +168 -0
- data/lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/Europe/Lisbon.rb +268 -0
- data/lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/Europe/Ljubljana.rb +13 -0
- data/lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/Europe/London.rb +288 -0
- data/lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/Europe/Madrid.rb +211 -0
- data/lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/Europe/Minsk.rb +170 -0
- data/lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/Europe/Moscow.rb +181 -0
- data/lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/Europe/Paris.rb +232 -0
- data/lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/Europe/Prague.rb +187 -0
- data/lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/Europe/Riga.rb +176 -0
- data/lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/Europe/Rome.rb +215 -0
- data/lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/Europe/Sarajevo.rb +13 -0
- data/lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/Europe/Skopje.rb +13 -0
- data/lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/Europe/Sofia.rb +173 -0
- data/lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/Europe/Stockholm.rb +165 -0
- data/lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/Europe/Tallinn.rb +172 -0
- data/lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/Europe/Vienna.rb +183 -0
- data/lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/Europe/Vilnius.rb +170 -0
- data/lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/Europe/Warsaw.rb +212 -0
- data/lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/Europe/Zagreb.rb +13 -0
- data/lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/Pacific/Auckland.rb +202 -0
- data/lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/Pacific/Fiji.rb +23 -0
- data/lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/Pacific/Guam.rb +22 -0
- data/lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/Pacific/Honolulu.rb +28 -0
- data/lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/Pacific/Majuro.rb +20 -0
- data/lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/Pacific/Midway.rb +25 -0
- data/lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/Pacific/Noumea.rb +25 -0
- data/lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/Pacific/Pago_Pago.rb +26 -0
- data/lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/Pacific/Port_Moresby.rb +20 -0
- data/lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/Pacific/Tongatapu.rb +27 -0
- data/lib/active_support/vendor/tzinfo-0.3.8/tzinfo/info_timezone.rb +52 -0
- data/lib/active_support/vendor/tzinfo-0.3.8/tzinfo/linked_timezone.rb +51 -0
- data/lib/active_support/vendor/tzinfo-0.3.8/tzinfo/linked_timezone_info.rb +44 -0
- data/lib/active_support/vendor/tzinfo-0.3.8/tzinfo/offset_rationals.rb +95 -0
- data/lib/active_support/vendor/tzinfo-0.3.8/tzinfo/time_or_datetime.rb +292 -0
- data/lib/active_support/vendor/tzinfo-0.3.8/tzinfo/timezone.rb +508 -0
- data/lib/active_support/vendor/tzinfo-0.3.8/tzinfo/timezone_definition.rb +56 -0
- data/lib/active_support/vendor/tzinfo-0.3.8/tzinfo/timezone_info.rb +40 -0
- data/lib/active_support/vendor/tzinfo-0.3.8/tzinfo/timezone_offset_info.rb +94 -0
- data/lib/active_support/vendor/tzinfo-0.3.8/tzinfo/timezone_period.rb +198 -0
- data/lib/active_support/vendor/tzinfo-0.3.8/tzinfo/timezone_transition_info.rb +138 -0
- data/lib/active_support/version.rb +2 -2
- data/lib/active_support/whiny_nil.rb +30 -10
- metadata +175 -5
- data/lib/active_support/core_ext/rexml.rb +0 -38
- data/lib/active_support/testing.rb +0 -1
@@ -1,32 +1,52 @@
|
|
1
|
-
# Extensions to nil which allow for more helpful error messages for
|
2
|
-
#
|
1
|
+
# Extensions to +nil+ which allow for more helpful error messages for people who
|
2
|
+
# are new to Rails.
|
3
3
|
#
|
4
|
-
#
|
5
|
-
#
|
6
|
-
#
|
7
|
-
#
|
8
|
-
|
4
|
+
# Ruby raises NoMethodError if you invoke a method on an object that does not
|
5
|
+
# respond to it:
|
6
|
+
#
|
7
|
+
# $ ruby -e nil.destroy
|
8
|
+
# -e:1: undefined method `destroy' for nil:NilClass (NoMethodError)
|
9
|
+
#
|
10
|
+
# With these extensions, if the method belongs to the public interface of the
|
11
|
+
# classes in NilClass::WHINERS the error message suggests which could be the
|
12
|
+
# actual intended class:
|
13
|
+
#
|
14
|
+
# $ script/runner nil.destroy
|
15
|
+
# ...
|
16
|
+
# You might have expected an instance of ActiveRecord::Base.
|
17
|
+
# ...
|
18
|
+
#
|
19
|
+
# NilClass#id exists in Ruby 1.8 (though it is deprecated). Since +id+ is a fundamental
|
20
|
+
# method of Active Record models NilClass#id is redefined as well to raise a RuntimeError
|
21
|
+
# and warn the user. She probably wanted a model database identifier and the 4
|
22
|
+
# returned by the original method could result in obscure bugs.
|
23
|
+
#
|
24
|
+
# The flag <tt>config.whiny_nils</tt> determines whether this feature is enabled.
|
25
|
+
# By default it is on in development and test modes, and it is off in production
|
26
|
+
# mode.
|
9
27
|
class NilClass
|
10
28
|
WHINERS = [::Array]
|
11
29
|
WHINERS << ::ActiveRecord::Base if defined? ::ActiveRecord
|
12
30
|
|
13
|
-
|
31
|
+
METHOD_CLASS_MAP = Hash.new
|
14
32
|
|
15
33
|
WHINERS.each do |klass|
|
16
34
|
methods = klass.public_instance_methods - public_instance_methods
|
17
35
|
class_name = klass.name
|
18
|
-
methods.each { |method|
|
36
|
+
methods.each { |method| METHOD_CLASS_MAP[method.to_sym] = class_name }
|
19
37
|
end
|
20
38
|
|
39
|
+
# Raises a RuntimeError when you attempt to call +id+ on +nil+.
|
21
40
|
def id
|
22
41
|
raise RuntimeError, "Called id for nil, which would mistakenly be 4 -- if you really wanted the id of nil, use object_id", caller
|
23
42
|
end
|
24
43
|
|
25
44
|
private
|
26
45
|
def method_missing(method, *args, &block)
|
27
|
-
raise_nil_warning_for
|
46
|
+
raise_nil_warning_for METHOD_CLASS_MAP[method], method, caller
|
28
47
|
end
|
29
48
|
|
49
|
+
# Raises a NoMethodError when you attempt to call a method on +nil+.
|
30
50
|
def raise_nil_warning_for(class_name = nil, selector = nil, with_caller = nil)
|
31
51
|
message = "You have a nil object when you didn't expect it!"
|
32
52
|
message << "\nYou might have expected an instance of #{class_name}." if class_name
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: activesupport
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.0
|
4
|
+
version: 2.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- David Heinemeier Hansson
|
@@ -9,7 +9,7 @@ autorequire:
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date: 2008-
|
12
|
+
date: 2008-05-31 00:00:00 -07:00
|
13
13
|
default_executable:
|
14
14
|
dependencies: []
|
15
15
|
|
@@ -28,6 +28,14 @@ files:
|
|
28
28
|
- lib/active_support/base64.rb
|
29
29
|
- lib/active_support/basic_object.rb
|
30
30
|
- lib/active_support/buffered_logger.rb
|
31
|
+
- lib/active_support/cache
|
32
|
+
- lib/active_support/cache/compressed_mem_cache_store.rb
|
33
|
+
- lib/active_support/cache/drb_store.rb
|
34
|
+
- lib/active_support/cache/file_store.rb
|
35
|
+
- lib/active_support/cache/mem_cache_store.rb
|
36
|
+
- lib/active_support/cache/memory_store.rb
|
37
|
+
- lib/active_support/cache.rb
|
38
|
+
- lib/active_support/callbacks.rb
|
31
39
|
- lib/active_support/clean_logger.rb
|
32
40
|
- lib/active_support/core_ext
|
33
41
|
- lib/active_support/core_ext/array
|
@@ -37,6 +45,10 @@ files:
|
|
37
45
|
- lib/active_support/core_ext/array/grouping.rb
|
38
46
|
- lib/active_support/core_ext/array/random_access.rb
|
39
47
|
- lib/active_support/core_ext/array.rb
|
48
|
+
- lib/active_support/core_ext/base64
|
49
|
+
- lib/active_support/core_ext/base64/encoding.rb
|
50
|
+
- lib/active_support/core_ext/base64.rb
|
51
|
+
- lib/active_support/core_ext/benchmark.rb
|
40
52
|
- lib/active_support/core_ext/bigdecimal
|
41
53
|
- lib/active_support/core_ext/bigdecimal/conversions.rb
|
42
54
|
- lib/active_support/core_ext/bigdecimal.rb
|
@@ -101,6 +113,7 @@ files:
|
|
101
113
|
- lib/active_support/core_ext/name_error.rb
|
102
114
|
- lib/active_support/core_ext/numeric
|
103
115
|
- lib/active_support/core_ext/numeric/bytes.rb
|
116
|
+
- lib/active_support/core_ext/numeric/conversions.rb
|
104
117
|
- lib/active_support/core_ext/numeric/time.rb
|
105
118
|
- lib/active_support/core_ext/numeric.rb
|
106
119
|
- lib/active_support/core_ext/object
|
@@ -113,16 +126,19 @@ files:
|
|
113
126
|
- lib/active_support/core_ext/pathname/clean_within.rb
|
114
127
|
- lib/active_support/core_ext/pathname.rb
|
115
128
|
- lib/active_support/core_ext/proc.rb
|
129
|
+
- lib/active_support/core_ext/process
|
130
|
+
- lib/active_support/core_ext/process/daemon.rb
|
131
|
+
- lib/active_support/core_ext/process.rb
|
116
132
|
- lib/active_support/core_ext/range
|
117
133
|
- lib/active_support/core_ext/range/blockless_step.rb
|
118
134
|
- lib/active_support/core_ext/range/conversions.rb
|
119
135
|
- lib/active_support/core_ext/range/include_range.rb
|
120
136
|
- lib/active_support/core_ext/range/overlaps.rb
|
121
137
|
- lib/active_support/core_ext/range.rb
|
122
|
-
- lib/active_support/core_ext/rexml.rb
|
123
138
|
- lib/active_support/core_ext/string
|
124
139
|
- lib/active_support/core_ext/string/access.rb
|
125
140
|
- lib/active_support/core_ext/string/conversions.rb
|
141
|
+
- lib/active_support/core_ext/string/filters.rb
|
126
142
|
- lib/active_support/core_ext/string/inflections.rb
|
127
143
|
- lib/active_support/core_ext/string/iterators.rb
|
128
144
|
- lib/active_support/core_ext/string/starts_ends_with.rb
|
@@ -138,11 +154,13 @@ files:
|
|
138
154
|
- lib/active_support/core_ext/time/behavior.rb
|
139
155
|
- lib/active_support/core_ext/time/calculations.rb
|
140
156
|
- lib/active_support/core_ext/time/conversions.rb
|
157
|
+
- lib/active_support/core_ext/time/zones.rb
|
141
158
|
- lib/active_support/core_ext/time.rb
|
142
159
|
- lib/active_support/core_ext.rb
|
143
160
|
- lib/active_support/dependencies.rb
|
144
161
|
- lib/active_support/deprecation.rb
|
145
162
|
- lib/active_support/duration.rb
|
163
|
+
- lib/active_support/gzip.rb
|
146
164
|
- lib/active_support/inflections.rb
|
147
165
|
- lib/active_support/inflector.rb
|
148
166
|
- lib/active_support/json
|
@@ -174,11 +192,13 @@ files:
|
|
174
192
|
- lib/active_support/multibyte/handlers/utf8_handler_proc.rb
|
175
193
|
- lib/active_support/multibyte.rb
|
176
194
|
- lib/active_support/option_merger.rb
|
195
|
+
- lib/active_support/ordered_hash.rb
|
177
196
|
- lib/active_support/ordered_options.rb
|
178
197
|
- lib/active_support/test_case.rb
|
179
198
|
- lib/active_support/testing
|
180
199
|
- lib/active_support/testing/default.rb
|
181
|
-
- lib/active_support/testing.rb
|
200
|
+
- lib/active_support/testing/setup_and_teardown.rb
|
201
|
+
- lib/active_support/time_with_zone.rb
|
182
202
|
- lib/active_support/values
|
183
203
|
- lib/active_support/values/time_zone.rb
|
184
204
|
- lib/active_support/values/unicode_tables.dat
|
@@ -193,6 +213,156 @@ files:
|
|
193
213
|
- lib/active_support/vendor/builder-2.1.2/builder/xmlevents.rb
|
194
214
|
- lib/active_support/vendor/builder-2.1.2/builder/xmlmarkup.rb
|
195
215
|
- lib/active_support/vendor/builder-2.1.2/builder.rb
|
216
|
+
- lib/active_support/vendor/memcache-client-1.5.0
|
217
|
+
- lib/active_support/vendor/memcache-client-1.5.0/memcache.rb
|
218
|
+
- lib/active_support/vendor/tzinfo-0.3.8
|
219
|
+
- lib/active_support/vendor/tzinfo-0.3.8/tzinfo
|
220
|
+
- lib/active_support/vendor/tzinfo-0.3.8/tzinfo/data_timezone.rb
|
221
|
+
- lib/active_support/vendor/tzinfo-0.3.8/tzinfo/data_timezone_info.rb
|
222
|
+
- lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions
|
223
|
+
- lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/Africa
|
224
|
+
- lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/Africa/Algiers.rb
|
225
|
+
- lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/Africa/Cairo.rb
|
226
|
+
- lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/Africa/Casablanca.rb
|
227
|
+
- lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/Africa/Harare.rb
|
228
|
+
- lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/Africa/Johannesburg.rb
|
229
|
+
- lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/Africa/Monrovia.rb
|
230
|
+
- lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/Africa/Nairobi.rb
|
231
|
+
- lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/America
|
232
|
+
- lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/America/Argentina
|
233
|
+
- lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/America/Argentina/Buenos_Aires.rb
|
234
|
+
- lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/America/Argentina/San_Juan.rb
|
235
|
+
- lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/America/Bogota.rb
|
236
|
+
- lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/America/Caracas.rb
|
237
|
+
- lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/America/Chicago.rb
|
238
|
+
- lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/America/Chihuahua.rb
|
239
|
+
- lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/America/Denver.rb
|
240
|
+
- lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/America/Godthab.rb
|
241
|
+
- lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/America/Guatemala.rb
|
242
|
+
- lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/America/Halifax.rb
|
243
|
+
- lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/America/Indiana
|
244
|
+
- lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/America/Indiana/Indianapolis.rb
|
245
|
+
- lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/America/Juneau.rb
|
246
|
+
- lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/America/La_Paz.rb
|
247
|
+
- lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/America/Lima.rb
|
248
|
+
- lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/America/Los_Angeles.rb
|
249
|
+
- lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/America/Mazatlan.rb
|
250
|
+
- lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/America/Mexico_City.rb
|
251
|
+
- lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/America/Monterrey.rb
|
252
|
+
- lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/America/New_York.rb
|
253
|
+
- lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/America/Phoenix.rb
|
254
|
+
- lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/America/Regina.rb
|
255
|
+
- lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/America/Santiago.rb
|
256
|
+
- lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/America/St_Johns.rb
|
257
|
+
- lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/America/Tijuana.rb
|
258
|
+
- lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/Asia
|
259
|
+
- lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/Asia/Almaty.rb
|
260
|
+
- lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/Asia/Baghdad.rb
|
261
|
+
- lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/Asia/Baku.rb
|
262
|
+
- lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/Asia/Bangkok.rb
|
263
|
+
- lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/Asia/Chongqing.rb
|
264
|
+
- lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/Asia/Dhaka.rb
|
265
|
+
- lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/Asia/Hong_Kong.rb
|
266
|
+
- lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/Asia/Irkutsk.rb
|
267
|
+
- lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/Asia/Jakarta.rb
|
268
|
+
- lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/Asia/Jerusalem.rb
|
269
|
+
- lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/Asia/Kabul.rb
|
270
|
+
- lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/Asia/Kamchatka.rb
|
271
|
+
- lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/Asia/Karachi.rb
|
272
|
+
- lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/Asia/Katmandu.rb
|
273
|
+
- lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/Asia/Kolkata.rb
|
274
|
+
- lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/Asia/Krasnoyarsk.rb
|
275
|
+
- lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/Asia/Kuala_Lumpur.rb
|
276
|
+
- lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/Asia/Kuwait.rb
|
277
|
+
- lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/Asia/Magadan.rb
|
278
|
+
- lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/Asia/Muscat.rb
|
279
|
+
- lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/Asia/Novosibirsk.rb
|
280
|
+
- lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/Asia/Rangoon.rb
|
281
|
+
- lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/Asia/Riyadh.rb
|
282
|
+
- lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/Asia/Seoul.rb
|
283
|
+
- lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/Asia/Shanghai.rb
|
284
|
+
- lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/Asia/Singapore.rb
|
285
|
+
- lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/Asia/Taipei.rb
|
286
|
+
- lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/Asia/Tashkent.rb
|
287
|
+
- lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/Asia/Tbilisi.rb
|
288
|
+
- lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/Asia/Tehran.rb
|
289
|
+
- lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/Asia/Tokyo.rb
|
290
|
+
- lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/Asia/Ulaanbaatar.rb
|
291
|
+
- lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/Asia/Urumqi.rb
|
292
|
+
- lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/Asia/Vladivostok.rb
|
293
|
+
- lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/Asia/Yakutsk.rb
|
294
|
+
- lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/Asia/Yekaterinburg.rb
|
295
|
+
- lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/Asia/Yerevan.rb
|
296
|
+
- lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/Atlantic
|
297
|
+
- lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/Atlantic/Azores.rb
|
298
|
+
- lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/Atlantic/Cape_Verde.rb
|
299
|
+
- lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/Atlantic/South_Georgia.rb
|
300
|
+
- lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/Australia
|
301
|
+
- lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/Australia/Adelaide.rb
|
302
|
+
- lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/Australia/Brisbane.rb
|
303
|
+
- lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/Australia/Darwin.rb
|
304
|
+
- lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/Australia/Hobart.rb
|
305
|
+
- lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/Australia/Melbourne.rb
|
306
|
+
- lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/Australia/Perth.rb
|
307
|
+
- lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/Australia/Sydney.rb
|
308
|
+
- lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/Etc
|
309
|
+
- lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/Etc/UTC.rb
|
310
|
+
- lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/Europe
|
311
|
+
- lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/Europe/Amsterdam.rb
|
312
|
+
- lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/Europe/Athens.rb
|
313
|
+
- lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/Europe/Belgrade.rb
|
314
|
+
- lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/Europe/Berlin.rb
|
315
|
+
- lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/Europe/Bratislava.rb
|
316
|
+
- lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/Europe/Brussels.rb
|
317
|
+
- lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/Europe/Bucharest.rb
|
318
|
+
- lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/Europe/Budapest.rb
|
319
|
+
- lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/Europe/Copenhagen.rb
|
320
|
+
- lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/Europe/Dublin.rb
|
321
|
+
- lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/Europe/Helsinki.rb
|
322
|
+
- lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/Europe/Istanbul.rb
|
323
|
+
- lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/Europe/Kiev.rb
|
324
|
+
- lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/Europe/Lisbon.rb
|
325
|
+
- lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/Europe/Ljubljana.rb
|
326
|
+
- lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/Europe/London.rb
|
327
|
+
- lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/Europe/Madrid.rb
|
328
|
+
- lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/Europe/Minsk.rb
|
329
|
+
- lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/Europe/Moscow.rb
|
330
|
+
- lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/Europe/Paris.rb
|
331
|
+
- lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/Europe/Prague.rb
|
332
|
+
- lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/Europe/Riga.rb
|
333
|
+
- lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/Europe/Rome.rb
|
334
|
+
- lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/Europe/Sarajevo.rb
|
335
|
+
- lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/Europe/Skopje.rb
|
336
|
+
- lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/Europe/Sofia.rb
|
337
|
+
- lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/Europe/Stockholm.rb
|
338
|
+
- lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/Europe/Tallinn.rb
|
339
|
+
- lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/Europe/Vienna.rb
|
340
|
+
- lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/Europe/Vilnius.rb
|
341
|
+
- lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/Europe/Warsaw.rb
|
342
|
+
- lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/Europe/Zagreb.rb
|
343
|
+
- lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/Pacific
|
344
|
+
- lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/Pacific/Auckland.rb
|
345
|
+
- lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/Pacific/Fiji.rb
|
346
|
+
- lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/Pacific/Guam.rb
|
347
|
+
- lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/Pacific/Honolulu.rb
|
348
|
+
- lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/Pacific/Majuro.rb
|
349
|
+
- lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/Pacific/Midway.rb
|
350
|
+
- lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/Pacific/Noumea.rb
|
351
|
+
- lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/Pacific/Pago_Pago.rb
|
352
|
+
- lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/Pacific/Port_Moresby.rb
|
353
|
+
- lib/active_support/vendor/tzinfo-0.3.8/tzinfo/definitions/Pacific/Tongatapu.rb
|
354
|
+
- lib/active_support/vendor/tzinfo-0.3.8/tzinfo/info_timezone.rb
|
355
|
+
- lib/active_support/vendor/tzinfo-0.3.8/tzinfo/linked_timezone.rb
|
356
|
+
- lib/active_support/vendor/tzinfo-0.3.8/tzinfo/linked_timezone_info.rb
|
357
|
+
- lib/active_support/vendor/tzinfo-0.3.8/tzinfo/offset_rationals.rb
|
358
|
+
- lib/active_support/vendor/tzinfo-0.3.8/tzinfo/time_or_datetime.rb
|
359
|
+
- lib/active_support/vendor/tzinfo-0.3.8/tzinfo/timezone.rb
|
360
|
+
- lib/active_support/vendor/tzinfo-0.3.8/tzinfo/timezone_definition.rb
|
361
|
+
- lib/active_support/vendor/tzinfo-0.3.8/tzinfo/timezone_info.rb
|
362
|
+
- lib/active_support/vendor/tzinfo-0.3.8/tzinfo/timezone_offset_info.rb
|
363
|
+
- lib/active_support/vendor/tzinfo-0.3.8/tzinfo/timezone_period.rb
|
364
|
+
- lib/active_support/vendor/tzinfo-0.3.8/tzinfo/timezone_transition_info.rb
|
365
|
+
- lib/active_support/vendor/tzinfo-0.3.8/tzinfo.rb
|
196
366
|
- lib/active_support/vendor/xml-simple-1.0.11
|
197
367
|
- lib/active_support/vendor/xml-simple-1.0.11/xmlsimple.rb
|
198
368
|
- lib/active_support/vendor.rb
|
@@ -222,7 +392,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
222
392
|
requirements: []
|
223
393
|
|
224
394
|
rubyforge_project: activesupport
|
225
|
-
rubygems_version: 1.
|
395
|
+
rubygems_version: 1.0.1
|
226
396
|
signing_key:
|
227
397
|
specification_version: 2
|
228
398
|
summary: Support and utility classes used by the Rails framework.
|
@@ -1,38 +0,0 @@
|
|
1
|
-
require 'rexml/document'
|
2
|
-
require 'rexml/entity'
|
3
|
-
|
4
|
-
# Fixes the rexml vulnerability disclosed at:
|
5
|
-
# http://www.ruby-lang.org/en/news/2008/08/23/dos-vulnerability-in-rexml/
|
6
|
-
# This fix is identical to rexml-expansion-fix version 1.0.1
|
7
|
-
|
8
|
-
# Earlier versions of rexml defined REXML::Version, newer ones REXML::VERSION
|
9
|
-
unless (defined?(REXML::VERSION) ? REXML::VERSION : REXML::Version) > "3.1.7.2"
|
10
|
-
module REXML
|
11
|
-
class Entity < Child
|
12
|
-
undef_method :unnormalized
|
13
|
-
def unnormalized
|
14
|
-
document.record_entity_expansion! if document
|
15
|
-
v = value()
|
16
|
-
return nil if v.nil?
|
17
|
-
@unnormalized = Text::unnormalize(v, parent)
|
18
|
-
@unnormalized
|
19
|
-
end
|
20
|
-
end
|
21
|
-
|
22
|
-
class Document < Element
|
23
|
-
|
24
|
-
@@entity_expansion_limit = 10_000
|
25
|
-
def self.entity_expansion_limit= val
|
26
|
-
@@entity_expansion_limit = val
|
27
|
-
end
|
28
|
-
|
29
|
-
def record_entity_expansion!
|
30
|
-
@number_of_expansions ||= 0
|
31
|
-
@number_of_expansions += 1
|
32
|
-
if @number_of_expansions > @@entity_expansion_limit
|
33
|
-
raise "Number of entity expansions exceeded, processing aborted."
|
34
|
-
end
|
35
|
-
end
|
36
|
-
end
|
37
|
-
end
|
38
|
-
end
|
@@ -1 +0,0 @@
|
|
1
|
-
require 'active_support/testing/default'
|