Skip to content

Commit

Permalink
v0.18.0
Browse files Browse the repository at this point in the history
  • Loading branch information
Adrian Salceanu committed Sep 20, 2019
1 parent cee4750 commit 683a6a8
Show file tree
Hide file tree
Showing 11 changed files with 35 additions and 22 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# Changelog

## v0.18.0 - 2019-09-20

* pluralized some of the folders for consistent naming: sessions, tasks, and tests
* fixed an issue with generating a new task
* deps updates

## v0.17.1 - 2019-09-09

* improved support for testing
Expand Down
4 changes: 2 additions & 2 deletions Manifest.toml
Original file line number Diff line number Diff line change
Expand Up @@ -96,9 +96,9 @@ version = "0.21.0"

[[JuliaInterpreter]]
deps = ["CodeTracking", "InteractiveUtils", "Random", "UUIDs"]
git-tree-sha1 = "1441c3e4a94263389f8a6e26f1d502540ca6e8c5"
git-tree-sha1 = "5020abc08c5c9f7d47ec7e861309bc79ed74aec7"
uuid = "aa1ae85d-cabe-5617-a682-6adf51b2e16a"
version = "0.7.1"
version = "0.7.2"

[[LibGit2]]
uuid = "76f85450-5226-5b5a-8eaa-529ad045b433"
Expand Down
2 changes: 1 addition & 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.17.1"
version = "0.18.0"

[deps]
ArgParse = "c7e460c6-2fb9-53a9-8c5b-16f535851c63"
Expand Down
4 changes: 2 additions & 2 deletions docs/guides/Working_With_Genie_Apps_Intermediary_Topics.md
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,7 @@ Great, now let's display the images. Let's start with the HTML view - please edi
<%
@foreach(@vars(:books)) do book
%>
<li><img src="$( isempty(book.cover) ? "img/docs.png" : book.cover )" width="100px" /> $(book.title) by $(book.author)
<li><img src='$( isempty(book.cover) ? "img/docs.png" : book.cover )' width="100px" /> $(book.title) by $(book.author)
<%
end
%>
Expand Down Expand Up @@ -334,7 +334,7 @@ Let's do it. First, replace the body of the `@foreach` block:

```html
<!-- app/resources/books/views/billgatesbooks.jl.html -->
"""<li><img src="$( isempty(book.cover) ? "img/docs.png" : book.cover )" width="100px" /> $(book.title) by $(book.author)"""
"""<li><img src='$( isempty(book.cover) ? "img/docs.png" : book.cover )' width="100px" /> $(book.title) by $(book.author)"""
```

with:
Expand Down
29 changes: 18 additions & 11 deletions files/new_app/config/initializers/logging.jl
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,21 @@ using Genie
using Logging, LoggingExtras
using Dates

if Genie.config.log_to_file
isdir(Genie.LOG_PATH) || mkpath(Genie.LOG_PATH)

DemuxLogger(
MinLevelLogger(
FileLogger(joinpath(Genie.LOG_PATH, "$(Genie.config.app_env)-$(Dates.today()).log"), always_flush = true, append = true), Genie.config.log_level),
include_current_global = true
)
else
ConsoleLogger(stdout, Genie.config.log_level)
end |> global_logger
const date_format = "yyyy-mm-dd HH:MM:SS"

const logger = if Genie.config.log_to_file
isdir(Genie.LOG_PATH) || mkpath(Genie.LOG_PATH)
DemuxLogger(
FileLogger(joinpath(Genie.LOG_PATH, "$(Genie.config.app_env)-$(Dates.today()).log"), always_flush = true, append = true),
ConsoleLogger(stdout, Genie.config.log_level),
include_current_global = false
)
else
ConsoleLogger(stdout, Genie.config.log_level)
end

timestamp_logger(logger) = TransformerLogger(logger) do log
merge(log, (; message = "$(Dates.format(now(), date_format)) $(log.message)"))
end

DemuxLogger(MinLevelLogger(logger, Genie.config.log_level), include_current_global = false) |> timestamp_logger |> global_logger
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion src/Configuration.jl
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ Core genie configuration / settings functionality.
"""
module Configuration

const GENIE_VERSION = v"0.17.1"
const GENIE_VERSION = v"0.18.0"

using Logging
using YAML
Expand Down
6 changes: 3 additions & 3 deletions src/Toolbox.jl
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,12 @@ Returns a vector of all registered Genie tasks.
function tasks(context::Module; filter_type_name::Union{Symbol,Nothing} = nothing) :: Vector{TaskInfo}
tasks = TaskInfo[]

f = readdir(joinpath(Main.UserApp.ROOT_PATH, Genie.config.tasks_folder))
f = readdir(joinpath(Main.UserApp.ROOT_PATH, Genie.TASKS_PATH))

for i in f
if ( endswith(i, "Task.jl") )
module_name = Genie.Util.file_name_without_extension(i) |> Symbol
Core.eval(context, :(include(joinpath(Genie.config.tasks_folder, $i))))
Core.eval(context, :(include(joinpath(Genie.TASKS_PATH, $i))))
Core.eval(context, :(using .$(module_name)))

ti = TaskInfo(i, module_name, taskdocs(module_name, context = context))
Expand Down Expand Up @@ -143,7 +143,7 @@ end
"""
"""
function tasksdir() :: String
joinpath(Main.UserApp.ROOT_PATH, Genie.config.tasks_folder)
joinpath(Main.UserApp.ROOT_PATH, Genie.TASKS_PATH)
end


Expand Down
4 changes: 2 additions & 2 deletions src/constants.jl
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@ const CONFIG_PATH = "config"
const ENV_PATH = joinpath(CONFIG_PATH, "env")
const APP_PATH = "app"
const RESOURCES_PATH = joinpath(APP_PATH, "resources")
const TEST_PATH = "test"
const TEST_PATH = "tests"
const TEST_PATH_UNIT = joinpath(TEST_PATH, "unit")
const LIB_PATH = "lib"
const HELPERS_PATH = joinpath(APP_PATH, "helpers")
const LOG_PATH = "log"
const LAYOUTS_PATH = joinpath(APP_PATH, "layouts")
const TASKS_PATH = "task"
const TASKS_PATH = "tasks"
const BUILD_PATH = "build"
const PLUGINS_PATH = "plugins"
const SESSIONS_PATH = "sessions"
Expand Down

0 comments on commit 683a6a8

Please sign in to comment.