< :前の番号
^ :番号順リスト
> :次の番号
P :前の記事(スレッド移動)
N :次の記事(スレッド移動)
|<:前のスレッド
>|:次のスレッド
^ :返事先
_:自分への返事
>:同じ返事先を持つ記事(前)
<:同じ返事先を持つ記事(後)
---:分割してスレッド表示、再表示
| :分割して(縦)スレッド表示、再表示
~ :スレッドのフレーム消去
.:インデックス
..:インデックスのインデックス
Issue #8027 has been updated by semaperepelitsa (Semyon Perepelitsa).
I think you are looking for Module.append_features:
module A
def self.append_features(mod)
raise "dont include me"
super
end
end
module E
begin
include A
rescue
end
end
p E.ancestors #=>[E]
If you don't call super it also won't be included.
----------------------------------------
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#change-37371
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/