Commit Graph

1103 Commits

Author SHA1 Message Date
Xavier Noria
69fec3ab3f adds parens to silence a warning in the test suite of AS 2010-06-20 23:29:37 +02:00
José Valim
71703c98ba Add ActiveSupport::FileUpdateChecker. 2010-06-20 13:26:42 +02:00
Norman Clarke
667522ca98 Adds titleize/titlecase to AS::Multibyte::Chars
[#2794 state:resolved]

Signed-off-by: José Valim <jose.valim@gmail.com>
2010-06-20 00:51:19 +02:00
José Valim
d430db9fd4 Remove descendants warning while executing tests. 2010-06-19 17:16:11 +02:00
José Valim
a2b7fcb07c Change callbacks to automatically include DescendantsTracker and rename descendents to descendants. 2010-06-19 16:58:15 +02:00
José Valim
8db8c6f4ce Add ActiveSupport::DescendantsTracker. 2010-06-19 16:44:35 +02:00
Aaron Patterson
5ae7a9d31d when the timezone is nil, a TimeWithZone object should not be constructed. [#4881 state:resolved]
Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
2010-06-17 14:14:30 -07:00
Xavier Noria
36143d26cb revises implementation of AS::OrderedHash#merge! 2010-06-13 06:37:54 +02:00
Xavier Noria
3359af63a5 Revert "hash merging with a block ignores non-existing keys altogether"
This reverts commit 72f9fec607c4a72b2e88995d0cb32b16b96e9068.

It is wrong, this feature is a little undocumented, doing some research.
2010-06-13 05:53:42 +02:00
Xavier Noria
72f9fec607 hash merging with a block ignores non-existing keys altogether 2010-06-13 05:09:31 +02:00
Paul Barry
9183eaebed re-organized test for merge into separate tests
Signed-off-by: Xavier Noria <fxn@hashref.com>
2010-06-13 04:19:35 +02:00
Paul Mucur
58e21a4a0d Support passing a block to ActiveSupport::OrderedHash's merge and merge! [#4838 state:committed]
For better consistency with Ruby's own Hash implementation.

Signed-off-by: Xavier Noria <fxn@hashref.com>
2010-06-13 04:19:35 +02:00
Geoff Buesing
4146a443b6 Date#since, #ago, #beginning_of_day, #end_of_day, #xmlschema return TimeWithZone when Time.zone_default is set
Signed-off-by: Xavier Noria <fxn@hashref.com>
2010-06-12 00:19:12 +02:00
Jeremy Kemper
ed61c3b640 Remove String#constantize deps 2010-06-11 10:33:43 -07:00
wycats
b97a3f33a3 Merge remote branch 'rsim/oracle_enhanced_rails3' 2010-06-07 23:03:59 -04:00
Xavier Noria
8c7730db02 oops, two cancelling errors made a previous test pass, fixing it 2010-06-07 07:27:51 +02:00
Xavier Noria
d96efe6368 the order in which we apply deltas in Date#advance matters, add test coverage for that 2010-06-07 06:59:09 +02:00
Jeremy Kemper
fd1a504136 ActiveSupport::Dependencies.constantize shortcut for caching named constant lookups 2010-06-05 22:05:58 -07:00
wycats
a6b3942843 Optimize LookupContext 2010-06-04 20:11:06 -07:00
Xavier Noria
67a43554f1 removes Array#random_element and backports Array#sample from Ruby 1.9, thanks to Marc-Andre Lafortune 2010-06-05 01:15:17 +02:00
Raimonds Simanovskis
5fcaf91761 fix conditions when DateTime#to_date and DateTime#xmlschema methods are defined 2010-06-04 22:44:03 +03:00
David Heinemeier Hansson
d57397c4b6 Extracted String#truncate from TextHelper#truncate [DHH] 2010-06-01 16:38:42 -05:00
Santiago Pastorino
78fffac668 Fix test incorrectly using a bare assert to use assert_kind_of
Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
2010-05-24 20:59:53 -07:00
Norman Clarke
f3abc8ac36 Use multibyte proxy class on 1.9, refactor Unicode.
Makes String#mb_chars on Ruby 1.9 return an instance of ActiveSupport::Multibyte::Chars to work around 1.9's lack of Unicode case folding.

Refactors class methods from ActiveSupport::Multibyte::Chars into new Unicode module, adding other related functionality for consistency.

[#4594 state:resolved]

Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
2010-05-21 12:24:54 -07:00
Neeraj Singh
cc45a1068f 1.day should respond_to kind_of too
[#4656 state:resolved]

Signed-off-by: José Valim <jose.valim@gmail.com>
2010-05-21 16:00:55 +02:00
Santiago Pastorino
aacf2581cd refactor evals and adds some __FILE__ and __LINE__
Signed-off-by: José Valim <jose.valim@gmail.com>
2010-05-20 15:18:57 +02:00
Neeraj Singh
39a246f545 Final iteration of use better testing methods
[#4652 state:resolved]

Signed-off-by: José Valim <jose.valim@gmail.com>
2010-05-19 21:31:51 +02:00
Xavier Noria
b753b4a076 removes deprecations of last_(month|year) from master, they will be deprecated in 2.3 instead 2010-05-19 00:20:10 +02:00
Neeraj Singh
0dab076a08 Better error messages for some of ActiveSupport tests
[#4635 state:resolved]

Signed-off-by: José Valim <jose.valim@gmail.com>
2010-05-18 16:12:59 +02:00
Rizwan Reza
8c5e1652c7 Renames Array#rand -> Array#random_element
Signed-off-by: Xavier Noria <fxn@hashref.com>
2010-05-17 23:03:16 +02:00
wycats
80b60671f7 Revert "Moved encoding work in progress to a feature branch."
This reverts commit ade756fe42423033bae8e5aea8f58782f7a6c517.
2010-05-17 19:41:54 +04:00
Jeremy Kemper
ade756fe42 Moved encoding work in progress to a feature branch.
This reverts commits af0d1a88157942c6e6398dbf73891cff1e152405 and 64d109e3539ad600f58536d3ecabd2f87b67fd1c.
2010-05-16 13:55:29 -07:00
Santiago Pastorino
821e15e5f2 Change on Array extension from rand => random_element [#4555 state:committed]
Signed-off-by: Xavier Noria <fxn@hashref.com>
2010-05-16 22:23:44 +02:00
wycats
af0d1a8815 Initial work to improve the state of encodings for templates 2010-05-16 22:43:35 +04:00
Santiago Pastorino
fdfebb7782 Make use of assert_equal to test equallity between object assert expects and object and a message of error
[#4611 state:committed]

Signed-off-by: José Valim <jose.valim@gmail.com>
2010-05-16 16:06:28 +02:00
wycats
9cfeefb637 Reorganized initializers a bit to enable better hooks for common cases without the need for Railtie. Specifically, the following hooks were added:
* before_configuration: this hook is run immediately after the Application class 
  comes into existence, but before the user has added any configuration. This is
  the appropriate place to set configuration for your plugin
* before_initialize: This is run after all of the user's configuration has completed,
  but before any initializers have begun (in other words, it runs right after
  config/environments/{development,production,test}.rb)
* after_initialize: This is run after all of the initializers have run. It is an
  appropriate place for forking in a preforking setup

Each of these hooks may be used via ActiveSupport.on_load(name) { }. In all these cases, the context inside the block will be the Application object. This means that for simple cases, you can use these hooks without needing to create a Railtie.
2010-05-15 06:09:07 -07:00
Xavier Noria
2203c781a7 defines prev_(month|year) in Date and Time to ease transition to 1.9, and deprecates last_(month|year) 2010-05-12 23:04:17 +02:00
Xavier Noria
2969543cef adds calendar reform test coverage for more relevant date calculations 2010-05-09 10:26:21 +02:00
Xavier Noria
636ffa1f08 Backports Date#>> from 1.9 so that calculations do the right thing around the calendar reform
Our next_month gives November for some late dates in September of 1582.
Related methods, last_*, and in general advance have the same issues.
This commit fixes those, see the test suite for expected behavior, which
we still run in 1.9 to ensure it matches as we do with other methods
defined in Date in 1.9.
2010-05-09 01:20:23 +02:00
Xavier Noria
7184a9e643 add test coverage for (last|next)_year on leap years 2010-05-08 18:46:15 +02:00
Xavier Noria
53c1cd6cde let Time.time_with_datetime_fallback handle properly years in the range 0..138 2010-05-05 00:35:06 +02:00
Xavier Noria
5d7d0c2fa3 BigDecimal#as_json does not really specify the F format, it delegates that to whatever BigDecimal#to_s default format is, do the same in its test 2010-05-03 22:11:33 +02:00
Xavier Noria
0e00f428a8 adds test coverage for Date.current vs Date.today in Date.(yesterday|tomorrow) implementation 2010-05-03 00:03:32 +02:00
José Valim
a76c7e68d5 Event should be aware if yielded block failed or not. 2010-05-02 22:45:54 +02:00
Justin George
109d3ee38d Make notifications go off even when an error is raised, so that we capture the underlying performance data [#4505 state:resolved]
This is important when trying to keep track of many layers of interrelated calls

i.e.:

ActiveRecord::Base.transaction do
  MyModel.find(1) #ActiveRecord::NotFound
end # should capture the full time until the error propagation

Signed-off-by: José Valim <jose.valim@gmail.com>
2010-05-02 22:45:53 +02:00
Xavier Noria
1b33a151b2 revises tests for Date.yesterday and Date.tomorrow 2010-05-02 01:36:10 +02:00
Marius Nuennerich
35598db01a repair the activesupport message encryptor tests for me, do so in the same way as jeremy did with message verifier
[#4517 state:committed]

Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
2010-05-01 10:04:01 -07:00
Norman Clarke
f0e754e713 Delegate Inflector.transliterate to i18n. [#4508 state:resolved]
Ancillary changes: Moved Chars#normalize into a class method; removed
unused UTF_PAT constant.

Signed-off-by: José Valim <jose.valim@gmail.com>
2010-04-30 16:18:12 +02:00
Neeraj Singh
580dd3b052 array.to_xml should be able to handle all types of data elements [#4490 state:resolved]
Signed-off-by: José Valim <jose.valim@gmail.com>
2010-04-29 09:04:34 +02:00
Cezary Baginski
1067a7be52 Fix BigDecimal JSON encoding test. [#4495 state:resolved]
Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
2010-04-28 09:02:03 -07:00