Skip to content

Commit

Permalink
v0.28
Browse files Browse the repository at this point in the history
  • Loading branch information
Adrian committed Mar 11, 2020
1 parent 7dd1787 commit 875e84b
Show file tree
Hide file tree
Showing 10 changed files with 11 additions and 41 deletions.
3 changes: 2 additions & 1 deletion Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "Genie"
uuid = "c43c736e-a2d1-11e8-161f-af95117fbd1e"
authors = ["Adrian Salceanu <[email protected]>"]
version = "0.27.0"
version = "0.28.0"

[deps]
ArgParse = "c7e460c6-2fb9-53a9-8c5b-16f535851c63"
Expand All @@ -27,6 +27,7 @@ Serialization = "9e88b42a-f829-5b0c-bbe9-9e923198166b"
Sockets = "6462fe0b-24de-5631-8697-dd941f90decc"
URIParser = "30578b45-9adc-5946-b283-645ec420af67"
Unicode = "4ec0a83e-493e-50e2-b9ac-8f72acf5a8f5"
YAML = "ddb6d928-2868-570f-bddf-ab3f9cf99eb6"

[compat]
ArgParse = "1"
Expand Down
2 changes: 1 addition & 1 deletion src/Router.jl
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ function route_ws_request(req, msg::String, ws_client, ip::Sockets.IPv4 = Socket
Genie.Configuration.isdev() && Revise.revise()

for f in unique(pre_match_hooks)
req, res, params.collection = f(req, res, params.collection)
req, msg, params.collection = f(req, msg, params.collection)
end

match_channels(req, msg, ws_client, params)
Expand Down
31 changes: 0 additions & 31 deletions src/genie_types.jl
Original file line number Diff line number Diff line change
@@ -1,40 +1,9 @@
import Base.string
import Base.print
import Base.show

export GenieType, GenieController, Controller

abstract type GenieType end
string(io::IO, t::T) where {T<:GenieType} = "$(typeof(t)) <: $(super(typeof(t)))"
print(io::IO, t::T) where {T<:GenieType} = print(io, "$(typeof(t)) <: $(super(typeof(t)))")
show(io::IO, t::T) where {T<:GenieType} = print(io, genietype_to_print(t))

mutable struct GenieController <: GenieType
end

const Controller = GenieController

mutable struct GenieChannel <: GenieType
end

# const Channel = GenieChannel

import Millboard


"""
genietype_to_print{T<:GenieType}(m::T) :: String
Pretty printing of Genie types.
"""
function genietype_to_print(m::T) :: String where {T<:GenieType}
output = "\n" * "$(typeof(m))" * "\n"
output *= string(Millboard.table(to_string_dict(m)), "\n")

output
end


"""
to_dict(m::Any) :: Dict{String,Any}
to_string_dict(m::Any; all_output::Bool = false) :: Dict{String,String}
Expand Down
2 changes: 1 addition & 1 deletion src/renderers/Html.jl
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ module Html


import Revise
import Markdown, Logging, Gumbo, Reexport, OrderedCollections, Millboard, HTTP
import Markdown, Logging, Gumbo, Reexport, OrderedCollections, Millboard, HTTP, YAML
import Genie, Genie.Renderer
import Genie.Renderer: @vars
Reexport.@reexport using HttpCommon
Expand Down
4 changes: 2 additions & 2 deletions src/renderers/Js.jl
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ function get_template(path::String; context::Module = @__MODULE__) :: Function
f_path = joinpath(Genie.config.path_build, Genie.Renderer.BUILD_NAME, mod_name)
f_stale = Genie.Renderer.build_is_stale(path, f_path)

if f_stale || ! isdefined(context, func_name)
f_stale && Genie.Renderer.build_module(to_js(data), path, mod_name)
if f_stale || ! isdefined(context, f_name)
f_stale && Genie.Renderer.build_module(to_js(read(path, String)), path, mod_name)

return Base.include(context, joinpath(Genie.config.path_build, Genie.Renderer.BUILD_NAME, mod_name))
end
Expand Down
2 changes: 1 addition & 1 deletion test/fileuploads/test.jl
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
using Pkg
Pkg.activate(".")

using Genie, Genie.Router, Genie.Renderer
using Genie, Genie.Router, Genie.Renderer, Genie.Renderer.Html

form = """
<form action="/" method="POST" enctype="multipart/form-data">
Expand Down
2 changes: 1 addition & 1 deletion test/htmlrendering/test.jl
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
using Pkg
Pkg.activate(".")

using Genie, Genie.Router, Genie.Renderer
using Genie, Genie.Router, Genie.Renderer, Genie.Renderer.Html

markup = """<button class="nes-btn" id="submit-button">Go!</button>"""
markup *= """<label for="whatever"></label>"""
Expand Down
2 changes: 1 addition & 1 deletion test/inlinecache/test.jl
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Pkg.activate(".")
using Revise
Revise.track(@__FILE__)

using Genie, Genie.Router, Genie.Renderer
using Genie, Genie.Router, Genie.Renderer, Genie.Renderer.Html

route("/") do
view = "<h1>Hello Genie!!</h1>"
Expand Down
2 changes: 1 addition & 1 deletion test/json-error/test.jl
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
using Pkg
Pkg.activate(".")

using Genie, HTTP
using Genie, HTTP, Test
import Genie.Router: route, POST, @params
import Genie.Requests: jsonpayload

Expand Down
2 changes: 1 addition & 1 deletion test/postform/test.jl
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
using Pkg
Pkg.activate(".")

using Genie, Genie.Router, Genie.Renderer
using Genie, Genie.Router, Genie.Renderer, Genie.Renderer.Html

form = """
<form action="/" method="POST" enctype="multipart/form-data">
Expand Down

2 comments on commit 875e84b

@essenciary
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@JuliaRegistrator
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Registration pull request created: JuliaRegistries/General/10851

After the above pull request is merged, it is recommended that a tag is created on this repository for the registered package version.

This will be done automatically if Julia TagBot is installed, or can be done manually through the github interface, or via:

git tag -a v0.28.0 -m "<description of version>" 875e84b1b5ad5c646f12bc883fd13bdb8580cdc9
git push origin v0.28.0

Please sign in to comment.