Commit Graph

629 Commits

Author SHA1 Message Date
Andrew White
f1966337fa Add before_remove_const callback to ActiveSupport::Dependencies.remove_unloadable_constants!
Signed-off-by: Xavier Noria <fxn@hashref.com>
2010-09-01 22:32:41 +02:00
Jeremy Kemper
b861942691 Update CHANGELOGs for 3.0 release and upcoming 3.1 2010-08-29 22:06:48 -07:00
Xavier Noria
475ea14fd0 implements String#strip_heredoc 2010-08-29 23:52:38 +02:00
Mike Perham
390d285ef6 Support pluggable cache stores.
[#5486 state:committed]

Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
2010-08-28 15:43:10 -07:00
Santiago Pastorino
b451de0d6d Deletes trailing whitespaces (over text files only find * -type f -exec sed 's/[ \t]*$//' -i {} \;) 2010-08-14 04:12:33 -03:00
Paco Guzman
8a2b69b727 applied guidelines to "# =>" 2010-08-12 17:09:58 +02:00
David Heinemeier Hansson
856fc4bbc3 Prep for RC 2010-07-26 12:53:25 -05:00
Santiago Pastorino
9a32af96d1 CHANGELOG updated Object#returning removed
Signed-off-by: José Valim <jose.valim@gmail.com>
2010-07-25 23:30:36 +02:00
wycats
c1beeb4068 Add CHANGELOG for new deprecation style 2010-06-29 12:25:13 -07:00
Xavier Noria
6f83a5036d renames load_(once_)paths to autoload_(once_)paths in dependencies and config 2010-06-24 00:17:28 +02:00
José Valim
50d37a7606 Update ActiveSupport CHANGELOG with latest changes. 2010-06-20 14:47:56 +02:00
Xavier Noria
36143d26cb revises implementation of AS::OrderedHash#merge! 2010-06-13 06:37:54 +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
Xavier Noria
f28d5cfbe6 registers 4146a44 in CHANGELOG 2010-06-12 22:16:57 +02:00
David Heinemeier Hansson
32d4330b81 Get ready for beta 4 2010-06-08 14:47:02 -04: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
David Heinemeier Hansson
d57397c4b6 Extracted String#truncate from TextHelper#truncate [DHH] 2010-06-01 16:38:42 -05: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
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
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
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
df508bd970 aliases Date#sunday to Date#end_of_week, for symmetry with existing alias Date#monday -> Date#beginning_of_week 2010-05-09 11:16:34 +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
f2072a323c adds Date#to_time refinement from previous commit to the CHANGELOG 2010-05-05 00:48:31 +02:00
José Valim
a61a6d206b Speed up I18n helpers in views and add entry to CHANGELOG. 2010-05-01 22:38:57 +02:00
José Valim
2e9af3638d Move several configuration values from Hash to ActiveSupport::XmlMini, which both Hash and Array depends on.
Also, refactored ActiveModel serializers to just use ActiveSupport::XmlMini.to_tag. As consequence, if a serialized attribute is an array or a hash, it's not encoded as yaml, but as a hash or array.
2010-04-29 12:42:42 +02:00
Brian Durand
ee51b51b60 ActiveSupport::Cache refactoring
All Caches

* Add default options to initializer that will be sent to all read, write, fetch, exist?, increment, and decrement
* Add support for the :expires_in option to fetch and write for all caches. Cache entries are stored with the create timestamp and a ttl so that expiration can be handled independently of the implementation.
* Add support for a :namespace option. This can be used to set a global prefix for cache entries.
* Deprecate expand_cache_key on ActiveSupport::Cache and move it to ActionController::Caching and ActionDispatch::Http::Cache since the logic in the method used some Rails specific environment variables and was only used by ActionPack classes. Not very DRY but there didn't seem to be a good shared spot and ActiveSupport really shouldn't be Rails specific.
* Add support for :race_condition_ttl to fetch. This setting can prevent race conditions on fetch calls where several processes try to regenerate a recently expired entry at once.
* Add support for :compress option to fetch and write which will compress any data over a configurable threshold.
* Nil values can now be stored in the cache and are distinct from cache misses for fetch.
* Easier API to create new implementations. Just need to implement the methods read_entry, write_entry, and delete_entry instead of overwriting existing methods.
* Since all cache implementations support storing objects, update the docs to state that ActiveCache::Cache::Store implementations should store objects. Keys, however, must be strings since some implementations require that.
* Increase test coverage.
* Document methods which are provided as convenience but which may not be universally available.

MemoryStore

* MemoryStore can now safely be used as the cache for single server sites.
* Make thread safe so that the default cache implementation used by Rails is thread safe. The overhead is minimal and it is still the fastest store available.
* Provide :size initialization option indicating the maximum size of the cache in memory (defaults to 32Mb).
* Add prune logic that removes the least recently used cache entries to keep the cache size from exceeding the max.
* Deprecated SynchronizedMemoryStore since it isn't needed anymore.

FileStore

* Escape key values so they will work as file names on all file systems, be consistent, and case sensitive
* Use a hash algorithm to segment the cache into sub directories so that a large cache doesn't exceed file system limits.
* FileStore can be slow so implement the LocalCache strategy to cache reads for the duration of a request.
* Add cleanup method to keep the disk from filling up with expired entries.
* Fix increment and decrement to use file system locks so they are consistent between processes.

MemCacheStore

* Support all keys. Previously keys with spaces in them would fail
* Deprecate CompressedMemCacheStore since it isn't needed anymore (use :compress => true)

[#4452 state:committed]

Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
2010-04-27 11:13:37 -07:00
Jeremy Kemper
c1d7327071 JSON: encode objects that don't have a native JSON representation using to_hash, if available, instead of instance_values (the old fallback) or to_s (other encoders' default). Encode BigDecimal and Regexp encode as strings to conform with other encoders. Try to transcode non-UTF-8 strings. 2010-04-26 19:55:39 -07:00
Jeremy Kemper
d692e6be30 Restore HWIA#stringify_keys! and update changelog 2010-04-22 10:00:23 -07:00
David Heinemeier Hansson
4c8af9bf51 Update changelogs for release 2010-04-13 12:14:54 -07:00
Norman Clarke
dceef0828a Improve reliability of Inflector.transliterate. [#4374 state:resolved]
Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
2010-04-12 23:19:39 -07:00
Norman Clarke
e416f1d0ab Make tidy_bytes work on 1.9 and improve its performance. [#4350 state:resolved]
Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
2010-04-09 10:30:37 -07:00
David Heinemeier Hansson
f0364d87f0 Release is today, yo 2010-04-01 14:20:03 -07:00
wycats
c1883e75b3 Updated changelogs to differentiate beta1 and beta2 2010-04-01 14:04:55 -07:00
wycats
d2a48852a1 Updated changelogs 2010-04-01 13:55:06 -07:00
Xavier Noria
1412ad437e adds and entry for assert_blank and assert_present to CHANGELOG 2010-03-30 15:54:20 -07:00
Jeremy Kemper
f7b0a857e9 Use Object#singleton_class instead of #metaclass. Prefer Ruby's choice. 2010-02-25 09:32:29 -08:00
Jeremy Kemper
63bb955a99 Automatically prefer Yajl or JSON backend over Yaml, if available 2010-02-05 10:22:45 -08:00
Brian Lopez
a96bf4ab5e Add yajl-ruby as a JSON parsing backend
[#2666 state:committed]

Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
2010-02-05 10:15:51 -08:00
Jeremy Kemper
8ae25a8e41 Introduce class_attribute to declare inheritable class attributes. Writing an attribute on a subclass behaves just like overriding the superclass reader method. Unifies and replaces most usage of cattr_accessor, class_inheritable_attribute, superclass_delegating_attribute, and extlib_inheritable_attribute. 2010-02-01 02:02:41 -08:00
Geoff Buesing
e98f9579c4 Time#- with a DateTime argument behaves the same as with a Time argument, i.e. returns the difference between self and arg as a Float [#3476 status:resolved] 2010-01-27 20:17:09 -06:00
Jeremy Kemper
030ab357f9 Remove unbundle changelogs 2010-01-27 17:11:29 -08:00
Mikel Lindsaar
c1f308f8c6 Unvendor'd MemCache-Client. Now requires the MemCache Client gem as a dependency - Don't forget to gem bundle buys and girls 2010-01-28 11:56:47 +11:00
Mikel Lindsaar
f1fe71d754 Unvendor'd Builder. Now requires the Builder gem as a dependency 2010-01-28 11:51:37 +11:00
Mikel Lindsaar
9029efce41 Unbundling TZInfo 2010-01-28 11:46:54 +11:00
Gregor Schmidt
7b8c6472ff Adding custom yaml (de-)serialization for OrderedHash
[#3608 state:committed]

Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
2010-01-27 15:29:06 -08:00
Geoff Buesing
f3caa63bcb Update bundled TZInfo to v0.3.16 2010-01-26 20:22:29 -06:00
Geoff Buesing
1cda85d08a Georgetown TimeZone is now mapped to "America/Guyana" instead of "America/Argentina/San_Juan" [#1821 status:resolved] 2010-01-26 20:18:17 -06:00
David Heinemeier Hansson
6042067c0b Changed the default ActiveSupport.use_standard_json_time_format from false to true and
ActiveSupport.escape_html_entities_in_json from true to false to match previously announced Rails 3 defaults [DHH]
2010-01-03 19:20:43 -08:00
David Heinemeier Hansson
1c47d04ea5 Added Object#presence that returns the object if it's #present? otherwise returns nil [DHH/Colin Kelley] 2009-12-27 17:54:43 -08:00