aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/lib/active_support.rb
Commit message (Collapse)AuthorAgeFilesLines
* Refactor after the most recent code reviewGenadi Samokovarov2019-04-191-1/+1
|
* Introduce Actionable ErrorsGenadi Samokovarov2019-04-191-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Actionable errors let's you dispatch actions from Rails' error pages. This can help you save time if you have a clear action for the resolution of common development errors. The de-facto example are pending migrations. Every time pending migrations are found, a middleware raises an error. With actionable errors, you can run the migrations right from the error page. Other examples include Rails plugins that need to run a rake task to setup themselves. They can now raise actionable errors to run the setup straight from the error pages. Here is how to define an actionable error: ```ruby class PendingMigrationError < MigrationError #:nodoc: include ActiveSupport::ActionableError action "Run pending migrations" do ActiveRecord::Tasks::DatabaseTasks.migrate end end ``` To make an error actionable, include the `ActiveSupport::ActionableError` module and invoke the `action` class macro to define the action. An action needs a name and a procedure to execute. The name is shown as the name of a button on the error pages. Once clicked, it will invoke the given procedure.
* Bump license years for 2019Arun Agrawal2018-12-311-1/+1
|
* Bump license years for 2018Yoshiyuki Hirano2017-12-311-1/+1
|
* Introduced `ActiveSupport::Digest` that allows to specify hash function ↵Dmitri Dolguikh2017-12-121-0/+1
| | | | | | | | implementation and defaults to `Digest::MD5`. Replaced calls to `::Digest::MD5.hexdigest` with calls to `ActiveSupport::Digest.hexdigest`.
* Remove deprecated `halt_callback_chains_on_return_false` optionRafael Mendonça França2017-10-231-12/+0
|
* [Active Support] require_relative => requireAkira Matsuda2017-10-211-5/+5
| | | | This basically reverts 8da30ad6be34339124ba4cb4e36aea260dda12bc
* [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.