From b55dc64ff1e6c149aa7485d53f66e290a8e9be2b Mon Sep 17 00:00:00 2001 From: Chris de Graaf Date: Mon, 15 Oct 2018 11:55:09 -0500 Subject: [PATCH] Functions in Dates are exported --- src/generate.jl | 2 +- src/plugin.jl | 8 ++++---- src/template.jl | 2 +- test/tests.jl | 2 +- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/generate.jl b/src/generate.jl index 1243d62..0c64bb5 100644 --- a/src/generate.jl +++ b/src/generate.jl @@ -210,7 +210,7 @@ function gen_license(pkg_dir::AbstractString, t::Template) return String[] end - text = "Copyright (c) $(Dates.year(Dates.now())) $(t.authors)\n" + text = "Copyright (c) $(year(today())) $(t.authors)\n" text *= read_license(t.license) gen_file(joinpath(pkg_dir, "LICENSE"), text) diff --git a/src/plugin.jl b/src/plugin.jl index 00fa732..8a10b17 100644 --- a/src/plugin.jl +++ b/src/plugin.jl @@ -51,7 +51,7 @@ Generic plugins are plugins that add any number of patterns to the generated pac "https://myplugin.com/{{USER}}/{{PKGNAME}}.jl", ), ], - Dict{String, Any}("YEAR" => Dates.year(Dates.today())), + Dict{String, Any}("YEAR" => year(today())), ) end end @@ -61,9 +61,9 @@ interactive(::Type{MyPlugin}) = interactive(MyPlugin; file="my-plugin.toml") The above plugin ignores files ending with `.mgp`, copies `defaults/my-plugin.toml` by default, and creates a badge that links to the project on its own site, using the default -substitutions with one addition: `{{YEAR}} => Dates.year(Dates.today())`. Since the default -config template file doesn't follow the generic naming convention, we added another -`interactive` method to correct the assumed filename. +substitutions with one addition: `{{YEAR}} => year(today())`. Since the default config +template file doesn't follow the generic naming convention, we added another `interactive` +method to correct the assumed filename. """ abstract type GenericPlugin <: Plugin end diff --git a/src/template.jl b/src/template.jl index 539b876..78d3a04 100644 --- a/src/template.jl +++ b/src/template.jl @@ -106,7 +106,7 @@ function Base.show(io::IO, t::Template) if isempty(t.license) println(io, "None") else - println(io, "$(t.license) ($(t.authors) $(Dates.year(Dates.now())))") + println(io, "$(t.license) ($(t.authors) $(year(today())))") end println(io, "$spc→ Package directory: $(replace(maybe(t.dir), homedir() => "~"))") diff --git a/test/tests.jl b/test/tests.jl index d8a1c88..812b6db 100644 --- a/test/tests.jl +++ b/test/tests.jl @@ -114,7 +114,7 @@ end Template: → User: $me → Host: github.com - → License: MIT ($(LibGit2.getconfig("user.name", "")) $(Dates.year(now()))) + → License: MIT ($(LibGit2.getconfig("user.name", "")) $(year(today()))) → Package directory: $pkg_dir → Minimum Julia version: v$(PkgTemplates.version_floor()) → SSH remote: No