Commit Graph

506 Commits

Author SHA1 Message Date
Luca Guidi
ce65a05c5b Fix Ruby's Time marshaling bug in pre-1.9 versions of Ruby: utc instances are now correctly unmarshaled with a utc zone instead of the system local zone [#900 state:resolved] 2008-08-27 08:57:36 -05:00
Adrian Mugnolo
fc89a95193 Add in_groups to ActiveSupport::CoreExtensions::Array::Grouping. [#579 state:resolved]
Signed-off-by: Pratik Naik <pratiknaik@gmail.com>
2008-07-15 15:04:26 +01:00
gbuesing
3451045658 Fix TimeWithZone unmarshaling: coerce unmarshaled Time instances to utc, because Ruby's marshaling of Time instances doesn't respect the zone 2008-07-14 23:16:39 -05:00
Joshua Peek
8a9934a9d9 Added Memoizable mixin for caching simple lazy loaded attributes 2008-07-14 19:50:32 -05:00
Michael Koziarski
51e13d51ad Move test related core_ext stuff out of regular core ext to prevent nasty surprises when you require active_support then use Test::Unit directly. 2008-07-04 10:41:39 +03:00
Pratik Naik
4f75840d72 Add Inflection rules for String#humanize. [#535 state:resolved] [dcmanges]
Signed-off-by: Pratik Naik <pratiknaik@gmail.com>
2008-07-02 13:25:36 +01:00
gbuesing
676d6a6514 TimeWithZone: when crossing DST boundary, treat Durations of days, months or years as variable-length, and all other values as absolute length. A time + 24.hours will advance exactly 24 hours, but a time + 1.day will advance 23-25 hours, depending on the day. Ensure consistent behavior across all advancing methods. 2008-06-29 15:21:40 -05:00
gbuesing
4cf93935b2 Fix indentation and update changelogs for previous commit 2008-06-29 13:46:07 -05:00
David Heinemeier Hansson
161ab28b7c Added block-handling to Enumerable#many? (Damian Janowski) [#452 state:resolved] 2008-06-20 11:31:06 -05:00
David Heinemeier Hansson
22af62cf48 Added Array#second through Array#tenth as aliases for Array#[1] through Array#[9] [DHH] 2008-06-17 17:37:29 -05:00
David Heinemeier Hansson
ba0f38f89e Change Enumberal#several? to Enumberal#many? 2008-06-13 17:34:17 -05:00
David Heinemeier Hansson
f74ba37f4e Added test/do declaration style testing to ActiveSupport::TestCase [DHH via Jay Fields] 2008-06-12 20:10:38 -05:00
David Heinemeier Hansson
a3caf28da3 Added Object#present? which is equivalent to !Object#blank? [DHH] 2008-06-12 18:30:56 -05:00
David Heinemeier Hansson
556204abaf Added Enumberable#several? to encapsulate collection.size > 1 [DHH] 2008-06-12 17:46:15 -05:00
Joshua Peek
5fe2878973 Renamed StringQuestioneer to StringInquirer. 2008-06-04 15:06:32 -05:00
David Heinemeier Hansson
8afa725f4b Wrapped Rails.env in StringQuestioneer so you can do Rails.env.development? [DHH] 2008-06-03 17:44:56 -05:00
Steve Purcell
7cfa6ec8a3 Add more standard Hash methods to ActiveSupport::OrderedHash [#314 state:resolved]
Signed-off-by: Joshua Peek <josh@joshpeek.com>
2008-06-03 14:15:33 -05:00
David Heinemeier Hansson
64fea9c45c Fixed Date#end_of_quarter to not blow up on May 31st [#289 state:resolved] (Danger) 2008-06-02 22:02:43 -05:00
Marcos Tapajos
14a65cd982 Fixed changelog merge.
Signed-off-by: Joshua Peek <josh@joshpeek.com>
2008-06-02 09:47:53 -05:00
David Heinemeier Hansson
f9db7695fe Making ready for release of 2.1 2008-05-31 17:03:03 -07:00
gbuesing
f88267d532 TimeZone#to_s shows offset as GMT instead of UTC, because GMT will be more familiar to end users (see time zone selects used by Windows OS, google.com and yahoo.com.) Reverts [8370] 2008-05-25 11:56:29 -05:00
gbuesing
cee9297c9b Hash.from_xml: datetime xml types overflow to Ruby DateTime class when out of range of Time. Adding tests for utc offsets 2008-05-18 11:48:33 -05:00
gbuesing
cde9c09a52 TimeWithZone #+ and #- : ensure overflow to DateTime with Numeric arg 2008-05-18 11:15:29 -05:00
gbuesing
be85868987 Time#to_json: don't convert to utc before encoding. References #175 2008-05-18 10:48:11 -05:00
David Heinemeier Hansson
b60c8a573e Making ready for RC1 release 2008-05-11 18:29:44 -05:00
Cheah Chu Yeow
8f2f88f128 Remove unused JSON methods. [#164 state:resolved]
Signed-off-by: Pratik Naik <pratiknaik@gmail.com>
2008-05-11 19:49:47 +01:00
gbuesing
66728087d0 Adding Date.current, which returns Time.zone.today if config.time_zone is set; otherwise returns Date.today. ActionView date_helper uses Date.current to determine locale-appropriate default 2008-05-08 22:48:47 -05:00
gbuesing
4f03190f26 TimeWithZone: date part getter methods (#year #mon #day etc) are defined on class; no longer relying on method_missing 2008-05-08 22:07:21 -05:00
gbuesing
618d695f11 Updating changelogs 2008-05-08 21:58:37 -05:00
Joshua Peek
3cffe92ff0 Added Ruby 1.8 implementation of Process.daemon 2008-05-05 10:22:29 -05:00
gbuesing
32b82e4c6f Duration #since and #ago with no argument (e.g., 5.days.ago) return TimeWithZone when config.time_zone is set. Introducing Time.current, which returns Time.zone.now if config.time_zone is set, otherwise just returns Time.now 2008-04-20 21:57:04 -05:00
gbuesing
9620372a6d Time#since behaves correctly when passed a Duration. Closes #11527 [kemiller] 2008-04-12 19:35:47 -05:00
gbuesing
f285b6119b Add #getutc alias for DateTime#utc 2008-04-12 17:37:50 -05:00
gbuesing
0289b0e7df Refactor TimeWithZone: don't send #since, #ago, #+, #-, #advance through method_missing 2008-04-12 17:31:29 -05:00
gbuesing
7e5aa6569b TimeWithZone respects config.active_support.use_standard_json_time_format 2008-04-12 16:48:56 -05:00
Rick Olson
605196c448 Add config.active_support.escape_html_entities_in_json to allow disabling of html entity escaping. [rick]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@9238 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2008-04-08 03:45:26 +00:00
Pratik Naik
097c0d6166 Fix more typos and changelog
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@9227 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2008-04-05 11:18:05 +00:00
Josh Peek
08318b8bcd Replaced callback method evaluation in AssociationCollection class to use ActiveSupport::Callbacks. Modified ActiveSupport::Callbacks::Callback#call to accept multiple arguments.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@9225 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2008-04-04 20:26:42 +00:00
Geoff Buesing
49f2e6f8d4 Time #yesterday and #tomorrow behave correctly crossing DST boundary. Closes #7399 [sblackstone]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@9221 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2008-04-04 03:29:30 +00:00
Geoff Buesing
2c6f1d4396 TimeWithZone: Adding tests for dst and leap day edge cases when advancing time
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@9213 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2008-04-02 14:15:30 +00:00
Pratik Naik
3b603bbc93 Revert [9209] Use Hash#except
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@9210 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2008-04-02 12:47:52 +00:00
Pratik Naik
adaed1ebcb Adding Hash#without Closes #7369 [eventualbuddha]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@9209 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2008-04-02 11:45:03 +00:00
Geoff Buesing
f4dc834976 TimeWithZone#method_missing: send to utc to advance with dst correctness, otherwise send to time. Adding tests for time calculations methods
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@9208 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2008-04-02 06:56:44 +00:00
Rick Olson
1eb57a6870 Add config.active_support.use_standard_json_time_format setting so that Times and Dates export to ISO 8601 dates. [rick]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@9203 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2008-04-01 20:25:26 +00:00
Geoff Buesing
2ccfcc42b0 TZInfo: Removing unneeded TimezoneProxy class
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@9153 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2008-03-30 23:49:52 +00:00
Geoff Buesing
9c124a98b3 TZInfo: Removing unneeded TimezoneIndexDefinition, since we're not including Indexes::Timezones
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@9152 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2008-03-30 23:27:17 +00:00
Geoff Buesing
458fd10483 Removing unnecessary uses_tzinfo helper from tests, given that TZInfo is now bundled
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@9150 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2008-03-30 23:01:06 +00:00
Geoff Buesing
d4493bc562 Bundling abbreviated version of TZInfo gem 0.3.8: only the classes and zone definitions required to support Rails time zone features are included. If a recent version of the full TZInfo gem is installed, this will take precedence over the bundled version
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@9149 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2008-03-30 22:24:35 +00:00
Geoff Buesing
c62db052a0 config.time_zone and TimeWithZone#marshal_load accept tzinfo/Olson identifiers
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@9108 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2008-03-28 04:35:48 +00:00
Geoff Buesing
59183eec6f Time.zone= accepts TZInfo::Timezone instances and Olson identifiers; wraps result in TimeZone instance
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@9107 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2008-03-28 04:06:47 +00:00