Browse Source

Merge pull request #20 from hrbrmstr/0.6.0

0.6.0
master
boB Rudis 3 years ago
committed by GitHub
parent
commit
029dae9c29
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 1
      .Rbuildignore
  2. 4
      DESCRIPTION
  3. 2
      LICENSE
  4. 21
      LICENSE.md
  5. 62
      R/docker-splash.r
  6. 90
      R/utils-safely.R
  7. 2
      man/as_har.Rd
  8. 2
      man/as_httr_req.Rd
  9. 2
      man/as_response.Rd
  10. 2
      man/execute_lua.Rd
  11. 2
      man/get_content_size.Rd
  12. 2
      man/get_content_type.Rd
  13. 2
      man/get_har_entry.Rd
  14. 2
      man/get_request_type.Rd
  15. 2
      man/get_request_url.Rd
  16. 2
      man/get_response_body.Rd
  17. 2
      man/har_entries.Rd
  18. 2
      man/har_entry_count.Rd
  19. 7
      man/install_splash.Rd
  20. 2
      man/json_fromb64.Rd
  21. 2
      man/killall_splash.Rd
  22. 2
      man/print.splashr.Rd
  23. 2
      man/render_har.Rd
  24. 2
      man/render_html.Rd
  25. 2
      man/render_jpeg.Rd
  26. 2
      man/render_json.Rd
  27. 2
      man/render_png.Rd
  28. 2
      man/splash.Rd
  29. 2
      man/splash_active.Rd
  30. 2
      man/splash_add_lua.Rd
  31. 2
      man/splash_click.Rd
  32. 2
      man/splash_debug.Rd
  33. 2
      man/splash_enable_javascript.Rd
  34. 2
      man/splash_focus.Rd
  35. 2
      man/splash_go.Rd
  36. 2
      man/splash_har.Rd
  37. 2
      man/splash_har_reset.Rd
  38. 2
      man/splash_history.Rd
  39. 2
      man/splash_html.Rd
  40. 2
      man/splash_images.Rd
  41. 2
      man/splash_perf_stats.Rd
  42. 2
      man/splash_plugins.Rd
  43. 2
      man/splash_png.Rd
  44. 2
      man/splash_press.Rd
  45. 2
      man/splash_private_mode.Rd
  46. 2
      man/splash_release.Rd
  47. 2
      man/splash_response_body.Rd
  48. 2
      man/splash_send_keys.Rd
  49. 2
      man/splash_send_text.Rd
  50. 2
      man/splash_user_agent.Rd
  51. 2
      man/splash_version.Rd
  52. 2
      man/splash_wait.Rd
  53. 14
      man/start_splash.Rd
  54. 2
      man/stop_splash.Rd

1
.Rbuildignore

@ -1,3 +1,4 @@
^LICENSE\.md$
^.*\.Rproj$
^\.Rproj\.user$
^\.travis\.yml$

4
DESCRIPTION

