Skip to content

Commit

Permalink
remove hash module
Browse files Browse the repository at this point in the history
  • Loading branch information
ujjwalguptaofficial committed Apr 16, 2020
1 parent 88900b5 commit b43b9f7
Show file tree
Hide file tree
Showing 7 changed files with 39 additions and 39 deletions.
4 changes: 2 additions & 2 deletions src/generics/generic_controller.cr
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
require "../abstracts/index"
require "../hashes/index"
require "../tuples/all"

module Shivneri
module GENERIC
include ABSTRACT
include HASHES
include TUPLE

class GenericController < Controller
def generic_method
Expand Down
4 changes: 2 additions & 2 deletions src/handlers/request_handler_helper.cr
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
require "../fort_global"
require "../constants"
require "../hashes/index"
require "../tuples/all"
require "http"
require "../exceptions/index"

module Shivneri
module Handlers
include HASHES
include TUPLE
include EXCEPTION

class RequestHandlerHelper
Expand Down
1 change: 0 additions & 1 deletion src/hashes/index.cr

This file was deleted.

32 changes: 0 additions & 32 deletions src/hashes/mime_type.cr

This file was deleted.

4 changes: 2 additions & 2 deletions src/model/http_result.cr
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
require "../hashes/index"
require "../tuples/all"

module Shivneri
module MODEL
include HASHES
include TUPLE

struct HttpResult
property status_code, response_data, content_type, response_format, should_redirect, file
Expand Down
1 change: 1 addition & 0 deletions src/tuples/all.cr
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
require "./http_method"
require "./mime_type"
32 changes: 32 additions & 0 deletions src/tuples/mime_type.cr
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
module Shivneri
module TUPLE
MIME_TYPE = {
text: "text/plain",
json: "application/json",
html: "text/html",
form_url_encoded: "application/x-www-form-urlencoded",
css: "text/css",
csv: "text/csv",
js: "application/javascript",
# Bmp : "image/bmp",
# Jpeg : "image/jpeg",
# Gif : "image/gif",
# Ico : "image/x-icon",
# Png : "image/png",
# Pdf : "application/pdf",
# Svg : "image/svg+xml",
rtf: "application/rtf",
xml: "application/xml",
# Xls : "application/vnd.ms-excel",
# Xlsx : "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",
# Ttf : "font/ttf",
# Woff : "font/woff",
# Woff2 : "font/woff2",
# Eot : "application/vnd.ms-fontobject",
# Otf : "font/otf",
# Swf : "application/x-shockwave-flash",
# Avi : "video/avi",
"form_multi_part": "multipart/form-data",
}
end
end

0 comments on commit b43b9f7

Please sign in to comment.