Sha256: e4823b73cafc8fb1b62fc2e83673e6f08e204f17d2bdc1ffdf5a2521dc5bfc23

Contents?: true

Size: 1.39 KB

Versions: 1

Compression:

Stored size: 1.39 KB

Contents

#
# Ronin Web - A Ruby library for Ronin that provides support for web
# scraping and spidering functionality.
#
# Copyright (c) 2006-2009 Hal Brodigan (postmodern.mod3 at gmail.com)
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program 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 General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
#

require 'ronin/web/proxy/app'

module Ronin
  module Web
    #
    # Returns the Ronin Web Proxy. When called for the first time
    # the proxy will be started in the background.
    #
    # @see Server::Base.run!
    #
    def Web.proxy_server(options={},&block)
      unless class_variable_defined?('@@ronin_web_proxy')
        @@ronin_web_proxy = Proxy::App
        @@ronin_web_proxy.run!(options.merge(:background => true))
      end

      @@ronin_web_proxy.class_eval(&block)

      return @@ronin_web_proxy
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
ronin-web-0.2.1 lib/ronin/web/proxy/web.rb