Functions in Dates are exported

This commit is contained in:
Chris de Graaf 2018-10-15 11:55:09 -05:00
parent e47672bff1
commit b55dc64ff1
4 changed files with 7 additions and 7 deletions

View File

@ -210,7 +210,7 @@ function gen_license(pkg_dir::AbstractString, t::Template)
return String[] return String[]
end end
text = "Copyright (c) $(Dates.year(Dates.now())) $(t.authors)\n" text = "Copyright (c) $(year(today())) $(t.authors)\n"
text *= read_license(t.license) text *= read_license(t.license)
gen_file(joinpath(pkg_dir, "LICENSE"), text) gen_file(joinpath(pkg_dir, "LICENSE"), text)

View File

@ -51,7 +51,7 @@ Generic plugins are plugins that add any number of patterns to the generated pac
"https://myplugin.com/{{USER}}/{{PKGNAME}}.jl", "https://myplugin.com/{{USER}}/{{PKGNAME}}.jl",
), ),
], ],
Dict{String, Any}("YEAR" => Dates.year(Dates.today())), Dict{String, Any}("YEAR" => year(today())),
) )
end end
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 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 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 substitutions with one addition: `{{YEAR}} => year(today())`. Since the default config
config template file doesn't follow the generic naming convention, we added another template file doesn't follow the generic naming convention, we added another `interactive`
`interactive` method to correct the assumed filename. method to correct the assumed filename.
""" """
abstract type GenericPlugin <: Plugin end abstract type GenericPlugin <: Plugin end

View File

@ -106,7 +106,7 @@ function Base.show(io::IO, t::Template)
if isempty(t.license) if isempty(t.license)
println(io, "None") println(io, "None")
else else
println(io, "$(t.license) ($(t.authors) $(Dates.year(Dates.now())))") println(io, "$(t.license) ($(t.authors) $(year(today())))")
end end
println(io, "$spc→ Package directory: $(replace(maybe(t.dir), homedir() => "~"))") println(io, "$spc→ Package directory: $(replace(maybe(t.dir), homedir() => "~"))")

View File

@ -114,7 +114,7 @@ end
Template: Template:
User: $me User: $me
Host: github.com Host: github.com
License: MIT ($(LibGit2.getconfig("user.name", "")) $(Dates.year(now()))) License: MIT ($(LibGit2.getconfig("user.name", "")) $(year(today())))
Package directory: $pkg_dir Package directory: $pkg_dir
Minimum Julia version: v$(PkgTemplates.version_floor()) Minimum Julia version: v$(PkgTemplates.version_floor())
SSH remote: No SSH remote: No