Class: Locomotive::Steam::StandaloneServer

Inherits:
Server
  • Object
show all
Defined in:
lib/locomotive/steam/standalone_server.rb

Instance Method Summary collapse

Methods inherited from Server

#call

Constructor Details

#initialize(path, options = {}) ⇒ StandaloneServer

Returns a new instance of StandaloneServer.



14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
# File 'lib/locomotive/steam/standalone_server.rb', line 14

def initialize(path, options={})
  options.fetch(:logger) do
    Locomotive::Steam::Logger.setup(path, false)
  end

  reader = options.fetch(:reader) do
    _reader = Locomotive::Mounter::Reader::FileSystem.instance
    Proc.new { |_path| _reader.run!(path: _path) }
  end
  reader.call path

  Bundler.require 'monkey_patches'
  Bundler.require 'initializers'

  # run the rack app
  super(reader, disable_listen: true)
end