Sha256: 06651e006b24183ddaf642210623ac3f938580c18f463e19356dddd3a3783059
Contents?: true
Size: 1.66 KB
Versions: 1
Compression:
Stored size: 1.66 KB
Contents
# frozen_string_literal: true # # ronin-web-server - A custom Ruby web server based on Sinatra. # # Copyright (c) 2006-2022 Hal Brodigan (postmodern.mod3 at gmail.com) # # ronin-web-server is free software: you can redistribute it and/or modify # it under the terms of the GNU Lesser General Public License as published # by the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # ronin-web-server is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public License # along with ronin-web-server. If not, see <https://www.gnu.org/licenses/>. # require 'ronin/web/server/base' require 'ronin/web/server/app' module Ronin module Web # # Returns the Ronin Web Server. # # @param [Hash] options # Additional options. # # @yield [server] # If a block is given, it will be passed the current web server. # # @yieldparam [Server::App] # The current web server class. # # @return [Server::App] # The current web server class. # # @example # Web.server do # get '/hello' do # 'world' # end # end # # @see Server::Base.run! # # @api public # def self.server(options={},&block) unless @server @server = Server::App @server.run!(options.merge(background: true)) end @server.class_eval(&block) if block return @server end end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
ronin-web-server-0.1.0.beta1 | lib/ronin/web/server.rb |