@ -2,7 +2,7 @@ Package: splashr
Type: Package
Title: Tools to Work with the 'Splash' 'JavaScript' Rendering and Scraping Service
Version: 0.6.0
Date: 2019-01-13
Date: 2019-02-24
Encoding: UTF-8
Authors@R: c(
person("Bob", "Rudis", email = "bob@rud.is", role = c("aut", "cre"),
@ -18,7 +18,7 @@ Description: 'Splash' <https://github.com/scrapinghub/splash> is a 'JavaScript'
page context; getting detailed rendering info in 'HAR' format.
URL: http://gitlab.com/hrbrmstr/splashr
BugReports: https://gitlab.com/hrbrmstr/splashr/issues
License: AGPL
License: MIT + file LICENSE
Suggests:
testthat,
tibble,

2
LICENSE

@ -0,0 +1,2 @@
YEAR: 2019
COPYRIGHT HOLDER: Bob Rudis

21
LICENSE.md

@ -0,0 +1,21 @@
# MIT License
Copyright (c) 2019 Bob Rudis
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

62
R/docker-splash.r

@ -2,6 +2,7 @@
#'
#' @md
#' @param tag Splash Docker image tag to install
#' @return a `docker_image` object or `NULL` if an error occurred.
#' @export
#' @family splash_docker_helpers
#' @examples \dontrun{
@ -9,9 +10,23 @@
#' splash_container <- start_splash()
#' stop_splash(splash_container)
#' }
install_splash <- function(tag="3.2") {
install_splash <- function(tag="latest") {
docker <- stevedore::docker_client()
res <- docker$image$pull("scrapinghub/splash", tag=tag, stream=stdout())
tryCatch(
docker$image$pull("scrapinghub/splash", tag=tag, stream=stdout()),
error = function(e) {
message("Error pulling image from DockerHub.\n", e)
return(NULL)
},
interrupt = function(e) {
stop("Terminated by user", call. = FALSE)
}
) -> res
invisible(res)
}
#' Start a Splash server Docker container
@ -19,6 +34,10 @@ install_splash <- function(tag="3.2") {
#' If using this in an automation context, you should consider adding a
#' `Sys.sleep(3)` (or higher) after starting the docker container.
#'
#' This uses the `latest` image and passed the `--disable-browser-caches`
#' parameter. If you do not want to use the 3.2.x+ versions of `Splash`
#' you should use your own startup scripts vs this helper function.
#'
#' @param tag Splash Docker image tag to start
#' @note you need Docker running on your system and have pulled the container with
#' [install_splash] for this to work. You should save the resultant
@ -27,25 +46,37 @@ install_splash <- function(tag="3.2") {
#' @param container_name naem for the container. Defaults to "`splashr`".
#' @param remove remove the Splash container instance after it's stopped?
#' Defaults to `FALSE`.
#' @param ... passed on to Splash instance launch parameters
#' @family splash_docker_helpers
#' @return `stevedor` container object
#' @return `stevedore` container object
#' @export
#' @examples \dontrun{
#' install_splash()
#' splash_container <- start_splash()
#' stop_splash(splash_container)
#' }
start_splash <- function(tag="3.2", container_name = "splashr", remove=FALSE) {
start_splash <- function(tag="latest", container_name = "splashr", remove=FALSE, ...) {
docker <- stevedore::docker_client()
docker$container$run(
image = sprintf("scrapinghub/splash:%s", tag),
name = container_name,
ports = c("5023:5023", "8051:8051", "8050:8050"),
detach = TRUE,
rm = remove,
tty = TRUE
tryCatch(
docker$container$run(
image = sprintf("scrapinghub/splash:%s", tag),
name = container_name,
ports = c("5023:5023", "8051:8051", "8050:8050"),
detach = TRUE,
rm = remove,
tty = TRUE,
"--disable-browser-caches",
...
),
error = function(e) {
message("Error pulling image from DockerHub.")
return(NULL)
},
interrupt = function(e) {
stop("Terminated by user", call. = FALSE)
}
) -> splash_inst
invisible(splash_inst)
@ -66,8 +97,10 @@ start_splash <- function(tag="3.2", container_name = "splashr", remove=FALSE) {
#' stop_splash(splash_container)
#' }
stop_splash <- function(splash_container) {
splash_container$stop()
splash_container$remove()
if (inherits(splash_container, "stevedore_object")) {
splash_container$stop()
splash_container$remove()
}
invisible(NULL)
}
@ -83,7 +116,9 @@ stop_splash <- function(splash_container) {
killall_splash <- function() {
docker <- stevedore::docker_client()
x <- docker$container$list(all=TRUE)
for (i in 1:nrow(x)) {
if (grepl("bin/splash", x$command[i])) {
message(sprintf("Pruning: %s...", x$id[i]))
@ -94,6 +129,7 @@ killall_splash <- function() {
}
}
}
}

90
R/utils-safely.R

@ -0,0 +1,90 @@
# Less cool counterparts to purrr's side-effect capture-rs
#
# Most of the helper functions are 100% from output.R in purrr repo
#
# @param quiet Hide errors (`TRUE`, the default), or display them
# as they occur?
# @param otherwise Default value to use when an error occurs.
#
# @return `safely`: wrapped function instead returns a list with
# components `result` and `error`. One value is always `NULL`.
#
# `quietly`: wrapped function instead returns a list with components
# `result`, `output`, `messages` and `warnings`.
#
# `possibly`: wrapped function uses a default value (`otherwise`)
# whenever an error occurs.
safely <- function(.f, otherwise = NULL, quiet = TRUE) {
function(...) capture_error(.f(...), otherwise, quiet)
}
quietly <- function(.f) {
function(...) capture_output(.f(...))
}
possibly <- function(.f, otherwise, quiet = TRUE) {
force(otherwise)
function(...) {
tryCatch(.f(...),
error = function(e) {
if (!quiet)
message("Error: ", e$message)
otherwise
},
interrupt = function(e) {
stop("Terminated by user", call. = FALSE)
}
)
}
}
capture_error <- function(code, otherwise = NULL, quiet = TRUE) {
tryCatch(
list(result = code, error = NULL),
error = function(e) {
if (!quiet)
message("Error: ", e$message)
list(result = otherwise, error = e)
},
interrupt = function(e) {
stop("Terminated by user", call. = FALSE)
}
)
}
capture_output <- function(code) {
warnings <- character()
wHandler <- function(w) {
warnings <<- c(warnings, w$message)
invokeRestart("muffleWarning")
}
messages <- character()
mHandler <- function(m) {
messages <<- c(messages, m$message)
invokeRestart("muffleMessage")
}
temp <- file()
sink(temp)
on.exit({
sink()
close(temp)
})
result <- withCallingHandlers(
code,
warning = wHandler,
message = mHandler
)
output <- paste0(readLines(temp, warn = FALSE), collapse = "\n")
list(
result = result,
output = output,
warnings = warnings,
messages = messages
)
}

2
man/as_har.Rd

@ -1,5 +1,5 @@
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/render-har.R
% Please edit documentation in R/render-har.r
\name{as_har}
\alias{as_har}
\title{Turn a generic Splash HAR response into a HAR object}

2
man/as_httr_req.Rd

@ -1,5 +1,5 @@
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/as_req.R
% Please edit documentation in R/as_req.r
\name{as_httr_req}
\alias{as_httr_req}
\title{Create an httr verb request function from an HAR request}

2
man/as_response.Rd

@ -1,5 +1,5 @@
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/as_request.R
% Please edit documentation in R/as_request.r
\name{as_response}
\alias{as_response}
\title{Return a HAR entry response as an httr::response object}

2
man/execute_lua.Rd

@ -1,5 +1,5 @@
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/execute.R
% Please edit documentation in R/execute.r
\name{execute_lua}
\alias{execute_lua}
\title{Execute a custom rendering script and return a result.}

2
man/get_content_size.Rd

@ -1,5 +1,5 @@
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/content.R
% Please edit documentation in R/content.r
\name{get_content_size}
\alias{get_content_size}
\alias{get_body_size}

2
man/get_content_type.Rd

@ -1,5 +1,5 @@
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/helpers.R
% Please edit documentation in R/helpers.r
\name{get_content_type}
\alias{get_content_type}
\alias{is_content_type}

2
man/get_har_entry.Rd

@ -1,5 +1,5 @@
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/helpers.R
% Please edit documentation in R/helpers.r
\name{get_har_entry}
\alias{get_har_entry}
\title{Retrieve an entry by index from a HAR object}

2
man/get_request_type.Rd

@ -1,5 +1,5 @@
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/helpers.R
% Please edit documentation in R/helpers.r
\name{get_request_type}
\alias{get_request_type}
\alias{is_get}

2
man/get_request_url.Rd

@ -1,5 +1,5 @@
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/helpers.R
% Please edit documentation in R/helpers.r
\name{get_request_url}
\alias{get_request_url}
\title{Retrieve request URL}

2
man/get_response_body.Rd

@ -1,5 +1,5 @@
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/helpers.R
% Please edit documentation in R/helpers.r
\name{get_response_body}
\alias{get_response_body}
\title{Retrieve the body content of a HAR entry}

2
man/har_entries.Rd

@ -1,5 +1,5 @@
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/helpers.R
% Please edit documentation in R/helpers.r
\name{har_entries}
\alias{har_entries}
\title{Retrieve just the HAR entries from a splashr request}

2
man/har_entry_count.Rd

@ -1,5 +1,5 @@
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/helpers.R
% Please edit documentation in R/helpers.r
\name{har_entry_count}
\alias{har_entry_count}
\title{Retrieves number of HAR entries in a response}

7
man/install_splash.Rd

@ -1,14 +1,17 @@
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/docker-splash.R
% Please edit documentation in R/docker-splash.r
\name{install_splash}
\alias{install_splash}
\title{Retrieve the Docker image for Splash}
\usage{
install_splash(tag = "3.2")
install_splash(tag = "latest")
}
\arguments{
\item{tag}{Splash Docker image tag to install}
}
\value{
a \code{docker_image} object or \code{NULL} if an error occurred.
}
\description{
Retrieve the Docker image for Splash
}

2
man/json_fromb64.Rd

@ -1,5 +1,5 @@
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/utils.R
% Please edit documentation in R/utils.r
\name{json_fromb64}
\alias{json_fromb64}
\title{Convert a Base64 encoded string into an R object}

2
man/killall_splash.Rd

@ -1,5 +1,5 @@
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/docker-splash.R
% Please edit documentation in R/docker-splash.r
\name{killall_splash}
\alias{killall_splash}
\title{Prune all dead and running Splash Docker containers}

2
man/print.splashr.Rd

@ -1,5 +1,5 @@
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/splashr.R
% Please edit documentation in R/splashr.r
\name{print.splashr}
\alias{print.splashr}
\title{Print for splashr}

2
man/render_har.Rd

@ -1,5 +1,5 @@
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/render-har.R
% Please edit documentation in R/render-har.r
\name{render_har}
\alias{render_har}
\title{Return information about Splash interaction with a website in HAR format.}

2
man/render_html.Rd

@ -1,5 +1,5 @@
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/render-html.R
% Please edit documentation in R/render-html.r
\name{render_html}
\alias{render_html}
\title{Return the HTML of the javascript-rendered page.}

2
man/render_jpeg.Rd

@ -1,5 +1,5 @@
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/render-jpg.R
% Please edit documentation in R/render-jpg.r
\name{render_jpeg}
\alias{render_jpeg}
\title{Return a image (in JPEG format) of the javascript-rendered page.}

2
man/render_json.Rd

@ -1,5 +1,5 @@
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/render-json.R
% Please edit documentation in R/render-json.r
\name{render_json}
\alias{render_json}
\title{Return a json-encoded dictionary with information about javascript-rendered webpage.}

2
man/render_png.Rd

@ -1,5 +1,5 @@
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/render-png.R
% Please edit documentation in R/render-png.r
\name{render_png}
\alias{render_png}
\title{Return an image (in PNG format) of the javascript-rendered page.}

2
man/splash.Rd

@ -1,5 +1,5 @@
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/splashr.R
% Please edit documentation in R/splashr.r
\docType{data}
\name{splash}
\alias{splash}

2
man/splash_active.Rd

@ -1,5 +1,5 @@
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/splashr.R
% Please edit documentation in R/splashr.r
\name{splash_active}
\alias{splash_active}
\title{Test if a Splash server is up}

2
man/splash_add_lua.Rd

@ -1,5 +1,5 @@
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/dsl.R
% Please edit documentation in R/dsl.r
\name{splash_add_lua}
\alias{splash_add_lua}
\title{Add raw lua code into DSL call chain}

2
man/splash_click.Rd

@ -1,5 +1,5 @@
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/dsl.R
% Please edit documentation in R/dsl.r
\name{splash_click}
\alias{splash_click}
\title{Trigger mouse click event in web page.}

2
man/splash_debug.Rd

@ -1,5 +1,5 @@
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/splashr.R
% Please edit documentation in R/splashr.r
\name{splash_debug}
\alias{splash_debug}
\alias{print.splash_debug}

2
man/splash_enable_javascript.Rd

@ -1,5 +1,5 @@
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/dsl.R
% Please edit documentation in R/dsl.r
\name{splash_enable_javascript}
\alias{splash_enable_javascript}
\title{Enable or disable execution of JavaSript code embedded in the page.}

2
man/splash_focus.Rd

@ -1,5 +1,5 @@
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/dsl.R
% Please edit documentation in R/dsl.r
\name{splash_focus}
\alias{splash_focus}
\title{Focus on a document element provided by a CSS selector}

2
man/splash_go.Rd

@ -1,5 +1,5 @@
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/dsl.R
% Please edit documentation in R/dsl.r
\name{splash_go}
\alias{splash_go}
\title{Go to an URL.}

2
man/splash_har.Rd

@ -1,5 +1,5 @@
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/dsl.R
% Please edit documentation in R/dsl.r
\name{splash_har}
\alias{splash_har}
\title{Return information about Splash interaction with a website in HAR format.}

2
man/splash_har_reset.Rd

@ -1,5 +1,5 @@
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/dsl.R
% Please edit documentation in R/dsl.r
\name{splash_har_reset}
\alias{splash_har_reset}
\title{Drops all internally stored HAR records.}

2
man/splash_history.Rd

@ -1,5 +1,5 @@
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/splashr.R
% Please edit documentation in R/splashr.r
\name{splash_history}
\alias{splash_history}
\title{Get information about requests/responses for the pages loaded}

2
man/splash_html.Rd

@ -1,5 +1,5 @@
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/dsl.R
% Please edit documentation in R/dsl.r
\name{splash_html}
\alias{splash_html}
\title{Return a HTML snapshot of a current page.}

2
man/splash_images.Rd

@ -1,5 +1,5 @@
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/dsl.R
% Please edit documentation in R/dsl.r
\name{splash_images}
\alias{splash_images}
\title{Enable/disable images}

2
man/splash_perf_stats.Rd

@ -1,5 +1,5 @@
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/splashr.R
% Please edit documentation in R/splashr.r
\name{splash_perf_stats}
\alias{splash_perf_stats}
\title{Get Splash performance-related statistics}

2
man/splash_plugins.Rd

@ -1,5 +1,5 @@
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/dsl.R
% Please edit documentation in R/dsl.r
\name{splash_plugins}
\alias{splash_plugins}
\title{Enable or disable browser plugins (e.g. Flash).}

2
man/splash_png.Rd

@ -1,5 +1,5 @@
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/dsl.R
% Please edit documentation in R/dsl.r
\name{splash_png}
\alias{splash_png}
\title{Return a screenshot of a current page in PNG format.}

2
man/splash_press.Rd

@ -1,5 +1,5 @@
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/dsl.R
% Please edit documentation in R/dsl.r
\name{splash_press}
\alias{splash_press}
\title{Trigger mouse press event in web page.}

2
man/splash_private_mode.Rd

@ -1,5 +1,5 @@
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/dsl.R
% Please edit documentation in R/dsl.r
\name{splash_private_mode}
\alias{splash_private_mode}
\title{Enable or disable execution of JavaSript code embedded in the page.}

2
man/splash_release.Rd

@ -1,5 +1,5 @@
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/dsl.R
% Please edit documentation in R/dsl.r
\name{splash_release}
\alias{splash_release}
\title{Trigger mouse release event in web page.}

2
man/splash_response_body.Rd

@ -1,5 +1,5 @@
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/dsl.R
% Please edit documentation in R/dsl.r
\name{splash_response_body}
\alias{splash_response_body}
\title{Enable or disable response content tracking.}

2
man/splash_send_keys.Rd

@ -1,5 +1,5 @@
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/dsl.R
% Please edit documentation in R/dsl.r
\name{splash_send_keys}
\alias{splash_send_keys}
\title{Send keyboard events to page context.}

2
man/splash_send_text.Rd

@ -1,5 +1,5 @@
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/dsl.R
% Please edit documentation in R/dsl.r
\name{splash_send_text}
\alias{splash_send_text}
\title{Send text as input to page context, literally, character by character.}

2
man/splash_user_agent.Rd

@ -1,5 +1,5 @@
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/dsl.R, R/user-agents.R
% Please edit documentation in R/dsl.r, R/user-agents.R
\docType{data}
\name{splash_user_agent}
\alias{splash_user_agent}

2
man/splash_version.Rd

@ -1,5 +1,5 @@
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/splashr.R
% Please edit documentation in R/splashr.r
\name{splash_version}
\alias{splash_version}
\title{Get Splash version information}

2
man/splash_wait.Rd

@ -1,5 +1,5 @@
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/dsl.R
% Please edit documentation in R/dsl.r
\name{splash_wait}
\alias{splash_wait}
\title{Wait for a period time}

14
man/start_splash.Rd

@ -1,10 +1,11 @@
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/docker-splash.R
% Please edit documentation in R/docker-splash.r
\name{start_splash}
\alias{start_splash}
\title{Start a Splash server Docker container}
\usage{
start_splash(tag = "3.2", container_name = "splashr", remove = FALSE)
start_splash(tag = "latest", container_name = "splashr",
remove = FALSE, ...)
}
\arguments{
\item{tag}{Splash Docker image tag to start}
@ -13,14 +14,21 @@ start_splash(tag = "3.2", container_name = "splashr", remove = FALSE)
\item{remove}{remove the Splash container instance after it's stopped?
Defaults to `FALSE`.}
\item{...}{passed on to Splash instance launch parameters}
}
\value{
`stevedor` container object
`stevedore` container object
}
\description{
If using this in an automation context, you should consider adding a
`Sys.sleep(3)` (or higher) after starting the docker container.
}
\details{
This uses the `latest` image and passed the `--disable-browser-caches`
parameter. If you do not want to use the 3.2.x+ versions of `Splash`
you should use your own startup scripts vs this helper function.
}
\note{
you need Docker running on your system and have pulled the container with
[install_splash] for this to work. You should save the resultant

2
man/stop_splash.Rd

@ -1,5 +1,5 @@
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/docker-splash.R
% Please edit documentation in R/docker-splash.r
\name{stop_splash}
\alias{stop_splash}
\title{Stop a running a Splash server Docker container}

Loading…
Cancel
Save