From: "Hanmac (Hans Mackowiak)" Date: 2013-03-06T17:26:23+09:00 Subject: [ruby-core:53161] [ruby-trunk - Feature #8027][Open] add the possibility to raise an exception in #included, #extended, #prepended, #inherited and break the calling feature Issue #8027 has been reported by Hanmac (Hans Mackowiak). ---------------------------------------- Feature #8027: add the possibility to raise an exception in #included, #extended, #prepended, #inherited and break the calling feature https://bugs.ruby-lang.org/issues/8027 Author: Hanmac (Hans Mackowiak) Status: Open Priority: Normal Assignee: Category: core Target version: imo an exception in this hook methods should be possible to prevent the adding in the ancestor chain module A def self.included(mod) raise "dont include me" end end module E include A end ##>> RuntimeError: dont include me E.ancestors #=>[E,A] what i want: E.ancestors #=>[E] maybe other hook methods like method_defined should get an "prevent" option too maybe for not breaking code we could add "before_included" where an exception could be raised -- http://bugs.ruby-lang.org/