Skip to content

Commit

Permalink
update doc + module --> modules
Browse files Browse the repository at this point in the history
  • Loading branch information
wahani committed Dec 18, 2015
1 parent c62790f commit fd94fc0
Show file tree
Hide file tree
Showing 7 changed files with 38 additions and 30 deletions.
1 change: 1 addition & 0 deletions DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ Description: Provides modules as an organizational unit for source code. Modules
enforce to be more rigorous when defining dependencies and have
a local search path. They can be used as a sub unit within packages
or in scripts.
BugReports: https://github.com/wahani/modules/issues
Depends:
R (>= 3.2.2),
aoos,
Expand Down
6 changes: 3 additions & 3 deletions R/module-class.R
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ environment : ModuleParent(parent = baseenv()) %type% {
# This is the type for the initial parent of a module.
# It knows of some functions:
parent.env(.Object) <- .Object@parent
makeDelayedAssignment("module", "import", into = .Object)
makeDelayedAssignment("module", "use", into = .Object)
makeDelayedAssignment("module", "export", into = .Object)
makeDelayedAssignment("modules", "import", into = .Object)
makeDelayedAssignment("modules", "use", into = .Object)
makeDelayedAssignment("modules", "export", into = .Object)
.Object
}

Expand Down
33 changes: 20 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,20 +9,20 @@ vignette: >
%\VignetteEncoding{UTF-8}
---

[![Build Status](https://travis-ci.org/wahani/module.png?branch=master)](https://travis-ci.org/wahani/module)
[![codecov.io](https://codecov.io/github/wahani/module/coverage.svg?branch=master)](https://codecov.io/github/wahani/module?branch=master)
[![CRAN](http://www.r-pkg.org/badges/version/module)](http://cran.rstudio.com/package=module)
[![Downloads](http://cranlogs.r-pkg.org/badges/module?color=brightgreen)](http://www.r-pkg.org/pkg/module)
[![Build Status](https://travis-ci.org/wahani/modules.png?branch=master)](https://travis-ci.org/wahani/modules)
[![codecov.io](https://codecov.io/github/wahani/modules/coverage.svg?branch=master)](https://codecov.io/github/wahani/modules?branch=master)
[![CRAN](http://www.r-pkg.org/badges/version/modules)](http://cran.rstudio.com/package=modules)
[![Downloads](http://cranlogs.r-pkg.org/badges/modules?color=brightgreen)](http://www.r-pkg.org/pkg/modules)

Provides modules as an organizational unit for source code. Modules enforce to be more rigorous when defining dependencies and have a local search path. They can be used as a sub unit within packages or in scripts.

## Installation

From this GitHub:
From GitHub:


```r
devtools::install_github("wahani/aoos")
devtools::install_github("wahani/modules")
```

# Introduction
Expand All @@ -47,7 +47,14 @@ Typically you do not have to call that function explicitly but instead call


```r
library(module)
library(modules)
```

```
## Loading required package: aoos
```

```r
m <- module({
boringFunction <- function() cat("boring output")
})
Expand Down Expand Up @@ -235,11 +242,11 @@ search()
```

```
## [1] ".GlobalEnv" "import:module" "import:module"
## [4] "package:parallel" "package:module" "package:aoos"
## [7] "tools:rstudio" "package:stats" "package:graphics"
## [10] "package:grDevices" "package:utils" "package:datasets"
## [13] "package:methods" "Autoloads" "package:base"
## [1] ".GlobalEnv" "import:module" "package:parallel"
## [4] "package:modules" "package:aoos" "tools:rstudio"
## [7] "package:stats" "package:graphics" "package:grDevices"
## [10] "package:utils" "package:datasets" "package:methods"
## [13] "Autoloads" "package:base"
```

```r
Expand Down Expand Up @@ -318,7 +325,7 @@ clusterMap(cl, m$gen, list(m$NewType(NULL)))
## NULL
##
## attr(,".self")
## <environment: 0x1a3a3ef8>
## <environment: 0x4238408>
## attr(,"class")
## [1] "NewType" "list"
```
Expand Down
2 changes: 1 addition & 1 deletion module.Rproj
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,4 @@ StripTrailingWhitespace: Yes
BuildType: Package
PackageUseDevtools: Yes
PackageInstallArgs: --no-multiarch --with-keep.source
PackageRoxygenize: rd,collate,namespace,vignette
PackageRoxygenize: rd,collate,namespace
4 changes: 2 additions & 2 deletions tests/testthat.R
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
library(testthat)
library(module)
library(modules)

test_check("module")
test_check("modules")
6 changes: 3 additions & 3 deletions tests/testthat/test-module.R
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ test_that("Imports of module", {

# imported objects are only available to module
m <- module({
import(module, module)
import(modules, module)
localModule <- module({
fun <- function(x) x
})
Expand All @@ -56,7 +56,7 @@ test_that("delayed assignment", {
test_that("Attaching other module", {
m1 <- module({

import(module, module)
import(modules, module)

m <- module({
fun <- function(x) x
Expand Down Expand Up @@ -85,7 +85,7 @@ test_that("cross package deps", {

disposables::make_packages(

imports = "module",
imports = "modules",

M1 = {
m1 <- module({
Expand Down
16 changes: 8 additions & 8 deletions vignettes/modulesInR.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -9,21 +9,21 @@ vignette: >
%\VignetteEncoding{UTF-8}
---

[![Build Status](https://travis-ci.org/wahani/module.png?branch=master)](https://travis-ci.org/wahani/module)
[![codecov.io](https://codecov.io/github/wahani/module/coverage.svg?branch=master)](https://codecov.io/github/wahani/module?branch=master)
[![CRAN](http://www.r-pkg.org/badges/version/module)](http://cran.rstudio.com/package=module)
[![Downloads](http://cranlogs.r-pkg.org/badges/module?color=brightgreen)](http://www.r-pkg.org/pkg/module)
[![Build Status](https://travis-ci.org/wahani/modules.png?branch=master)](https://travis-ci.org/wahani/modules)
[![codecov.io](https://codecov.io/github/wahani/modules/coverage.svg?branch=master)](https://codecov.io/github/wahani/modules?branch=master)
[![CRAN](http://www.r-pkg.org/badges/version/modules)](http://cran.rstudio.com/package=modules)
[![Downloads](http://cranlogs.r-pkg.org/badges/modules?color=brightgreen)](http://www.r-pkg.org/pkg/modules)

```{r, results='asis', echo=FALSE}
cat(gsub("\\n ", "", packageDescription("module", fields = "Description")))
cat(gsub("\\n ", "", packageDescription("modules", fields = "Description")))
```

## Installation

From this GitHub:
From GitHub:

```{r, eval=FALSE}
devtools::install_github("wahani/aoos")
devtools::install_github("wahani/modules")
```

# Introduction
Expand All @@ -47,7 +47,7 @@ Typically you do not have to call that function explicitly but instead call
`use` to load a module into your current session.

```{r}
library(module)
library(modules)
m <- module({
boringFunction <- function() cat("boring output")
})
Expand Down

0 comments on commit fd94fc0

Please sign in to comment.