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

Version Path
intranet-core-2.5.0 README.md
intranet-core-2.4.5 README.md
intranet-core-2.4.4 README.md
intranet-core-2.4.3 README.md
intranet-core-2.4.1 README.md
intranet-core-2.4.0 README.md
intranet-core-2.3.3 README.md
intranet-core-2.3.2 README.md
intranet-core-2.3.1 README.md
intranet-core-2.3.0 README.md
intranet-core-2.2.0 README.md
intranet-core-2.1.4 README.md
intranet-core-2.1.2 README.md
intranet-core-2.1.1 README.md
intranet-core-2.1.0 README.md
intranet-core-2.0.0 README.md
intranet-core-1.2.0 README.md
intranet-core-1.1.1 README.md
intranet-core-1.0.2 README.md
intranet-core-1.0.1 README.md