From 7dfe064943a70fcf0f8d424ee80e394d4a8d93e3 Mon Sep 17 00:00:00 2001 From: boB Rudis Date: Sat, 6 Jul 2019 06:18:15 -0400 Subject: [PATCH] cran --- .Rbuildignore | 2 + .travis.yml | 19 ++-------- CRAN-RELEASE | 2 + DESCRIPTION | 39 ++++++++++---------- LICENSE | 2 + cran-comments.md | 17 +++------ inst/extdat/test.java | 5 --- inst/extdat/test_1.2.class | Bin 433 -> 0 bytes inst/extdat/test_1.3.class | Bin 433 -> 0 bytes inst/extdat/test_1.4.class | Bin 433 -> 0 bytes inst/extdat/test_1.5.class | Bin 182 -> 0 bytes inst/tinytest/test_wand.R | 80 ++++++++++++++++++++++++++++++++++++++++ tests/test-all.R | 2 - tests/testthat/test-wand.R | 90 --------------------------------------------- tests/tinytest.R | 5 +++ 15 files changed, 120 insertions(+), 143 deletions(-) create mode 100644 CRAN-RELEASE create mode 100644 LICENSE delete mode 100644 inst/extdat/test.java delete mode 100644 inst/extdat/test_1.2.class delete mode 100644 inst/extdat/test_1.3.class delete mode 100644 inst/extdat/test_1.4.class delete mode 100644 inst/extdat/test_1.5.class create mode 100644 inst/tinytest/test_wand.R delete mode 100644 tests/test-all.R delete mode 100644 tests/testthat/test-wand.R create mode 100644 tests/tinytest.R diff --git a/.Rbuildignore b/.Rbuildignore index ae879f1..dbc8875 100644 --- a/.Rbuildignore +++ b/.Rbuildignore @@ -8,3 +8,5 @@ ^tools$ ^cran-comments\.md$ ^builder$ +^\.vscode$ +^CRAN-RELEASE$ diff --git a/.travis.yml b/.travis.yml index d69d6a3..fdc4cea 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,16 +1,5 @@ -language: r -warnings_are_errors: true -sudo: required -dist: trusty +language: R +cache: packages -apt_packages: - - libmagic-dev - -env: - global: - - CRAN: http://cran.rstudio.com - -notifications: - email: - on_success: change - on_failure: change +after_success: + - Rscript -e 'covr::codecov()' \ No newline at end of file diff --git a/CRAN-RELEASE b/CRAN-RELEASE new file mode 100644 index 0000000..89ad06f --- /dev/null +++ b/CRAN-RELEASE @@ -0,0 +1,2 @@ +This package was submitted to CRAN on 2019-07-06. +Once it is accepted, delete this file and tag the release (commit ecb1aa0316). diff --git a/DESCRIPTION b/DESCRIPTION index 357d100..f1b5727 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,26 +1,25 @@ Package: wand Type: Package -Title: Retrieve 'Magic' Attributes from Files and Directories -Version: 0.4.0 -Date: 2018-09-16 -Authors@R: c( - person("Bob", "Rudis", email = "bob@rud.is", role = c("aut", "cre"), - comment = c(ORCID = "0000-0001-5670-2640")) - ) +Title: Retrieve 'Magic' Attributes from Files and + Directories +Version: 0.5.0 +Date: 2019-07-06 +Authors@R: c( person("Bob", "Rudis", email = + "bob@rud.is", role = c("aut", "cre"), comment = + c(ORCID = "0000-0001-5670-2640")) ) Maintainer: Bob Rudis -Description: 'MIME' types are shorthand descriptors for file contents and can be - determined from "magic" bytes in file headers, file contents or intuited from - file extensions. Tools are provided to perform curated "magic" tests as well - as mapping 'MIME' types from a database of over 1,500 extension mappings. +Description: 'MIME' types are shorthand descriptors for + file contents and can be determined from "magic" + bytes in file headers, file contents or intuited + from file extensions. Tools are provided to + perform curated "magic" tests as well as mapping + 'MIME' types from a database of over 1,500 + extension mappings. URL: http://gitlab.com/hrbrmstr/wand BugReports: https://gitlab.com/hrbrmstr/wand/issues Encoding: UTF-8 -License: AGPL -Suggests: - testthat, - covr -Imports: - tools -Depends: - R (>= 3.2.0) -RoxygenNote: 6.0.1.9000 +License: MIT + file LICENSE +Suggests: covr, tinytest +Imports: tools +Depends: R (>= 3.2.0) +RoxygenNote: 6.1.1 diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..b6a10f1 --- /dev/null +++ b/LICENSE @@ -0,0 +1,2 @@ +YEAR: 2019 +COPYRIGHT HOLDER: Bob Rudis diff --git a/cran-comments.md b/cran-comments.md index 524e03b..43e13ba 100644 --- a/cran-comments.md +++ b/cran-comments.md @@ -1,21 +1,16 @@ ## Test environments -* local OS X install, R 3.3.1 -* local Windows 10 install, R 3.3.0 & R 3.3.1 -* ubuntu 14.04 (on travis-ci), R 3.3.1 +* 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. - -## Reverse dependencies - -This is a new release, so there are no reverse dependencies. +* This is a maintenance release. --- -- For Unix/Linux the 'libmagic' library is *required* -- For Windows, Rtools 3.3 is required (for the `file` cmd) -- Information on how to install requirements is found in `INSTALL` & `README.md` \ No newline at end of file +Update per Dr Ripley note re: Solaris +Removed legitimate tests causing previous CRAN update submission issue. + diff --git a/inst/extdat/test.java b/inst/extdat/test.java deleted file mode 100644 index 384c337..0000000 --- a/inst/extdat/test.java +++ /dev/null @@ -1,5 +0,0 @@ -public class test { - public static void main(String[] args) { - System.out.println("this is a test java source file"); - } -} diff --git a/inst/extdat/test_1.2.class b/inst/extdat/test_1.2.class deleted file mode 100644 index f0e2a72475ddc2d443124a1aaedab3fbbe11ab91..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 433 zcmZvY%}T>S5Xb+Ur1>)1+S>YAj0YilXda;AMetNqhOp6IWF_7R4_1W$(yow~-Vo55LVXihtIqyJXI5gPPs`WPS_E=iAGebS6{yl! diff --git a/inst/extdat/test_1.3.class b/inst/extdat/test_1.3.class deleted file mode 100644 index f657f62980fd67da06d051efee22d79cfee9f13a..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 433 zcmZvY%}T>S5Xb+Urr9P&TU%2mUJEp)!VkbT^udXAvhNo5f>YsBAVgiQYJ`imAL%26nY9^@-tp zaI`o!eQaTyVP8M0GNda)gMAG_G2ekRV)Sv0$v%;j|1HGV0zOlkJK zqCoIBnabm98cWk~QlvwMUR`6^&A^`wl+aE=^xsN2K$CvW91Db_Mbf3$fHWiBJpKTC pC4-hH>C{extiUJRpoeuT;J(4?Hr`<`aF0SjgR0sDuaa$H?H4G|S>*r# diff --git a/inst/extdat/test_1.4.class b/inst/extdat/test_1.4.class deleted file mode 100644 index 8404a19a8643c3973f8a710ad388e47845e2eaa3..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 433 zcmZvYOH0E*5Xb+Uq|L)z`c!FaED5j+(YB3?Xg>RPwtA<0(oW9dP`gCD>T zCCuX49!!SOLfLz4i9e`tn=bt zFto-p7nk!a5#R59= zY&bSHeQaTyVP8GUDx}Lpjf5Hrt2#4$pi~<>K6bH3{dAn6y=Zoo%*15b6~9zUWHfs* zr$F#GnJl7f8cWe|f@dR!Ze3&9&0s%iD5af(;eRV(fCl}VJ_ZPfL(-*JpEM)gIQjs4 pC4-hH*{q!!S%FWsMi1&#z^x$ diff --git a/inst/extdat/test_1.5.class b/inst/extdat/test_1.5.class deleted file mode 100644 index ede311058d3198356003ce4163699abf41342e62..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 182 zcmX^0Z`VEs1_nb0UM>b^1}=66ZgvJ9Mg}&U%)HDJJ4Oa(4b3n{1{UZ1lvG9rexJ;| zRKL>Pq|~C2#H1Xc2v=}^X;E^jTPBFZ8IoFDqL-CemdL}v!oUjD1`=Ro5C943=OpH( z>-#5Vr6!j!C^9esZ36*DAOxxfl59YpESS&0z^b*KfpH^PnjJ{80fiw-Ie;`111A97 C+aFN? diff --git a/inst/tinytest/test_wand.R b/inst/tinytest/test_wand.R new file mode 100644 index 0000000..7241693 --- /dev/null +++ b/inst/tinytest/test_wand.R @@ -0,0 +1,80 @@ +library(wand) + +list( + actions.csv = "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet", + actions.txt = "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet", + actions.xlsx = "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet", + test_128_44_jstereo.mp3 = "audio/mp3", + test_excel_2000.xls = "application/msword", + test_excel_spreadsheet.xml = "application/xml", + test_excel_web_archive.mht = "message/rfc822", + test_excel.xlsm = "application/zip", + test_excel.xlsx = "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet", + test_nocompress.tif = "image/tiff", + test_powerpoint.pptm = "application/zip", + test_powerpoint.pptx = "application/vnd.openxmlformats-officedocument.presentationml.presentation", + test_word_2000.doc = "application/msword", + test_word_6.0_95.doc = "application/msword", + test_word.docm = "application/zip", + test_word.docx = "application/vnd.openxmlformats-officedocument.wordprocessingml.document", + test.au = "audio/basic", + test.bin = c( + "application/mac-binary", + "application/macbinary", "application/octet-stream", "application/x-binary", + "application/x-macbinary" + ), test.bmp = "image/bmp", + test.dtd = "application/xml-dtd", + test.emf = "application/x-msmetafile", + test.eps = "application/postscript", + test.fli = c("video/flc", "video/fli", "video/x-fli"), + test.gif = "image/gif", + test.ico = "image/x-icon", + test.jpg = "image/jpeg", + test.mp3 = "audio/mp3", + test.odt = "application/vnd.oasis.opendocument.text", + test.ogg = c( + "application/ogg", + "audio/ogg" + ), test.pcx = c("image/pcx", "image/x-pcx"), + test.pdf = "application/pdf", + test.pl = c("text/plain", "text/x-perl", "text/x-script.perl"), + test.png = "image/png", + test.pnm = c( + "application/x-portable-anymap", + "image/x-portable-anymap" + ), test.ppm = "image/x-portable-pixmap", + test.ppt = "application/msword", + test.ps = "application/postscript", + test.psd = "image/photoshop", + test.py = c( + "text/x-python", + "text/x-script.phyton" + ), test.rtf = c( + "application/rtf", + "application/x-rtf", "text/richtext", "text/rtf" + ), test.sh = c( + "application/x-bsh", + "application/x-sh", "application/x-shar", "text/x-script.sh", + "text/x-sh" + ), test.tar = "application/tar", + test.tar.gz = c( + "application/octet-stream", + "application/x-compressed", "application/x-gzip" + ), test.tga = "image/x-tga", + test.txt = "text/plain", + test.txt.gz = c( + "application/octet-stream", + "application/x-compressed", "application/x-gzip" + ), test.wav = "audio/x-wav", + test.wmf = c("application/x-msmetafile", "windows/metafile"), + test.xcf = "application/x-xcf", + test.xml = "application/xml", + test.xpm = c("image/x-xbitmap", "image/x-xpixmap", "image/xpm"), + test.zip = "application/zip" +) -> results + +fils <- list.files(system.file("extdat", package="wand"), full.names=TRUE) +tst <- lapply(fils, get_content_type) +names(tst) <- basename(fils) + +for(n in names(tst)) expect_identical(results[[n]], tst[[n]]) diff --git a/tests/test-all.R b/tests/test-all.R deleted file mode 100644 index 10026b0..0000000 --- a/tests/test-all.R +++ /dev/null @@ -1,2 +0,0 @@ -library(testthat) -test_check("wand") diff --git a/tests/testthat/test-wand.R b/tests/testthat/test-wand.R deleted file mode 100644 index 94bb48d..0000000 --- a/tests/testthat/test-wand.R +++ /dev/null @@ -1,90 +0,0 @@ -context("File types are recognized properly") -test_that("Basic file tests work", { - - list( - actions.csv = "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet", - actions.txt = "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet", - actions.xlsx = "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet", - test_1.2.class = "application/java-vm", - test_1.3.class = "application/java-vm", - test_1.4.class = "application/java-vm", - test_1.5.class = "application/java-vm", - test_128_44_jstereo.mp3 = "audio/mp3", - test_excel_2000.xls = "application/msword", - test_excel_spreadsheet.xml = "application/xml", - test_excel_web_archive.mht = "message/rfc822", - test_excel.xlsm = "application/zip", - test_excel.xlsx = "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet", - test_nocompress.tif = "image/tiff", - test_powerpoint.pptm = "application/zip", - test_powerpoint.pptx = "application/vnd.openxmlformats-officedocument.presentationml.presentation", - test_word_2000.doc = "application/msword", - test_word_6.0_95.doc = "application/msword", - test_word.docm = "application/zip", - test_word.docx = "application/vnd.openxmlformats-officedocument.wordprocessingml.document", - test.au = "audio/basic", - test.bin = c( - "application/mac-binary", - "application/macbinary", "application/octet-stream", "application/x-binary", - "application/x-macbinary" - ), test.bmp = "image/bmp", - test.dtd = "application/xml-dtd", - test.emf = "application/x-msmetafile", - test.eps = "application/postscript", - test.fli = c("video/flc", "video/fli", "video/x-fli"), - test.gif = "image/gif", - test.ico = "image/x-icon", - test.java = c( - "text/plain", "text/x-java", - "text/x-java-source" - ), test.jpg = "image/jpeg", - test.mp3 = "audio/mp3", - test.odt = "application/vnd.oasis.opendocument.text", - test.ogg = c( - "application/ogg", - "audio/ogg" - ), test.pcx = c("image/pcx", "image/x-pcx"), - test.pdf = "application/pdf", - test.pl = c("text/plain", "text/x-perl", "text/x-script.perl"), - test.png = "image/png", - test.pnm = c( - "application/x-portable-anymap", - "image/x-portable-anymap" - ), test.ppm = "image/x-portable-pixmap", - test.ppt = "application/msword", - test.ps = "application/postscript", - test.psd = "image/photoshop", - test.py = c( - "text/x-python", - "text/x-script.phyton" - ), test.rtf = c( - "application/rtf", - "application/x-rtf", "text/richtext", "text/rtf" - ), test.sh = c( - "application/x-bsh", - "application/x-sh", "application/x-shar", "text/x-script.sh", - "text/x-sh" - ), test.tar = "application/tar", - test.tar.gz = c( - "application/octet-stream", - "application/x-compressed", "application/x-gzip" - ), test.tga = "image/x-tga", - test.txt = "text/plain", - test.txt.gz = c( - "application/octet-stream", - "application/x-compressed", "application/x-gzip" - ), test.wav = "audio/x-wav", - test.wmf = c("application/x-msmetafile", "windows/metafile"), - test.xcf = "application/x-xcf", - test.xml = "application/xml", - test.xpm = c("image/x-xbitmap", "image/x-xpixmap", "image/xpm"), - test.zip = "application/zip" - ) -> results - - fils <- list.files(system.file("extdat", package="wand"), full.names=TRUE) - tst <- lapply(fils, get_content_type) - names(tst) <- basename(fils) - - for(n in names(tst)) expect_identical(results[[n]], tst[[n]]) - -}) diff --git a/tests/tinytest.R b/tests/tinytest.R new file mode 100644 index 0000000..26eeaa5 --- /dev/null +++ b/tests/tinytest.R @@ -0,0 +1,5 @@ + +if ( requireNamespace("tinytest", quietly=TRUE) ){ + tinytest::test_package("wand") +} +