Browse Source

cran prep

tags/v0.3.0
boB Rudis 6 years ago
parent
commit
d6ee3f0400
No known key found for this signature in database GPG Key ID: 1D7529BE14E2BBA9
  1. 17
      DESCRIPTION
  2. 2
      NAMESPACE
  3. 6
      R/RcppExports.R
  4. 2
      R/aaa.r
  5. 2
      R/wand-package.R
  6. 1
      man/get_os.Rd
  7. 1
      man/incant.Rd
  8. 1
      man/magic_wand_file.Rd
  9. 1
      man/mime_db.Rd
  10. 3
      man/wand.Rd
  11. 2
      src/Makevars
  12. 33
      src/RcppExports.cpp
  13. 4
      tests/testthat/test-wand.R

17
DESCRIPTION

@ -1,16 +1,21 @@
Package: wand
Type: Package
Title: Retrieve 'Magic' Attributes from Files and Directories
Version: 0.2.0
Date: 2016-08-14
Author: Bob Rudis (@hrbrmstr), Christos Zoulas [libmagic], Mans Rullgard [file],
Jonathan Ong <me@jongleberry.com> [mime-db]
Version: 0.2.1
Date: 2017-10-20
Authors@R: c(
person("Bob", "Rudis", email = "bob@rud.is", role = c("aut", "cre"),
comment = c(ORCID = "0000-0001-5670-2640")),
person("Christos", "Zoulas", role=("ctb"), comment="libmagic"),
person("Mans", "Rullgard", role=("ctb"), comment="file"),
person("Jonathan", "Ong", role=("ctb"), comment="mime-db")
)
Maintainer: Bob Rudis <bob@rud.is>
Description: The 'libmagic' library provides functions to determine
'MIME' type and other metadata from files through their "magic"
attributes. This is useful when you do not wish to rely solely on
the honesty of a user or the extension on a file name. It also
incorporates other metadata from the mime-db database
incorporates other metadata from the 'mime-db' database
<https://github.com/jshttp/mime-db>.
URL: http://github.com/hrbrmstr/wand
BugReports: https://github.com/hrbrmstr/wand/issues
@ -34,4 +39,4 @@ Imports:
Rcpp
Encoding: UTF-8
LinkingTo: Rcpp
RoxygenNote: 5.0.1
RoxygenNote: 6.0.1.9000

2
NAMESPACE

@ -13,4 +13,4 @@ importFrom(dplyr,mutate)
importFrom(dplyr,mutate_all)
importFrom(rappdirs,user_cache_dir)
importFrom(utils,unzip)
useDynLib(wand)
useDynLib(wand, .registration=TRUE)

6
R/RcppExports.R

@ -1,11 +1,11 @@
# This file was generated by Rcpp::compileAttributes
# Generated by using Rcpp::compileAttributes() -> do not edit by hand
# Generator token: 10BE3573-1514-4C36-9D1C-5A225CD40393
incant_ <- function(path, magic_db = "system") {
.Call('wand_incant_', PACKAGE = 'wand', path, magic_db)
.Call(`_wand_incant_`, path, magic_db)
}
lib_version <- function() {
.Call('wand_lib_version', PACKAGE = 'wand')
.Call(`_wand_lib_version`)
}

2
R/aaa.r

@ -1 +1 @@
extensions <- mime_type <- response <- encoding <- NULL
globalVariables(c("extensions", "mime_type", "response", "encoding"))

2
R/wand-package.R

@ -16,7 +16,7 @@
#' @import tidyr
#' @import stringi
#' @importFrom rappdirs user_cache_dir
#' @useDynLib wand
#' @useDynLib wand, .registration=TRUE
#' @importFrom Rcpp sourceCpp
#' @importFrom utils unzip
#' @importFrom dplyr mutate left_join mutate_all

1
man/get_os.Rd

@ -9,4 +9,3 @@ get_os()
\description{
ripped from rappdirs (ty Hadley!)
}

