Top Level Namespace

Defined in:

Constant Summary

APP_NAME = {{ (((read_file("/srv/crystaldoc.info/github-GeopJr-sabo-tabby-v1.1.0/src/../shard.yml")).split("name: "))[1].split("\n"))[0] }}
LICENSE_FILES = {"LICENSE", "LICENSE.md", "UNLICENSE"}
OLD_LICENSE = "#{("Kemal".capitalize.colorize.mode(:underline)).mode(:bold)}\nCopyright (c) 2016 Serdar Doğruyol\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE\n"

Method Summary

Method Detail

def abort_log(message : String) : Colorize::Object(String) #

Returns an error formatted string


[View source]
def get_license_content(parent : Path) : String | Nil #

[View source]
def log(message : String | Colorize::Object(String), newline : Bool = false, ignore_pipe : Bool = false, emoji : Bool = Sabo::Tabby.config.emoji) #

Logs the output via logger. This is the built-in Sabo::Tabby::LogHandler by default which uses STDOUT.

If newline is true then the log will start with a newline.

If ignore_pipe is true then it won't be logged if it's not a TTY.

If emoji is false then it won't prefix the log with a Sabo::Tabby::EMOJIS[:base].


[View source]
def send_file(env : HTTP::Server::Context, path : String, mime_type : String | Nil = nil, *, filename : String | Nil = nil, disposition : String | Nil = nil) #

Send a file with given path and base the mime-type on the file extension or default application/octet-stream mime_type.

send_file env, "./path/to/file"

Optionally you can override the mime_type

send_file env, "./path/to/file", "image/jpeg"

Also you can set the filename and the disposition

send_file env, "./path/to/file", filename: "image.jpg", disposition: "attachment"

[View source]
def send_file(env : HTTP::Server::Context, data : Slice(UInt8), mime_type : String | Nil = nil, *, filename : String | Nil = nil, disposition : String | Nil = nil) #

Send a file with given data and default application/octet-stream mime_type.

send_file env, data_slice

Optionally you can override the mime_type

send_file env, data_slice, "image/jpeg"

Also you can set the filename and the disposition

send_file env, data_slice, filename: "image.jpg", disposition: "attachment"

[View source]