summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authormatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2002-02-01 06:03:03 +0000
committermatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2002-02-01 06:03:03 +0000
commit9f0d9bd7111ecfbc087cc4dfe6b4d46e8b98800f (patch)
treeec2aadfdc8488f26e27777b91b415c2f2eb0521f /lib
parent3d51761abd3bbda185410dd980e2e064b848ad02 (diff)
* file.c (rb_stat_inspect): print dev, rdev in hexadecimal.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2038 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib')
-rw-r--r--lib/singleton.rb7
1 files changed, 3 insertions, 4 deletions
diff --git a/lib/singleton.rb b/lib/singleton.rb
index 2b5a3a3cb5..6ff6d190f2 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