aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/lib/active_support/deprecation/reporting.rb
Commit message (Collapse)AuthorAgeFilesLines
* Return back "/" to the end of RAILS_GEM_ROOTbogdanvlviv2018-04-201-1/+1
| | | | | | | | | | | - The "/" was removed in 40bdbce191ad90dfea43dad51fac5c4726b89392 during refactoring. It may cause regression since looks like was added intentionaly because it is possible that a name of any another gem can start with /rails/, so slash was added to ensure that it is "rails" gem. I would like to backport this to `5-2-stable` too. - Use `__dir__` instead of `__FILE__`. Follow up #29176.
* Enable autocorrect for `Lint/EndAlignment` copKoichi ITO2018-01-181-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ### Summary This PR changes .rubocop.yml. Regarding the code using `if ... else ... end`, I think the coding style that Rails expects is as follows. ```ruby var = if cond a else b end ``` However, the current .rubocop.yml setting does not offense for the following code. ```ruby var = if cond a else b end ``` I think that the above code expects offense to be warned. Moreover, the layout by autocorrect is unnatural. ```ruby var = if cond a else b end ``` This PR adds a setting to .rubocop.yml to make an offense warning and autocorrect as expected by the coding style. And this change also fixes `case ... when ... end` together. Also this PR itself is an example that arranges the layout using `rubocop -a`. ### Other Information Autocorrect of `Lint/EndAlignment` cop is `false` by default. https://github.com/bbatsov/rubocop/blob/v0.51.0/config/default.yml#L1443 This PR changes this value to `true`. Also this PR has changed it together as it is necessary to enable `Layout/ElseAlignment` cop to make this behavior.
* [Active Support] `rubocop -a --only Layout/EmptyLineAfterMagicComment`Koichi ITO2017-07-111-0/+1
|
* Use frozen-string-literal in ActiveSupportKir Shatrov2017-07-091-0/+1
|
* Revert "Merge pull request #29540 from kirs/rubocop-frozen-string"Matthew Draper2017-07-021-1/+0
| | | | | This reverts commit 3420a14590c0e6915d8b6c242887f74adb4120f9, reversing changes made to afb66a5a598ce4ac74ad84b125a5abf046dcf5aa.
* Enforce frozen string in RubocopKir Shatrov2017-07-011-0/+1
|
* Define path with __dir__bogdanvlviv2017-05-231-1/+1
| | | | | | ".. with __dir__ we can restore order in the Universe." - by @fxn Related to 5b8738c2df003a96f0e490c43559747618d10f5f
* Send deprecation horizon and gem name as arguments to deprecation heavier ↵Willem van Bergen2017-04-191-1/+1
| | | | handler, and make sure they are used for the ActiveSupport::Notifications message.
* Remove redundant namespaces from sample code of `deprecated_method_warning` ↵kenta-s2017-02-151-3/+3
| | | | [ci skip]
* applies remaining conventions across the projectXavier Noria2016-08-061-2/+2
|
* applies new string literal convention in activesupport/libXavier Noria2016-08-061-2/+2
| | | | | The current code base is not uniform. After some discussion, we have chosen to go with double quotes by default.
* Pass over all Rails 5 warnings, to make sure:Vipul A M2016-04-121-1/+0
| | | | | | | | | | - we are ending sentences properly - fixing of space issues - fixed continuity issues in some sentences. Reverts https://github.com/rails/rails/commit/8fc97d198ef31c1d7a4b9b849b96fc08a667fb02 . This change reverts making sure we add '.' at end of deprecation sentences. This is to keep sentences within Rails itself consistent and with a '.' at the end.
* :bomb: run the test @rafaelfranca :angry:Rafael Mendonça França2016-02-241-1/+1
|
* Ignore callstacks from Ruby stdlib in deprecationRafael Mendonça França2016-02-241-4/+12
| | | | Fixes #22982.
* Fix deprecation message when frame doesn't have absolute_pathRafael Mendonça França2015-11-031-1/+1
| | | | | | When a frame is an eval block without filename argument there is no absolute_path so the previous implementation would fail because `nil` doesn't responds to `start_with?`.
* use `caller_locations` instead of `caller`Aaron Patterson2015-08-241-2/+13
| | | | | We have `caller_locations`, so we don't need to parse the strings in the callstack.
* Make caller attribute in deprecation methods optionalAlexey Gaziev2012-10-301-2/+5
|
* Merge branch 'master' of github.com:lifo/docrailsVijay Dev2012-09-211-3/+3
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: actionmailer/lib/action_mailer/base.rb activesupport/lib/active_support/configurable.rb activesupport/lib/active_support/core_ext/module/deprecation.rb guides/source/action_controller_overview.md guides/source/active_support_core_extensions.md guides/source/ajax_on_rails.textile guides/source/association_basics.textile guides/source/upgrading_ruby_on_rails.md While resolving conflicts, I have chosen to ignore changes done in docrails at some places - these will be most likely 1.9 hash syntax changes.
| * update AS/deprecation docs [ci skip]Francesco Rodriguez2012-09-141-3/+3
| |
* | warning removed: shadowing outer local variable - messageArun Agrawal2012-09-141-2/+2
| |
* | Copy-edit deprecation relared documentation [ci skip]Rafael Mendonça França2012-09-131-0/+1
| |
* | Change ActiveSupport::Deprecation to class.Piotr Niełacny2012-09-131-59/+76
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ActiveSupport::Deprecation is now a class rather than a module. You can get instance of ActiveSupport::Deprecation calling #instance method. ActiveSupport::Deprecation.instance But when you need to get new object od ActiveSupport::Deprecation you need to just call #new. @instance = ActiveSupport::Deprecation.new Since you can create a new object, you can change the version and the name of the library where the deprecator concerned. ActiveSupport::Deprecation.new('2.0', 'MyGem') If you need use another deprecator instance you can select it in the options of deprecate method. deprecate :method, :deprecator => deprecator_instance Documentation has been updated.
* | extend ActiveSupport::Deprecation with self, allow other objects to ↵Robert Pankowecki2012-09-131-59/+58
|/ | | | | | | | | | extend/include it also. test local deprecation deprecator object Test ActiveSupport::Deprecation when included
* fixes a few mistakes in api docs [ci skip]Vijay Dev2012-06-221-1/+1
|
* add example to AS::Deprecation#silence [ci skip]Francesco Rodriguez2012-06-171-1/+10
|
* minor changesVijay Dev2011-04-271-3/+1
|
* fixing whitespace errorsAaron Patterson2011-01-121-1/+1
|
* Improve documentation on ActiveSupport::Deprecation.Ryan Bigg2010-12-211-1/+7
|
* better callstack reporting in deprecation messagesJakub Suder2010-08-251-4/+8
| | | | | | | | | | now the reported line is the first line in the stack that's outside Rails, which is the one that actually caused the problem in the first place [#5231 state:resolved] Signed-off-by: José Valim <jose.valim@gmail.com>
* Add the possibility to have several behaviors in AS::Deprecation.José Valim2010-07-011-2/+3
|
* Allow deprecation messages with or without a final period.Jeremy Kemper2010-03-051-1/+2
|
* Dice up ActiveSupport::DeprecationJeremy Kemper2009-04-171-0/+55