Skip to content

Commit

Permalink
Testing travis (Novartis#13)
Browse files Browse the repository at this point in the history
Add Travis-CI for generating pkgdown
Some docs
Bugfix for TidyModule
  • Loading branch information
m-l-1 authored Feb 3, 2020
1 parent 45bb954 commit 7296040
Show file tree
Hide file tree
Showing 94 changed files with 193 additions and 14,896 deletions.
2 changes: 2 additions & 0 deletions .Rbuildignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,5 @@
dev_history.R
^dev$
$run_dev.*
.travis.yml
pkgdown
10 changes: 10 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
language: r
cache: packages
warnings_are_errors: false
before_cache: Rscript -e 'remotes::install_cran("pkgdown")'
deploy:
provider: script
script: Rscript -e 'pkgdown::deploy_site_github(ssh_id = Sys.getenv("TRAVIS_DEPLOY_KEY", ""))'
skip_cleanup: true
on:
branch: master
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Package: tidymodules
Title: A robust framework for developing shiny modules
Version: 0.1.0
Version: 0.1.0.9000
Authors@R: c(
person('Mustapha', 'Larbaoui', email = '[email protected]', role = c('cre', 'aut')),
person('Douglas', 'Robinson', email = '[email protected]', role = c('ctb')),
Expand Down
8 changes: 8 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
# tidymodules 0.1.0.9000

Add travis-CI for building pkgdsown site
Remove docs
Fix & complete docs/vignettes
Add new TidyModule fields : name & order
Fix issue for creating nested module in console & setting parent namespace

# tidymodules 0.1.0

* Github release
2 changes: 2 additions & 0 deletions R/UtilityModule.R
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,10 @@
#' This utility module is a special TidyModule class that doesn't get registered in the ModStore.
#' It is used to retrieve ModStore objects, like sessions and modules.
#' @examples
#' \dontrun{
#' # Print current session Id
#' UtilityModule$new()$getSessionId()
#' }
UtilityModule <- R6::R6Class(
"UtilityModule",
inherit = TidyModule,
Expand Down
1 change: 1 addition & 0 deletions R/examples.R
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
#'
#' @param id Example ID. If null display list of examples with ID.
#' @param server boolean. Is this a server call?
#' @param options list of options to be passed to shinyApps or shinyDir
#'
#' @export
#'
Expand Down
26 changes: 20 additions & 6 deletions R/pipes.R
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@

#'
#' mkDoublePipe: Pipe function generator
#'
#' Create a pipe function for mapping module output to module input
Expand All @@ -11,9 +11,9 @@ mkDoublePipe <- function(l,r, f = TRUE , rev = FALSE){
reverse <- rev
return(
function(l_mod,r_mod){
if(!is(l_mod,"TidyModule"))
if(!methods::is(l_mod,"TidyModule"))
stop(paste0(deparse(substitute(l_mod))," is not a Module"))
if(!is(r_mod,"TidyModule"))
if(!methods::is(r_mod,"TidyModule"))
stop(paste0(deparse(substitute(r_mod))," is not a Module"))

# Make sure we don't use mods from the global session
Expand Down Expand Up @@ -67,7 +67,7 @@ mkSinglePipe <- function(p = NULL, f = TRUE , rev = FALSE){
if(!shiny::is.reactivevalues(from) &&
!shiny::is.reactive(from) )
stop(paste0(deparse(substitute(from))," is not reactive"))
if(!is(to$mod,"TidyModule"))
if(!methods::is(to$mod,"TidyModule"))
stop(paste0(deparse(substitute(to$mod))," is not a Module"))

# getMod function below enforce the use of modules from the user session
Expand Down Expand Up @@ -100,9 +100,9 @@ mkSinglePipe <- function(p = NULL, f = TRUE , rev = FALSE){
#'
#' @keywords internal
multiPipeFunc <- function(l_mod,r_mod,rev = FALSE, t = NULL){
if(!is(l_mod,"TidyModule"))
if(!methods::is(l_mod,"TidyModule"))
stop(paste0(deparse(substitute(l_mod))," is not a Module"))
if(!is(r_mod,"TidyModule"))
if(!methods::is(r_mod,"TidyModule"))
stop(paste0(deparse(substitute(r_mod))," is not a Module"))

# Make sure we don't use mods from the global session
Expand Down Expand Up @@ -219,6 +219,9 @@ for (rp in 1:pipes$maxPort) {
#' @description This pipe works at the port level where left and right object are ports not modules.
#' Take the left port and maps it to the right port.
#'
#' @param lp left port
#' @param rp right port
#'
#' @return The module of the right port
#'
#' @export
Expand All @@ -241,6 +244,9 @@ for (rp in 1:pipes$maxPort) {
#'
#' @description This pipe maps all the left output ports to the right input ports.
#'
#' @param l left module
#' @param r right module
#'
#' @return The right module
#'
#' @export
Expand All @@ -252,6 +258,9 @@ for (rp in 1:pipes$maxPort) {
#'
#' @description This pipe maps all the left input ports to the right input ports.
#'
#' @param l left module
#' @param r right module
#'
#' @return The right module
#'
#' @export
Expand All @@ -268,6 +277,9 @@ for (rp in 1:pipes$maxPort) {
#'
#' @description This pipe maps all the left output ports to the right input ports.
#'
#' @param l left module
#' @param r right module
#'
#' @return The left module
#'
#' @export
Expand All @@ -276,6 +288,8 @@ for (rp in 1:pipes$maxPort) {
#'
#' @title Single-port mapping function
#'
#'
#'
#' @name %x>y%
#'
#' @description This pipe works at the module level.
Expand Down
6 changes: 3 additions & 3 deletions R/utility.R
Original file line number Diff line number Diff line change
Expand Up @@ -142,13 +142,13 @@ callModules <- function(){
o <- i <- s <- NULL
if(!is.null(serverEnv)){
if(!is.null(serverEnv$input) &&
is(serverEnv$input, "reactivevalues"))
methods::is(serverEnv$input, "reactivevalues"))
i <- serverEnv$input
if(!is.null(serverEnv$output) &&
is(serverEnv$output, "shinyoutput"))
methods::is(serverEnv$output, "shinyoutput"))
o <- serverEnv$output
if(!is.null(serverEnv$session) &&
is(serverEnv$session, "ShinySession"))
methods::is(serverEnv$session, "ShinySession"))
s <- serverEnv$session
}
cloned <- mod$deepClone(o,i,s)
Expand Down
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,8 @@ Some examples have been deployed on shinyapp.io, such as:
Learning More
-------------

Please review the [Get Started](https://opensource.nibr.com/tidymodules/articles/tidymodules.html)
Please review the [Get
Started](https://opensource.nibr.com/tidymodules/articles/tidymodules.html)
page for a high level introduction to tidymodules and its usage in
developing Shiny apps.

Expand Down
172 changes: 0 additions & 172 deletions docs/404.html

This file was deleted.

Loading

0 comments on commit 7296040

Please sign in to comment.