1
man/incant.Rd

@ -39,4 +39,3 @@ system.file("extdata/img", package="wand") \%>\%
See \url{http://openpreservation.org/blog/2012/08/09/magic-editing-and-creation-primer/}
for information on how to create your own \code{magic} database
}

1
man/magic_wand_file.Rd

@ -33,4 +33,3 @@ system.file("extdata/img", package="wand") \%>\%
incant(magic_wand_file()) \%>\%
glimpse()
}

1
man/mime_db.Rd

@ -37,4 +37,3 @@ Last updated 2016-08-14; the only guaranteed field is \code{source}
Ingested from \url{https://github.com/jshttp/mime-db}.
}
\keyword{datasets}

3
man/wand.Rd

@ -1,5 +1,5 @@
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/wand-package.r
% Please edit documentation in R/wand-package.R
\docType{package}
\name{wand}
\alias{wand}
@ -18,4 +18,3 @@ Based on \code{file} / \code{libmagic} - \url{https://github.com/file/file}
\author{
Bob Rudis (@hrbrmstr)
}

2
src/Makevars

@ -0,0 +1,2 @@
PKG_CPPFLAGS= -L/usr/include -L/usr/local/include
PKG_LIBS= -L/usr/local/lib -L/usr/lib -lmagic

33
src/RcppExports.cpp

@ -1,4 +1,4 @@
// This file was generated by Rcpp::compileAttributes
// Generated by using Rcpp::compileAttributes() -> do not edit by hand
// Generator token: 10BE3573-1514-4C36-9D1C-5A225CD40393
#include <Rcpp.h>
@ -7,23 +7,34 @@ using namespace Rcpp;
// incant_
DataFrame incant_(CharacterVector path, std::string magic_db);
RcppExport SEXP wand_incant_(SEXP pathSEXP, SEXP magic_dbSEXP) {
RcppExport SEXP _wand_incant_(SEXP pathSEXP, SEXP magic_dbSEXP) {
BEGIN_RCPP
Rcpp::RObject __result;
Rcpp::RNGScope __rngScope;
Rcpp::RObject rcpp_result_gen;
Rcpp::RNGScope rcpp_rngScope_gen;
Rcpp::traits::input_parameter< CharacterVector >::type path(pathSEXP);
Rcpp::traits::input_parameter< std::string >::type magic_db(magic_dbSEXP);
__result = Rcpp::wrap(incant_(path, magic_db));
return __result;
rcpp_result_gen = Rcpp::wrap(incant_(path, magic_db));
return rcpp_result_gen;
END_RCPP
}
// lib_version
int lib_version();
RcppExport SEXP wand_lib_version() {
RcppExport SEXP _wand_lib_version() {
BEGIN_RCPP
Rcpp::RObject __result;
Rcpp::RNGScope __rngScope;
__result = Rcpp::wrap(lib_version());
return __result;
Rcpp::RObject rcpp_result_gen;
Rcpp::RNGScope rcpp_rngScope_gen;
rcpp_result_gen = Rcpp::wrap(lib_version());
return rcpp_result_gen;
END_RCPP
}
static const R_CallMethodDef CallEntries[] = {
{"_wand_incant_", (DL_FUNC) &_wand_incant_, 2},
{"_wand_lib_version", (DL_FUNC) &_wand_lib_version, 0},
{NULL, NULL, 0}
};
RcppExport void R_init_wand(DllInfo *dll) {
R_registerRoutines(dll, NULL, CallEntries, NULL, NULL);
R_useDynamicSymbols(dll, FALSE);
}

4
tests/testthat/test-wand.R

@ -1,5 +1,5 @@
context("basic functionality")
test_that("we can do something", {
context("wand can correctly test files")
test_that("a sample image file is identified correctly", {
tmp <- incant(list.files(system.file("extdata", "img", package="wand"),
full.names=TRUE),

Loading…
Cancel
Save