mirror of
https://github.com/sinatra/sinatra
synced 2023-03-27 23:18:01 -04:00
no longer override define_singleton_method, fixes #567
This commit is contained in:
parent
0e1585ceae
commit
f1b7c3a146
2 changed files with 6 additions and 4 deletions
2
CHANGES
2
CHANGES
|
@ -85,6 +85,8 @@
|
|||
|
||||
* Improve documentation (Konstantin Haase)
|
||||
|
||||
* No longer override `define_singleton_method`. (Konstantin Haase)
|
||||
|
||||
= 1.3.4 / 2013-01-26
|
||||
|
||||
* Improve documentation. (Kashyap, Stanislav Chistenko, Konstantin Haase,
|
||||
|
|
|
@ -1152,9 +1152,9 @@ module Sinatra
|
|||
end
|
||||
end
|
||||
|
||||
define_singleton_method("#{option}=", setter) if setter
|
||||
define_singleton_method(option, getter) if getter
|
||||
define_singleton_method("#{option}?", "!!#{option}") unless method_defined? "#{option}?"
|
||||
define_singleton("#{option}=", setter) if setter
|
||||
define_singleton(option, getter) if getter
|
||||
define_singleton("#{option}?", "!!#{option}") unless method_defined? "#{option}?"
|
||||
self
|
||||
end
|
||||
|
||||
|
@ -1284,7 +1284,7 @@ module Sinatra
|
|||
|
||||
private
|
||||
# Dynamically defines a method on settings.
|
||||
def define_singleton_method(name, content = Proc.new)
|
||||
def define_singleton(name, content = Proc.new)
|
||||
# replace with call to singleton_class once we're 1.9 only
|
||||
(class << self; self; end).class_eval do
|
||||
undef_method(name) if method_defined? name
|
||||
|
|
Loading…
Add table
Reference in a new issue