Class: SCV::Server

Inherits:
Object
  • Object
show all
Defined in:
lib/scv/server.rb

Overview

This is only intended to be a very basic web server that serves files from the ‘.scv` directory and also allows uploading files there.

Wihout! Any! Authentication!

You do understand what this means, right?

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(repository_path, port: 4242) ⇒ Server

Returns a new instance of Server.



17
18
19
20
# File 'lib/scv/server.rb', line 17

def initialize(repository_path, port: 4242)
  @repository_path = repository_path
  @port            = port
end

Instance Attribute Details

#portObject (readonly)

Returns the value of attribute port.



15
16
17
# File 'lib/scv/server.rb', line 15

def port
  @port
end

Instance Method Details

#startObject



22
23
24
# File 'lib/scv/server.rb', line 22

def start
  Rack::Handler::WEBrick.run method(:request_handler), {Port: @port}
end