module Rackup::Handler

def self.require_handler(prefix, const_name)

FooBarBaz # => 'foo_bar_baz.rb'
FOOBAR # => 'foobar.rb'
FOObar # => 'foobar.rb'
FooBAR # => 'foobar.rb'
FooBar # => 'foo_bar.rb'
Foo # => 'foo'

Naming convention:

then tries to require them but silences the LoadError if not found
Transforms server-name constants to their canonical form as filenames,
def self.require_handler(prefix, const_name)
  file = const_name.to_s.gsub(/^[A-Z]+/) { |pre| pre.downcase }.
    gsub(/[A-Z]+[^A-Z]/, '_\&').downcase
  require(::File.join(prefix, file))
end