Skip to content

Commit 3187dfb

Browse files
author
Kirill Müller
committed
Merge branch 'release/0.1' into production
2 parents c4dff3c + 76f916e commit 3187dfb

36 files changed

+616
-83
lines changed

.Rbuildignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,3 +10,4 @@
1010
^wercker\.yml$
1111
^readme$
1212
^appveyor\.yml$
13+
^makeR$

.gitmodules

Lines changed: 0 additions & 3 deletions
This file was deleted.

DESCRIPTION

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,18 @@
11
Package: rprojroot
22
Title: Finding Files in Project Subdirectories
3-
Version: 0.0-8
3+
Version: 0.1
44
Authors@R: as.person("Kirill Müller <krlmlr+r@mailbox.org> [aut, cre]")
5-
Description: Robust, reliable and flexible paths to files below a project root.
6-
The 'root' of a project is defined as a directory that matches a certain
7-
criterion, e.g., it contains a certain regular file.
8-
Depends:
9-
R (>= 3.0.0)
10-
Suggests:
11-
testthat,
12-
knitr,
13-
rmarkdown
5+
Description: Robust, reliable and flexible paths to files below a
6+
project root. The 'root' of a project is defined as a directory
7+
that matches a certain criterion, e.g., it contains a certain
8+
regular file.
9+
Depends: R (>= 3.0.0)
10+
Suggests: testthat, knitr, rmarkdown
1411
VignetteBuilder: knitr
1512
License: GPL-3
1613
LazyData: true
1714
Encoding: UTF-8
1815
GitHub: https://github.com/krlmlr/rprojroot
1916
URL: https://krlmlr.github.io/rprojroot
2017
BugReports: https://github.com/krlmlr/rprojroot/issues
18+
RoxygenNote: 5.0.1

Makefile

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,2 @@
11
-include makeR/Makefile
22
-include Makefile.in
3-
4-
init:
5-
git submodule update --init

NAMESPACE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Generated by roxygen2 (4.1.1.9001): do not edit by hand
1+
# Generated by roxygen2: do not edit by hand
22

33
S3method(as.root_criterion,character)
44
S3method(as.root_criterion,default)

NEWS.md

