diff --git a/DESCRIPTION b/DESCRIPTION index bfe941f..137b1ee 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,13 +1,16 @@ -Package: filemagic +Package: wand Type: Package -Title: filemagic title goes here +Title: Retrieve 'Magic' Attributes from Files and Directories Version: 0.1.0 Date: 2016-08-12 Author: Bob Rudis (@hrbrmstr), Christos Zoulas [libmagic] Maintainer: Bob Rudis -Description: filemagic description goes here -URL: http://github.com/hrbrmstr/filemagic -BugReports: https://github.com/hrbrmstr/filemagic/issues +Description: The 'libmagic' library provides functions to determine + mime type and other metadata from files through their "magic" + attributes. +URL: http://github.com/hrbrmstr/wand +BugReports: https://github.com/hrbrmstr/wand/issues +SystemRequirements: libmagic License: AGPL Suggests: testthat, diff --git a/NAMESPACE b/NAMESPACE index e21a9bb..85692cf 100644 --- a/NAMESPACE +++ b/NAMESPACE @@ -3,4 +3,4 @@ export(incant) import(purrr) importFrom(Rcpp,sourceCpp) -useDynLib(filemagic) +useDynLib(wand) diff --git a/R/RcppExports.R b/R/RcppExports.R index 6449e9c..5c05f39 100644 --- a/R/RcppExports.R +++ b/R/RcppExports.R @@ -15,6 +15,6 @@ #' incant() %>% #' glimpse() incant <- function(path) { - .Call('filemagic_incant', PACKAGE = 'filemagic', path) + .Call('wand_incant', PACKAGE = 'wand', path) } diff --git a/R/filemagic-package.R b/R/wand-package.R similarity index 54% rename from R/filemagic-package.R rename to R/wand-package.R index ecf643f..ac6ef33 100644 --- a/R/filemagic-package.R +++ b/R/wand-package.R @@ -1,9 +1,9 @@ -#' A package to ... +#' Retrieve 'Magic' Attributes from Files and Directories #' -#' @name filemagic +#' @name wand #' @docType package #' @author Bob Rudis (@@hrbrmstr) #' @import purrr -#' @useDynLib filemagic +#' @useDynLib wand #' @importFrom Rcpp sourceCpp NULL diff --git a/README.Rmd b/README.Rmd index 07422c5..5fd02fb 100644 --- a/README.Rmd +++ b/README.Rmd @@ -2,13 +2,13 @@ output: rmarkdown::github_document --- -`filemagic` : R interface to `libmagic` +`wand` : Retrieve 'Magic' Attributes from Files and Directories -So you do need to install `libmagic` to use this. This should also be pretty straightforward to get working on Windows. Assistance to do that is welcome. +The `libmagic` library must be installed and available to use this. The package should also be pretty straightforward to get working on Windows. Assistance to do that is welcome. The following functions are implemented: -- `incant` : returns the mimetype of the files in the input vector (as a data frame) +- `incant` : returns the "magic" metadata of the files in the input vector (as a data frame) The following data sets are included: @@ -17,7 +17,7 @@ The following data sets are included: ### Installation ```{r eval=FALSE} -devtools::install_github("hrbrmstr/filemagic") +devtools::install_github("hrbrmstr/wand") ``` ```{r echo=FALSE, message=FALSE, warning=FALSE, error=FALSE} @@ -27,24 +27,24 @@ options(width=120) ### Usage ```{r message=FALSE} -library(filemagic) +library(wand) library(magrittr) library(dplyr) -system.file("img", package="filemagic") %>% +system.file("img", package="wand") %>% list.files(full.names=TRUE) %>% incant() %>% glimpse() # current verison -packageVersion("filemagic") +packageVersion("wand") ``` ### Test Results ```{r message=FALSE} -library(filemagic) +library(wand) library(testthat) date() diff --git a/README.md b/README.md index 7633ac6..b01dc25 100644 --- a/README.md +++ b/README.md @@ -1,11 +1,11 @@ -`filemagic` : R interface to `libmagic` +`wand` : Retrieve 'Magic' Attributes from Files and Directories -So you do need to install `libmagic` to use this. This should also be pretty straightforward to get working on Windows. Assistance to do that is welcome. +The `libmagic` library must be installed and available to use this. The package should also be pretty straightforward to get working on Windows. Assistance to do that is welcome. The following functions are implemented: -- `incant` : returns the mimetype of the files in the input vector (as a data frame) +- `incant` : returns the "magic" metadata of the files in the input vector (as a data frame) The following data sets are included: @@ -14,17 +14,17 @@ The following data sets are included: ### Installation ``` r -devtools::install_github("hrbrmstr/filemagic") +devtools::install_github("hrbrmstr/wand") ``` ### Usage ``` r -library(filemagic) +library(wand) library(magrittr) library(dplyr) -system.file("img", package="filemagic") %>% +system.file("img", package="wand") %>% list.files(full.names=TRUE) %>% incant() %>% glimpse() @@ -32,7 +32,7 @@ system.file("img", package="filemagic") %>% ## Observations: 10 ## Variables: 5 - ## $ file "/Library/Frameworks/R.framework/Versions/3.3/Resources/library/filemagic/img/example_dir", "/L... + ## $ file "/Library/Frameworks/R.framework/Versions/3.3/Resources/library/wand/img/example_dir", "/Librar... ## $ mime_type "inode/directory", "text/x-c", "text/html", "text/plain", "text/rtf", "image/jpeg", "applicatio... ## $ encoding "binary", "us-ascii", "us-ascii", "us-ascii", "us-ascii", "binary", "binary", "binary", "us-asc... ## $ extensions NA, "???", "???", "???", "???", "jpeg/jpg/jpe/jfif", "???", "???", "???", "???" @@ -40,7 +40,7 @@ system.file("img", package="filemagic") %>% ``` r # current verison -packageVersion("filemagic") +packageVersion("wand") ``` ## [1] '0.1.0' @@ -48,13 +48,13 @@ packageVersion("filemagic") ### Test Results ``` r -library(filemagic) +library(wand) library(testthat) date() ``` - ## [1] "Fri Aug 12 19:47:32 2016" + ## [1] "Fri Aug 12 21:41:40 2016" ``` r test_dir("tests/") diff --git a/man/filemagic.Rd b/man/filemagic.Rd deleted file mode 100644 index 4d232ad..0000000 --- a/man/filemagic.Rd +++ /dev/null @@ -1,14 +0,0 @@ -% Generated by roxygen2: do not edit by hand -% Please edit documentation in R/filemagic-package.R -\docType{package} -\name{filemagic} -\alias{filemagic} -\alias{filemagic-package} -\title{A package to ...} -\description{ -A package to ... -} -\author{ -Bob Rudis (@hrbrmstr) -} - diff --git a/man/wand.Rd b/man/wand.Rd new file mode 100644 index 0000000..8192476 --- /dev/null +++ b/man/wand.Rd @@ -0,0 +1,14 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/wand-package.R +\docType{package} +\name{wand} +\alias{wand} +\alias{wand-package} +\title{Retrieve 'Magic' Attributes from Files and Directories} +\description{ +Retrieve 'Magic' Attributes from Files and Directories +} +\author{ +Bob Rudis (@hrbrmstr) +} + diff --git a/src/RcppExports.cpp b/src/RcppExports.cpp index 3ec15e2..3e00e48 100644 --- a/src/RcppExports.cpp +++ b/src/RcppExports.cpp @@ -7,7 +7,7 @@ using namespace Rcpp; // incant DataFrame incant(CharacterVector path); -RcppExport SEXP filemagic_incant(SEXP pathSEXP) { +RcppExport SEXP wand_incant(SEXP pathSEXP) { BEGIN_RCPP Rcpp::RObject __result; Rcpp::RNGScope __rngScope; diff --git a/src/filemagic.cpp b/src/wand.cpp similarity index 100% rename from src/filemagic.cpp rename to src/wand.cpp diff --git a/tests/testthat/test-filemagic.R b/tests/testthat/test-wand.R similarity index 100% rename from tests/testthat/test-filemagic.R rename to tests/testthat/test-wand.R diff --git a/filemagic.Rproj b/wand.Rproj similarity index 100% rename from filemagic.Rproj rename to wand.Rproj