Module: Ronin::Web::Server::Helpers

Includes:
Rack::Utils, Sinatra::Helpers
Included in:
Base
Defined in:
lib/ronin/web/server/helpers.rb

Overview

Provides Sinatra routing and helper methods.

Instance Method Summary collapse

Instance Method Details

#content_type_for(path) ⇒ Object

Sets the Content-Type for the file.

Parameters:

  • path (String)

    The path to determine the Content-Type for.



60
61
62
# File 'lib/ronin/web/server/helpers.rb', line 60

def content_type_for(path)
  content_type mime_type_for(path)
end

#mime_type_for(path) ⇒ String

Returns the MIME type for a path.

Parameters:

  • path (String)

    The path to determine the MIME type for.

Returns:

  • (String)

    The MIME type for the path.



48
49
50
# File 'lib/ronin/web/server/helpers.rb', line 48

def mime_type_for(path)
  mime_type(File.extname(path))
end