From 61b44a285d9cdb8dce0c6c4c065f02dc00e6b011 Mon Sep 17 00:00:00 2001 From: Chris de Graaf Date: Fri, 18 Aug 2017 16:08:48 -0500 Subject: [PATCH] Fix typos, change placeholder name --- LICENSE | 2 +- README.md | 22 +++++++-------- docs/make.jl | 8 +++--- docs/src/index.md | 14 +++++----- docs/src/pages/licenses.md | 2 +- src/generate.jl | 2 +- src/plugin.jl | 2 +- src/plugins/documenter.jl | 2 +- src/plugins/githubpages.jl | 2 +- test/tests.jl | 57 +++++++++++++++++++------------------- 10 files changed, 57 insertions(+), 56 deletions(-) diff --git a/LICENSE b/LICENSE index ba1d902..390b2cd 100644 --- a/LICENSE +++ b/LICENSE @@ -1,4 +1,4 @@ -Copyright (c) 2017 Invenia Technical Computing Corporation +Copyright (c) 2017 Chris de Graaf, Invenia Technical Computing Corporation Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/README.md b/README.md index 67c77c4..6fccb75 100644 --- a/README.md +++ b/README.md @@ -1,10 +1,10 @@ # PkgTemplates -[![Stable](https://img.shields.io/badge/docs-stable-blue.svg)](https://invenia.github.io/PkgTemplates.jl/stable) -[![Latest](https://img.shields.io/badge/docs-latest-blue.svg)](https://invenia.github.io/PkgTemplates.jl/latest) -[![Build Status](https://travis-ci.org/invenia/PkgTemplates.jl.svg?branch=master)](https://travis-ci.org/invenia/PkgTemplates.jl) -[![Build Status](https://ci.appveyor.com/api/projects/status/github/invenia/PkgTemplates.jl?svg=true)](https://ci.appveyor.com/project/invenia/PkgTemplates-jl) -[![CodeCov](https://codecov.io/gh/invenia/PkgTemplates.jl/branch/master/graph/badge.svg)](https://codecov.io/gh/invenia/PkgTemplates.jl) +[![Stable](https://img.shields.io/badge/docs-stable-blue.svg)](https://christopher-dG.github.io/PkgTemplates.jl/stable) +[![Latest](https://img.shields.io/badge/docs-latest-blue.svg)](https://christopher-dG.github.io/PkgTemplates.jl/latest) +[![Build Status](https://travis-ci.org/christopher-dG/PkgTemplates.jl.svg?branch=master)](https://travis-ci.org/christopher-dG/PkgTemplates.jl) +[![Build Status](https://ci.appveyor.com/api/projects/status/github/christopher-dG/PkgTemplates.jl?svg=true)](https://ci.appveyor.com/project/christopher-dG/PkgTemplates-jl) +[![CodeCov](https://codecov.io/gh/christopher-dG/PkgTemplates.jl/branch/master/graph/badge.svg)](https://codecov.io/gh/christopher-dG/PkgTemplates.jl) **PkgTemplates is a Julia package for creating new Julia packages in an easy, repeatable, and customizable way.** @@ -23,12 +23,12 @@ The simplest template only requires your GitHub username. ```julia julia> using PkgTemplates -julia> t = Template(; user="invenia") +julia> t = Template(; user="christopher-dG") julia> generate("MyPkg", t) INFO: Initialized git repo at /tmp/tmpvaHVki/MyPkg INFO: Made initial empty commit -INFO: Set remote origin to https://github.com/invenia/MyPkg.jl +INFO: Set remote origin to https://github.com/christopher-dG/MyPkg.jl INFO: Staged 5 files/directories: src/, test/, REQUIRE, .gitignore, README.md INFO: Committed files generated by PkgTemplates INFO: Moving temporary package directory into /home/degraafc/.julia/v0.6/ @@ -47,7 +47,7 @@ However, we can also configure a number of keyword arguments to `Template` and ```julia julia> t = Template(; - user="invenia", + user="christopher-dG", license="MIT", authors=["Chris de Graaf", "Invenia Technical Computing Corporation"], years="2016-2017", @@ -68,7 +68,7 @@ julia> generate("MyPkg", t; force=true, ssh=true) INFO: Initialized git repo at /tmp/tmpe0dWY5/MyPkg INFO: Applying git configuration INFO: Made initial empty commit -INFO: Set remote origin to git@github.com:invenia/MyPkg.jl.git +INFO: Set remote origin to git@github.com:christopher-dG/MyPkg.jl.git INFO: Created empty gh-pages branch INFO: Staged 9 files/directories: src/, test/, REQUIRE, README.md, .gitignore, LICENSE, .travis.yml, .appveyor.yml, docs/ INFO: Committed files generated by PkgTemplates @@ -91,7 +91,7 @@ test/runtests.jl ``` Information on each keyword as well as plugin types can be found in the -[documentation](https://invenia.github.io/PkgTemplates.jl/stable). +[documentation](https://christopher-dG.github.io/PkgTemplates.jl/stable). ## Comparison to [PkgDev](https://github.com/JuliaLang/PkgDev.jl) @@ -105,4 +105,4 @@ features that `PkgTemplates` doesn't include, you are encouraged to use It's extremely easy to extend `PkgTemplates` with new plugins. To get started, check out the -[plugin development guide](https://invenia.github.io/PkgTemplates.jl/stable/pages/plugin_development.html). +[plugin development guide](https://chrostipher-dG.github.io/PkgTemplates.jl/stable/pages/plugin_development.html). diff --git a/docs/make.jl b/docs/make.jl index 8893c81..0fae2a2 100644 --- a/docs/make.jl +++ b/docs/make.jl @@ -1,6 +1,6 @@ using Documenter, PkgTemplates -makedocs( +makedocs(; modules=[PkgTemplates], format=:html, pages=[ @@ -13,14 +13,14 @@ makedocs( ], repo="https://github.com/christopher-dG/PkgTemplates.jl/blob/{commit}{path}#L{line}", sitename="PkgTemplates.jl", - authors="Invenia Technical Computing Corporation", + authors="Chris de Graaf, Invenia Technical Computing Corporation", assets=[ "assets/invenia.css", ], ) -deploydocs( - repo="github.com/christopher-dG/PkgTemplates.jl.git", +deploydocs(; + repo="github.com/christopher-dG/PkgTemplates.jl", target="build", julia="0.6", deps=nothing, diff --git a/docs/src/index.md b/docs/src/index.md index a006947..0d3d2d1 100644 --- a/docs/src/index.md +++ b/docs/src/index.md @@ -1,10 +1,10 @@ # PkgTemplates -[![Stable](https://img.shields.io/badge/docs-stable-blue.svg)](https://invenia.github.io/PkgTemplates.jl/stable) -[![Latest](https://img.shields.io/badge/docs-latest-blue.svg)](https://invenia.github.io/PkgTemplates.jl/latest) -[![Build Status](https://travis-ci.org/invenia/PkgTemplates.jl.svg?branch=master)](https://travis-ci.org/invenia/PkgTemplates.jl) -[![Build Status](https://ci.appveyor.com/api/projects/status/github/invenia/PkgTemplates.jl?svg=true)](https://ci.appveyor.com/project/invenia/PkgTemplates-jl) -[![CodeCov](https://codecov.io/gh/invenia/PkgTemplates.jl/branch/master/graph/badge.svg)](https://codecov.io/gh/invenia/PkgTemplates.jl) +[![Stable](https://img.shields.io/badge/docs-stable-blue.svg)](https://christopher-dG.github.io/PkgTemplates.jl/stable) +[![Latest](https://img.shields.io/badge/docs-latest-blue.svg)](https://christopher-dG.github.io/PkgTemplates.jl/latest) +[![Build Status](https://travis-ci.org/christopher-dG/PkgTemplates.jl.svg?branch=master)](https://travis-ci.org/christopher-dG/PkgTemplates.jl) +[![Build Status](https://ci.appveyor.com/api/projects/status/github/christopher-dG/PkgTemplates.jl?svg=true)](https://ci.appveyor.com/project/christopher-dG/PkgTemplates-jl) +[![CodeCov](https://codecov.io/gh/christopher-dG/PkgTemplates.jl/branch/master/graph/badge.svg)](https://codecov.io/gh/christopher-dG/PkgTemplates.jl) **PkgTemplates is a Julia package for creating new Julia packages in an easy, repeatable, and customizable way.** @@ -22,7 +22,7 @@ The simplest template only requires your GitHub username. ```@repl using PkgTemplates -t = Template(; user="invenia") +t = Template(; user="christopher-dG") generate("MyPkg", t) cd(joinpath(t.dir, "MyPkg")); run(`git ls-tree -r --name-only HEAD`) ``` @@ -33,7 +33,7 @@ However, we can also configure a number of keyword arguments to [`Template`](@re ```@repl using PkgTemplates t = Template(; - user="invenia", + user="christopher-dG", license="MIT", authors=["Chris de Graaf", "Invenia Technical Computing Corporation"], years="2016-2017", diff --git a/docs/src/pages/licenses.md b/docs/src/pages/licenses.md index fddd256..df3c4ce 100644 --- a/docs/src/pages/licenses.md +++ b/docs/src/pages/licenses.md @@ -4,7 +4,7 @@ CurrentModule = PkgTemplates # Licenses -[Many open-source licenses](https://github.com/invenia/PkgTemplates.jl/tree/master/licenses) +[Many open-source licenses](https://github.com/christopher-dG/PkgTemplates.jl/tree/master/licenses) are available for use with `PkgTemplates`, but if you see that one is missing, don't hesitate to open an issue or PR. diff --git a/src/generate.jl b/src/generate.jl index 66d391f..fb1b5a5 100644 --- a/src/generate.jl +++ b/src/generate.jl @@ -34,7 +34,7 @@ function generate( if !force && ispath(pkg_dir) throw(ArgumentError( - "Something already exists at $pkg_dir, use force=true to overwrite it." + "Path '$pkg_dir' already exists, use force=true to overwrite it." )) end diff --git a/src/plugin.jl b/src/plugin.jl index 91d7c98..0885669 100644 --- a/src/plugin.jl +++ b/src/plugin.jl @@ -38,7 +38,7 @@ Generic plugins are plugins that add any number of patterns to the generated pac new( ["*.mgp"], config_file, - ".mypugin.yml", + ".myplugin.yml", [ Badge( "My Plugin", diff --git a/src/plugins/documenter.jl b/src/plugins/documenter.jl index 2eca3b7..678bf98 100644 --- a/src/plugins/documenter.jl +++ b/src/plugins/documenter.jl @@ -35,7 +35,7 @@ function gen_plugin(plugin::Documenter, template::Template, pkg_name::AbstractSt text = """ using Documenter, $pkg_name - makedocs( + makedocs(; modules=[$pkg_name], format=:html, pages=[ diff --git a/src/plugins/githubpages.jl b/src/plugins/githubpages.jl index 2c85695..99ce687 100644 --- a/src/plugins/githubpages.jl +++ b/src/plugins/githubpages.jl @@ -50,7 +50,7 @@ function gen_plugin(plugin::GitHubPages, template::Template, pkg_name::AbstractS file, """ - deploydocs( + deploydocs(; repo="github.com/$(template.user)/$pkg_name.jl", target="build", julia="0.6", diff --git a/test/tests.jl b/test/tests.jl index 5232c7b..5768da8 100644 --- a/test/tests.jl +++ b/test/tests.jl @@ -9,6 +9,7 @@ end struct Bar <: CustomPlugin end struct Baz <: Plugin end +const me = "christopher-dG" const git_config = Dict( "user.name" => "Tester McTestFace", "user.email" => "email@web.site", @@ -29,9 +30,9 @@ template_text = """ write(test_file, template_text) @testset "Template creation" begin - t = Template(; user="invenia") + t = Template(; user=me) rm(t.temp_dir; recursive=true) - @test t.user == "invenia" + @test t.user == me @test t.license == nothing @test t.years == string(Dates.year(Dates.today())) @test t.authors == LibGit2.getconfig("user.name", "") @@ -40,50 +41,50 @@ write(test_file, template_text) @test isempty(t.git_config) @test isempty(t.plugins) - t = Template(; user="invenia", license="MIT") + t = Template(; user=me, license="MIT") rm(t.temp_dir; recursive=true) @test t.license == "MIT" - t = Template(; user="invenia", years=2014) + t = Template(; user=me, years=2014) rm(t.temp_dir; recursive=true) @test t.years == "2014" - t = Template(user="invenia", years="2014-2015") + t = Template(user=me, years="2014-2015") rm(t.temp_dir; recursive=true) @test t.years == "2014-2015" - t = Template(; user="invenia", authors="Some Guy") + t = Template(; user=me, authors="Some Guy") rm(t.temp_dir; recursive=true) @test t.authors == "Some Guy" - t = Template(; user="invenia", authors=["Guy", "Gal"]) + t = Template(; user=me, authors=["Guy", "Gal"]) rm(t.temp_dir; recursive=true) @test t.authors == "Guy, Gal" - t = Template(; user="invenia", dir=test_file) + t = Template(; user=me, dir=test_file) rm(t.temp_dir; recursive=true) @test t.dir == test_file - t = Template(; user="invenia", julia_version=v"0.1.2") + t = Template(; user=me, julia_version=v"0.1.2") rm(t.temp_dir; recursive=true) @test t.julia_version == v"0.1.2" - t = Template(; user="invenia", requirements=["$test_pkg 0.1"]) + t = Template(; user=me, requirements=["$test_pkg 0.1"]) rm(t.temp_dir; recursive=true) @test t.requirements == ["$test_pkg 0.1"] - @test_warn r".+" t = Template(; user="invenia", requirements=[test_pkg, test_pkg]) + @test_warn r".+" t = Template(; user=me, requirements=[test_pkg, test_pkg]) rm(t.temp_dir; recursive=true) @test t.requirements == [test_pkg] @test_throws ArgumentError t = Template(; - user="invenia", + user=me, requirements=[test_pkg, "$test_pkg 0.1"] ) rm(t.temp_dir; force=true, recursive=true) - t = Template(; user="invenia", git_config=git_config) + t = Template(; user=me, git_config=git_config) rm(t.temp_dir; recursive=true) @test t.git_config == git_config - t = Template(; user="invenia", git_config=git_config) + t = Template(; user=me, git_config=git_config) rm(t.temp_dir; recursive=true) @test t.authors == git_config["user.name"] @@ -93,7 +94,7 @@ write(test_file, template_text) @test t.authors == git_config["user.name"] t = Template(; - user="invenia", + user=me, plugins = [GitHubPages(), TravisCI(), AppVeyor(), CodeCov(), Coveralls()], ) rm(t.temp_dir; recursive=true) @@ -105,7 +106,7 @@ write(test_file, template_text) ) @test_warn r".+" t = Template(; - user="invenia", + user=me, plugins=[TravisCI(), TravisCI()], ) rm(t.temp_dir; recursive=true) @@ -117,7 +118,7 @@ write(test_file, template_text) @test t.user == LibGit2.getconfig("github.username", "") end rm(t.temp_dir; force=true, recursive=true) - @test_throws ArgumentError t = Template(; user="invenia", license="FakeLicense") + @test_throws ArgumentError t = Template(; user=me, license="FakeLicense") rm(t.temp_dir; force=true, recursive=true) end @@ -237,7 +238,7 @@ end @testset "File generation" begin t = Template(; - user="invenia", + user=me, license="MPL", requirements=[test_pkg], git_config=git_config, @@ -316,7 +317,7 @@ end end @testset "Package generation" begin - t = Template(; user="invenia") + t = Template(; user=me) generate(test_pkg, t) @test !isfile(Pkg.dir(test_pkg, "LICENSE")) @test isfile(Pkg.dir(test_pkg, "README.md")) @@ -330,7 +331,7 @@ end remote = LibGit2.get(LibGit2.GitRemote, repo, "origin") branches = [LibGit2.shortname(branch[1]) for branch in LibGit2.GitBranchIter(repo)] @test LibGit2.getconfig(repo, "user.name", "") == LibGit2.getconfig("user.name", "") - @test LibGit2.url(remote) == "https://github.com/invenia/$test_pkg.jl" + @test LibGit2.url(remote) == "https://github.com/$me/$test_pkg.jl" @test in("master", branches) @test !in("gh-pages", branches) @test !LibGit2.isdirty(repo) @@ -339,24 +340,24 @@ end generate(test_pkg, t; ssh=true) repo = LibGit2.GitRepo(Pkg.dir(test_pkg)) remote = LibGit2.get(LibGit2.GitRemote, repo, "origin") - @test LibGit2.url(remote) == "git@github.com:invenia/$test_pkg.jl.git" + @test LibGit2.url(remote) == "git@github.com:$me/$test_pkg.jl.git" rm(Pkg.dir(test_pkg); recursive=true) - t = Template(; user="invenia", host="gitlab.com") + t = Template(; user=me, host="gitlab.com") generate(test_pkg, t) repo = LibGit2.GitRepo(Pkg.dir(test_pkg)) remote = LibGit2.get(LibGit2.GitRemote, repo, "origin") - @test LibGit2.url(remote) == "https://gitlab.com/invenia/$test_pkg.jl" + @test LibGit2.url(remote) == "https://gitlab.com/$me/$test_pkg.jl" rm(Pkg.dir(test_pkg); recursive=true) temp_dir = mktempdir() - t = Template(; user="invenia", dir=temp_dir) + t = Template(; user=me, dir=temp_dir) generate(test_pkg, t) @test isdir(joinpath(temp_dir, test_pkg)) rm(temp_dir; recursive=true) t = Template(; - user="invenia", + user=me, license="MIT", git_config=git_config, plugins=[AppVeyor(), GitHubPages(), Coveralls(), CodeCov(), TravisCI()], @@ -383,7 +384,7 @@ end @test isfile(Pkg.dir(test_pkg, "README.md")) rm(Pkg.dir(test_pkg); recursive=true) - t = Template(; user="invenia", plugins=[GitHubPages()]) + t = Template(; user=me, plugins=[GitHubPages()]) generate(test_pkg, t) readme = readstring(Pkg.dir(test_pkg, "README.md")) index = readstring(Pkg.dir(test_pkg, "docs", "src", "index.md")) @@ -392,7 +393,7 @@ end end @testset "Plugin generation" begin - t = Template(; user="invenia") + t = Template(; user=me) pkg_dir = joinpath(t.temp_dir, test_pkg) p = TravisCI() @@ -539,7 +540,7 @@ end @test contains(text, "PKGNAME: $test_pkg") @test contains(text, "Other") - t = Template(; user="invenia") + t = Template(; user=me) rm(t.temp_dir; recursive=true) view["OTHER"] = false