From ae34a6fde5e15e9ba3ca40cf800d0366e44eec1f Mon Sep 17 00:00:00 2001 From: Ryan Tomayko Date: Thu, 4 Mar 2010 07:52:53 -0800 Subject: [PATCH] work around ruby >= 1.8.7-p248 segfault bug #2781 This seems to avoid triggering whatever craziness is causing the segfault. For more info see: http://redmine.ruby-lang.org/issues/show/2781 --- lib/sinatra/base.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/sinatra/base.rb b/lib/sinatra/base.rb index d03458671a..d66453a636 100644 --- a/lib/sinatra/base.rb +++ b/lib/sinatra/base.rb @@ -699,7 +699,7 @@ def set(option, value=self, &block) if value.kind_of?(Proc) metadef(option, &value) metadef("#{option}?") { !!__send__(option) } - metadef("#{option}=") { |val| set(option, Proc.new{val}) } + metadef("#{option}=") { |val| metadef(option, &Proc.new{val}) } elsif value == self && option.respond_to?(:to_hash) option.to_hash.each { |k,v| set(k, v) } elsif respond_to?("#{option}=")