Class: Eris::Server
- Inherits:
-
Sinatra::Base
- Object
- Sinatra::Base
- Eris::Server
- Defined in:
- lib/eris/lib/server.rb
Constant Summary collapse
- JS_HELPER_PATH =
File.dirname(__FILE__) + '/../../../js_helpers/'
Instance Method Summary collapse
-
#initialize(path = Dir.pwd) ⇒ Server
constructor
A new instance of Server.
- #serve_static_files_from(path, filename) ⇒ Object
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.(path + unescape(filename)) env['sinatra.static_file'] = path_to_static_file send_file path_to_static_file, :disposition => nil end |