diff options
| author | matz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2002-02-01 06:03:03 +0000 |
|---|---|---|
| committer | matz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2002-02-01 06:03:03 +0000 |
| commit | bea51160a891ca17c1cad61bb1c8ec65951d50d8 (patch) | |
| tree | ec2aadfdc8488f26e27777b91b415c2f2eb0521f /lib | |
| parent | 2716db1b8170e013f26fa66998065b58e076283a (diff) | |
| download | ruby-bea51160a891ca17c1cad61bb1c8ec65951d50d8.tar.gz ruby-bea51160a891ca17c1cad61bb1c8ec65951d50d8.tar.xz ruby-bea51160a891ca17c1cad61bb1c8ec65951d50d8.zip | |
* file.c (rb_stat_inspect): print dev, rdev in hexadecimal.
git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@2038 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib')
| -rw-r--r-- | lib/singleton.rb | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/lib/singleton.rb b/lib/singleton.rb index 2b5a3a3cb..6ff6d190f 100644 --- a/lib/singleton.rb +++ b/lib/singleton.rb @@ -66,18 +66,17 @@ module Singleton # singletons types (sounds like an oxymoron) and # helps out people counting on transitive mixins unless mod.instance_of? (Class) - raise TypeError.new "Inclusion of the OO-Singleton module in module #{mod}" + raise TypeError, "Inclusion of the OO-Singleton module in module #{mod}" end unless (class << mod; self end) <= (class << Object; self end) - raise TypeError.new "Inclusion of the OO-Singleton module in singleton type" + raise TypeError, "Inclusion of the OO-Singleton module in singleton type" end super end def included (klass) # remove build in copying methods klass.class_eval do - undef_method(:clone) rescue nil - undef_method(:dup) rescue nil + define_method(:clone) {raise TypeError, "can't clone singleton #{self.type}"} end # initialize the ``klass instance variable'' @__instance__ to nil |
