aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/lib/active_support.rb
Commit message (Collapse)AuthorAgeFilesLines
* [Active Support] `rubocop -a --only Layout/EmptyLineAfterMagicComment`Koichi ITO2017-07-111-0/+1
|
* Use frozen-string-literal in ActiveSupportKir Shatrov2017-07-091-0/+1
|
* [Active Support] require => require_relativeAkira Matsuda2017-07-011-5/+5
|
* ActiveSupport::CurrentAttributes provides a thread-isolated attributes ↵David Heinemeier Hansson2017-05-261-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | singleton (#29180) * Add ActiveSupport::CurrentAttributes to provide a thread-isolated attributes singleton * Need to require first * Move stubs into test namespace. Thus they won't conflict with other Current and Person stubs. * End of the line for you, whitespace! * Support super in attribute methods. Define instance level accessors in an included module such that `super` in an overriden accessor works, akin to Active Model. * Spare users the manual require. Follow the example of concerns, autoload in the top level Active Support file. * Add bidelegation support * Rename #expose to #set. Simpler, clearer * Automatically reset every instance. Skips the need for users to actively embed something that resets their CurrentAttributes instances. * Fix test name; add tangible name value when blank. * Try to ensure we run after a request as well. * Delegate all missing methods to the instance This allows regular `delegate` to serve, so we don't need bidelegate. * Properly test resetting after execution cycle. Also remove the stale puts debugging. * Update documentation to match new autoreset
* deprecate `halt_callback_chains_on_return_false` instead of ↵yuuji.yaginuma2017-02-081-2/+6
| | | | | | | | | | | | | | `halt_and_display_warning_on_return_false` `halt_and_display_warning_on_return_false` is not a public API and application is using `halt_callback_chains_on_return_false`. https://github.com/rails/rails/blob/5-0-stable/railties/lib/rails/generators/rails/app/templates/config/initializers/new_framework_defaults.rb.tt#L29 https://github.com/rails/rails/blob/5-0-stable/activesupport/lib/active_support.rb#L86..L88 Therefore, deprecate messages should be issued for `halt_callback_chains_on_return_false` instead of `halt_and_display_warning_on_return_false`.
* Bump license years for 2017Jon Moss2016-12-311-1/+1
| | | | | | | | Per https://www.timeanddate.com/counters/firstnewyear.html, it's already 2017 in a lot of places, so we should bump the Rails license years to 2017. [ci skip]
* applies new string literal convention in activesupport/libXavier Noria2016-08-061-1/+1
| | | | | The current code base is not uniform. After some discussion, we have chosen to go with double quotes by default.
* Add compatibility for Ruby 2.4 `to_time` changesAndrew White2016-04-231-0/+9
| | | | | | | | | | | | | | | In Ruby 2.4 the `to_time` method for both `DateTime` and `Time` will preserve the timezone of the receiver when converting to an instance of `Time`. Since Rails 5.0 will support Ruby 2.2, 2.3 and later we need to introduce a compatibility layer so that apps that upgrade do not break. New apps will have a config initializer file that defaults to match the new Ruby 2.4 behavior going forward. For information about the changes to Ruby see: https://bugs.ruby-lang.org/issues/12189 https://bugs.ruby-lang.org/issues/12271 Fixes #24617.
* Publish AS::Executor and AS::Reloader APIsMatthew Draper2016-03-021-0/+3
| | | | | | These should allow external code to run blocks of user code to do "work", at a similar unit size to a web request, without needing to get intimate with ActionDipatch.
* Update copyright notices to 2016 [ci skip]Rashmi Yadav2015-12-311-1/+1
|
* renames AS::FileEventedUpdateChecker to AS::EventedFileUpdateCheckerXavier Noria2015-12-091-1/+1
| | | | Better English.
* implements an evented file update checker [Puneet Agarwal]Xavier Noria2015-11-081-0/+1
| | | | | | | | | | | | This is the implementation of the file update checker written by Puneet Agarwal for GSoC 2015 (except for the tiny version of the listen gem, which was 3.0.2 in the original patch). Puneet's branch became too out of sync with upstream. This is the final work in one single clean commit. Credit goes in the first line using a convention understood by the contrib app.
* Refactor AS::Callbacks halt config and fix the documentationRoque Pinel2015-10-011-2/+2
| | | | | | | | | Move from `AS::Callbacks::CallbackChain.halt_and_display_warning_on_return_false` to `AS::Callbacks.halt_and_display_warning_on_return_false` base on [this discussion](https://github.com/rails/rails/pull/21218#discussion_r39354580) Fix the documentation broken by 0a120a818d413c64ff9867125f0b03788fc306f8
* Avoid to define an initializer after the load_config_initializersRafael Mendonça França2015-04-071-0/+8
| | | | | This make the config/initializers run before the railties are loaded what can break some configurations.
* Add ActiveSupport::ArrayInquirer and Array#inquiryGeorge Claghorn2015-03-241-0/+1
| | | | | | | | | | | | | | | | | | | | | | Wrapping an array in an `ArrayInquirer` gives a friendlier way to check its string-like contents. For example, `request.variant` returns an `ArrayInquirer` object. To check a request's variants, you can call: request.variant.phone? request.variant.any?(:phone, :tablet) ...instead of: request.variant.include?(:phone) request.variant.any? { |v| v.in?([:phone, :tablet]) } `Array#inquiry` is a shortcut for wrapping the receiving array in an `ArrayInquirer`: pets = [:cat, :dog] pets.cat? # => true pets.ferret? # => false pets.any?(:cat, :ferret} # => true
* Merge pull request #18090 from egilburg/patch-3Rafael Mendonça França2015-01-041-9/+1
|\ | | | | | | simplify ActiveSupport.test_order definition
| * simplify ActiveSupport.test_order definitionEugene Gilburg2014-12-181-9/+2
| |
* | Update copyright notices to 2015 [ci skip]Arun Agrawal2014-12-311-1/+1
|/
* Add docs for AS::TestCase::test_orderclaudiob2014-12-181-2/+2
| | | | | | Document `test_order` and `test_order=` from `ActiveSupport::TestCase`. [ci skip]
* Define the configuration at Active SupportRafael Mendonça França2014-09-111-0/+10
|
* update copyright notices to 2014. [ci skip]Vipul A M2014-01-011-1/+1
|
* Make load of NumberHelper thread safeRafael Mendonça França2013-12-021-0/+7
|
* Remove deprecated AS::BasicObject, use AS::ProxyObject insteadCarlos Antonio da Silva2013-07-011-1/+0
|
* Updated copyright notices for 2013Andrew Nesbitt2012-12-311-1/+1
|
* Rename ActiveSupport::BasicObject to ActiveSupport::ProxyObjectFrancesco Rodriguez2012-12-071-0/+1
| | | | | AS::BasicObject is used for proxy classes. Let's give it a less concerning name. Also, it avoids the confusion with Ruby's Basic Object.
* Add ActiveSupport::KeyGenerator as a simple wrapper around PBKDF2Michael Koziarski2012-10-011-0/+1
| | | | | | This will be used to derive keys from the secret and a salt, in order to allow us to do things like encrypted cookie stores without using the secret for multiple purposes directly.
* Make ActiveSupport::Autoload localJosé Valim2012-08-211-2/+1
| | | | | | | Previously, ActiveSupport::Autoload was global and reserved for usage inside Rails. This pull request makes it local, fixes its test (they were not being run because its file was named wrongly) and make it part of Rails public API.
* Fix the buildSantiago Pastorino2012-05-221-0/+1
|
* require active_support/lazy_load_hooks where is neededSantiago Pastorino2012-05-221-1/+0
|
* refactor lazy_load_hooks load positionJan Xie2012-05-221-0/+1
|
* Removed ActiveSupport#load_all!Pan Thomakos2012-03-181-14/+1
| | | | | | This is no longer used and actually raises an error when trying to load `ActiveSupport::Dependencies`. I removed the related code and added the `Dependencies` module to the autoload list.
* remove ActiveSupport::Base64 in favor of ::Base64Sergey Nartimov2012-01-021-1/+0
|
* Merge pull request #4248 from andrew/2012Vijay Dev2011-12-311-1/+1
|\ | | | | Updated copyright notices for 2012
| * Updated copyright notices for 2012Andrew Nesbitt2011-12-311-1/+1
| |
* | Update activesupport/lib/active_support.rbJosé Valim2011-12-221-1/+1
| |
* | Remove deprecations from Active Support.José Valim2011-12-201-1/+0
| |
* | * BufferedLogger is deprecated. Use ActiveSupport::Logger, or the loggerAaron Patterson2011-12-191-1/+1
| | | | | | | | from Ruby stdlib.
* | Added X-Request-Id tracking and TaggedLogging to easily log that and other ↵David Heinemeier Hansson2011-10-191-0/+1
|/ | | | production concerns
* Removed ActiveSupport::SecureRandom in favour of SecureRandom from the ↵Jon Leighton2011-05-231-1/+0
| | | | standard library. (It has been deprecated in the 3-1-stable branch.)
* Replace references to ActiveSupport::SecureRandom with just SecureRandom, ↵Jon Leighton2011-05-231-1/+3
| | | | and require 'securerandom' from the stdlib when active support is required.
* Update copyright year in Active Resource and Active SupportVijay Dev2011-05-091-1/+1
| | | | Signed-off-by: Santiago Pastorino <santiago@wyeworks.com>
* File watcher won't make the cut for 3.1. Maybe on 3.2.José Valim2011-04-231-1/+0
|
* Add initial FileWatcher implementation. The Backend is just an abstract ↵wycats2011-02-061-0/+1
| | | | implementation, which will be inherited by backends that do the heavy lifting.
* Always pull in version for frameworks (standardize autoload / require / none)wycats2010-10-101-1/+1
|
* Make ActiveSupport load own version.Barry Sears2010-10-101-0/+1
| | | | | | [#5739 state:committed] Signed-off-by: Santiago Pastorino <santiago@wyeworks.com>
* Move Rails::LogSubscriber to ActiveSupport::LogSubscriber, allowing ↵José Valim2010-06-241-1/+2
| | | | frameworks like ActiveRecord and ActiveResource to log outsude Rails::Application [#4816 state:resolved]
* Add ActiveSupport::FileUpdateChecker.José Valim2010-06-201-1/+3
|
* Add ActiveSupport::DescendantsTracker.José Valim2010-06-191-0/+1
|
* Make many parts of Rails lazy. In order to facilitate this,wycats2010-03-071-0/+3
| | | | | | | | | | | | add lazy_load_hooks.rb, which allows us to declare code that should be run at some later time. For instance, this allows us to defer requiring ActiveRecord::Base at boot time purely to apply configuration. Instead, we register a hook that should apply configuration once ActiveRecord::Base is loaded. With these changes, brings down total boot time of a new app to 300ms in production and 400ms in dev. TODO: rename base_hook
* For performance reasons, you can no longer call html_safe! on Strings. ↵Yehuda Katz2010-01-311-0/+1
| | | | | | | | | | | | Instead, all Strings are always not html_safe?. Instead, you can get a SafeBuffer from a String by calling #html_safe, which will SafeBuffer.new(self). * Additionally, instead of doing concat("</form>".html_safe), you can do safe_concat("</form>"), which will skip both the flag set, and the flag check. * For the first pass, I converted virtually all #html_safe!s to #html_safe, and the tests pass. A further optimization would be to try to use #safe_concat as much as possible, reducing the performance impact if we know up front that a String is safe.