Class: Locomotive::Steam::Server

Inherits:
Object
  • Object
show all
Defined in:
lib/locomotive/steam/server.rb,
lib/locomotive/steam/server/page.rb,
lib/locomotive/steam/server/path.rb,
lib/locomotive/steam/server/locale.rb,
lib/locomotive/steam/server/favicon.rb,
lib/locomotive/steam/server/logging.rb,
lib/locomotive/steam/server/renderer.rb,
lib/locomotive/steam/server/timezone.rb,
lib/locomotive/steam/server/middleware.rb,
lib/locomotive/steam/server/dynamic_assets.rb,
lib/locomotive/steam/server/entry_submission.rb,
lib/locomotive/steam/server/templatized_page.rb

Direct Known Subclasses

StandaloneServer

Defined Under Namespace

Classes: DynamicAssets, EntrySubmission, Favicon, Locale, Logging, Middleware, Page, Path, Renderer, TemplatizedPage, Timezone

Instance Method Summary collapse

Constructor Details

#initialize(reader, options = {}) ⇒ Server

Returns a new instance of Server.



24
25
26
27
28
29
30
31
32
33
# File 'lib/locomotive/steam/server.rb', line 24

def initialize(reader, options = {})
  Locomotive::Steam::Dragonfly.setup!(reader.mounting_point.path)

  Sprockets::Sass.add_sass_functions = false

  @reader = reader
  @app    = self.create_rack_app(@reader)

  BetterErrors.application_root = reader.mounting_point.path
end

Instance Method Details

#call(env) ⇒ Object



35
36
37
38
# File 'lib/locomotive/steam/server.rb', line 35

def call(env)
  env['steam.mounting_point'] = @reader.mounting_point
  @app.call(env)
end