Class: Boxed::Geminabox::Server

Inherits:
Fishwife::HttpServer
  • Object
show all
Defined in:
lib/boxed-geminabox.rb

Constant Summary collapse

DEFAULT_PORT =
5791

Instance Method Summary collapse

Constructor Details

#initialize(local_options = {}) ⇒ Server

Returns a new instance of Server.



36
37
38
39
40
41
42
43
44
45
# File 'lib/boxed-geminabox.rb', line 36

def initialize( local_options = {} )
  opts = { :port => DEFAULT_PORT,
           :min_threads => 2,
           :max_threads => 5,
           :request_log_file => :stderr }

  opts = opts.merge( local_options )
  opts = Hooker.merge( [ :bgb, :http_server ], opts )
  super( opts )
end

Instance Method Details

#geminabox_appObject



51
52
53
54
55
56
57
58
59
60
# File 'lib/boxed-geminabox.rb', line 51

def geminabox_app
  ::Geminabox.tap do |box|
    box.data = './data'

    Hooker.apply( [ :bgb, :geminabox ], box )

    # Make our data dir if it doesn't already exist
    FileUtils.mkdir_p( box.data, :mode => 0755 )
  end
end

#start(app = geminabox_app) ⇒ Object



47
48
49
# File 'lib/boxed-geminabox.rb', line 47

def start( app = geminabox_app )
  super( app )
end