Browse Source

working

master
boB Rudis 5 years ago
parent
commit
5809f83a23
No known key found for this signature in database GPG Key ID: 1D7529BE14E2BBA9
  1. 2
      .Rbuildignore
  2. 18
      DESCRIPTION
  3. 29
      Makefile
  4. 3
      NAMESPACE
  5. 9
      R/cruxjars-package.R
  6. 21
      R/logging.R
  7. 5
      R/zzz.R
  8. 6
      README.Rmd
  9. 699
      README.html
  10. 54
      README.md
  11. BIN
      inst/java/commons-lang3-3.7.jar
  12. BIN
      inst/java/crux-2.0.2.jar
  13. BIN
      inst/java/jsoup-1.9.2.jar
  14. 14
      java/crux/Makefile
  15. 18
      java/crux/pom.xml
  16. 13
      java/crux/src/main/java/is/rud/crux/App.java
  17. 38
      java/crux/src/test/java/is/rud/crux/AppTest.java
  18. 7
      man/cruxjars.Rd

2
.Rbuildignore

@ -1,3 +1,4 @@
^Makefile$
^.vscode$
^.*\.Rproj$
^\.Rproj\.user$
@ -8,6 +9,7 @@
^NOTES\.*html$
^\.codecov\.yml$
^README_files$
^java$
^doc$
^docs$
^tmp$

18
DESCRIPTION

@ -1,14 +1,18 @@
Package: cruxjars
Type: Package
Title: cruxjars title goes here otherwise CRAN checks fail
Version: 0.1.0
Title: Java Archive Wrapper Supporting the 'crux' Package
Version: 2.0.2
Date: 2019-03-01
Authors@R: c(
person("Bob", "Rudis", email = "bob@rud.is", role = c("aut", "cre"),
comment = c(ORCID = "0000-0001-5670-2640"))
comment = c(ORCID = "0000-0001-5670-2640")),
person("Chimbori", role = "aut",
comment = "crux Java library (<https://github.com/chimbori/crux>)")
)
Maintainer: Bob Rudis <bob@rud.is>
Description: A good description goes here otherwise CRAN checks fail.
Description: Contents of the 'crux' & supporting Java archives
<https://github.com/chimbori/crux>. Version number reflects the version
number of the included 'JAR' file.
URL: https://gitlab.com/hrbrmstr/cruxjars
BugReports: https://gitlab.com/hrbrmstr/cruxjars/issues
Encoding: UTF-8
@ -17,9 +21,7 @@ Suggests:
testthat,
covr
Depends:
R (>= 3.2.0)
Imports:
httr,
jsonlite
R (>= 3.2.0),
rJava
Roxygen: list(markdown = TRUE)
RoxygenNote: 6.1.1

29
Makefile

@ -0,0 +1,29 @@
PACKAGE := $(shell grep '^Package:' DESCRIPTION | sed -E 's/^Package:[[:space:]]+//')
RSCRIPT = Rscript --no-init-file
all: install
test:
${RSCRIPT} -e 'library(methods); devtools::test()'
doc:
${RSCRIPT} -e "library(methods); devtools::document()"
install:
${RSCRIPT} -e "library(methods); devtools::install()"
build:
${RSCRIPT} -e "library(methods); devtools::build()"
check:
_R_CHECK_CRAN_INCOMING_=FALSE make check_all
check_all:
${RSCRIPT} -e "library(methods); devtools::check(cran=TRUE)"
README.md: README.Rmd
Rscript -e 'library(methods); devtools::load_all(); rmarkdown::render("README.Rmd", output_file="README.md")'
sed -i.bak 's/[[:space:]]*$$//' $@
rm -f $@.bak
.PHONY: all test doc install check check_all

3
NAMESPACE

@ -1,4 +1,3 @@
# Generated by roxygen2: do not edit by hand
import(httr)
importFrom(jsonlite,fromJSON)
import(rJava)

9
R/cruxjars-package.R

@ -1,4 +1,8 @@
#' ...
#' Java Archive Wrapper Supporting the 'crux' Package
#'
#' Contents of the 'crux' & supporting Java archives
#' <https://github.com/chimbori/crux>.Version number reflects the version
#' number of the included 'JAR' file.
#'
#' - URL: <https://gitlab.com/hrbrmstr/cruxjars>
#' - BugReports: <https://gitlab.com/hrbrmstr/cruxjars/issues>
@ -7,6 +11,5 @@
#' @name cruxjars
#' @docType package
#' @author Bob Rudis (bob@@rud.is)
#' @import httr
#' @importFrom jsonlite fromJSON
#' @import rJava
NULL

21
R/logging.R

@ -0,0 +1,21 @@
#' @title rJava logging
#' @description Toggle verbose rJava logging
#' @details This function turns off the somewhat verbose rJava logging, most of which is
#' uninformative. It is called automatically when tabulizer is attached via
#' \code{library()}, \code{require}, etc. To keep logging on, load the package
#' namespace using \code{requireNamespace("htmlunit")} and reference functions
#' in using fully qualified references.
#' @note This resets a global Java setting and may affect logging of other rJava operations,
#' requiring a restart of R.
#' @return `NULL`, invisibly.
#' @author Thomas J. Leeper <thosjleeper@@gmail.com>
#' @noRd
#' @md
#' @examples
#' \dontrun{
#' stop_logging()
#' }
stop_logging <- function() {
rJava::J("java.util.logging.LogManager")$getLogManager()$reset()
invisible(NULL)
}

5
R/zzz.R

@ -0,0 +1,5 @@
.onLoad <- function(libname, pkgname) {
rJava::.jpackage(pkgname, jars = "*", lib.loc = libname)
rJava::.jaddClassPath(dir(file.path(getwd(), "inst/java"), full.names = TRUE))
stop_logging()
}

