aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport
Commit message (Collapse)AuthorAgeFilesLines
* Add missing require to with_options [#4601 state:resolved]Carlos Antonio da Silva2010-05-151-0/+2
| | | | Signed-off-by: José Valim <jose.valim@gmail.com>
* Better code formatting and proper line numbers for stack tracesNeeraj Singh2010-05-141-1/+1
| | | | | | [#4596 state:resolved] Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
* defines prev_(month|year) in Date and Time to ease transition to 1.9, and ↵Xavier Noria2010-05-126-25/+64
| | | | deprecates last_(month|year)
* aliases Date#sunday to Date#end_of_week, for symmetry with existing alias ↵Xavier Noria2010-05-092-0/+3
| | | | Date#monday -> Date#beginning_of_week
* adds calendar reform test coverage for more relevant date calculationsXavier Noria2010-05-091-1/+14
|
* Backports Date#>> from 1.9 so that calculations do the right thing around ↵Xavier Noria2010-05-093-0/+47
| | | | | | | | | | 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.
* add test coverage for (last|next)_year on leap yearsXavier Noria2010-05-081-0/+8
|
* adds Date#to_time refinement from previous commit to the CHANGELOGXavier Noria2010-05-051-0/+2
|
* let Time.time_with_datetime_fallback handle properly years in the range 0..138Xavier Noria2010-05-055-4/+30
|
* date/conversions needs time/calculations for (utc|local)_timeXavier Noria2010-05-031-0/+1
|
* BigDecimal#as_json does not really specify the F format, it delegates that ↵Xavier Noria2010-05-031-1/+3
| | | | to whatever BigDecimal#to_s default format is, do the same in its test
* adds a comment explaining why BigDecimal#as_json returns a JSON stringXavier Noria2010-05-031-1/+9
|
* fixes colon in previous YAML exampleXavier Noria2010-05-031-1/+1
|
* Fix transliteration rule example in docs. [#4526 state:resolved]Norman Clarke2010-05-031-2/+3
| | | | Signed-off-by: Xavier Noria <fxn@hashref.com>
* Update I18n gem to 0.4.0.beta1 [#4525 state:resolved].José Valim2010-05-031-1/+1
|
* adds test coverage for Date.current vs Date.today in ↵Xavier Noria2010-05-031-1/+45
| | | | Date.(yesterday|tomorrow) implementation
* Event should be aware if yielded block failed or not.José Valim2010-05-022-3/+7
|
* Change event namespace ordering to most-significant first [#4504 state:resolved]Justin George2010-05-021-1/+1
| | | | | | | | | More work still needs to be done on some of these names (render_template.action_view and render_template!.action_view particularly) but this allows (for example) /^sql/ to subscribe to all the various ORMs without further modification Signed-off-by: José Valim <jose.valim@gmail.com>
* Make notifications go off even when an error is raised, so that we capture ↵Justin George2010-05-022-5/+9
| | | | | | | | | | | | | | 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>
* Missing require added make pass activesupport/test/json/encoding_test.rb in ↵Santiago Pastorino2010-05-021-0/+1
| | | | | | isolation Signed-off-by: Xavier Noria <fxn@hashref.com>
* revises tests for Date.yesterday and Date.tomorrowXavier Noria2010-05-021-3/+3
|
* let Date.yesterday and Date.tomorrow be based on Date.current rather than ↵Xavier Noria2010-05-021-2/+2
| | | | Date.today
* Speed up I18n helpers in views and add entry to CHANGELOG.José Valim2010-05-011-0/+2
|
* repair the activesupport message encryptor tests for me, do so in the same ↵Marius Nuennerich2010-05-011-0/+10
| | | | | | | | way as jeremy did with message verifier [#4517 state:committed] Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
* Depend on the I18n 0.4.0.beta.José Valim2010-04-301-1/+1
|
* Delegate Inflector.transliterate to i18n. [#4508 state:resolved]Norman Clarke2010-04-303-89/+101
| | | | | | | Ancillary changes: Moved Chars#normalize into a class method; removed unused UTF_PAT constant. Signed-off-by: José Valim <jose.valim@gmail.com>
* Move several configuration values from Hash to ActiveSupport::XmlMini, which ↵José Valim2010-04-297-169/+162
| | | | | | 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.
* array.to_xml should be able to handle all types of data elements [#4490 ↵Neeraj Singh2010-04-296-70/+79
| | | | | | state:resolved] Signed-off-by: José Valim <jose.valim@gmail.com>
* The rake task :environment now loads config/environment.rb instead of ↵José Valim2010-04-291-5/+7
| | | | initializing the application on its own. This fixes [#4492 state:resolved] and also avoids the application being initialized twice in some rake tasks.
* object_id may be negative, producing an invalid symbol. h/t Markus SchirpJeremy Kemper2010-04-281-1/+1
|
* Fix BigDecimal JSON encoding test. [#4495 state:resolved]Cezary Baginski2010-04-281-3/+3
| | | | Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
* ActiveSupport::Cache refactoringBrian Durand2010-04-279-509/+1403
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* use ordinary syntax for options to be well-formed in 1.8Xavier Noria2010-04-271-1/+1
|
* JSON: encode objects that don't have a native JSON representation using ↵Jeremy Kemper2010-04-263-7/+43
| | | | 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.
* Use explicit source encoding rather than forced UTF-8 from US-ASCII.Santiago Pastorino2010-04-263-3/+4
| | | | Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
* Use Config::CONFIG['host_os'] instead of RUBY_PLATFORM [#4477 state:resolved]Anil Wadghule2010-04-262-2/+4
| | | | Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
* Action Pack: fix tests with -K*, work around Ruby 1.9.1 constant lookup.Cezary Baginski2010-04-251-2/+2
| | | | | | [#4473 state:committed] Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
* allow unsubscribe by name or subscription [#4433 state:resolved]David Chelimsky2010-04-242-5/+37
| | | | Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
* HWIA relies on Hash#symbolize_keys and #stringify_keys extensions.Santiago Pastorino2010-04-221-0/+2
| | | | Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
* Change HWIA#stringify_keys to return a HWIA not a HashJeremy Kemper2010-04-222-1/+4
|
* Restore HWIA#stringify_keys! and update changelogJeremy Kemper2010-04-223-5/+7
|
* HWIA delegates to to_hash symbolize_keys and stringify_keys and bang methods ↵Santiago Pastorino2010-04-222-4/+40
| | | | | | are not in the api Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
* Clean up the config object in ActionPack. Create config_accessor which just ↵José Valim2010-04-222-18/+61
| | | | delegates to the config object, reducing the number of deprecations and add specific tests.
* updates String#to_(date|date_time|time) to return nil for blank stringsDaniel Neighman2010-04-212-3/+9
|
* TimeZones lazy loadSantiago Pastorino2010-04-201-24/+9
| | | | Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
* Switch to TimezoneProxy for later support of deferred TZ loadingJeremy Kemper2010-04-203-9/+10
|
* Missing requires addedSantiago Pastorino2010-04-201-0/+3
| | | | Signed-off-by: Xavier Noria <fxn@hashref.com>
* much complete rdoc for String#ordXavier Noria2010-04-191-3/+19
|
* revises the rdoc of String#ordXavier Noria2010-04-191-1/+5
|
* MemoryStore#read_multi(*keys) for dev-mode compatibility with memcache storeJeremy Kemper2010-04-192-1/+14
|