activesupport 3.0.0.beta4 → 3.0.pre
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 +1 -100
- data/lib/active_support.rb +4 -38
- data/lib/active_support/autoload.rb +28 -0
- data/lib/active_support/backtrace_cleaner.rb +9 -31
- data/lib/active_support/benchmarkable.rb +0 -1
- data/lib/active_support/buffered_logger.rb +1 -0
- data/lib/active_support/cache.rb +81 -436
- data/lib/active_support/cache/compressed_mem_cache_store.rb +13 -6
- data/lib/active_support/cache/file_store.rb +41 -139
- data/lib/active_support/cache/mem_cache_store.rb +75 -120
- data/lib/active_support/cache/memory_store.rb +27 -127
- data/lib/active_support/cache/strategy/local_cache.rb +58 -111
- data/lib/active_support/cache/synchronized_memory_store.rb +38 -2
- data/lib/active_support/callbacks.rb +48 -87
- data/lib/active_support/configurable.rb +18 -19
- data/lib/active_support/core_ext/array.rb +0 -1
- data/lib/active_support/core_ext/array/access.rb +1 -1
- data/lib/active_support/core_ext/array/conversions.rb +54 -29
- data/lib/active_support/core_ext/array/extract_options.rb +1 -16
- data/lib/active_support/core_ext/array/random_access.rb +5 -19
- data/lib/active_support/core_ext/array/wrap.rb +9 -13
- data/lib/active_support/core_ext/benchmark.rb +12 -0
- data/lib/active_support/core_ext/boolean.rb +1 -0
- data/lib/active_support/core_ext/boolean/conversions.rb +11 -0
- data/lib/active_support/core_ext/cgi/escape_skipping_slashes.rb +0 -2
- data/lib/active_support/core_ext/class.rb +1 -1
- data/lib/active_support/core_ext/class/attribute_accessors.rb +27 -33
- data/lib/active_support/core_ext/class/delegating_attributes.rb +41 -35
- data/lib/active_support/core_ext/class/inheritable_attributes.rb +13 -22
- data/lib/active_support/core_ext/class/removal.rb +53 -0
- data/lib/active_support/core_ext/date.rb +7 -0
- data/lib/active_support/core_ext/date/calculations.rb +8 -30
- data/lib/active_support/core_ext/date/conversions.rb +2 -2
- data/lib/active_support/core_ext/date_time.rb +5 -0
- data/lib/active_support/core_ext/date_time/calculations.rb +1 -2
- data/lib/active_support/core_ext/date_time/conversions.rb +5 -23
- data/lib/active_support/core_ext/enumerable.rb +9 -5
- data/lib/active_support/core_ext/exception.rb +47 -0
- data/lib/active_support/core_ext/file.rb +0 -1
- data/lib/active_support/core_ext/file/atomic.rb +2 -3
- data/lib/active_support/core_ext/float/rounding.rb +2 -3
- data/lib/active_support/core_ext/hash/conversions.rb +145 -65
- data/lib/active_support/core_ext/hash/deep_merge.rb +7 -6
- data/lib/active_support/core_ext/hash/except.rb +0 -8
- data/lib/active_support/core_ext/hash/indifferent_access.rb +0 -5
- data/lib/active_support/core_ext/hash/keys.rb +11 -10
- data/lib/active_support/core_ext/hash/slice.rb +0 -6
- data/lib/active_support/core_ext/integer.rb +1 -1
- data/lib/active_support/core_ext/integer/even_odd.rb +16 -0
- data/lib/active_support/core_ext/kernel.rb +1 -1
- data/lib/active_support/core_ext/kernel/daemonizing.rb +7 -0
- data/lib/active_support/core_ext/kernel/debugger.rb +2 -3
- data/lib/active_support/core_ext/kernel/reporting.rb +1 -2
- data/lib/active_support/core_ext/load_error.rb +30 -17
- data/lib/active_support/core_ext/logger.rb +1 -1
- data/lib/active_support/core_ext/module.rb +3 -5
- data/lib/active_support/core_ext/module/aliasing.rb +1 -1
- data/lib/active_support/core_ext/module/attr_accessor_with_default.rb +1 -1
- data/lib/active_support/core_ext/module/attr_internal.rb +2 -2
- data/lib/active_support/core_ext/module/attribute_accessors.rb +21 -25
- data/lib/active_support/core_ext/module/delegation.rb +10 -21
- data/lib/active_support/core_ext/module/inclusion.rb +30 -0
- data/lib/active_support/core_ext/module/introspection.rb +8 -8
- data/lib/active_support/core_ext/module/loading.rb +23 -0
- data/lib/active_support/core_ext/module/synchronization.rb +1 -2
- data/lib/active_support/core_ext/name_error.rb +1 -3
- data/lib/active_support/core_ext/nil.rb +1 -0
- data/lib/active_support/core_ext/nil/conversions.rb +5 -0
- data/lib/active_support/core_ext/object.rb +2 -6
- data/lib/active_support/core_ext/object/blank.rb +2 -20
- data/lib/active_support/core_ext/object/conversions.rb +16 -2
- data/lib/active_support/core_ext/object/duplicable.rb +1 -23
- data/lib/active_support/core_ext/object/extending.rb +77 -8
- data/lib/active_support/core_ext/object/instance_variables.rb +7 -0
- data/lib/active_support/core_ext/object/metaclass.rb +13 -0
- data/lib/active_support/core_ext/object/misc.rb +1 -0
- data/lib/active_support/core_ext/object/tap.rb +16 -0
- data/lib/active_support/core_ext/object/with_options.rb +0 -2
- data/lib/active_support/core_ext/proc.rb +4 -4
- data/lib/active_support/core_ext/regexp.rb +22 -0
- data/lib/active_support/core_ext/rexml.rb +1 -4
- data/lib/active_support/core_ext/string.rb +2 -3
- data/lib/active_support/core_ext/string/access.rb +2 -4
- data/lib/active_support/core_ext/string/bytesize.rb +5 -0
- data/lib/active_support/core_ext/string/conversions.rb +1 -36
- data/lib/active_support/core_ext/string/filters.rb +0 -29
- data/lib/active_support/core_ext/string/inflections.rb +12 -1
- data/lib/active_support/core_ext/string/interpolation.rb +92 -2
- data/lib/active_support/core_ext/string/iterators.rb +13 -0
- data/lib/active_support/core_ext/string/multibyte.rb +19 -16
- data/lib/active_support/core_ext/string/output_safety.rb +35 -101
- data/lib/active_support/core_ext/string/starts_ends_with.rb +14 -0
- data/lib/active_support/core_ext/string/xchar.rb +1 -1
- data/lib/active_support/core_ext/symbol.rb +1 -0
- data/lib/active_support/core_ext/symbol/to_proc.rb +14 -0
- data/lib/active_support/core_ext/time.rb +10 -0
- data/lib/active_support/core_ext/time/calculations.rb +7 -9
- data/lib/active_support/core_ext/time/conversions.rb +0 -1
- data/lib/active_support/core_ext/time/marshal_with_utc_flag.rb +22 -0
- data/lib/active_support/core_ext/uri.rb +4 -10
- data/lib/active_support/dependencies.rb +192 -179
- data/lib/active_support/deprecated_callbacks.rb +283 -0
- data/lib/active_support/deprecation/behaviors.rb +1 -1
- data/lib/active_support/deprecation/method_wrappers.rb +9 -10
- data/lib/active_support/deprecation/reporting.rb +1 -2
- data/lib/active_support/duration.rb +2 -6
- data/lib/active_support/hash_with_indifferent_access.rb +1 -9
- data/lib/active_support/inflections.rb +1 -1
- data/lib/active_support/inflector.rb +407 -4
- data/lib/active_support/json/backends/jsongem.rb +9 -12
- data/lib/active_support/json/decoding.rb +1 -16
- data/lib/active_support/json/encoding.rb +12 -42
- data/lib/active_support/locale/en.yml +1 -4
- data/lib/active_support/memoizable.rb +1 -1
- data/lib/active_support/message_encryptor.rb +0 -1
- data/lib/active_support/message_verifier.rb +5 -6
- data/lib/active_support/multibyte.rb +22 -7
- data/lib/active_support/multibyte/chars.rb +392 -164
- data/lib/active_support/multibyte/unicode_database.rb +71 -0
- data/lib/active_support/multibyte/utils.rb +7 -6
- data/lib/active_support/notifications.rb +113 -23
- data/lib/active_support/ordered_hash.rb +11 -35
- data/lib/active_support/ordered_options.rb +0 -6
- data/lib/active_support/rescuable.rb +4 -7
- data/lib/active_support/ruby/shim.rb +6 -4
- data/lib/active_support/test_case.rb +7 -2
- data/lib/active_support/testing/assertions.rb +0 -15
- data/lib/active_support/testing/declarative.rb +1 -1
- data/lib/active_support/testing/isolation.rb +19 -63
- data/lib/active_support/testing/performance.rb +337 -342
- data/lib/active_support/testing/setup_and_teardown.rb +29 -51
- data/lib/active_support/time.rb +3 -23
- data/lib/active_support/time_with_zone.rb +10 -5
- data/lib/active_support/values/time_zone.rb +84 -40
- data/lib/active_support/values/unicode_tables.dat +0 -0
- data/lib/active_support/vendor.rb +16 -0
- data/lib/active_support/vendor/builder-2.1.2/lib/blankslate.rb +113 -0
- data/lib/active_support/vendor/builder-2.1.2/lib/builder.rb +13 -0
- data/lib/active_support/vendor/builder-2.1.2/lib/builder/blankslate.rb +20 -0
- data/lib/active_support/vendor/builder-2.1.2/lib/builder/css.rb +250 -0
- data/lib/active_support/vendor/builder-2.1.2/lib/builder/xchar.rb +115 -0
- data/lib/active_support/vendor/builder-2.1.2/lib/builder/xmlbase.rb +139 -0
- data/lib/active_support/vendor/builder-2.1.2/lib/builder/xmlevents.rb +63 -0
- data/lib/active_support/vendor/builder-2.1.2/lib/builder/xmlmarkup.rb +328 -0
- data/lib/active_support/vendor/i18n-0.1.3/MIT-LICENSE +20 -0
- data/lib/active_support/vendor/i18n-0.1.3/README.textile +20 -0
- data/lib/active_support/vendor/i18n-0.1.3/Rakefile +5 -0
- data/lib/active_support/vendor/i18n-0.1.3/i18n.gemspec +27 -0
- data/lib/active_support/vendor/i18n-0.1.3/lib/i18n.rb +204 -0
- data/lib/active_support/vendor/i18n-0.1.3/lib/i18n/backend/simple.rb +215 -0
- data/lib/active_support/vendor/i18n-0.1.3/lib/i18n/exceptions.rb +53 -0
- data/lib/active_support/vendor/i18n-0.1.3/test/all.rb +5 -0
- data/lib/active_support/vendor/i18n-0.1.3/test/i18n_exceptions_test.rb +99 -0
- data/lib/active_support/vendor/i18n-0.1.3/test/i18n_test.rb +124 -0
- data/lib/active_support/vendor/i18n-0.1.3/test/locale/en.rb +1 -0
- data/lib/active_support/vendor/i18n-0.1.3/test/locale/en.yml +3 -0
- data/lib/active_support/vendor/i18n-0.1.3/test/simple_backend_test.rb +567 -0
- data/lib/active_support/vendor/memcache-client-1.7.5/lib/memcache.rb +1133 -0
- data/lib/active_support/vendor/tzinfo-0.3.13/lib/tzinfo.rb +33 -0
- data/lib/active_support/vendor/tzinfo-0.3.13/lib/tzinfo/data_timezone.rb +47 -0
- data/lib/active_support/vendor/tzinfo-0.3.13/lib/tzinfo/data_timezone_info.rb +228 -0
- data/lib/active_support/vendor/tzinfo-0.3.13/lib/tzinfo/definitions/Africa/Algiers.rb +55 -0
- data/lib/active_support/vendor/tzinfo-0.3.13/lib/tzinfo/definitions/Africa/Cairo.rb +219 -0
- data/lib/active_support/vendor/tzinfo-0.3.13/lib/tzinfo/definitions/Africa/Casablanca.rb +42 -0
- data/lib/active_support/vendor/tzinfo-0.3.13/lib/tzinfo/definitions/Africa/Harare.rb +18 -0
- data/lib/active_support/vendor/tzinfo-0.3.13/lib/tzinfo/definitions/Africa/Johannesburg.rb +25 -0
- data/lib/active_support/vendor/tzinfo-0.3.13/lib/tzinfo/definitions/Africa/Monrovia.rb +22 -0
- data/lib/active_support/vendor/tzinfo-0.3.13/lib/tzinfo/definitions/Africa/Nairobi.rb +23 -0
- data/lib/active_support/vendor/tzinfo-0.3.13/lib/tzinfo/definitions/America/Argentina/Buenos_Aires.rb +166 -0
- data/lib/active_support/vendor/tzinfo-0.3.13/lib/tzinfo/definitions/America/Argentina/San_Juan.rb +86 -0
- data/lib/active_support/vendor/tzinfo-0.3.13/lib/tzinfo/definitions/America/Bogota.rb +23 -0
- data/lib/active_support/vendor/tzinfo-0.3.13/lib/tzinfo/definitions/America/Caracas.rb +23 -0
- data/lib/active_support/vendor/tzinfo-0.3.13/lib/tzinfo/definitions/America/Chicago.rb +283 -0
- data/lib/active_support/vendor/tzinfo-0.3.13/lib/tzinfo/definitions/America/Chihuahua.rb +136 -0
- data/lib/active_support/vendor/tzinfo-0.3.13/lib/tzinfo/definitions/America/Denver.rb +204 -0
- data/lib/active_support/vendor/tzinfo-0.3.13/lib/tzinfo/definitions/America/Godthab.rb +161 -0
- data/lib/active_support/vendor/tzinfo-0.3.13/lib/tzinfo/definitions/America/Guatemala.rb +27 -0
- data/lib/active_support/vendor/tzinfo-0.3.13/lib/tzinfo/definitions/America/Halifax.rb +274 -0
- data/lib/active_support/vendor/tzinfo-0.3.13/lib/tzinfo/definitions/America/Indiana/Indianapolis.rb +149 -0
- data/lib/active_support/vendor/tzinfo-0.3.13/lib/tzinfo/definitions/America/Juneau.rb +194 -0
- data/lib/active_support/vendor/tzinfo-0.3.13/lib/tzinfo/definitions/America/La_Paz.rb +22 -0
- data/lib/active_support/vendor/tzinfo-0.3.13/lib/tzinfo/definitions/America/Lima.rb +35 -0
- data/lib/active_support/vendor/tzinfo-0.3.13/lib/tzinfo/definitions/America/Los_Angeles.rb +232 -0
- data/lib/active_support/vendor/tzinfo-0.3.13/lib/tzinfo/definitions/America/Mazatlan.rb +139 -0
- data/lib/active_support/vendor/tzinfo-0.3.13/lib/tzinfo/definitions/America/Mexico_City.rb +144 -0
- data/lib/active_support/vendor/tzinfo-0.3.13/lib/tzinfo/definitions/America/Monterrey.rb +131 -0
- data/lib/active_support/vendor/tzinfo-0.3.13/lib/tzinfo/definitions/America/New_York.rb +282 -0
- data/lib/active_support/vendor/tzinfo-0.3.13/lib/tzinfo/definitions/America/Phoenix.rb +30 -0
- data/lib/active_support/vendor/tzinfo-0.3.13/lib/tzinfo/definitions/America/Regina.rb +74 -0
- data/lib/active_support/vendor/tzinfo-0.3.13/lib/tzinfo/definitions/America/Santiago.rb +205 -0
- data/lib/active_support/vendor/tzinfo-0.3.13/lib/tzinfo/definitions/America/Sao_Paulo.rb +171 -0
- data/lib/active_support/vendor/tzinfo-0.3.13/lib/tzinfo/definitions/America/St_Johns.rb +288 -0
- data/lib/active_support/vendor/tzinfo-0.3.13/lib/tzinfo/definitions/America/Tijuana.rb +196 -0
- data/lib/active_support/vendor/tzinfo-0.3.13/lib/tzinfo/definitions/Asia/Almaty.rb +67 -0
- data/lib/active_support/vendor/tzinfo-0.3.13/lib/tzinfo/definitions/Asia/Baghdad.rb +73 -0
- data/lib/active_support/vendor/tzinfo-0.3.13/lib/tzinfo/definitions/Asia/Baku.rb +161 -0
- data/lib/active_support/vendor/tzinfo-0.3.13/lib/tzinfo/definitions/Asia/Bangkok.rb +20 -0
- data/lib/active_support/vendor/tzinfo-0.3.13/lib/tzinfo/definitions/Asia/Chongqing.rb +33 -0
- data/lib/active_support/vendor/tzinfo-0.3.13/lib/tzinfo/definitions/Asia/Colombo.rb +30 -0
- data/lib/active_support/vendor/tzinfo-0.3.13/lib/tzinfo/definitions/Asia/Dhaka.rb +27 -0
- data/lib/active_support/vendor/tzinfo-0.3.13/lib/tzinfo/definitions/Asia/Hong_Kong.rb +87 -0
- data/lib/active_support/vendor/tzinfo-0.3.13/lib/tzinfo/definitions/Asia/Irkutsk.rb +165 -0
- data/lib/active_support/vendor/tzinfo-0.3.13/lib/tzinfo/definitions/Asia/Jakarta.rb +30 -0
- data/lib/active_support/vendor/tzinfo-0.3.13/lib/tzinfo/definitions/Asia/Jerusalem.rb +163 -0
- data/lib/active_support/vendor/tzinfo-0.3.13/lib/tzinfo/definitions/Asia/Kabul.rb +20 -0
- data/lib/active_support/vendor/tzinfo-0.3.13/lib/tzinfo/definitions/Asia/Kamchatka.rb +163 -0
- data/lib/active_support/vendor/tzinfo-0.3.13/lib/tzinfo/definitions/Asia/Karachi.rb +32 -0
- data/lib/active_support/vendor/tzinfo-0.3.13/lib/tzinfo/definitions/Asia/Kathmandu.rb +20 -0
- data/lib/active_support/vendor/tzinfo-0.3.13/lib/tzinfo/definitions/Asia/Kolkata.rb +25 -0
- data/lib/active_support/vendor/tzinfo-0.3.13/lib/tzinfo/definitions/Asia/Krasnoyarsk.rb +163 -0
- data/lib/active_support/vendor/tzinfo-0.3.13/lib/tzinfo/definitions/Asia/Kuala_Lumpur.rb +31 -0
- data/lib/active_support/vendor/tzinfo-0.3.13/lib/tzinfo/definitions/Asia/Kuwait.rb +18 -0
- data/lib/active_support/vendor/tzinfo-0.3.13/lib/tzinfo/definitions/Asia/Magadan.rb +163 -0
- data/lib/active_support/vendor/tzinfo-0.3.13/lib/tzinfo/definitions/Asia/Muscat.rb +18 -0
- data/lib/active_support/vendor/tzinfo-0.3.13/lib/tzinfo/definitions/Asia/Novosibirsk.rb +164 -0
- data/lib/active_support/vendor/tzinfo-0.3.13/lib/tzinfo/definitions/Asia/Rangoon.rb +24 -0
- data/lib/active_support/vendor/tzinfo-0.3.13/lib/tzinfo/definitions/Asia/Riyadh.rb +18 -0
- data/lib/active_support/vendor/tzinfo-0.3.13/lib/tzinfo/definitions/Asia/Seoul.rb +34 -0
- data/lib/active_support/vendor/tzinfo-0.3.13/lib/tzinfo/definitions/Asia/Shanghai.rb +35 -0
- data/lib/active_support/vendor/tzinfo-0.3.13/lib/tzinfo/definitions/Asia/Singapore.rb +33 -0
- data/lib/active_support/vendor/tzinfo-0.3.13/lib/tzinfo/definitions/Asia/Taipei.rb +59 -0
- data/lib/active_support/vendor/tzinfo-0.3.13/lib/tzinfo/definitions/Asia/Tashkent.rb +47 -0
- data/lib/active_support/vendor/tzinfo-0.3.13/lib/tzinfo/definitions/Asia/Tbilisi.rb +78 -0
- data/lib/active_support/vendor/tzinfo-0.3.13/lib/tzinfo/definitions/Asia/Tehran.rb +121 -0
- data/lib/active_support/vendor/tzinfo-0.3.13/lib/tzinfo/definitions/Asia/Tokyo.rb +30 -0
- data/lib/active_support/vendor/tzinfo-0.3.13/lib/tzinfo/definitions/Asia/Ulaanbaatar.rb +65 -0
- data/lib/active_support/vendor/tzinfo-0.3.13/lib/tzinfo/definitions/Asia/Urumqi.rb +33 -0
- data/lib/active_support/vendor/tzinfo-0.3.13/lib/tzinfo/definitions/Asia/Vladivostok.rb +164 -0
- data/lib/active_support/vendor/tzinfo-0.3.13/lib/tzinfo/definitions/Asia/Yakutsk.rb +163 -0
- data/lib/active_support/vendor/tzinfo-0.3.13/lib/tzinfo/definitions/Asia/Yekaterinburg.rb +165 -0
- data/lib/active_support/vendor/tzinfo-0.3.13/lib/tzinfo/definitions/Asia/Yerevan.rb +165 -0
- data/lib/active_support/vendor/tzinfo-0.3.13/lib/tzinfo/definitions/Atlantic/Azores.rb +270 -0
- data/lib/active_support/vendor/tzinfo-0.3.13/lib/tzinfo/definitions/Atlantic/Cape_Verde.rb +23 -0
- data/lib/active_support/vendor/tzinfo-0.3.13/lib/tzinfo/definitions/Atlantic/South_Georgia.rb +18 -0
- data/lib/active_support/vendor/tzinfo-0.3.13/lib/tzinfo/definitions/Australia/Adelaide.rb +187 -0
- data/lib/active_support/vendor/tzinfo-0.3.13/lib/tzinfo/definitions/Australia/Brisbane.rb +35 -0
- data/lib/active_support/vendor/tzinfo-0.3.13/lib/tzinfo/definitions/Australia/Darwin.rb +29 -0
- data/lib/active_support/vendor/tzinfo-0.3.13/lib/tzinfo/definitions/Australia/Hobart.rb +193 -0
- data/lib/active_support/vendor/tzinfo-0.3.13/lib/tzinfo/definitions/Australia/Melbourne.rb +185 -0
- data/lib/active_support/vendor/tzinfo-0.3.13/lib/tzinfo/definitions/Australia/Perth.rb +37 -0
- data/lib/active_support/vendor/tzinfo-0.3.13/lib/tzinfo/definitions/Australia/Sydney.rb +185 -0
- data/lib/active_support/vendor/tzinfo-0.3.13/lib/tzinfo/definitions/Etc/UTC.rb +16 -0
- data/lib/active_support/vendor/tzinfo-0.3.13/lib/tzinfo/definitions/Europe/Amsterdam.rb +228 -0
- data/lib/active_support/vendor/tzinfo-0.3.13/lib/tzinfo/definitions/Europe/Athens.rb +185 -0
- data/lib/active_support/vendor/tzinfo-0.3.13/lib/tzinfo/definitions/Europe/Belgrade.rb +163 -0
- data/lib/active_support/vendor/tzinfo-0.3.13/lib/tzinfo/definitions/Europe/Berlin.rb +188 -0
- data/lib/active_support/vendor/tzinfo-0.3.13/lib/tzinfo/definitions/Europe/Bratislava.rb +13 -0
- data/lib/active_support/vendor/tzinfo-0.3.13/lib/tzinfo/definitions/Europe/Brussels.rb +232 -0
- data/lib/active_support/vendor/tzinfo-0.3.13/lib/tzinfo/definitions/Europe/Bucharest.rb +181 -0
- data/lib/active_support/vendor/tzinfo-0.3.13/lib/tzinfo/definitions/Europe/Budapest.rb +197 -0
- data/lib/active_support/vendor/tzinfo-0.3.13/lib/tzinfo/definitions/Europe/Copenhagen.rb +179 -0
- data/lib/active_support/vendor/tzinfo-0.3.13/lib/tzinfo/definitions/Europe/Dublin.rb +276 -0
- data/lib/active_support/vendor/tzinfo-0.3.13/lib/tzinfo/definitions/Europe/Helsinki.rb +163 -0
- data/lib/active_support/vendor/tzinfo-0.3.13/lib/tzinfo/definitions/Europe/Istanbul.rb +218 -0
- data/lib/active_support/vendor/tzinfo-0.3.13/lib/tzinfo/definitions/Europe/Kiev.rb +168 -0
- data/lib/active_support/vendor/tzinfo-0.3.13/lib/tzinfo/definitions/Europe/Lisbon.rb +268 -0
- data/lib/active_support/vendor/tzinfo-0.3.13/lib/tzinfo/definitions/Europe/Ljubljana.rb +13 -0
- data/lib/active_support/vendor/tzinfo-0.3.13/lib/tzinfo/definitions/Europe/London.rb +288 -0
- data/lib/active_support/vendor/tzinfo-0.3.13/lib/tzinfo/definitions/Europe/Madrid.rb +211 -0
- data/lib/active_support/vendor/tzinfo-0.3.13/lib/tzinfo/definitions/Europe/Minsk.rb +170 -0
- data/lib/active_support/vendor/tzinfo-0.3.13/lib/tzinfo/definitions/Europe/Moscow.rb +181 -0
- data/lib/active_support/vendor/tzinfo-0.3.13/lib/tzinfo/definitions/Europe/Paris.rb +232 -0
- data/lib/active_support/vendor/tzinfo-0.3.13/lib/tzinfo/definitions/Europe/Prague.rb +187 -0
- data/lib/active_support/vendor/tzinfo-0.3.13/lib/tzinfo/definitions/Europe/Riga.rb +176 -0
- data/lib/active_support/vendor/tzinfo-0.3.13/lib/tzinfo/definitions/Europe/Rome.rb +215 -0
- data/lib/active_support/vendor/tzinfo-0.3.13/lib/tzinfo/definitions/Europe/Sarajevo.rb +13 -0
- data/lib/active_support/vendor/tzinfo-0.3.13/lib/tzinfo/definitions/Europe/Skopje.rb +13 -0
- data/lib/active_support/vendor/tzinfo-0.3.13/lib/tzinfo/definitions/Europe/Sofia.rb +173 -0
- data/lib/active_support/vendor/tzinfo-0.3.13/lib/tzinfo/definitions/Europe/Stockholm.rb +165 -0
- data/lib/active_support/vendor/tzinfo-0.3.13/lib/tzinfo/definitions/Europe/Tallinn.rb +172 -0
- data/lib/active_support/vendor/tzinfo-0.3.13/lib/tzinfo/definitions/Europe/Vienna.rb +183 -0
- data/lib/active_support/vendor/tzinfo-0.3.13/lib/tzinfo/definitions/Europe/Vilnius.rb +170 -0
- data/lib/active_support/vendor/tzinfo-0.3.13/lib/tzinfo/definitions/Europe/Warsaw.rb +212 -0
- data/lib/active_support/vendor/tzinfo-0.3.13/lib/tzinfo/definitions/Europe/Zagreb.rb +13 -0
- data/lib/active_support/vendor/tzinfo-0.3.13/lib/tzinfo/definitions/Pacific/Auckland.rb +202 -0
- data/lib/active_support/vendor/tzinfo-0.3.13/lib/tzinfo/definitions/Pacific/Fiji.rb +23 -0
- data/lib/active_support/vendor/tzinfo-0.3.13/lib/tzinfo/definitions/Pacific/Guam.rb +22 -0
- data/lib/active_support/vendor/tzinfo-0.3.13/lib/tzinfo/definitions/Pacific/Honolulu.rb +28 -0
- data/lib/active_support/vendor/tzinfo-0.3.13/lib/tzinfo/definitions/Pacific/Majuro.rb +20 -0
- data/lib/active_support/vendor/tzinfo-0.3.13/lib/tzinfo/definitions/Pacific/Midway.rb +25 -0
- data/lib/active_support/vendor/tzinfo-0.3.13/lib/tzinfo/definitions/Pacific/Noumea.rb +25 -0
- data/lib/active_support/vendor/tzinfo-0.3.13/lib/tzinfo/definitions/Pacific/Pago_Pago.rb +26 -0
- data/lib/active_support/vendor/tzinfo-0.3.13/lib/tzinfo/definitions/Pacific/Port_Moresby.rb +20 -0
- data/lib/active_support/vendor/tzinfo-0.3.13/lib/tzinfo/definitions/Pacific/Tongatapu.rb +27 -0
- data/lib/active_support/vendor/tzinfo-0.3.13/lib/tzinfo/info_timezone.rb +52 -0
- data/lib/active_support/vendor/tzinfo-0.3.13/lib/tzinfo/linked_timezone.rb +51 -0
- data/lib/active_support/vendor/tzinfo-0.3.13/lib/tzinfo/linked_timezone_info.rb +44 -0
- data/lib/active_support/vendor/tzinfo-0.3.13/lib/tzinfo/offset_rationals.rb +98 -0
- data/lib/active_support/vendor/tzinfo-0.3.13/lib/tzinfo/ruby_core_support.rb +56 -0
- data/lib/active_support/vendor/tzinfo-0.3.13/lib/tzinfo/time_or_datetime.rb +292 -0
- data/lib/active_support/vendor/tzinfo-0.3.13/lib/tzinfo/timezone.rb +508 -0
- data/lib/active_support/vendor/tzinfo-0.3.13/lib/tzinfo/timezone_definition.rb +56 -0
- data/lib/active_support/vendor/tzinfo-0.3.13/lib/tzinfo/timezone_info.rb +40 -0
- data/lib/active_support/vendor/tzinfo-0.3.13/lib/tzinfo/timezone_offset_info.rb +94 -0
- data/lib/active_support/vendor/tzinfo-0.3.13/lib/tzinfo/timezone_period.rb +198 -0
- data/lib/active_support/vendor/tzinfo-0.3.13/lib/tzinfo/timezone_transition_info.rb +129 -0
- data/lib/active_support/version.rb +2 -3
- data/lib/active_support/whiny_nil.rb +7 -9
- data/lib/active_support/xml_mini.rb +1 -126
- data/lib/active_support/xml_mini/jdom.rb +0 -2
- data/lib/active_support/xml_mini/libxml.rb +86 -24
- data/lib/active_support/xml_mini/nokogiri.rb +24 -27
- data/lib/active_support/xml_mini/rexml.rb +1 -7
- metadata +191 -49
- data/lib/active_support/builder.rb +0 -6
- data/lib/active_support/core_ext/array/uniq_by.rb +0 -17
- data/lib/active_support/core_ext/class/attribute.rb +0 -67
- data/lib/active_support/core_ext/class/subclasses.rb +0 -55
- data/lib/active_support/core_ext/file/path.rb +0 -5
- data/lib/active_support/core_ext/integer/multiple.rb +0 -6
- data/lib/active_support/core_ext/kernel/singleton_class.rb +0 -13
- data/lib/active_support/core_ext/module/anonymous.rb +0 -24
- data/lib/active_support/core_ext/module/method_names.rb +0 -14
- data/lib/active_support/core_ext/module/reachable.rb +0 -10
- data/lib/active_support/core_ext/module/remove_method.rb +0 -6
- data/lib/active_support/core_ext/object/to_param.rb +0 -49
- data/lib/active_support/core_ext/object/to_query.rb +0 -27
- data/lib/active_support/core_ext/string/encoding.rb +0 -11
- data/lib/active_support/core_ext/string/exclude.rb +0 -6
- data/lib/active_support/core_ext/time/marshal.rb +0 -56
- data/lib/active_support/dependencies/autoload.rb +0 -50
- data/lib/active_support/i18n.rb +0 -8
- data/lib/active_support/inflector/inflections.rb +0 -211
- data/lib/active_support/inflector/methods.rb +0 -141
- data/lib/active_support/inflector/transliterate.rb +0 -97
- data/lib/active_support/json/backends/yajl.rb +0 -40
- data/lib/active_support/lazy_load_hooks.rb +0 -27
- data/lib/active_support/multibyte/unicode.rb +0 -393
- data/lib/active_support/notifications/fanout.rb +0 -93
- data/lib/active_support/notifications/instrumenter.rb +0 -56
- data/lib/active_support/railtie.rb +0 -100
- data/lib/active_support/xml_mini/libxmlsax.rb +0 -85
- data/lib/active_support/xml_mini/nokogirisax.rb +0 -83
@@ -0,0 +1,71 @@
|
|
1
|
+
# encoding: utf-8
|
2
|
+
|
3
|
+
module ActiveSupport #:nodoc:
|
4
|
+
module Multibyte #:nodoc:
|
5
|
+
# Holds data about a codepoint in the Unicode database
|
6
|
+
class Codepoint
|
7
|
+
attr_accessor :code, :combining_class, :decomp_type, :decomp_mapping, :uppercase_mapping, :lowercase_mapping
|
8
|
+
end
|
9
|
+
|
10
|
+
# Holds static data from the Unicode database
|
11
|
+
class UnicodeDatabase
|
12
|
+
ATTRIBUTES = :codepoints, :composition_exclusion, :composition_map, :boundary, :cp1252
|
13
|
+
|
14
|
+
attr_writer(*ATTRIBUTES)
|
15
|
+
|
16
|
+
def initialize
|
17
|
+
@codepoints = Hash.new(Codepoint.new)
|
18
|
+
@composition_exclusion = []
|
19
|
+
@composition_map = {}
|
20
|
+
@boundary = {}
|
21
|
+
@cp1252 = {}
|
22
|
+
end
|
23
|
+
|
24
|
+
# Lazy load the Unicode database so it's only loaded when it's actually used
|
25
|
+
ATTRIBUTES.each do |attr_name|
|
26
|
+
class_eval(<<-EOS, __FILE__, __LINE__ + 1)
|
27
|
+
def #{attr_name} # def codepoints
|
28
|
+
load # load
|
29
|
+
@#{attr_name} # @codepoints
|
30
|
+
end # end
|
31
|
+
EOS
|
32
|
+
end
|
33
|
+
|
34
|
+
# Loads the Unicode database and returns all the internal objects of UnicodeDatabase.
|
35
|
+
def load
|
36
|
+
begin
|
37
|
+
@codepoints, @composition_exclusion, @composition_map, @boundary, @cp1252 = File.open(self.class.filename, 'rb') { |f| Marshal.load f.read }
|
38
|
+
rescue Exception => e
|
39
|
+
raise IOError.new("Couldn't load the Unicode tables for UTF8Handler (#{e.message}), ActiveSupport::Multibyte is unusable")
|
40
|
+
end
|
41
|
+
|
42
|
+
# Redefine the === method so we can write shorter rules for grapheme cluster breaks
|
43
|
+
@boundary.each do |k,_|
|
44
|
+
@boundary[k].instance_eval do
|
45
|
+
def ===(other)
|
46
|
+
detect { |i| i === other } ? true : false
|
47
|
+
end
|
48
|
+
end if @boundary[k].kind_of?(Array)
|
49
|
+
end
|
50
|
+
|
51
|
+
# define attr_reader methods for the instance variables
|
52
|
+
class << self
|
53
|
+
attr_reader(*ATTRIBUTES)
|
54
|
+
end
|
55
|
+
end
|
56
|
+
|
57
|
+
# Returns the directory in which the data files are stored
|
58
|
+
def self.dirname
|
59
|
+
File.dirname(__FILE__) + '/../values/'
|
60
|
+
end
|
61
|
+
|
62
|
+
# Returns the filename for the data file for this version
|
63
|
+
def self.filename
|
64
|
+
File.expand_path File.join(dirname, "unicode_tables.dat")
|
65
|
+
end
|
66
|
+
end
|
67
|
+
|
68
|
+
# UniCode Database
|
69
|
+
UCD = UnicodeDatabase.new
|
70
|
+
end
|
71
|
+
end
|
@@ -26,11 +26,11 @@ module ActiveSupport #:nodoc:
|
|
26
26
|
else
|
27
27
|
def self.verify(string)
|
28
28
|
if expression = valid_character
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
true
|
29
|
+
for c in string.split(//)
|
30
|
+
return false unless expression.match(c)
|
31
|
+
end
|
33
32
|
end
|
33
|
+
true
|
34
34
|
end
|
35
35
|
end
|
36
36
|
|
@@ -49,8 +49,9 @@ module ActiveSupport #:nodoc:
|
|
49
49
|
else
|
50
50
|
def self.clean(string)
|
51
51
|
if expression = valid_character
|
52
|
-
|
53
|
-
|
52
|
+
stripped = []; for c in string.split(//)
|
53
|
+
stripped << c if expression.match(c)
|
54
|
+
end; stripped.join
|
54
55
|
else
|
55
56
|
string
|
56
57
|
end
|
@@ -1,4 +1,6 @@
|
|
1
|
+
require 'thread'
|
1
2
|
require 'active_support/core_ext/module/delegation'
|
3
|
+
require 'active_support/core_ext/module/attribute_accessors'
|
2
4
|
|
3
5
|
module ActiveSupport
|
4
6
|
# Notifications provides an instrumentation API for Ruby. To instrument an
|
@@ -9,12 +11,12 @@ module ActiveSupport
|
|
9
11
|
# end
|
10
12
|
#
|
11
13
|
# You can consume those events and the information they provide by registering
|
12
|
-
# a
|
14
|
+
# a subscriber. For instance, let's store all instrumented events in an array:
|
13
15
|
#
|
14
16
|
# @events = []
|
15
17
|
#
|
16
|
-
# ActiveSupport::Notifications.subscribe do
|
17
|
-
# @events <<
|
18
|
+
# ActiveSupport::Notifications.subscribe do |event|
|
19
|
+
# @events << event
|
18
20
|
# end
|
19
21
|
#
|
20
22
|
# ActiveSupport::Notifications.instrument(:render, :extra => :information) do
|
@@ -22,6 +24,7 @@ module ActiveSupport
|
|
22
24
|
# end
|
23
25
|
#
|
24
26
|
# event = @events.first
|
27
|
+
# event.class #=> ActiveSupport::Notifications::Event
|
25
28
|
# event.name #=> :render
|
26
29
|
# event.duration #=> 10 (in miliseconds)
|
27
30
|
# event.result #=> "Foo"
|
@@ -35,47 +38,134 @@ module ActiveSupport
|
|
35
38
|
# end
|
36
39
|
#
|
37
40
|
# Notifications ships with a queue implementation that consumes and publish events
|
38
|
-
# to
|
41
|
+
# to subscribers in a thread. You can use any queue implementation you want.
|
39
42
|
#
|
40
43
|
module Notifications
|
41
|
-
|
42
|
-
autoload :Event, 'active_support/notifications/instrumenter'
|
43
|
-
autoload :Fanout, 'active_support/notifications/fanout'
|
44
|
+
mattr_accessor :queue
|
44
45
|
|
45
46
|
class << self
|
46
|
-
attr_writer :notifier
|
47
|
-
delegate :publish, :subscribe, :unsubscribe, :to => :notifier
|
48
47
|
delegate :instrument, :to => :instrumenter
|
49
48
|
|
50
|
-
def
|
51
|
-
|
49
|
+
def instrumenter
|
50
|
+
Thread.current[:notifications_instrumeter] ||= Instrumenter.new(publisher)
|
52
51
|
end
|
53
52
|
|
54
|
-
def
|
55
|
-
|
53
|
+
def publisher
|
54
|
+
@publisher ||= Publisher.new(queue)
|
55
|
+
end
|
56
|
+
|
57
|
+
def subscribe(pattern=nil, &block)
|
58
|
+
Subscriber.new(queue).bind(pattern).subscribe(&block)
|
59
|
+
end
|
60
|
+
end
|
61
|
+
|
62
|
+
class Instrumenter
|
63
|
+
def initialize(publisher)
|
64
|
+
@publisher = publisher
|
65
|
+
end
|
66
|
+
|
67
|
+
def instrument(name, payload={})
|
68
|
+
payload[:time] = Time.now
|
69
|
+
payload[:thread_id] = Thread.current.object_id
|
70
|
+
payload[:result] = yield if block_given?
|
71
|
+
ensure
|
72
|
+
payload[:duration] = 1000 * (Time.now.to_f - payload[:time].to_f)
|
73
|
+
@publisher.publish(name, payload)
|
74
|
+
end
|
75
|
+
end
|
76
|
+
|
77
|
+
class Publisher
|
78
|
+
def initialize(queue)
|
79
|
+
@queue = queue
|
80
|
+
end
|
81
|
+
|
82
|
+
def publish(name, payload)
|
83
|
+
@queue.publish(name, payload)
|
56
84
|
end
|
57
85
|
end
|
58
86
|
|
59
|
-
class
|
60
|
-
def initialize(queue
|
87
|
+
class Subscriber
|
88
|
+
def initialize(queue)
|
61
89
|
@queue = queue
|
62
90
|
end
|
63
91
|
|
64
|
-
def
|
65
|
-
@
|
92
|
+
def bind(pattern)
|
93
|
+
@pattern = pattern
|
94
|
+
self
|
95
|
+
end
|
96
|
+
|
97
|
+
def subscribe
|
98
|
+
@queue.subscribe(@pattern) do |name, payload|
|
99
|
+
yield Event.new(name, payload)
|
100
|
+
end
|
101
|
+
end
|
102
|
+
end
|
103
|
+
|
104
|
+
class Event
|
105
|
+
attr_reader :name, :time, :duration, :thread_id, :result, :payload
|
106
|
+
|
107
|
+
def initialize(name, payload)
|
108
|
+
@name = name
|
109
|
+
@payload = payload.dup
|
110
|
+
@time = @payload.delete(:time)
|
111
|
+
@thread_id = @payload.delete(:thread_id)
|
112
|
+
@result = @payload.delete(:result)
|
113
|
+
@duration = @payload.delete(:duration)
|
114
|
+
end
|
115
|
+
|
116
|
+
def parent_of?(event)
|
117
|
+
start = (self.time - event.time) * 1000
|
118
|
+
start <= 0 && (start + self.duration >= event.duration)
|
119
|
+
end
|
120
|
+
end
|
121
|
+
|
122
|
+
# This is a default queue implementation that ships with Notifications. It
|
123
|
+
# consumes events in a thread and publish them to all registered subscribers.
|
124
|
+
#
|
125
|
+
class LittleFanout
|
126
|
+
def initialize
|
127
|
+
@listeners, @stream = [], Queue.new
|
128
|
+
@thread = Thread.new { consume }
|
129
|
+
end
|
130
|
+
|
131
|
+
def publish(*event)
|
132
|
+
@stream.push(event)
|
66
133
|
end
|
67
134
|
|
68
|
-
def subscribe(pattern
|
69
|
-
@
|
135
|
+
def subscribe(pattern=nil, &block)
|
136
|
+
@listeners << Listener.new(pattern, &block)
|
70
137
|
end
|
71
138
|
|
72
|
-
def
|
73
|
-
@
|
139
|
+
def consume
|
140
|
+
while event = @stream.shift
|
141
|
+
@listeners.each { |l| l.publish(*event) }
|
142
|
+
end
|
74
143
|
end
|
75
144
|
|
76
|
-
|
77
|
-
|
145
|
+
class Listener
|
146
|
+
attr_reader :thread
|
147
|
+
|
148
|
+
def initialize(pattern, &block)
|
149
|
+
@pattern = pattern
|
150
|
+
@subscriber = block
|
151
|
+
@queue = Queue.new
|
152
|
+
@thread = Thread.new { consume }
|
153
|
+
end
|
154
|
+
|
155
|
+
def publish(name, payload)
|
156
|
+
unless @pattern && !(@pattern === name.to_s)
|
157
|
+
@queue << [name, payload]
|
158
|
+
end
|
159
|
+
end
|
160
|
+
|
161
|
+
def consume
|
162
|
+
while event = @queue.shift
|
163
|
+
@subscriber.call(*event)
|
164
|
+
end
|
165
|
+
end
|
78
166
|
end
|
79
167
|
end
|
80
168
|
end
|
169
|
+
|
170
|
+
Notifications.queue = Notifications::LittleFanout.new
|
81
171
|
end
|
@@ -1,28 +1,10 @@
|
|
1
|
-
require 'yaml'
|
2
|
-
|
3
|
-
YAML.add_builtin_type("omap") do |type, val|
|
4
|
-
ActiveSupport::OrderedHash[val.map(&:to_a).map(&:first)]
|
5
|
-
end
|
6
|
-
|
7
1
|
# OrderedHash is namespaced to prevent conflicts with other implementations
|
8
2
|
module ActiveSupport
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
def to_yaml(opts = {})
|
15
|
-
YAML.quick_emit(self, opts) do |out|
|
16
|
-
out.seq(taguri, to_yaml_style) do |seq|
|
17
|
-
each do |k, v|
|
18
|
-
seq.add(k => v)
|
19
|
-
end
|
20
|
-
end
|
21
|
-
end
|
22
|
-
end
|
23
|
-
|
24
|
-
# Hash is ordered in Ruby 1.9!
|
25
|
-
if RUBY_VERSION < '1.9'
|
3
|
+
# Hash is ordered in Ruby 1.9!
|
4
|
+
if RUBY_VERSION >= '1.9'
|
5
|
+
OrderedHash = ::Hash
|
6
|
+
else
|
7
|
+
class OrderedHash < Hash #:nodoc:
|
26
8
|
def initialize(*args, &block)
|
27
9
|
super
|
28
10
|
@keys = []
|
@@ -70,7 +52,7 @@ module ActiveSupport
|
|
70
52
|
end
|
71
53
|
super
|
72
54
|
end
|
73
|
-
|
55
|
+
|
74
56
|
def delete_if
|
75
57
|
super
|
76
58
|
sync_keys!
|
@@ -138,21 +120,15 @@ module ActiveSupport
|
|
138
120
|
dup.merge!(other_hash)
|
139
121
|
end
|
140
122
|
|
141
|
-
# When replacing with another hash, the initial order of our keys must come from the other hash -ordered or not.
|
142
|
-
def replace(other)
|
143
|
-
super
|
144
|
-
@keys = other.keys
|
145
|
-
self
|
146
|
-
end
|
147
|
-
|
148
123
|
def inspect
|
149
124
|
"#<OrderedHash #{super}>"
|
150
125
|
end
|
151
126
|
|
152
|
-
|
153
|
-
|
154
|
-
|
155
|
-
|
127
|
+
private
|
128
|
+
|
129
|
+
def sync_keys!
|
130
|
+
@keys.delete_if {|k| !has_key?(k)}
|
131
|
+
end
|
156
132
|
end
|
157
133
|
end
|
158
134
|
end
|
@@ -1,8 +1,5 @@
|
|
1
|
-
require 'active_support/
|
2
|
-
require 'active_support/core_ext/class/attribute'
|
1
|
+
require 'active_support/core_ext/class/inheritable_attributes'
|
3
2
|
require 'active_support/core_ext/proc'
|
4
|
-
require 'active_support/core_ext/string/inflections'
|
5
|
-
require 'active_support/core_ext/array/extract_options'
|
6
3
|
|
7
4
|
module ActiveSupport
|
8
5
|
# Rescuable module adds support for easier exception handling.
|
@@ -10,7 +7,7 @@ module ActiveSupport
|
|
10
7
|
extend Concern
|
11
8
|
|
12
9
|
included do
|
13
|
-
|
10
|
+
class_inheritable_accessor :rescue_handlers
|
14
11
|
self.rescue_handlers = []
|
15
12
|
end
|
16
13
|
|
@@ -68,7 +65,7 @@ module ActiveSupport
|
|
68
65
|
end
|
69
66
|
|
70
67
|
# put the new handler at the end because the list is read in reverse
|
71
|
-
|
68
|
+
rescue_handlers << [key, options[:with]]
|
72
69
|
end
|
73
70
|
end
|
74
71
|
end
|
@@ -84,7 +81,7 @@ module ActiveSupport
|
|
84
81
|
def handler_for_rescue(exception)
|
85
82
|
# We go from right to left because pairs are pushed onto rescue_handlers
|
86
83
|
# as rescue_from declarations are found.
|
87
|
-
_, rescuer =
|
84
|
+
_, rescuer = Array(rescue_handlers).reverse.detect do |klass_name, handler|
|
88
85
|
# The purpose of allowing strings in rescue_from is to support the
|
89
86
|
# declaration of handler associations for exception classes whose
|
90
87
|
# definition is yet unknown.
|
@@ -4,19 +4,21 @@
|
|
4
4
|
# Date next_year, next_month
|
5
5
|
# DateTime to_date, to_datetime, xmlschema
|
6
6
|
# Enumerable group_by, each_with_object, none?
|
7
|
+
# Integer even?, odd?
|
8
|
+
# Object tap
|
7
9
|
# Process Process.daemon
|
8
10
|
# REXML security fix
|
9
11
|
# String ord
|
12
|
+
# Symbol to_proc
|
10
13
|
# Time to_date, to_time, to_datetime
|
11
14
|
require 'active_support'
|
12
15
|
require 'active_support/core_ext/date/calculations'
|
13
16
|
require 'active_support/core_ext/date_time/conversions'
|
14
17
|
require 'active_support/core_ext/enumerable'
|
18
|
+
require 'active_support/core_ext/integer/even_odd'
|
19
|
+
require 'active_support/core_ext/object/tap'
|
15
20
|
require 'active_support/core_ext/process/daemon'
|
16
21
|
require 'active_support/core_ext/string/conversions'
|
17
|
-
require 'active_support/core_ext/string/interpolation'
|
18
|
-
require 'active_support/core_ext/string/encoding'
|
19
22
|
require 'active_support/core_ext/rexml'
|
23
|
+
require 'active_support/core_ext/symbol/to_proc'
|
20
24
|
require 'active_support/core_ext/time/conversions'
|
21
|
-
require 'active_support/core_ext/file/path'
|
22
|
-
require 'active_support/core_ext/module/method_names'
|
@@ -5,10 +5,9 @@ require 'active_support/testing/deprecation'
|
|
5
5
|
require 'active_support/testing/declarative'
|
6
6
|
require 'active_support/testing/pending'
|
7
7
|
require 'active_support/testing/isolation'
|
8
|
-
require 'active_support/core_ext/kernel/reporting'
|
9
8
|
|
10
9
|
begin
|
11
|
-
|
10
|
+
require 'mocha'
|
12
11
|
rescue LoadError
|
13
12
|
# Fake Mocha::ExpectationError so we can rescue it in #run. Bleh.
|
14
13
|
Object.const_set :Mocha, Module.new
|
@@ -22,6 +21,12 @@ module ActiveSupport
|
|
22
21
|
alias_method :method_name, :name if method_defined? :name
|
23
22
|
alias_method :method_name, :__name__ if method_defined? :__name__
|
24
23
|
else
|
24
|
+
# TODO: Figure out how to get the Rails::BacktraceFilter into minitest/unit
|
25
|
+
if defined?(Rails) && ENV['BACKTRACE'].nil?
|
26
|
+
require 'rails/backtrace_cleaner'
|
27
|
+
Test::Unit::Util::BacktraceFilter.module_eval { include Rails::BacktraceFilterForTestUnit }
|
28
|
+
end
|
29
|
+
|
25
30
|
Assertion = Test::Unit::AssertionFailedError
|
26
31
|
|
27
32
|
require 'active_support/testing/default'
|