aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/lib/active_support/core_ext
Commit message (Collapse)AuthorAgeFilesLines
...
* Adding TimeZone#at and DateTime#to_fGeoff Buesing2008-03-171-0/+6
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@9042 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Applied the faster squish version (closes #11123) [jordi]David Heinemeier Hansson2008-03-131-2/+4
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@9015 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Removing unneeded #change_time_zone method from Time, DateTime and TimeWithZoneGeoff Buesing2008-03-111-13/+0
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@9008 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Fix Hash#from_xml with Type records. Closes #9242 [Juanjo Bazan, Isaac Feliu]Jeremy Kemper2008-02-271-2/+3
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8937 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Adding Time#end_of_day, _quarter, _week, and _year. Closes #9312.Jeremy Kemper2008-02-272-0/+39
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8934 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Time.=== returns true for TimeWithZone instancesGeoff Buesing2008-02-161-0/+5
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8885 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Add String#squish and String#squish! to remove consecutive chunks of ↵Michael Koziarski2008-02-162-0/+26
| | | | | | whitespace. Closes #11123 [jordi, Henrik N] git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8878 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Serialize BigDecimals as Floats when using to_yaml. Closes #8746 ↵Michael Koziarski2008-02-151-0/+23
| | | | | | [ernesto.jimenez] git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8877 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Time#zone=, #in_time_zone and #change_time_zone accept a DurationGeoff Buesing2008-02-101-1/+2
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8850 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Time#in_time_zone handles Time.local instances correctlyGeoff Buesing2008-02-101-4/+2
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8849 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Pruning unneeded Time#change_time_zone_to_current. Enhanced docs for ↵Geoff Buesing2008-02-101-7/+6
| | | | | | #change_time_zone git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8848 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* ActiveSupport::Base64.encode64s since Base64 is deprecatedJeremy Kemper2008-02-073-9/+6
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8817 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Added Base64.encode64s to encode values in base64 without the newlines. This ↵David Heinemeier Hansson2008-02-072-0/+20
| | | | | | makes the values immediately usable as URL parameters or memcache keys without further processing [DHH] git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8816 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Remove :nodoc: entries around the ActiveSupport test/unit assertions. Closes ↵Rick Olson2008-02-071-3/+5
| | | | | | #10946 [dancroak, jamesh] git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8810 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Add Time Zone support to ActiveRecord, and config.time_zone property for ↵Rick Olson2008-02-061-1/+3
| | | | | | specifying a default Time Zone. Closes #10982 [Geoff Buesing, rick] git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8806 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Simplified, faster implementation of Benchmark.realtime [Alexander Dymo]Michael Koziarski2008-02-021-0/+12
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8771 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Time#- coerces TimeWithZone argument to a Time instance so that difference ↵Geoff Buesing2008-01-251-0/+11
| | | | | | in seconds can be calculated. Closes #10914 [Geoff Buesing, yyyc514] git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8730 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Time.get_zone refactored to private method, given that the encapsulated ↵Geoff Buesing2008-01-251-6/+12
| | | | | | logic is only useful internally git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8719 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Time.zone uses thread-local variable for thread safety. Adding ↵Geoff Buesing2008-01-251-7/+13
| | | | | | | | Time.use_zone, for overriding Time.zone locally inside a block. Removing unneeded Time.zone_reset! git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8718 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Time.days_in_month defaults to current year if no year is supplied as ↵Geoff Buesing2008-01-251-12/+7
| | | | | | argument, uses Date.gregorian_leap? to determine leap year, and uses constant lookup to determine days in month. Closes #10799 [Radar] git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8715 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Adding Time and DateTime #compare_with_coercion, which layers behavior on ↵Geoff Buesing2008-01-232-0/+29
| | | | | | #<=> so that any combination of Time, DateTime and ActiveSupport::TimeWithZone instances can be chronologically compared git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8711 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Time #in_current_time_zone and #change_time_zone_to_current return self when ↵Geoff Buesing2008-01-231-2/+2
| | | | | | Time.zone is nil git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8708 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Remove unneeded #to_datetime_default_s alias for DateTime#to_s, given that ↵Geoff Buesing2008-01-231-1/+0
| | | | | | we inherit a #to_default_s from Date that does exactly the same thing git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8705 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Enumerable#group_by uses ActiveSupport::OrderedHashJeremy Kemper2008-01-231-15/+2
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8700 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Refactor Time and DateTime #to_formatted_s: use ternary instead of nested ↵Geoff Buesing2008-01-232-18/+4
| | | | | | if/else git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8699 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Adding Time and DateTime #formatted_offset, for outputting +HH:MM utc offset ↵Geoff Buesing2008-01-232-0/+17
| | | | | | strings with cross-platform consistency git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8698 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Introduce ActiveSupport::TimeWithZone, for wrapping Time instances with a ↵Geoff Buesing2008-01-233-0/+72
| | | | | | TimeZone. Introduce instance methods to Time for creating TimeWithZone instances, and class methods for managing a global time zone git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8696 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Introducing DateTime #utc, #utc? and #utc_offset, for duck-typing ↵Geoff Buesing2008-01-161-0/+20
| | | | | | compatibility with Time. Closes #10002 git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8649 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Refactor number-to-HH:MM-string conversion logic from ↵Geoff Buesing2008-01-122-1/+22
| | | | | | TimeZone#formatted_offset to reusable Numeric#to_utc_offset_s method git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8635 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Simplify to_formatted_s docs. Closes #10747 [Jeremy Kemper]Jeremy Kemper2008-01-093-74/+38
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8608 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Document date and time to_formatted_s. Closes #10747 [leethal]Jeremy Kemper2008-01-093-5/+66
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8606 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Fix up Enumerable#group_byJeremy Kemper2008-01-091-7/+14
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8604 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Improve documentation to classify to make it clear that it expects names to ↵Michael Koziarski2008-01-081-2/+5
| | | | | | be plural. Reference #10615 [kris_chambers] git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8596 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Use a decorator module for Files instantiated by Hash.from_xml. Add test ↵Jeremy Kemper2008-01-061-3/+18
| | | | | | coverage. Closes #10726 [Cheah Chu Yeow] git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8579 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Simplify and speedup Hash#stringify_keys! References #10717 [Cheah Chu Yeow]Jeremy Kemper2008-01-061-4/+1
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8576 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Ruby 1.9: Module#local_constants can now just use constants(false). Closes ↵Jeremy Kemper2008-01-041-12/+21
| | | | | | #10648 [Xavier Noria] git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8555 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Moved the caching stores from ActionController::Caching::Fragments::* to ↵David Heinemeier Hansson2008-01-033-0/+4
| | | | | | ActiveSupport::Cache::*. If you're explicitly referring to a store, like ActionController::Caching::Fragments::MemoryStore, you need to update that reference with ActiveSupport::Cache::MemoryStore [DHH] Deprecated ActionController::Base.fragment_cache_store for ActionController::Base.cache_store [DHH] All fragment cache keys are now by default prefixed with the 'views/' namespace [DHH] Added ActiveRecord::Base.cache_key to make it easier to cache Active Records in combination with the new ActiveSupport::Cache::* libraries [DHH] Added ActiveSupport::Gzip.decompress/compress(source) as an easy wrapper for Zlib [Tobias Luetke] Included MemCache-Client to make the improved ActiveSupport::Cache::MemCacheStore work out of the box [Bob Cottrell, Eric Hodel] Added config.cache_store to environment options to control the default cache store (default is FileStore if tmp/cache is present, otherwise MemoryStore is used) [DHH] git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8546 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Ruby 1.9 compat: special-case String access methods to not depend on #charsJeremy Kemper2008-01-031-48/+72
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8538 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Correct Hash#assert_valid_keys docs. Closes #10621 [Cheah Chu Yeow, blackanger]Jeremy Kemper2008-01-021-3/+4
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8521 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Changed the implementation of Enumerable#group_by to use a double array ↵David Heinemeier Hansson2007-12-311-2/+7
| | | | | | approach instead of a hash such that the insert order is honored [DHH/Marcel] git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8516 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Ruby 1.9 compat: introduce ActiveSupport::FrozenObjectError normalize ↵Jeremy Kemper2007-12-291-0/+8
| | | | | | TypeError vs RuntimeError handling. Closes #10645 [Frederick Cheung] git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8510 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Ruby 1.9 compat: introduce instance_variable_names. Closes #10630 [Frederick ↵Jeremy Kemper2007-12-281-0/+4
| | | | | | Cheung] git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8499 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Ruby 1.9 compat: don't use obsolete ParseDateJeremy Kemper2007-12-271-4/+4
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8490 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Ruby 1.9 compat: dependencies uses Module#local_constant_names. References ↵Jeremy Kemper2007-12-221-0/+6
| | | | | | #1689 [Frederick Cheung] git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8482 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Ruby 1.9: use enumerator for blockless Range#stepJeremy Kemper2007-12-211-6/+16
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8469 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Multibyte: String#chars returns self for Ruby 1.9Jeremy Kemper2007-12-211-32/+51
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8460 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Hash#symbolize_keys skips keys that can't be symbolized. Closes #10500.Jeremy Kemper2007-12-201-1/+1
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8454 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Ruby 1.9 compat: move from the deprecated Base64 module to ↵Jeremy Kemper2007-12-181-2/+1
| | | | | | ActiveSupport::Base64. Closes #10554. git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8433 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Docfix (closes #10369) [revans]David Heinemeier Hansson2007-12-171-1/+17
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8428 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Ruby 1.9 compat: 'a'.ord == 'a'[0]Jeremy Kemper2007-12-151-2/+7
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8403 5ecf4fe2-1ee6-0310-87b1-e25e094e27de