6
README.Rmd

@ -14,8 +14,14 @@ options(width=120)
# cruxjars
Java Archive Wrapper Supporting the 'crux' Package
## Description
Contents of the 'crux' & supporting Java archives
<https://github.com/chimbori/crux>.Version number reflects the version
number of the included 'JAR' file.
## What's Inside The Tin
The following functions are implemented:

699
README.html

File diff suppressed because one or more lines are too long

54
README.md

@ -1,2 +1,56 @@
[![Travis-CI Build
Status](https://travis-ci.org/hrbrmstr/cruxjars.svg?branch=master)](https://travis-ci.org/hrbrmstr/cruxjars)
[![Coverage
Status](https://codecov.io/gh/hrbrmstr/cruxjars/branch/master/graph/badge.svg)](https://codecov.io/gh/hrbrmstr/cruxjars)
[![CRAN\_Status\_Badge](http://www.r-pkg.org/badges/version/cruxjars)](https://cran.r-project.org/package=cruxjars)
# cruxjars
Java Archive Wrapper Supporting the ‘crux’ Package
## Description
Contents of the ‘crux’ & supporting Java archives
<https://github.com/chimbori/crux>.Version number reflects the version
number of the included ‘JAR’ file.
## What’s Inside The Tin
The following functions are implemented:
## Installation
``` r
devtools::install_git("https://sr.ht.com/~hrbrmstr/cruxjars.git")
# or
devtools::install_git("https://gitlab.com/hrbrmstr/cruxjars.git")
# or (if you must)
devtools::install_github("hrbrmstr/cruxjars")
```
## Usage
``` r
library(cruxjars)
# current version
packageVersion("cruxjars")
## [1] '2.0.2'
```
## cruxjars Metrics
| Lang | \# Files | (%) | LoC | (%) | Blank lines | (%) | \# Lines | (%) |
| :---- | -------: | --: | --: | ---: | ----------: | ---: | -------: | ---: |
| Java | 2 | 0.2 | 28 | 0.36 | 5 | 0.18 | 18 | 0.21 |
| Maven | 1 | 0.1 | 17 | 0.22 | 0 | 0.00 | 1 | 0.01 |
| R | 5 | 0.5 | 15 | 0.19 | 2 | 0.07 | 32 | 0.38 |
| make | 1 | 0.1 | 10 | 0.13 | 4 | 0.14 | 0 | 0.00 |
| Rmd | 1 | 0.1 | 8 | 0.10 | 17 | 0.61 | 33 | 0.39 |
## Code of Conduct
Please note that this project is released with a [Contributor Code of
Conduct](CONDUCT.md). By participating in this project you agree to
abide by its terms.

BIN
inst/java/commons-lang3-3.7.jar

Binary file not shown.

BIN
inst/java/crux-2.0.2.jar

Binary file not shown.

BIN
inst/java/jsoup-1.9.2.jar

Binary file not shown.

14
java/crux/Makefile

@ -0,0 +1,14 @@
.PHONY: clean pkg deps run
pkg:
mvn --quiet package
cp target/crux-1.0-SNAPSHOT.jar ../../inst/java
clean:
mvn clean
deps:
mvn dependency:copy-dependencies -DoutputDirectory=../../inst/java
new:
mvn archetype:generate -DgroupId=is.rud.crux -DartifactId=crux -DarchetypeArtifactId=maven-archetype-quickstart -DinteractiveMode=false && mv Makefile crux

18
java/crux/pom.xml

@ -0,0 +1,18 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>is.rud.crux</groupId>
<artifactId>crux</artifactId>
<packaging>jar</packaging>
<version>1.0-SNAPSHOT</version>
<name>crux</name>
<url>http://maven.apache.org</url>
<dependencies>
<!-- https://mvnrepository.com/artifact/com.chimbori.crux/crux -->
<dependency>
<groupId>com.chimbori.crux</groupId>
<artifactId>crux</artifactId>
<version>2.0.2</version>
</dependency>
</dependencies>
</project>

13
java/crux/src/main/java/is/rud/crux/App.java

@ -0,0 +1,13 @@
package is.rud.crux;
/**
* Hello world!
*
*/
public class App
{
public static void main( String[] args )
{
System.out.println( "Hello World!" );
}
}

38
java/crux/src/test/java/is/rud/crux/AppTest.java

@ -0,0 +1,38 @@
package is.rud.crux;
import junit.framework.Test;
import junit.framework.TestCase;
import junit.framework.TestSuite;
/**
* Unit test for simple App.
*/
public class AppTest
extends TestCase
{
/**
* Create the test case
*
* @param testName name of the test case
*/
public AppTest( String testName )
{
super( testName );
}
/**
* @return the suite of tests being tested
*/
public static Test suite()
{
return new TestSuite( AppTest.class );
}
/**
* Rigourous Test :-)
*/
public void testApp()
{
assertTrue( true );
}
}

7
man/cruxjars.Rd

@ -4,8 +4,13 @@
\name{cruxjars}
\alias{cruxjars}
\alias{cruxjars-package}
\title{...}
\title{Java Archive Wrapper Supporting the 'crux' Package}
\description{
Contents of the 'crux' & supporting Java archives
\url{https://github.com/chimbori/crux}.Version number reflects the version
number of the included 'JAR' file.
}
\details{
\itemize{
\item URL: \url{https://gitlab.com/hrbrmstr/cruxjars}
\item BugReports: \url{https://gitlab.com/hrbrmstr/cruxjars/issues}

Loading…
Cancel
Save