[ARVADOS] updated: 1.1.2-114-g68d1c59

Git user git at public.curoverse.com
Fri Jan 12 08:11:48 EST 2018


Summary of changes:
 sdk/R/R/Subcollection.R             |  7 +++++--
 sdk/R/README                        | 11 +++++++++--
 sdk/R/tests/testthat/test-Arvados.R |  2 +-
 3 files changed, 15 insertions(+), 5 deletions(-)

       via  68d1c59bc33df1b002754b958b6887896f2a40d5 (commit)
      from  b0f36fd28ee29321d368852bd14b61485e758af3 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.


commit 68d1c59bc33df1b002754b958b6887896f2a40d5
Author: Fuad Muhic <fmuhic at capeannenterprises.com>
Date:   Fri Jan 12 14:09:51 2018 +0100

    Reworked functionality for removing content from collection.
    
    Arvados-DCO-1.1-Signed-off-by: Fuad Muhic <fmuhic at capeannenterprises.com>

diff --git a/sdk/R/R/Subcollection.R b/sdk/R/R/Subcollection.R
index 06df7c4..298ab10 100644
--- a/sdk/R/R/Subcollection.R
+++ b/sdk/R/R/Subcollection.R
@@ -63,7 +63,8 @@ Subcollection <- R6::R6Class(
             else
             {
                 stop(paste("Expected AravodsFile or Subcollection object, got",
-                           class(content), "."))
+                           paste0("(", paste0(class(content), collapse = ", "), ")"),
+                           "."))
             }
         },
 
@@ -90,7 +91,9 @@ Subcollection <- R6::R6Class(
             }
             else
             {
-                stop(paste("Expected character, got", class(content), "."))
+                stop(paste("Expected character, got",
+                           paste0("(", paste0(class(name), collapse = ", "), ")"),
+                           "."))
             }
         },
 
diff --git a/sdk/R/README b/sdk/R/README
index 7f984fe..5ef9620 100644
--- a/sdk/R/README
+++ b/sdk/R/README
@@ -154,19 +154,26 @@ arvadosFile$write("This is new file content")
 
 file <- collection$get("location/to/my/file.cpp")
 
-file$removeFromCollection()
+collection$remove(file)
 
 #Or
 
-collection$remove(file)
+collection$remove("location/to/my/file.cpp")
 
 #Both examples will remove file "file.cpp" from a collection
+#You can remove both Subcollection and ArvadosFile
 #If subcollection contains more files or folders they will be removed recursively.
 
 #You can also remove multiple files
 
 collection$remove(c("path/to/my/file.cpp", "path/to/other/file.cpp"))
 
+#Delete file or folder from a Subcollection
+
+subcollection <- collection$get("mySubcollection/")
+subcollection$remove("fileInsideSubcollection.exe")
+subcollection$remove("folderInsideSubcollection/")
+
 --------------------------------------------------------------------------------------------------------------------------------
 
 #Move file or folder inside collection
diff --git a/sdk/R/tests/testthat/test-Arvados.R b/sdk/R/tests/testthat/test-Arvados.R
index 950c545..ef82b3d 100644
--- a/sdk/R/tests/testthat/test-Arvados.R
+++ b/sdk/R/tests/testthat/test-Arvados.R
@@ -42,7 +42,7 @@ test_that("Constructor raises exception if fields and environment variables are
     expect_that(Arvados$new(),
                 throws_error(paste0("Please provide host name and authentification token",
                                     " or set ARVADOS_API_HOST and ARVADOS_API_TOKEN",
-                                    " environmental variables.")))
+                                    " environment variables.")))
 }) 
 
 test_that("getWebDavHostName calls REST service properly", {

-----------------------------------------------------------------------


hooks/post-receive
-- 




More information about the arvados-commits mailing list