Skip to content

Commit

Permalink
merge minor conflict
Browse files Browse the repository at this point in the history
  • Loading branch information
Luke Winslow committed Dec 30, 2015
2 parents 1482199 + e80ee3d commit 6c45e45
Show file tree
Hide file tree
Showing 37 changed files with 83 additions and 102 deletions.
1 change: 1 addition & 0 deletions .Rbuildignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@
.gitignore
^.*\.Rproj$
^\.Rproj\.user$
man-roxygen
1 change: 1 addition & 0 deletions R/authenticate_sb.R
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ authenticate_sb = function(username, password){

readPassword <- function(prompt) {
# found this cool function in rstudio
.rs.askForPassword <- '.global_def'
if (exists(".rs.askForPassword")) {
pass <- .rs.askForPassword(prompt)
} else {
Expand Down
6 changes: 1 addition & 5 deletions R/folder_create.R
Original file line number Diff line number Diff line change
@@ -1,12 +1,8 @@
#' Create a folder
#'
#' @export
#' @param id A ScienceBase ID or something that can be coerced to a SB item ID
#' by \code{\link{as.sbitem}}
#' @template manipulate_item
#' @param name (character) the folder name
#' @param ... Additional parameters are passed on to \code{\link[httr]{GET}} and
#' \code{\link[httr]{DELETE}}
#' @param session Session object from \code{\link{authenticate_sb}}
#' @return A \code{\link[httr]{response}} object
#' @examples \dontrun{
#' folder_create(user_id(), "foobar345")
Expand Down
5 changes: 1 addition & 4 deletions R/item_append_files.R
Original file line number Diff line number Diff line change
@@ -1,11 +1,8 @@
#' @title Upload File to Item
#' @description Adds a file to an item
#'
#' @param id A ScienceBase ID or something that can be coerced to a SB item ID
#' by \code{\link{as.sbitem}}
#' @template manipulate_item
#' @param files A file path to upload.
#' @param ... Additional parameters are passed on to \code{\link[httr]{POST}}
#' @param session A ScienceBase session object from authenticate_sb.
#'
#' @return An object of class \code{sbitem}
#'
Expand Down
5 changes: 1 addition & 4 deletions R/item_create.R
Original file line number Diff line number Diff line change
@@ -1,11 +1,8 @@
#' @title Create a new SB item
#'
#' @param id A ScienceBase ID or something that can be coerced to a SB item ID
#' by \code{\link{as.sbitem}}
#' @template manipulate_item
#' @param title The title of the new SB item
#' @param ... Additional parameters are passed on to \code{\link[httr]{POST}}
#' @param info (optional) list of metadata info for the new item
#' @param session Authenticated session object (from \link{authenticate_sb})
#' @return An object of class \code{sbitem}
#'
#' @export
Expand Down
4 changes: 1 addition & 3 deletions R/item_file_download.R
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,13 @@
#' or a \code{dest_dir} can be supplied where all attached files will be written
#' with the names as stored on SB.
#'
#' @param id SB item ID
#' @param ... Additional parameters are passed on to \code{\link[httr]{GET}}
#' @template manipulate_item
#' @param names String vector list of file names attached to item that you wish
#' to download.
#' @param destinations String vector list of destinations for requested files.
#' Must be same length as \code{names}
#' @param dest_dir A directory path for saving files when \code{names} parameter
#' is omitted
#' @param session Session object from \code{\link{authenticate_sb}}
#' @param overwrite_file Boolean indicating if file should be overwritten if it
#' already exists locally
#'
Expand Down
4 changes: 1 addition & 3 deletions R/item_get.R
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
#' @title Retrieve SB item
#'
#' @export
#' @param id (character) A ScienceBase ID
#' @param ... Additional parameters are passed on to \code{\link[httr]{GET}}
#' @param session Session object from \code{\link{authenticate_sb}}
#' @template manipulate_item
#' @return An object of class \code{sbitem}
#' @examples \dontrun{
#' # Get an item
Expand Down
4 changes: 1 addition & 3 deletions R/item_get_fields.R
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
#' Retrieve specific fields from an SB item
#'
#' @param id SB item ID
#' @template manipulate_item
#' @param fields a vector of fields
#' @param ... Additional parameters are passed on to \code{\link[httr]{GET}}
#' @param drop logical. If only one field is selected, should the
#' list format be dropped?
#' @param session Session object from \code{\link{authenticate_sb}}
#' @return List serialization of chosen metadata for an SB item
#' @import httr
#' @export
Expand Down
4 changes: 1 addition & 3 deletions R/item_get_parent.R
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
#' @title Get an item's parent ID
#'
#' @param id ID of SB item
#' @param ... Additional parameters are passed on to \code{\link[httr]{GET}}
#' @param session SB session object from \code{\link{authenticate_sb}}
#' @template manipulate_item
#' @return The parent ID of an item.
#' @export
#' @examples \dontrun{
Expand Down
5 changes: 1 addition & 4 deletions R/item_list_children.R
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,7 @@
#'
#' Returns a list of child IDs for a ScienceBase item
#'
#' @param id A ScienceBase ID or something that can be coerced to a SB item ID
#' by \code{\link{as.sbitem}}
#' @param ... Additional parameters are passed on to \code{\link[httr]{GET}}
#' @param session (optional) SB session from \link{authenticate_sb}
#' @template manipulate_item
#' @param limit Max children returned
#'
#' @return \code{data.frame} with a row for each child item
Expand Down
4 changes: 1 addition & 3 deletions R/item_list_files.R
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
#' @title Get list of files attached to SB item
#'
#' @param id item ID
#' @template manipulate_item
#' @param recursive (logical) List files recursively. Default: \code{FALSE}
#' @param session Session object from \link{authenticate_sb}
#' @param ... Additional parameters are passed on to \link[httr]{GET}
#'
#' @return
#' A data.frame with columns fname, size, and url.
Expand Down
5 changes: 1 addition & 4 deletions R/item_move.R
Original file line number Diff line number Diff line change
@@ -1,12 +1,9 @@
#' Move item from one folder to another
#'
#' @export
#' @param id A ScienceBase ID or something that can be coerced to a SB item ID
#' by \code{\link{as.sbitem}}
#' @template manipulate_item
#' @param id_new Folder/item to move \code{id} to. A ScienceBase ID or something
#' that can be coerced to a SB item ID by \code{\link{as.sbitem}}
#' @param ... Additional parameters are passed on to \code{\link[httr]{PUT}}
#' @param session Authenticated session object (from \link{authenticate_sb})
#'
#' @return An object of class \code{sbitem}. Same as \code{id}, but with new
#' parent id
Expand Down
5 changes: 1 addition & 4 deletions R/item_replace_files.R
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
#' @title Replace files associated with an item
#' @param id a sciencebase item identifier
#' @template manipulate_item
#' @param files a character vector of file paths
#' @param ... Additional parameters are passed on to \code{\link[httr]{PUT}}
#' and \code{\link[httr]{POST}}
#' @param session Authenticated session object (from \link{authenticate_sb})
#' @description replaces existing files associated with an item with a new one.
#' (Currently does not support multi-file uploads.) This function will not
#' append an existing collection of files. If that is desired, use
Expand Down
6 changes: 1 addition & 5 deletions R/item_rm.R
Original file line number Diff line number Diff line change
@@ -1,13 +1,9 @@
#' @title Remove item from SB
#'
#' @param id A ScienceBase ID or something that can be coerced to a SB item ID
#' by \code{\link{as.sbitem}}
#' @param ... Additional parameters are passed on to \code{\link[httr]{GET}} and
#' \code{\link[httr]{DELETE}}
#' @template manipulate_item
#' @param recursive logical, FALSE by default. CAUTION: setting recursive=TRUE
#' means that not only will this item be deleted, but so will all its child
#' items and their child items and so on.
#' @param session Session object from \code{\link{authenticate_sb}}
#'
#' @return \pkg{httr} \code{\link[httr]{response}} object
#'
Expand Down
5 changes: 1 addition & 4 deletions R/item_rm_files.R
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
#' @title Remove all files associated with an item
#'
#' @param id A ScienceBase ID or something that can be coerced to a SB item ID
#' by \code{\link{as.sbitem}}
#' @param ... Additional parameters are passed on to \code{\link[httr]{PUT}}
#' @param session Authenticated session object (from \link{authenticate_sb})
#' @template manipulate_item
#' @description Removes existing files associated with an item.
#' @return An object of class \code{sbitem}
#' @export
Expand Down
5 changes: 1 addition & 4 deletions R/item_rm_recursive.R
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
#' @title Remove an item completely by recursively removing its child items
#'
#' @keywords internal
#' @param id A ScienceBase ID or something that can be coerced to a SB item ID
#' @param ... Additional parameters are passed on to \code{\link[httr]{GET}} and
#' \code{\link[httr]{DELETE}}
#' @param session Session object from \code{\link{authenticate_sb}}
#' @template manipulate_item
#' @return \code{TRUE} to indicate success
#' @details BEWARE: This completely removes ALL CHILD ITEMS AND THEIR CHILDREN
#' as well as the item itself.
Expand Down
5 changes: 1 addition & 4 deletions R/item_update.R
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
#' @title Update a SB item with new metadata
#'
#' @param id A ScienceBase ID or something that can be coerced to a SB item ID
#' by \code{\link{as.sbitem}}
#' @template manipulate_item
#' @param info list of metadata info (key-value pairs) to change on the item
#' @param ... Additional parameters are passed on to \code{\link[httr]{PUT}}
#' @param session Authenticated session object (from \link{authenticate_sb})
#'
#' @return An object of class \code{sbitem}
#'
Expand Down
5 changes: 1 addition & 4 deletions R/item_update_identifier.R
Original file line number Diff line number Diff line change
@@ -1,12 +1,9 @@
#'@title Add custom identifier to an existing item
#'
#'@param id SB item ID
#' @template manipulate_item
#'@param scheme The identifier scheme
#'@param type The identifier type
#'@param key The identifier key
#'@param ... Additional parameters are passed on to \code{\link[httr]{GET}} and
#' \code{\link[httr]{PUT}}
#'@param session SB session from \code{\link{authenticate_sb}}
#'
#'@author Luke Winslow
#'
Expand Down
2 changes: 1 addition & 1 deletion R/user_id.R
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
#'
#' @export
#' @param ... Additional parameters are passed on to \code{\link[httr]{POST}}
#' @param session Session object from authenticate_sb
#' @param session Session object from \code{\link{authenticate_sb}}
#' @return A single character string, your user id
#' @examples \dontrun{
#' user_id()
Expand Down
5 changes: 5 additions & 0 deletions man-roxygen/manipulate_item.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#' @param id A ScienceBase ID or something that can be coerced to a SB item ID
#' by \code{\link{as.sbitem}}
#' @param ... Additional parameters are passed on to \code{\link[httr]{GET}}, \code{\link[httr]{POST}},
#' \code{\link[httr]{HEAD}}, \code{\link[httr]{PUT}}, or \code{\link[httr]{DELETE}}
#' @param session Session object from \code{\link{authenticate_sb}}
4 changes: 2 additions & 2 deletions man/folder_create.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 3 additions & 2 deletions man/item_append_files.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 3 additions & 2 deletions man/item_create.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 4 additions & 2 deletions man/item_file_download.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 4 additions & 2 deletions man/item_get.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 4 additions & 2 deletions man/item_get_fields.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 5 additions & 3 deletions man/item_get_parent.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 3 additions & 2 deletions man/item_list_children.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 5 additions & 3 deletions man/item_list_files.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 3 additions & 2 deletions man/item_move.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 5 additions & 4 deletions man/item_replace_files.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 6c45e45

Please sign in to comment.