Lines changed: 24 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -1,49 +1,24 @@
1-
Version 0.0-8 (2015-06-03)
2-
===
3-
4-
- use `dirname` instead of `normalizePath("..")`
5-
6-
Version 0.0-7 (2015-05-31)
7-
===
8-
9-
- Use `winslash = "/"` for consistent tests and behavior
10-
- Replace potentially endless loop with a limited loop
11-
- Test on Windows with appveyor
12-
13-
Version 0.0-6 (2015-05-29)
14-
===
15-
16-
- Full test coverage
17-
18-
Version 0.0-5 (2015-05-29)
19-
===
20-
21-
- New function `as.root_criterion` (called by `find_root()`), a character argument is converted to a `has_file()` criterion. Now the call `find_root("filename")` is identical to `find_root(has_file("filename"))`.
22-
- Use `"."` instead of `"getwd()"` as default for `path` argument
23-
- Improved documentation
24-
25-
Version 0.0-4 (2015-05-20)
26-
===
27-
28-
- New variables `criteria`, `is_rstudio_project`, `is_r_package`
29-
- New function `has_file_pattern` (was previously `has_file`); the `has_file` function now checks the entire file name without pattern matching
30-
31-
Version 0.0-3 (2015-05-20)
32-
===
33-
34-
- Criterion concept: constructors `root_criterion` and `has_file`
35-
- All functions that used to accept `filename` + `contents` + `n` now accept only a criterion
36-
37-
Version 0.0-2 (2015-05-19)
38-
===
39-
40-
- Factory `make_fix_root_file` that fixes the working directory
41-
42-
Version 0.0-1 (2015-05-19)
43-
===
44-
45-
- Initial version
46-
- Main workhorse function `find_root`
47-
- Wrapper `find_root_file`
48-
- Factory `make_find_root_file` and helpers `find_rstudio_root_file` and `find_package_root_file`
49-
- Vignette
1+
Version 0.1 (2016-02-03)
2+
===
3+
4+
Initial GitHub release.
5+
6+
- Getting started:
7+
- `find_package_root_file()`
8+
- `find_rstudio_root_file()`
9+
10+
- S3 class `root_criterion`:
11+
- `root_criterion()`
12+
- `as.root_criterion()`
13+
- `is.root_criterion()`
14+
- `has_file()`
15+
- `has_file_pattern()`
16+
- `criteria`
17+
- `is_r_package`
18+
- `is_rstudio_project`
19+
20+
- Use a custom notion of a project root:
21+
- `find_root()`
22+
- `find_root_file()`
23+
- `make_find_root_file()`
24+
- `make_fix_root_file()`

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<!-- README.md is generated from README.Rmd. Please edit that file -->
2-
[rprojroot](https://krlmlr.github.io/rprojroot) [![wercker status](https://app.wercker.com/status/c4dfa136cd78514514e259cc388e880c/s/master "wercker status")](https://app.wercker.com/project/bykey/c4dfa136cd78514514e259cc388e880c) [![AppVeyor Build Status](https://ci.appveyor.com/api/projects/status/github/krlmlr/rprojroot?branch=master)](https://ci.appveyor.com/project/krlmlr/rprojroot) [![codecov.io](https://codecov.io/github/krlmlr/rprojroot/coverage.svg?branch=master)](https://codecov.io/github/krlmlr/rprojroot?branch=master)
2+
[rprojroot](https://krlmlr.github.io/rprojroot) [![wercker status](https://app.wercker.com/status/c4dfa136cd78514514e259cc388e880c/s/master "wercker status")](https://app.wercker.com/project/bykey/c4dfa136cd78514514e259cc388e880c) [![AppVeyor Build Status](https://ci.appveyor.com/api/projects/status/github/krlmlr/rprojroot?branch=master&svg=true)](https://ci.appveyor.com/project/krlmlr/rprojroot) [![codecov.io](https://codecov.io/github/krlmlr/rprojroot/coverage.svg?branch=master)](https://codecov.io/github/krlmlr/rprojroot?branch=master)
33
=======================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================
44

55
This package helps accessing files relative to a *project root* to [stop the working directory insanity](https://gist.github.com/jennybc/362f52446fe1ebc4c49f).
@@ -32,7 +32,7 @@ Installation and further reading
3232
Install from GitHub:
3333

3434
``` r
35-
devtools::install("krlmlr/rprojroot")
35+
devtools::install_github("krlmlr/rprojroot")
3636
```
3737

3838
See the [vignette](http://krlmlr.github.io/rprojroot/vignettes/rprojroot.html) for more detail.

makeR

Lines changed: 0 additions & 1 deletion
This file was deleted.

makeR/Makefile

Lines changed: 206 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,206 @@
1+
R := R --no-save --no-restore
2+
RSCRIPT := Rscript
3+
DELETE := rm -fR
4+
PKGNAME := $(shell Rscript ./makeR/get-pkg-name)
5+
VERSION := $(shell Rscript ./makeR/get-pkg-version)
6+
TARGZ := $(PKGNAME)_$(VERSION).tar.gz
7+
8+
.SILENT:
9+
10+
.FORCE:
11+
12+
usage:
13+
echo "Available targets:"
14+
echo ""
15+
echo " clean - Clean everything up"
16+
echo " bump-cran - Bump second digit of version (0.1 -> 0.2) and tag"
17+
echo " bump-gh - Bump third digit of version (0.1.2 -> 0.1.3) and tag"
18+
echo " bump - Bump fourth digit of version (0.1.2.3 -> 0.1.2.4) and tag"
19+
echo " rd - Create documentation via roxygen2"
20+
echo " install - Install dependencies"
21+
echo " dependencies "
22+
echo " dt_* - Run devtools verb"
23+
echo " test - Run tests"
24+
echo " covr - Check coverage"
25+
echo " lintr - Run lintr"
26+
echo " check-rev-dep - Run a reverse dependency check against packages on CRAN"
27+
echo " check-rd-files - Run Rd2pdf on each doc file to track hard-to-spot doc/latex errors"
28+
echo " winbuilder - Ask for email and build on winbuilder"
29+
echo " init-gh-pages - Initialize orphan gh-pages branch"
30+
echo " staticdocs - Build staticdocs in inst/web"
31+
echo " gh-pages-build - Populate gh-pages branch with staticdocs"
32+
echo " gh-pages-push - Push gh-pages branch to GitHub Pages"
33+
echo " view-docs - View staticdocs locally"
34+
echo " init-wercker - Install a default wercker.yml"
35+
echo " wercker-build - Run wercker build for local instance of docker"
36+
echo " wercker-deploy - Run wercker deploy for local instance of docker"
37+
echo " upgrade - upgrade installation of makeR"
38+
echo " uninstall - uninstall makeR"
39+
40+
41+
## Script targers
42+
43+
git-is-clean branch-is-master init-gh-pages init-staticdocs gh-pages-build postinstall init-wercker:
44+
sh ./makeR/$@
45+
46+
47+
48+
## devtools targets:
49+
50+
# ls("package:devtools") %>% setNames(nm=.) %>% lapply(get) %>% lapply(formals) %>% lapply(`[`, 1) %>% lapply(names) %>% equals("pkg") %>% Filter(isTRUE, .) %>% names %>% sprintf("dt_%s", .) %>% cat
51+
dt_add_rstudio_project dt_add_test_infrastructure dt_add_travis dt_bash dt_build dt_build_vignettes dt_build_win dt_check dt_check_doc dt_clean_dll dt_clean_vignettes dt_compile_dll dt_document dt_imports_env dt_install dt_install_deps dt_lint dt_load_all dt_load_code dt_load_data dt_load_dll dt_missing_s3 dt_ns_env dt_parse_ns_file dt_pkg_env dt_release dt_release_checks dt_reload dt_revdep dt_revdep_check dt_revdep_maintainers dt_run_examples dt_show_news dt_submit_cran dt_test dt_unload dt_use_appveyor dt_use_cran_comments dt_use_data_raw dt_use_package_doc dt_use_rcpp dt_use_readme_rmd dt_use_revdep dt_use_rstudio dt_use_testthat dt_use_travis dt_wd:
52+
53+
dt_%: git-is-clean
54+
Rscript -e "devtools::$(subst dt_,,$@)()"
55+
git add .
56+
git commit -m "$(subst dt_,,$@)"
57+
58+
59+
60+
## Helper targers
61+
62+
git-is-clean:
63+
64+
branch-is-master: git-is-clean
65+
66+
tag:
67+
(echo Release v$$(sed -n -r '/^Version: / {s/.* ([0-9.-]+)$$/\1/;p}' DESCRIPTION); echo; sed -n '/^===/,/^===/{:a;N;/\n===/!ba;p;q}' NEWS.md | head -n -3 | tail -n +3) | git tag -a -F /dev/stdin v$$(sed -n -r '/^Version: / {s/.* ([0-9.-]+)$$/\1/;p}' DESCRIPTION)
68+
69+
bump-cran-desc: git-is-clean rd
70+
crant -u 2 -C
71+
72+
bump-gh-desc: git-is-clean rd
73+
crant -u 3 -C
74+
75+
bump-desc: git-is-clean rd
76+
test "$$(git status --porcelain | wc -c)" = "0"
77+
sed -i -r '/^Version: / s/( [0-9.]+)$$/\1-0.0/' DESCRIPTION
78+
git add DESCRIPTION
79+
test "$$(git status --porcelain | wc -c)" = "0" || git commit -m "add suffix -0.0 to version"
80+
crant -u 4 -C
81+
82+
inst/NEWS.Rd: git-is-clean NEWS.md
83+
Rscript -e "tools:::news2Rd('$(word 2,$^)', '$@')"
84+
sed -r -i 's/`([^`]+)`/\\code{\1}/g' $@
85+
git add $@
86+
test "$$(git status --porcelain | wc -c)" = "0" || git commit -m "update NEWS.Rd"
87+
88+
inst/web:
89+
mkdir -p inst
90+
git branch gh-pages origin/gh-pages || true
91+
git clone --branch gh-pages . inst/web
92+
93+
94+
95+
## Cleanup
96+
97+
clean:
98+
echo "Cleaning up ..."
99+
${DELETE} src/*.o src/*.so *.tar.gz
100+
${DELETE} *.Rcheck
101+
${DELETE} .RData .Rhistory
102+
103+
104+
105+
## Tagging
106+
107+
bump-cran: bump-cran-desc inst/NEWS.Rd tag
108+
109+
bump-gh: bump-gh-desc inst/NEWS.Rd tag
110+
111+
bump: bump-desc inst/NEWS.Rd tag
112+
113+
114+
115+
## Documentation
116+
117+
rd: git-is-clean
118+
Rscript -e "library(methods); devtools::document()"
119+
git add man/ NAMESPACE
120+
test "$$(git status --porcelain | wc -c)" = "0" || git commit -m "document"
121+
122+
123+
124+
## Testing
125+
126+
dependencies-hook:
127+
128+
install dependencies: dependencies-hook
129+
Rscript -e "sessionInfo()"
130+
Rscript -e "options(repos = c(CRAN = 'http://cran.rstudio.com')); devtools::install_deps(dependencies = TRUE, upgrade = FALSE)"
131+
132+
test:
133+
Rscript -e "devtools::check(document = TRUE, check_dir = '.', cleanup = FALSE)"
134+
! egrep -A 5 "ERROR|WARNING|NOTE" *.Rcheck/00check.log
135+
136+
covr:
137+
Rscript -e 'if (!requireNamespace("covr")) devtools::install_github("jimhester/covr"); covr::codecov()'
138+
139+
lintr:
140+
Rscript -e 'Sys.setenv(LINTR_COMMENT_BOT="FALSE"); if (!requireNamespace("lintr")) devtools::install_github("jimhester/lintr"); lintr::lint_package()'
141+
142+
check-rev-dep:
143+
echo "Running reverse dependency checks for CRAN ..."
144+
${RSCRIPT} ./makeR/check-rev-dep
145+
146+
check-rd-files: rd
147+
echo "Checking RDs one by one ..."
148+
${RSCRIPT} ./makeR/check-rd-files
149+
150+
winbuilder: rd
151+
echo "Building via winbuilder"
152+
${RSCRIPT} ./makeR/winbuilder
153+
154+
155+
156+
# staticdocs
157+
158+
gh-pages-init:
159+
160+
init-staticdocs:
161+
162+
staticdocs: inst/web
163+
Rscript -e 'if (!requireNamespace("staticdocs")) devtools::install_github("gaborcsardi/staticdocs"); staticdocs::build_site()'
164+
165+
gh-pages-build: staticdocs
166+
167+
gh-pages-push:
168+
git push origin gh-pages
169+
170+
view-html-vignettes:
171+
chromium-browser inst/doc/*.html
172+
173+
view-docs:
174+
chromium-browser inst/web/index.html
175+
176+
177+
178+
## wercker
179+
180+
init-wercker: git-is-clean
181+
182+
wercker-build:
183+
wercker build --docker-host=unix://var/run/docker.sock --no-remove
184+
185+
wercker-deploy:
186+
wercker deploy --docker-host=unix://var/run/docker.sock --no-remove
187+
188+
189+
190+
## Maintenance
191+
192+
postinstall: git-is-clean
193+
194+
upgrade: git-is-clean
195+
echo "Upgrading makeR"
196+
sh ./makeR/upgrade
197+
198+
uninstall: git-is-clean
199+
echo "Uninstalling makeR"
200+
sh ./makeR/uninstall
201+
202+
203+
## Obsolete
204+
205+
init:
206+
true

makeR/Makefile.tmpl

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
-include makeR/Makefile
2+
-include Makefile.in

0 commit comments

Comments
 (0)