diff --git a/.build.yml b/.build.yml index 58782c8..58fe583 100644 --- a/.build.yml +++ b/.build.yml @@ -13,6 +13,7 @@ packages: - libbz2-dev - libcairo2-dev - libcurl4-openssl-dev + - libxml2-dev - libjpeg-dev - liblapack-dev - liblzma-dev @@ -25,6 +26,9 @@ packages: - libx11-dev - libxt-dev - mpack + - pandoc + - pandoc-citeproc + - pandoc-data - subversion - tcl8.6-dev - texinfo @@ -55,24 +59,71 @@ packages: - r-base - r-base-dev - r-recommended + - r-cran-crayon + - r-cran-curl + - r-cran-desc + - r-cran-httr + - r-cran-jsonlite + - r-cran-devtools + - r-cran-knitr + - r-cran-rmarkdown + - r-cran-rprojroot + - r-cran-stringi + - r-cran-testthat + - r-cran-testit + - r-cran-tidyverse + - r-cran-xml2 +environment: + R_PACKAGE: wand sources: - - https://git.sr.ht/~hrbrmstr/wand -triggers: - - action: email - condition: always - to: bob@rud.is + - https://git.sr.ht/hrbrmstr/wand tasks: - setup: | - sudo update-locale "LANG=en_US.UTF-8" + echo "en_US.UTF-8 UTF-8" > loc + sudo cp loc /etc/locale.gen sudo locale-gen --purge "en_US.UTF-8" - sudo dpkg-reconfigure --frontend noninteractive locales + sudo /usr/sbin/update-locale LANG=en_US.UTF-8 export LC_ALL=en_US.UTF-8 export LANG=en_US.UTF-8 export LANGUAGE=en_US.UTF-8 echo 'options(repos = c(CRAN = "https://cloud.r-project.org"))' > ~/.Rprofile echo 'R_LIBS_USER=/home/build/packages' > ~/.Renviron mkdir /home/build/packages - Rscript -e 'install.packages(c("covr", "tinytest"))' + export _R_CHECK_URLS_USE_CURL_=FALSE + export _R_CHECK_LENGTH_1_CONDITION_=TRUE + export _R_CHECK_LENGTH_1_LOGIC2_=TRUE + export _R_CHECK_TOPLEVEL_FILES_=TRUE + export _R_CHECK_VC_DIRS_=TRUE + export _R_CHECK_TIMINGS_=10 + export _R_CHECK_INSTALL_DEPENDS_=TRUE + export _R_CHECK_SUGGESTS_ONLY_=TRUE + export _R_CHECK_NO_RECOMMENDED_=TRUE + export _R_CHECK_EXECUTABLES_EXCLUSIONS_=FALSE + export _R_CHECK_DOC_SIZES2_=TRUE + export _R_CHECK_CODE_ASSIGN_TO_GLOBALENV_=TRUE + export _R_CHECK_CODE_ATTACH_=TRUE + export _R_CHECK_CODE_DATA_INTO_GLOBALENV_=TRUE + export _R_CHECK_CODE_USAGE_VIA_NAMESPACES_=TRUE + export _R_CHECK_DOT_FIRSTLIB_=TRUE + export _R_CHECK_DEPRECATED_DEFUNCT_=TRUE + export _R_CHECK_REPLACING_IMPORTS_=TRUE + export _R_CHECK_SCREEN_DEVICE_=stop + export _R_CHECK_TOPLEVEL_FILES_=TRUE + export _R_CHECK_S3_METHODS_NOT_REGISTERED_=TRUE + export _R_CHECK_OVERWRITE_REGISTERED_S3_METHODS_=TRUE + export _R_CHECK_PRAGMAS_=TRUE + export _R_CHECK_CRAN_INCOMING_USE_ASPELL_=TRUE + export _R_CHECK_COMPILATION_FLAGS_=TRUE + export _R_CHECK_R_DEPENDS_=warn + export _R_CHECK_SERIALIZATION_=TRUE + export _R_CHECK_R_ON_PATH_=TRUE + export _R_CHECK_PACKAGES_USED_IN_TESTS_USE_SUBDIRS_=TRUE + export _R_CHECK_SHLIB_OPENMP_FLAGS_=TRUE + export _R_CHECK_CONNECTIONS_LEFT_OPEN_=TRUE + export _R_CHECK_FUTURE_FILE_TIMESTAMPS_=TRUE + export _R_CHECK_AUTOCONF_=TRUE - build: | - R CMD build wand - R CMD check wand_*gz + sudo R CMD javareconf + Rscript -e 'install.packages(c("covr", "tinytest"))' + R CMD build ${R_PACKAGE} + R CMD check ${R_PACKAGE}_*gz diff --git a/README.Rmd b/README.Rmd index daea2c2..9ed19d8 100644 --- a/README.Rmd +++ b/README.Rmd @@ -1,7 +1,5 @@ --- -output: - rmarkdown::github_document: - df_print: kable +output: rmarkdown::github_document --- ```{r pkg-knitr-opts, include=FALSE} hrbrpkghelpr::global_opts() diff --git a/README.html b/README.html deleted file mode 100644 index cff2e28..0000000 --- a/README.html +++ /dev/null @@ -1,1065 +0,0 @@ - - - - -
- - - - - - - - - - - - - - -Retrieve Magic Attributes from Files and Directories
-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,800 extension mappings.
-The header checking is minimal (i.e. nowhere near as comprehensive as libmagic
) but covers quite a bit of ground. If there are content-check types from magic sources
that you would like coded into the package, please file an issue and include the full line(s) from that linked magic.tab
that you would like mapped.
The following functions are implemented:
-get_content_type
: Discover MIME type of a file based on contentsguess_content_type
: Guess MIME type from filename (extension)simplemagic_mime_db
: File extension-to-MIME mapping data frameinstall.packages("wand", repos = "https://cinc.rud.is")
-# or
-remotes::install_git("https://git.rud.is/hrbrmstr/wand.git")
-# or
-remotes::install_git("https://git.sr.ht/~hrbrmstr/wand")
-# or
-remotes::install_gitlab("hrbrmstr/wand")
-# or
-remotes::install_bitbucket("hrbrmstr/wand")
-# or
-remotes::install_github("hrbrmstr/wand")
NOTE: To use the ‘remotes’ install options you will need to have the {remotes} package installed.
-list.files(system.file("extdat", package="wand"), full.names=TRUE) %>%
- map_df(~{
- tibble(
- fil = basename(.x),
- mime = list(get_content_type(.x))
- )
- }) %>%
- unnest()
fil | -mime | -
---|---|
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 | -application/mac-binary | -
test.bin | -application/macbinary | -
test.bin | -application/octet-stream | -
test.bin | -application/x-binary | -
test.bin | -application/x-macbinary | -
test.bmp | -image/bmp | -
test.dtd | -application/xml-dtd | -
test.emf | -application/x-msmetafile | -
test.emf | -image/emf | -
test.eps | -application/postscript | -
test.fli | -video/flc | -
test.fli | -video/fli | -
test.fli | -video/x-fli | -
test.gif | -image/gif | -
test.ico | -image/vnd.microsoft.icon | -
test.ico | -image/x-icon | -
test.jpg | -image/jpeg | -
test.mp3 | -audio/mp3 | -
test.odt | -application/vnd.oasis.opendocument.text | -
test.ogg | -application/ogg | -
test.ogg | -audio/ogg | -
test.pcx | -image/pcx | -
test.pcx | -image/vnd.zbrush.pcx | -
test.pcx | -image/x-pcx | -
test.pdf | -application/pdf | -
test.pl | -application/x-perl | -
test.pl | -text/plain | -
test.pl | -text/x-perl | -
test.pl | -text/x-script.perl | -
test.png | -image/png | -
test.pnm | -application/x-portable-anymap | -
test.pnm | -image/x-portable-anymap | -
test.ppm | -image/x-portable-pixmap | -
test.ppt | -application/msword | -
test.ps | -application/postscript | -
test.psd | -image/photoshop | -
test.py | -text/x-python | -
test.py | -text/x-script.phyton | -
test.rtf | -application/rtf | -
test.rtf | -application/x-rtf | -
test.rtf | -text/richtext | -
test.rtf | -text/rtf | -
test.sh | -application/x-bsh | -
test.sh | -application/x-sh | -
test.sh | -application/x-shar | -
test.sh | -text/x-script.sh | -
test.sh | -text/x-sh | -
test.tar | -application/tar | -
test.tar.gz | -application/gzip | -
test.tar.gz | -application/octet-stream | -
test.tar.gz | -application/x-compressed | -
test.tar.gz | -application/x-gzip | -
test.tga | -image/x-tga | -
test.txt | -text/plain | -
test.txt.gz | -application/gzip | -
test.txt.gz | -application/octet-stream | -
test.txt.gz | -application/x-compressed | -
test.txt.gz | -application/x-gzip | -
test.wav | -audio/x-wav | -
test.wmf | -application/x-msmetafile | -
test.wmf | -image/wmf | -
test.wmf | -windows/metafile | -
test.xcf | -application/x-xcf | -
test.xml | -application/xml | -
test.xpm | -image/x-xbitmap | -
test.xpm | -image/x-xpixmap | -
test.xpm | -image/xpm | -
test.zip | -application/zip | -
Lang | -# Files | -(%) | -LoC | -(%) | -Blank lines | -(%) | -# Lines | -(%) | -
---|---|---|---|---|---|---|---|---|
HTML | -1 | -0.1 | -1044 | -0.81 | -10 | -0.12 | -0 | -0.00 | -
R | -7 | -0.7 | -154 | -0.12 | -59 | -0.69 | -70 | -0.69 | -
JSON | -1 | -0.1 | -80 | -0.06 | -0 | -0.00 | -0 | -0.00 | -
Rmd | -1 | -0.1 | -17 | -0.01 | -17 | -0.20 | -31 | -0.31 | -
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 e0c9aab..1ed0ade 100644 --- a/README.md +++ b/README.md @@ -91,108 +91,29 @@ list.files(system.file("extdat", package="wand"), full.names=TRUE) %>% ) }) %>% unnest() +## # A tibble: 85 x 2 +## fil mime +##