-
-
Save dchelimsky/846265 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module MyModule | |
def some_method | |
super | |
rescue SystemStackError => e | |
puts "you're including MyModule more than once" | |
end | |
end | |
class MyBaseClass; end | |
class MySubClass < MyBaseClass; | |
include MyModule | |
end | |
MyBaseClass.class_eval { include MyModule } | |
MySubClass.new.some_method |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ ruby example_spec.rb | |
you're including MyModule more than once |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment