I was looking at this line:
extensions << Module.new(&block) if block_given?
It seems to create a new module and add it to an arry.
Why would you build a module from a block though? The block could be anything and then the extensions array becomes unpredictable.
Edit: This is from Sinatra's base class:
def register(*extensions, &block)
extensions << Module.new(&block) if block_given?
extensions.each do |extension|
extend extension
extension.registered(self) if extension.respond_to?(:registered)
end
end