Class: Eris::Server

Inherits:
Sinatra::Base
  • Object
show all
Defined in:
lib/eris/lib/server.rb

Constant Summary collapse

JS_HELPER_PATH =
File.dirname(__FILE__) + '/../../../js_helpers/'

Instance Method Summary collapse

Constructor Details

#initialize(path = Dir.pwd) ⇒ Server

Returns a new instance of Server.



10
11
12
13
14
# File 'lib/eris/lib/server.rb', line 10

def initialize(path=Dir.pwd)
  @path = path
  settings.views = path
  super
end

Instance Method Details

#serve_static_files_from(path, filename) ⇒ Object



68
69
70
71
72
73
# File 'lib/eris/lib/server.rb', line 68

def serve_static_files_from(path, filename)
  path_to_static_file = File.expand_path(path + unescape(filename))

  env['sinatra.static_file'] = path_to_static_file
  send_file path_to_static_file, :disposition => nil
end