Sha256: 898388e89d3619734d68893edacdf99eff7d39c57cfe1cd0d4ca3c5525ace193
Contents?: true
Size: 918 Bytes
Versions: 21
Compression:
Stored size: 918 Bytes
Contents
# intranet-core `intranet-core` provides the core component of a generic, highly customizable intranet built around [WEBrick HTTP server](https://rubygems.org/gems/webrick). Each section of the intranet can be provided by a different _module_, which is basically a Webrick servlet in charge of a specific subdirectory of the web server. ## Usage ### Creating a custom _module_ You can create a new _module_ by deriving from `Intranet::AbstractResponder`: ```ruby require 'intranet/abstract_responder' class MyModule << Intranet::AbstractResponder def initialize(params = {}) @params = params end def generate_page(path, query) # generate HTML for the given path end end ``` ### Starting the Intranet The Intranet is controlled by the `Intranet::Core` class. ```ruby intranet = Intranet::Core.new module = MyModule.new intranet.register_module(module, 'my_module', __dir__) intranet.start ```
Version data entries
21 entries across 21 versions & 1 rubygems