diff --git a/.Rbuildignore b/.Rbuildignore index 43d710e..39746d2 100644 --- a/.Rbuildignore +++ b/.Rbuildignore @@ -6,6 +6,7 @@ ^README\.*html$ ^NOTES\.*Rmd$ ^NOTES\.*html$ +^README\.md$ ^\.codecov\.yml$ ^README_files$ ^doc$ @@ -13,3 +14,6 @@ ^notes$ ^\.gitlab-ci\.yml$ ^appveyor\.yml$ +^cran-comments\.md$ +^CRAN-RELEASE$ +^CODE_OF_CONDUCT\.md$ diff --git a/CODE_OF_CONDUCT.md b/CODE_OF_CONDUCT.md new file mode 100644 index 0000000..0343527 --- /dev/null +++ b/CODE_OF_CONDUCT.md @@ -0,0 +1,25 @@ +# Contributor Code of Conduct + +As contributors and maintainers of this project, we pledge to respect all people who +contribute through reporting issues, posting feature requests, updating documentation, +submitting pull requests or patches, and other activities. + +We are committed to making participation in this project a harassment-free experience for +everyone, regardless of level of experience, gender, gender identity and expression, +sexual orientation, disability, personal appearance, body size, race, ethnicity, age, or religion. + +Examples of unacceptable behavior by participants include the use of sexual language or +imagery, derogatory comments or personal attacks, trolling, public or private harassment, +insults, or other unprofessional conduct. + +Project maintainers have the right and responsibility to remove, edit, or reject comments, +commits, code, wiki edits, issues, and other contributions that are not aligned to this +Code of Conduct. Project maintainers who do not follow the Code of Conduct may be removed +from the project team. + +Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by +opening an issue or contacting one or more of the project maintainers. + +This Code of Conduct is adapted from the Contributor Covenant +(https://www.contributor-covenant.org), version 1.0.0, available at +https://contributor-covenant.org/version/1/0/0/. diff --git a/CRAN-RELEASE b/CRAN-RELEASE new file mode 100644 index 0000000..37a978f --- /dev/null +++ b/CRAN-RELEASE @@ -0,0 +1,2 @@ +This package was submitted to CRAN on 2019-07-05. +Once it is accepted, delete this file and tag the release (commit bb5293d272). diff --git a/README.Rmd b/README.Rmd index bc0bef1..87ba5ce 100644 --- a/README.Rmd +++ b/README.Rmd @@ -1,11 +1,15 @@ --- output: rmarkdown::github_document +editor_options: + chunk_output_type: console --- +```{r pkg-knitr-opts, include=FALSE} +hrbrpkghelpr::global_opts() +``` -[![Travis-CI Build Status](https://travis-ci.org/hrbrmstr/ulid.svg?branch=master)](https://travis-ci.org/hrbrmstr/ulid) -[![AppVeyor build status](https://ci.appveyor.com/api/projects/status/github/hrbrmstr/ulid?branch=master&svg=true)](https://ci.appveyor.com/project/hrbrmstr/ulid) -[![Coverage Status](https://codecov.io/gh/hrbrmstr/ulid/branch/master/graph/badge.svg)](https://codecov.io/gh/hrbrmstr/ulid) -[![CRAN_Status_Badge](https://www.r-pkg.org/badges/version/ulid)](https://cran.r-project.org/package=ulid) +```{r badges, results='asis', echo=FALSE, cache=FALSE} +hrbrpkghelpr::stinking_badges() +``` # ulid @@ -64,20 +68,16 @@ The left-most character must be sorted first, and the right-most character sorte The following functions are implemented: -- `ULIDgenerate` / `generate` / `ulid_generate`: Generate a time-based ULID -- `ts_generate`: Generate ULID from timestamps -- `unmarshal`: Unmarshal a ULID into a data frame with timestamp and random bitstring columns +```{r ingredients, results='asis', echo=FALSE, cache=FALSE} +hrbrpkghelpr::describe_ingredients() +``` ## Installation -```{r nstall-ex, results='asis', echo = FALSE} +```{r install-ex, results='asis', echo=FALSE, cache=FALSE} hrbrpkghelpr::install_block() ``` -```{r message=FALSE, warning=FALSE, error=FALSE, include=FALSE} -options(width=120) -``` - ## Usage ```{r message=FALSE, warning=FALSE, error=FALSE} @@ -114,8 +114,12 @@ unmarshal(u) unmarshal(ut) ``` -## Package Code Metrics +## ulid Code Metrics ```{r} cloc::cloc_pkg_md() ``` + +## Code of Conduct + +Please note that this project is released with a Contributor Code of Conduct. By participating in this project you agree to abide by its terms. diff --git a/README.md b/README.md index e7bfafb..d62c3a0 100644 --- a/README.md +++ b/README.md @@ -1,11 +1,24 @@ -[![Travis-CI Build +[![Project Status: Active – The project has reached a stable, usable +state and is being actively +developed.](https://www.repostatus.org/badges/latest/active.svg)](https://www.repostatus.org/#active) +[![Signed +by](https://img.shields.io/badge/Keybase-Verified-brightgreen.svg)](https://keybase.io/hrbrmstr) +![Signed commit +%](https://img.shields.io/badge/Signed_Commits-90.0%25-lightgrey.svg) +[![Linux build Status](https://travis-ci.org/hrbrmstr/ulid.svg?branch=master)](https://travis-ci.org/hrbrmstr/ulid) -[![AppVeyor build -status](https://ci.appveyor.com/api/projects/status/github/hrbrmstr/ulid?branch=master&svg=true)](https://ci.appveyor.com/project/hrbrmstr/ulid) +[![Windows build +status](https://ci.appveyor.com/api/projects/status/github/hrbrmstr/ulid?svg=true)](https://ci.appveyor.com/project/hrbrmstr/ulid) [![Coverage Status](https://codecov.io/gh/hrbrmstr/ulid/branch/master/graph/badge.svg)](https://codecov.io/gh/hrbrmstr/ulid) -[![CRAN\_Status\_Badge](https://www.r-pkg.org/badges/version/ulid)](https://cran.r-project.org/package=ulid) +[![cran +checks](https://cranchecks.info/badges/worst/ulid)](https://cranchecks.info/pkgs/ulid) +[![CRAN +status](https://www.r-pkg.org/badges/version/ulid)](https://www.r-pkg.org/pkg/ulid) +![Minimal R +Version](https://img.shields.io/badge/R%3E%3D-3.2.0-blue.svg) +![License](https://img.shields.io/badge/License-MIT-blue.svg) # ulid @@ -72,9 +85,8 @@ must be used. Within the same millisecond, sort order is not guaranteed. The following functions are implemented: - - `ULIDgenerate` / `generate` / `ulid_generate`: Generate a time-based - ULID - - `ts_generate`: Generate ULID from timestamps + - `ts_generate`: Generate ULIDs from timestamps + - `ULIDgenerate`: Generate ULID - `unmarshal`: Unmarshal a ULID into a data frame with timestamp and random bitstring columns @@ -83,17 +95,20 @@ The following functions are implemented: ``` r install.packages("ulid", repos = "https://cinc.rud.is") # or -devtools::install_git("https://git.rud.is/hrbrmstr/ulid.git") +remotes::install_git("https://git.rud.is/hrbrmstr/ulid.git") # or -devtools::install_git("https://git.sr.ht/~hrbrmstr/ulid") +remotes::install_git("https://git.sr.ht/~hrbrmstr/ulid") # or -devtools::install_gitlab("hrbrmstr/ulid") +remotes::install_gitlab("hrbrmstr/ulid") # or -devtools::install_bitbucket("hrbrmstr/ulid") +remotes::install_bitbucket("hrbrmstr/ulid") # or -devtools::install_github("hrbrmstr/ulid") +remotes::install_github("hrbrmstr/ulid") ``` +NOTE: To use the ‘remotes’ install options you will need to have the +[{remotes} package](https://github.com/r-lib/remotes) installed. + ## Usage ``` r @@ -101,74 +116,66 @@ library(ulid) # current verison packageVersion("ulid") +## [1] '0.3.0' ``` - ## [1] '0.3.0' - ### One ``` r ulid::ULIDgenerate() +## [1] "0001EKRG9Z3CR2GXQG3MCN7R8T" ``` - ## [1] "0001EHX2TS3FANDH25PE5CT843" - ### Many ``` r (u <- ulid::ULIDgenerate(20)) +## [1] "0001EKRG9Z9G02VMWAJPN6RTST" "0001EKRG9ZTEVMMA961V1PSH56" "0001EKRG9ZBK7SVA6W2YGKNM66" "0001EKRG9ZN5M21HPD49YY1GYF" +## [5] "0001EKRG9ZF74J6RYS68QF1NGX" "0001EKRG9ZS7TPM10KKHCKNCZ5" "0001EKRG9ZBGGFSGE1EAM2F13M" "0001EKRG9Z2DQ9R0ZX907VXYZW" +## [9] "0001EKRG9ZYAYCB3SC72P3F5ZE" "0001EKRG9Z8KZ1NC97DQT9CM9K" "0001EKRG9Z0TTWPCAAZ74XN9G3" "0001EKRG9Z7RBF3WJ63RG3JEMP" +## [13] "0001EKRG9Z1BW9WXS6H0M9E7R2" "0001EKRG9Z0PJTW7V4X030HDG0" "0001EKRG9ZG79SSF47HM064N50" "0001EKRG9Z6E260CXJ0MSSJM9J" +## [17] "0001EKRG9ZM0AHQ5PZMWHNP5P3" "0001EKRG9ZBMWP7JJQ86PVTDGT" "0001EKRG9Z49YK1FK9H8DMYX12" "0001EKRG9ZVSCHBCMN344AAFKQ" ``` - ## [1] "0001EHX2TSMATE28BM0P9P4ZT7" "0001EHX2TSQ07QG90YYBCCGVRH" "0001EHX2TS3QJ5X4JA9WVDZCTM" "0001EHX2TSJRXPB6F8C8FQRCVN" - ## [5] "0001EHX2TSKPY54201E740DZGP" "0001EHX2TSNERDHBA5WW6JVHV7" "0001EHX2TS8PSY34CSC9J0FRBZ" "0001EHX2TS20FZ80A0H1JXH2HJ" - ## [9] "0001EHX2TSVM253MAWW6GY2VS7" "0001EHX2TSCR0AWQKH6NNXSYAM" "0001EHX2TSWAZDQ9E87PBEG4AG" "0001EHX2TS6WHF11YM851XMWXC" - ## [13] "0001EHX2TSS52C9F7RG4BH39ME" "0001EHX2TSEPB58N4M551QFGCS" "0001EHX2TSZC15E2F729MS59AB" "0001EHX2TST95FS48CAFBYVG8S" - ## [17] "0001EHX2TSQQ9QYG7YMY5VDXBC" "0001EHX2TSKBET2J6ZQ7YGJ3FT" "0001EHX2TSJW2JNK61RQ8JSSNA" "0001EHX2TSV4CV21CTVNAAQE4V" - ### Unmarshal ``` r unmarshal(u) +## ts rnd +## 1 2019-07-27 08:19:11 9G02VMWAJPN6RTST +## 2 2019-07-27 08:19:11 TEVMMA961V1PSH56 +## 3 2019-07-27 08:19:11 BK7SVA6W2YGKNM66 +## 4 2019-07-27 08:19:11 N5M21HPD49YY1GYF +## 5 2019-07-27 08:19:11 F74J6RYS68QF1NGX +## 6 2019-07-27 08:19:11 S7TPM10KKHCKNCZ5 +## 7 2019-07-27 08:19:11 BGGFSGE1EAM2F13M +## 8 2019-07-27 08:19:11 2DQ9R0ZX907VXYZW +## 9 2019-07-27 08:19:11 YAYCB3SC72P3F5ZE +## 10 2019-07-27 08:19:11 8KZ1NC97DQT9CM9K +## 11 2019-07-27 08:19:11 0TTWPCAAZ74XN9G3 +## 12 2019-07-27 08:19:11 7RBF3WJ63RG3JEMP +## 13 2019-07-27 08:19:11 1BW9WXS6H0M9E7R2 +## 14 2019-07-27 08:19:11 0PJTW7V4X030HDG0 +## 15 2019-07-27 08:19:11 G79SSF47HM064N50 +## 16 2019-07-27 08:19:11 6E260CXJ0MSSJM9J +## 17 2019-07-27 08:19:11 M0AHQ5PZMWHNP5P3 +## 18 2019-07-27 08:19:11 BMWP7JJQ86PVTDGT +## 19 2019-07-27 08:19:11 49YK1FK9H8DMYX12 +## 20 2019-07-27 08:19:11 VSCHBCMN344AAFKQ ``` - ## ts rnd - ## 1 2019-07-04 19:27:21 MATE28BM0P9P4ZT7 - ## 2 2019-07-04 19:27:21 Q07QG90YYBCCGVRH - ## 3 2019-07-04 19:27:21 3QJ5X4JA9WVDZCTM - ## 4 2019-07-04 19:27:21 JRXPB6F8C8FQRCVN - ## 5 2019-07-04 19:27:21 KPY54201E740DZGP - ## 6 2019-07-04 19:27:21 NERDHBA5WW6JVHV7 - ## 7 2019-07-04 19:27:21 8PSY34CSC9J0FRBZ - ## 8 2019-07-04 19:27:21 20FZ80A0H1JXH2HJ - ## 9 2019-07-04 19:27:21 VM253MAWW6GY2VS7 - ## 10 2019-07-04 19:27:21 CR0AWQKH6NNXSYAM - ## 11 2019-07-04 19:27:21 WAZDQ9E87PBEG4AG - ## 12 2019-07-04 19:27:21 6WHF11YM851XMWXC - ## 13 2019-07-04 19:27:21 S52C9F7RG4BH39ME - ## 14 2019-07-04 19:27:21 EPB58N4M551QFGCS - ## 15 2019-07-04 19:27:21 ZC15E2F729MS59AB - ## 16 2019-07-04 19:27:21 T95FS48CAFBYVG8S - ## 17 2019-07-04 19:27:21 QQ9QYG7YMY5VDXBC - ## 18 2019-07-04 19:27:21 KBET2J6ZQ7YGJ3FT - ## 19 2019-07-04 19:27:21 JW2JNK61RQ8JSSNA - ## 20 2019-07-04 19:27:21 V4CV21CTVNAAQE4V - ### Use defined timestamps ``` r (ut <- ts_generate(as.POSIXct("2017-11-01 15:00:00", origin="1970-01-01"))) -``` +## [1] "0001CZM6DGXNMVPCQG0B295F3S" - ## [1] "0001CZM6DGX836E94E630NTNNB" - -``` r unmarshal(ut) +## ts rnd +## 1 2017-11-01 15:00:00 XNMVPCQG0B295F3S ``` - ## ts rnd - ## 1 2017-11-01 15:00:00 X836E94E630NTNNB - -## Package Code Metrics +## ulid Code Metrics ``` r cloc::cloc_pkg_md() @@ -176,7 +183,13 @@ cloc::cloc_pkg_md() | Lang | \# Files | (%) | LoC | (%) | Blank lines | (%) | \# Lines | (%) | | :----------- | -------: | ---: | --: | ---: | ----------: | ---: | -------: | ---: | -| C/C++ Header | 3 | 0.27 | 763 | 0.86 | 238 | 0.72 | 302 | 0.53 | -| C++ | 2 | 0.18 | 87 | 0.10 | 22 | 0.07 | 37 | 0.07 | -| Rmd | 2 | 0.18 | 20 | 0.02 | 65 | 0.20 | 136 | 0.24 | -| R | 4 | 0.36 | 15 | 0.02 | 7 | 0.02 | 94 | 0.17 | +| C/C++ Header | 3 | 0.27 | 763 | 0.86 | 238 | 0.71 | 302 | 0.53 | +| C++ | 2 | 0.18 | 87 | 0.10 | 22 | 0.07 | 37 | 0.06 | +| Rmd | 2 | 0.18 | 22 | 0.02 | 66 | 0.20 | 137 | 0.24 | +| R | 4 | 0.36 | 15 | 0.02 | 7 | 0.02 | 94 | 0.16 | + +## Code of Conduct + +Please note that this project is released with a Contributor Code of +Conduct. By participating in this project you agree to abide by its +terms. diff --git a/cran-comments.md b/cran-comments.md new file mode 100644 index 0000000..833d659 --- /dev/null +++ b/cran-comments.md @@ -0,0 +1,15 @@ +## Test environments +* local OS X install, R 3.6.0 +* ubuntu 14.04 (on travis-ci), R 3.6.0 +* win-builder (devel and release) + +## R CMD check results + +0 errors | 0 warnings | 1 note + +* This is a new release. +* The claimed potentially spelled incorrectly words are not spelled incorrectly + and I did not want to '' them all to avoid the check. +* I've commented out the calls to std::rand() and used' R's C random functions + instead (in the event y'all have other checks you do that winbuilder does + not show). \ No newline at end of file