Allow ActiveSupport::Deprecation features to be used by rails applications and library authors #2310

Closed
wants to merge 4 commits into
from

Conversation

Projects
None yet
7 participants
Contributor

paneq commented Jul 27, 2011

Currently ActiveSupport::Deprecation is a global that can be only used by Rails due to its generated messages. However it is a very nicely written piece of software that could be used by Rails applications (you know some of them last for years and it would be nice for them to have the ability to deprecate their own api) or gems that already depend on rails or active_support. This patch aims at fixing it.

It let's you use ActiveSupport::Deprecation as a module and include it in a class.

And it also adds additional argument to ActiveSupport::Deprecation::DeprecatedInstanceVariableProxy and ActiveSupport::Deprecation::DeprecatedConstantProxy constructors so that warnings can be generated by other objects than ActiveSupport::Deprecation module itself (but that's the default).

I added few more tests to make sure that those features works as advertised.

Member

josevalim commented Jul 27, 2011

I agree with the feature but wouldn't the implementation be better if AS::Deprecation actually became a class? Then we could simply delegate the most use methods like warn, deprecate and so on to an specific instance.

Contributor

isaacsanders commented Apr 28, 2012

@paneq Is this still an issue?

Contributor

paneq commented Apr 28, 2012

It never was an issue, it was a feature. I think we can close.

Member

josevalim commented Apr 28, 2012

I think this feature is actually welcome and a nice refactoring. /cc @tenderlove @jeremy wdyt?

Owner

jeremy commented Apr 29, 2012

Agreed!

Member

steveklabnik commented May 14, 2012

@paneq This can't be merged anymore, and @josevalim and @jeremey said they like the feature, but want a different implementation... are you interested in creating that implementation? If not, let me know and I'll give it a shot.

Contributor

paneq commented May 14, 2012

I would love to but I am getting married, buying new house and going to hospital in this month so I am kind of busy :) and I won't be able to take it on me.

Member

steveklabnik commented May 14, 2012

No worries. I'll check it out myself within a few days.

Congrats on the marriage, I hope the hospital isn't too bad.

Contributor

frodsan commented Sep 11, 2012

@carlosantoniodasilva @rafaelfranca If there is an updated version of this, can we close it?

Yeah, the other one currently has a lot more reviews and is likely to be merged in the near future. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment