summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authormatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>1998-12-14 09:00:08 +0000
committermatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>1998-12-14 09:00:08 +0000
commit17a5fa1b4344199cef86c2cea4f1ba35f021593d (patch)
treea85bb7fdd3bbae60a1a69b2efa898ce949f8e2ac /lib
parent11187ce939d94c3a2f6d9239114c2696a8271834 (diff)
1.1c final (hopefully)
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/v1_1r@347 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib')
-rw-r--r--lib/delegate.rb16
-rw-r--r--lib/mkmf.rb10
2 files changed, 18 insertions, 8 deletions
diff --git a/lib/delegate.rb b/lib/delegate.rb
index 16e68c9d6c..ce2bbc241b 100644
--- a/lib/delegate.rb
+++ b/lib/delegate.rb
@@ -20,11 +20,13 @@ class Delegator
def initialize(obj)
preserved = ::Kernel.instance_methods
+ preserved -= ["to_s","to_a","inspect","==","=~","==="]
for t in self.type.ancestors
preserved |= t.instance_methods
+ preserved |= t.private_instance_methods
+ preserved |= t.protected_instance_methods
break if t == Delegator
end
- preserved -= ["to_s","to_a","inspect","hash","eql?","==","=~","==="]
for method in obj.methods
next if preserved.include? method
eval <<EOS
@@ -32,8 +34,14 @@ def self.#{method}(*args, &block)
begin
__getobj__.__send__(:#{method}, *args, &block)
rescue Exception
- n = if /:in `__getobj__'$/ =~ $@[0] then 1 else 2 end #`
- $@[1,n] = nil
+ c = -caller(0).size
+ if /:in `__getobj__'$/ =~ $@[c-1] #`
+ n = 1
+ else
+ c -= 2
+ n = 3
+ end
+ $@[c,n] = nil
raise
end
end
@@ -72,7 +80,7 @@ def DelegateClass(superclass)
klass = Class.new
methods = superclass.instance_methods
methods -= ::Kernel.instance_methods
- methods |= ["to_s","to_a","inspect","hash","eql?","==","=~","==="]
+ methods |= ["to_s","to_a","inspect","==","=~","==="]
klass.module_eval <<EOS
def initialize(obj)
@obj = obj
diff --git a/lib/mkmf.rb b/lib/mkmf.rb
index 0aa9d98b9c..218b3b19f6 100644
--- a/lib/mkmf.rb
+++ b/lib/mkmf.rb
@@ -289,7 +289,8 @@ LDSHARED = #{CONFIG["LDSHARED"]}
prefix = #{CONFIG["prefix"]}
exec_prefix = #{CONFIG["exec_prefix"]}
-libdir = #{$archdir}
+libdir = #{$libdir}
+archdir = #{$archdir}
#### End of system configuration section. ####
@@ -312,11 +313,12 @@ clean:; @rm -f *.o *.so *.sl
realclean: clean
-install: $(libdir)/$(TARGET)
+install: $(archdir)/$(TARGET)
-$(libdir)/$(TARGET): $(TARGET)
+$(archdir)/$(TARGET): $(TARGET)
@test -d $(libdir) || mkdir $(libdir)
- $(INSTALL) $(TARGET) $(libdir)/$(TARGET)
+ @test -d $(archdir) || mkdir $(archdir)
+ $(INSTALL) $(TARGET) $(archdir)/$(TARGET)
EOMF
install_rb(mfile)
mfile.printf "\n"