Sha256: 137bf6506dba50f177ab5d87d7acf428c9ab91af669cd61c53e540d183880183

Contents?: true

Size: 517 Bytes

Versions: 1

Compression:

Stored size: 517 Bytes

Contents

if ARGV[0] == 'server'[0, ARGV[0].size] && ARGV[1] !~ /^\w+/
  server = %w[zbatery rainbows unicorn puma thin].find do |s|
    begin
      require s

      require 'rack/server'
      class ::Rack::Server
        alias_method :old_default_options, :default_options
      end

      ::Rack::Server.module_eval <<-RUBY
        def default_options
          old_default_options.merge(:config_file => "config/#{s}.rb")
        end
      RUBY

      true

    rescue LoadError
    end
  end

  ARGV.insert(1, server)
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
rack-handlers-0.5.4 lib/rack/handler/rails-server.rb