708 Commits

Author SHA1 Message Date
Jeremy Kemper
9d13b9eed8 Fix OrderedHash#inspect recursion 2009-03-04 16:21:44 -08:00
Jeremy Kemper
cb53452438 Fix OrderedHash#to_hash to return self instead of a new hash with self as default value 2009-03-03 19:10:33 -08:00
Guillermo Álvarez
ff1afbd650 Deprecated warnings for :skip_last_command and :connector of to_sentence [#1847 state:committed]
Signed-off-by: David Heinemeier Hansson <david@loudthinking.com>
2009-02-22 16:11:40 +01:00
Jeremy Kemper
69bbbe9068 Broaden URI.unescape fix to all affected 1.9.x by checking for broken behavior instead of specific patchlevel 2009-02-20 18:38:18 -08:00
moro
3b3dbd7973 Ruby 1.9.1p0's URI.decode() bug fix
backport to fix Ruby 1.9.1p0 bug on [ruby-dev:38005].

Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
2009-02-20 18:18:39 -08:00
Akira Matsuda
7c0e008973 Ruby 1.9 compat: fix JSON decoding to work properly with multibyte values
[#1969 state:committed]

Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
2009-02-17 11:58:53 -08:00
Levin Alexander
b91d98011c Remove obsolete silence_warnings wrappers from TZInfo-dependent tests in ActiveSupport [#1914 state:resolved] 2009-02-14 12:22:39 -06:00
Jiri Zajpt
7ed2e6c463 Adding inflection of databases (usually we wouldn't amend the current defaults, but this seems to obvious) [#1942 state:committed]
Signed-off-by: David Heinemeier Hansson <david@loudthinking.com>
2009-02-12 14:31:27 +01:00
Will Bryant
1a2a71333f Array#wrap should use #to_ary so association collections and named scopes are not re-wrapped
[#1935 state:committed]

Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
2009-02-10 18:03:33 -08:00
Zachary Zolton
73c91429a1 Time#to_s(:rfc822) uses #formatted_offset instead of unreliable and non-standard %z directive [#1899 state:resolved] 2009-02-09 22:38:43 -06:00
Levin Alexander
18d6369344 Make TimeWithZone#to_formatted_s an alias to TimeWithZone#to_s [#1796 state:resolved] 2009-02-08 11:36:57 -06:00
Jeremy Kemper
676b0c8764 Introduce Array.wrap(foo) to wrap the argument in an array unless it's already an array. Wraps nil as an empty array. Use instead of Array(foo) and foo.to_a since they treat String as Enumerable. 2009-02-06 10:04:43 -08:00
Jeremy Kemper
7564d98929 Include failed difference expression in assert message 2009-02-06 09:55:32 -08:00
Jeremy Kemper
278186534c Bump mocha requirement for Ruby 1.9 compat. Remove uses_mocha. 2009-02-03 18:40:22 -08:00
Joshua Peek
2e69db18ce Only dup local cache values if duplicable [#1653 state:resolved] 2009-01-28 21:20:46 -06:00
Pratik Naik
39e1ac658e Merge docrails 2009-01-18 18:10:58 +00:00
Lourens Naude
b08c968875 Decouple the local cache strategy from MemCacheStore for reuse with other remote stores [#1653 state:resolved]
Signed-off-by: Joshua Peek <josh@joshpeek.com>
2009-01-17 18:05:48 -06:00
Brandon Keepers
452cd74d81 Dup keys in OrderedHash to prevent them from being modified [#1676 state:resolved]
Signed-off-by: Frederick Cheung <frederick.cheung@gmail.com>
2009-01-16 17:23:43 +00:00
Michael Koziarski
0bed5bdb21 Properly quote json keys.
According to the RFC and the json.org site all json keys must be strings, and those strings must be quoted with double quotes.
[#1755 state:committed]
2009-01-16 17:40:04 +13:00
Nahum Wild
a53ad5bba3 Added in a local per request cache to MemCacheStore. It acts as a buffer to stop unneccessary requests being sent through to memcache [#1653 state:resolved]
Signed-off-by: Joshua Peek <josh@joshpeek.com>
2009-01-15 21:29:32 -06:00
Pratik Naik
5339f813be Change Object#try to raise NoMethodError on private methods and always return nil when Object is nil [Pratik Naik, Lawrence Pit] 2009-01-13 03:28:32 +00:00
Nicholas Dainty
296ca4da17 TimeWithZone#xmlschema accepts optional fraction_digits argument [#1725 state:resolved] 2009-01-11 13:56:07 -06:00
Jeremy Kemper
0f9e65b71f Object#tap for Ruby < 1.8.7 2009-01-07 13:19:48 -08:00
Pratik Naik
17da45b789 Fix JSON decoder date-converter regexp [#1662 state:resolved] [Jonathan del Strother] 2009-01-07 17:51:11 +00:00
gbuesing
d2a1c2778e TimeWithZone#- gives correct result with wrapped DateTime, and with DateTime argument 2009-01-04 13:58:08 -06:00
Joshua Peek
1e45818a62 Allow multiple conditions for callbacks [#1627 state:resolved] 2008-12-28 15:07:17 -06:00
trans
c9d4335418 MaKe Hash#slice! return removed values, akin to Array [#971 state:resolved]
Signed-off-by: Frederick Cheung <frederick.cheung@gmail.com>
2008-12-26 18:25:42 +00:00
Sergio Gil
e8de7a67a5 Add :allow_nil option to delegate [#1127 state:resolved]
Signed-off-by: Pratik Naik <pratiknaik@gmail.com>
2008-12-21 23:24:06 +00:00
Jeremy Kemper
19be3d35b3 Revert "Make constantize look into ancestors"
[#410 state:open]

This reverts commit 262fef7ed5.
2008-12-15 18:20:18 -08:00
Frederick Cheung
262fef7ed5 Make constantize look into ancestors
[#410 state:resolved]

Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
2008-12-15 11:01:04 -08:00
Frederick Cheung
4dcd8f01af Make delete_if/reject faster and fix other mutators
[#1559 state:committed]

Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
2008-12-15 15:34:29 +01:00
Eloy Duran
7394d12dc7 Fixed ActiveSupport::OrderedHash #delete_if, #reject!, and #reject, which did not sync the @keys after the operation.
This probably holds true for other mutating methods as well.

Signed-off-by: Michael Koziarski <michael@koziarski.com>
2008-12-11 14:32:20 +01:00
Frederick Cheung
9f69ff12d4 Squash memory leak when calling flush with an empty buffer
[#1552 state:committed]

Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
2008-12-10 15:07:34 -08:00
Bruce Krysiak
aa5cdb0d47 Added a :camelize option to ActiveRecord and Hash to_xml serialization and from_xml deserialization
Signed-off-by: Michael Koziarski <michael@koziarski.com>
2008-12-10 20:28:05 +01:00
Frederick Cheung
355f41d8aa Rework ActiveSupport::OrderedHash to make lookups faster
[#1352 state:committed]

Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
2008-12-10 09:07:47 -08:00
Jason Cheow
4e60eebae0 Add ActiveSupport::Multibyte::Chars#ord method so that it returns correct Unicode value instead of falling back on String#ord in CoreExtensions, which is not multibyte compatible
[#1483 state:committed]

Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
2008-12-08 16:02:57 -08:00
Akira Matsuda
273c770011 Change Array#to_sentence I18n options to pass comma and space character from outside.
[#1397 state:committed]

Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
2008-12-08 15:53:20 -08:00
Joshua Peek
761a633a9c Add Memoizable#flush_cache to clear the cache of a specific method [#1505 state:resolved] 2008-12-03 10:57:35 -06:00
Jeremy Kemper
2c43a6429e Ruby 1.9 compat: no Unicode normalization support yet 2008-11-26 17:59:35 -08:00
Christoffer Sawicki
05a938c5f7 Added ActiveSupport::OrderedHash#each_key and ActiveSupport::OrderedHash#each_value [#1410 state:resolved]
Signed-off-by: Pratik Naik <pratiknaik@gmail.com>
2008-11-26 14:54:35 +01:00
Michael Koziarski
07abc5efe1 Add a MessageEncryptor, just like MessageVerifier but using symmetric key encryption.
The use of encryption prevents people from seeing any potentially secret values you've used.  It also supports and encrypt_and_sign model to prevent people from tampering with the bits and creating random junk that gets fed to

A motivated coder could use this to add an :encrypt=>true option to the cookie store.
2008-11-25 20:51:30 +01:00
Jeremy Kemper
720ffdc42f Explicitly require Builder in test that uses it 2008-11-24 11:05:54 -08:00
Jeremy Kemper
e06c5bef7f Revert "Hack builder to look for fast_xs instead of insisting on its own String#to_xs"
This reverts commit 5d3712a81e.
2008-11-24 11:05:07 -08:00
Eloy Duran
823b623fe2 Allow optional arguments and/or block for Object#try like Object#send does. [#1425 state:resolved]
Original suggestion by Pat Nakajima.

Signed-off-by: Pratik Naik <pratiknaik@gmail.com>
2008-11-24 18:53:48 +01:00
Jeremy Kemper
e931012287 Require Mocha >= 0.9.3 which includes a MiniTest adapter 2008-11-23 15:05:59 -08:00
Jeremy Kemper
5d3712a81e Hack builder to look for fast_xs instead of insisting on its own String#to_xs 2008-11-23 15:05:57 -08:00
Michael Koziarski
f9b1aa7f4c Don't need _message as it's in the class name already 2008-11-23 16:33:56 +01:00
Michael Koziarski
d460c9a255 Add ActiveSupport::MessageVerifier to aid users who need to store tamper-proof messages in cookies etc.
This is particularly useful for things like remember-me tokens in web applications and auto-unsubscribe links in emails.
2008-11-23 15:33:59 +01:00
Jeremy Kemper
a75354fae1 Ruby 1.9 compat: don't use defined? on complex expressions 2008-11-22 19:19:12 -08:00
Jeremy Kemper
f927a60d0f Require mocha >= 0.9.0 for AS tests 2008-11-22 19:19:12 -08:00