{"action":"created","comment":{"url":"https://api.github.com/repos/klutometis/roxygen/pulls/comments/41966649","id":41966649,"diff_hunk":"@@ -0,0 +1,138 @@\n+#' @title Replace a value for a given tag on file in memory\n+#' @description Scan the lines and change the value for the named tag if one line has this tag, \n+#'    add a line at the end if no line has this tag and return a warning if several lines\n+#'    matching the tag\n+#' @param fileStrings A vector with each string containing a line of the file\n+#' @param tag The tag to be searched for \n+#' @param newVal The new value for the tag\n+#' @return The vector of strings with the new value\n+#' @examples\n+#' fakeFileStrings <- c(\"Hello = world\",\"SURE\\t= indeed\",\"Hello = you\")\n+#' \n+#' expect <- warning(ReplaceTag(fakeFileStrings,\"Hello\",\"me\"))\n+#' \n+#' newFake <- ReplaceTag(fakeFileStrings,\"SURE\",\"me\")\n+#' expect <- equal(length(newFake), length(fakeFileStrings))\n+#' expect <- equal(length(grep(\"SURE\",newFake)), 1)\n+#' expect <- equal(length(grep(\"me\",newFake)), 1)\n+#' \n+#' newFake <- ReplaceTag(fakeFileStrings,\"Bouh\",\"frightened?\")\n+#' expect <- equal(length(newFake), length(fakeFileStrings)+1)\n+#' expect <- equal(length(grep(\"Bouh\",newFake)), 1)\n+#' expect <- equal(length(grep(\"frightened?\",newFake)), 1)\n+#' @keywords internal \n+ReplaceTag <- function(fileStrings,tag,newVal){\n+    iLine <- grep(paste0(\"^\",tag,\"\\\\>\"),fileStrings)\n+    nLines <- length(iLine)\n+    if(nLines == 0){\n+        line <- paste0(tag,\"\\t= \",newVal)\n+        iLine <- length(fileStrings)+1\n+    }else if (nLines > 0){\n+        line <- gsub(\"=.*\",paste0(\"= \",newVal),fileStrings[iLine])\n+        if(nLines >1){\n+            warning(paste0(\"File has\",nLines,\"for key\",tag,\"check it up manually\"))\n+        }\n+    }\n+    fileStrings[iLine] <- line\n+    return(fileStrings)\n+}\n+#' Prepares the R package structure for use with doxygen\n+#' @description Makes a configuration file in inst/doxygen\n+#'     and set a few options: \n+#'     \\itemize{\n+#'        \\item{EXTRACT <- ALL = YES}\n+#'        \\item{INPUT = src/}\n+#'        \\item{OUTPUT <- DIRECTORY = inst/doxygen/}\n+#'     }\n+#' @param rootFolder The root of the R package\n+#' @note Please note this implies the installation of doxygen on the system, \n+#'       accessible on the command line by `doxygen`\n+#' @return NULL\n+#' @examples \n+#' \\dontrun{\n+#' doxygen_init()\n+#' }\n+#' @keywords internal\n+doxygen_init <- function(pkg_path,doxy_file){\n+    doxDir <- dirname(doxy_file)\n+    doxyFileName <- basename(doxy_file)\n+\n+    initFolder <- getwd()","path":"R/roclet-doxygen.R","position":60,"original_position":60,"commit_id":"612ebd9f00eb77e78ca18eba461151c4cad9dc3f","original_commit_id":"612ebd9f00eb77e78ca18eba461151c4cad9dc3f","user":{"login":"cbarbu","id":529412,"avatar_url":"https://avatars.githubusercontent.com/u/529412?v=3","gravatar_id":"","url":"https://api.github.com/users/cbarbu","html_url":"https://github.com/cbarbu","followers_url":"https://api.github.com/users/cbarbu/followers","following_url":"https://api.github.com/users/cbarbu/following{/other_user}","gists_url":"https://api.github.com/users/cbarbu/gists{/gist_id}","starred_url":"https://api.github.com/users/cbarbu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cbarbu/subscriptions","organizations_url":"https://api.github.com/users/cbarbu/orgs","repos_url":"https://api.github.com/users/cbarbu/repos","events_url":"https://api.github.com/users/cbarbu/events{/privacy}","received_events_url":"https://api.github.com/users/cbarbu/received_events","type":"User","site_admin":false},"body":"I removed that.","created_at":"2015-10-14T08:26:05Z","updated_at":"2015-10-14T08:26:05Z","html_url":"https://github.com/klutometis/roxygen/pull/387#discussion_r41966649","pull_request_url":"https://api.github.com/repos/klutometis/roxygen/pulls/387","_links":{"self":{"href":"https://api.github.com/repos/klutometis/roxygen/pulls/comments/41966649"},"html":{"href":"https://github.com/klutometis/roxygen/pull/387#discussion_r41966649"},"pull_request":{"href":"https://api.github.com/repos/klutometis/roxygen/pulls/387"}}},"pull_request":{"url":"https://api.github.com/repos/klutometis/roxygen/pulls/387","id":46908009,"html_url":"https://github.com/klutometis/roxygen/pull/387","diff_url":"https://github.com/klutometis/roxygen/pull/387.diff","patch_url":"https://github.com/klutometis/roxygen/pull/387.patch","issue_url":"https://api.github.com/repos/klutometis/roxygen/issues/387","number":387,"state":"closed","locked":false,"title":"doxygen as a new roclet for roxygen","user":{"login":"cbarbu","id":529412,"avatar_url":"https://avatars.githubusercontent.com/u/529412?v=3","gravatar_id":"","url":"https://api.github.com/users/cbarbu","html_url":"https://github.com/cbarbu","followers_url":"https://api.github.com/users/cbarbu/followers","following_url":"https://api.github.com/users/cbarbu/following{/other_user}","gists_url":"https://api.github.com/users/cbarbu/gists{/gist_id}","starred_url":"https://api.github.com/users/cbarbu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cbarbu/subscriptions","organizations_url":"https://api.github.com/users/cbarbu/orgs","repos_url":"https://api.github.com/users/cbarbu/repos","events_url":"https://api.github.com/users/cbarbu/events{/privacy}","received_events_url":"https://api.github.com/users/cbarbu/received_events","type":"User","site_admin":false},"body":"Following our interactions on \r\nhttps://github.com/hadley/devtools/pull/724\r\nand \r\nhttps://github.com/klutometis/roxygen/issues/326 \r\nThis is the pull request making doxygen doc through a roxygen roclet. \r\nPlease note:\r\n1) the folder for the documentation is inst/doxygen, feel free to move it around, just change the first lines of doxygen_update_all() and clean.doxygen() \r\n2) I'm not fully familiar with the \"roclet\" structure, hope I'm not messing up things but it seems to work on the roxygen package itself. \r\nHope it can be of use.","created_at":"2015-10-06T14:14:37Z","updated_at":"2015-10-14T08:26:05Z","closed_at":"2015-10-09T17:15:45Z","merged_at":null,"merge_commit_sha":"ff87fbea3bd73fa2ad4c2f749dca2482be43d4e6","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/klutometis/roxygen/pulls/387/commits","review_comments_url":"https://api.github.com/repos/klutometis/roxygen/pulls/387/comments","review_comment_url":"https://api.github.com/repos/klutometis/roxygen/pulls/comments{/number}","comments_url":"https://api.github.com/repos/klutometis/roxygen/issues/387/comments","statuses_url":"https://api.github.com/repos/klutometis/roxygen/statuses/612ebd9f00eb77e78ca18eba461151c4cad9dc3f","head":{"label":"cbarbu:master","ref":"master","sha":"612ebd9f00eb77e78ca18eba461151c4cad9dc3f","user":{"login":"cbarbu","id":529412,"avatar_url":"https://avatars.githubusercontent.com/u/529412?v=3","gravatar_id":"","url":"https://api.github.com/users/cbarbu","html_url":"https://github.com/cbarbu","followers_url":"https://api.github.com/users/cbarbu/followers","following_url":"https://api.github.com/users/cbarbu/following{/other_user}","gists_url":"https://api.github.com/users/cbarbu/gists{/gist_id}","starred_url":"https://api.github.com/users/cbarbu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cbarbu/subscriptions","organizations_url":"https://api.github.com/users/cbarbu/orgs","repos_url":"https://api.github.com/users/cbarbu/repos","events_url":"https://api.github.com/users/cbarbu/events{/privacy}","received_events_url":"https://api.github.com/users/cbarbu/received_events","type":"User","site_admin":false},"repo":{"id":32006807,"name":"roxygen","full_name":"cbarbu/roxygen","owner":{"login":"cbarbu","id":529412,"avatar_url":"https://avatars.githubusercontent.com/u/529412?v=3","gravatar_id":"","url":"https://api.github.com/users/cbarbu","html_url":"https://github.com/cbarbu","followers_url":"https://api.github.com/users/cbarbu/followers","following_url":"https://api.github.com/users/cbarbu/following{/other_user}","gists_url":"https://api.github.com/users/cbarbu/gists{/gist_id}","starred_url":"https://api.github.com/users/cbarbu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cbarbu/subscriptions","organizations_url":"https://api.github.com/users/cbarbu/orgs","repos_url":"https://api.github.com/users/cbarbu/repos","events_url":"https://api.github.com/users/cbarbu/events{/privacy}","received_events_url":"https://api.github.com/users/cbarbu/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/cbarbu/roxygen","description":"","fork":true,"url":"https://api.github.com/repos/cbarbu/roxygen","forks_url":"https://api.github.com/repos/cbarbu/roxygen/forks","keys_url":"https://api.github.com/repos/cbarbu/roxygen/keys{/key_id}","collaborators_url":"https://api.github.com/repos/cbarbu/roxygen/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/cbarbu/roxygen/teams","hooks_url":"https://api.github.com/repos/cbarbu/roxygen/hooks","issue_events_url":"https://api.github.com/repos/cbarbu/roxygen/issues/events{/number}","events_url":"https://api.github.com/repos/cbarbu/roxygen/events","assignees_url":"https://api.github.com/repos/cbarbu/roxygen/assignees{/user}","branches_url":"https://api.github.com/repos/cbarbu/roxygen/branches{/branch}","tags_url":"https://api.github.com/repos/cbarbu/roxygen/tags","blobs_url":"https://api.github.com/repos/cbarbu/roxygen/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/cbarbu/roxygen/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/cbarbu/roxygen/git/refs{/sha}","trees_url":"https://api.github.com/repos/cbarbu/roxygen/git/trees{/sha}","statuses_url":"https://api.github.com/repos/cbarbu/roxygen/statuses/{sha}","languages_url":"https://api.github.com/repos/cbarbu/roxygen/languages","stargazers_url":"https://api.github.com/repos/cbarbu/roxygen/stargazers","contributors_url":"https://api.github.com/repos/cbarbu/roxygen/contributors","subscribers_url":"https://api.github.com/repos/cbarbu/roxygen/subscribers","subscription_url":"https://api.github.com/repos/cbarbu/roxygen/subscription","commits_url":"https://api.github.com/repos/cbarbu/roxygen/commits{/sha}","git_commits_url":"https://api.github.com/repos/cbarbu/roxygen/git/commits{/sha}","comments_url":"https://api.github.com/repos/cbarbu/roxygen/comments{/number}","issue_comment_url":"https://api.github.com/repos/cbarbu/roxygen/issues/comments{/number}","contents_url":"https://api.github.com/repos/cbarbu/roxygen/contents/{+path}","compare_url":"https://api.github.com/repos/cbarbu/roxygen/compare/{base}...{head}","merges_url":"https://api.github.com/repos/cbarbu/roxygen/merges","archive_url":"https://api.github.com/repos/cbarbu/roxygen/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/cbarbu/roxygen/downloads","issues_url":"https://api.github.com/repos/cbarbu/roxygen/issues{/number}","pulls_url":"https://api.github.com/repos/cbarbu/roxygen/pulls{/number}","milestones_url":"https://api.github.com/repos/cbarbu/roxygen/milestones{/number}","notifications_url":"https://api.github.com/repos/cbarbu/roxygen/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/cbarbu/roxygen/labels{/name}","releases_url":"https://api.github.com/repos/cbarbu/roxygen/releases{/id}","created_at":"2015-03-11T08:37:22Z","updated_at":"2015-03-11T08:37:23Z","pushed_at":"2015-10-14T07:40:43Z","git_url":"git://github.com/cbarbu/roxygen.git","ssh_url":"git@github.com:cbarbu/roxygen.git","clone_url":"https://github.com/cbarbu/roxygen.git","svn_url":"https://github.com/cbarbu/roxygen","homepage":"","size":8289,"stargazers_count":0,"watchers_count":0,"language":"R","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"klutometis:master","ref":"master","sha":"9d314c6c4635996fa5bf12b55d37c3e48cc7faf3","user":{"login":"klutometis","id":85991,"avatar_url":"https://avatars.githubusercontent.com/u/85991?v=3","gravatar_id":"","url":"https://api.github.com/users/klutometis","html_url":"https://github.com/klutometis","followers_url":"https://api.github.com/users/klutometis/followers","following_url":"https://api.github.com/users/klutometis/following{/other_user}","gists_url":"https://api.github.com/users/klutometis/gists{/gist_id}","starred_url":"https://api.github.com/users/klutometis/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/klutometis/subscriptions","organizations_url":"https://api.github.com/users/klutometis/orgs","repos_url":"https://api.github.com/users/klutometis/repos","events_url":"https://api.github.com/users/klutometis/events{/privacy}","received_events_url":"https://api.github.com/users/klutometis/received_events","type":"User","site_admin":false},"repo":{"id":1765057,"name":"roxygen","full_name":"klutometis/roxygen","owner":{"login":"klutometis","id":85991,"avatar_url":"https://avatars.githubusercontent.com/u/85991?v=3","gravatar_id":"","url":"https://api.github.com/users/klutometis","html_url":"https://github.com/klutometis","followers_url":"https://api.github.com/users/klutometis/followers","following_url":"https://api.github.com/users/klutometis/following{/other_user}","gists_url":"https://api.github.com/users/klutometis/gists{/gist_id}","starred_url":"https://api.github.com/users/klutometis/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/klutometis/subscriptions","organizations_url":"https://api.github.com/users/klutometis/orgs","repos_url":"https://api.github.com/users/klutometis/repos","events_url":"https://api.github.com/users/klutometis/events{/privacy}","received_events_url":"https://api.github.com/users/klutometis/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/klutometis/roxygen","description":"","fork":false,"url":"https://api.github.com/repos/klutometis/roxygen","forks_url":"https://api.github.com/repos/klutometis/roxygen/forks","keys_url":"https://api.github.com/repos/klutometis/roxygen/keys{/key_id}","collaborators_url":"https://api.github.com/repos/klutometis/roxygen/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/klutometis/roxygen/teams","hooks_url":"https://api.github.com/repos/klutometis/roxygen/hooks","issue_events_url":"https://api.github.com/repos/klutometis/roxygen/issues/events{/number}","events_url":"https://api.github.com/repos/klutometis/roxygen/events","assignees_url":"https://api.github.com/repos/klutometis/roxygen/assignees{/user}","branches_url":"https://api.github.com/repos/klutometis/roxygen/branches{/branch}","tags_url":"https://api.github.com/repos/klutometis/roxygen/tags","blobs_url":"https://api.github.com/repos/klutometis/roxygen/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/klutometis/roxygen/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/klutometis/roxygen/git/refs{/sha}","trees_url":"https://api.github.com/repos/klutometis/roxygen/git/trees{/sha}","statuses_url":"https://api.github.com/repos/klutometis/roxygen/statuses/{sha}","languages_url":"https://api.github.com/repos/klutometis/roxygen/languages","stargazers_url":"https://api.github.com/repos/klutometis/roxygen/stargazers","contributors_url":"https://api.github.com/repos/klutometis/roxygen/contributors","subscribers_url":"https://api.github.com/repos/klutometis/roxygen/subscribers","subscription_url":"https://api.github.com/repos/klutometis/roxygen/subscription","commits_url":"https://api.github.com/repos/klutometis/roxygen/commits{/sha}","git_commits_url":"https://api.github.com/repos/klutometis/roxygen/git/commits{/sha}","comments_url":"https://api.github.com/repos/klutometis/roxygen/comments{/number}","issue_comment_url":"https://api.github.com/repos/klutometis/roxygen/issues/comments{/number}","contents_url":"https://api.github.com/repos/klutometis/roxygen/contents/{+path}","compare_url":"https://api.github.com/repos/klutometis/roxygen/compare/{base}...{head}","merges_url":"https://api.github.com/repos/klutometis/roxygen/merges","archive_url":"https://api.github.com/repos/klutometis/roxygen/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/klutometis/roxygen/downloads","issues_url":"https://api.github.com/repos/klutometis/roxygen/issues{/number}","pulls_url":"https://api.github.com/repos/klutometis/roxygen/pulls{/number}","milestones_url":"https://api.github.com/repos/klutometis/roxygen/milestones{/number}","notifications_url":"https://api.github.com/repos/klutometis/roxygen/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/klutometis/roxygen/labels{/name}","releases_url":"https://api.github.com/repos/klutometis/roxygen/releases{/id}","created_at":"2011-05-18T08:23:27Z","updated_at":"2015-10-11T02:21:08Z","pushed_at":"2015-10-11T20:57:19Z","git_url":"git://github.com/klutometis/roxygen.git","ssh_url":"git@github.com:klutometis/roxygen.git","clone_url":"https://github.com/klutometis/roxygen.git","svn_url":"https://github.com/klutometis/roxygen","homepage":"","size":10352,"stargazers_count":152,"watchers_count":152,"language":"R","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":71,"mirror_url":null,"open_issues_count":15,"forks":71,"open_issues":15,"watchers":152,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/klutometis/roxygen/pulls/387"},"html":{"href":"https://github.com/klutometis/roxygen/pull/387"},"issue":{"href":"https://api.github.com/repos/klutometis/roxygen/issues/387"},"comments":{"href":"https://api.github.com/repos/klutometis/roxygen/issues/387/comments"},"review_comments":{"href":"https://api.github.com/repos/klutometis/roxygen/pulls/387/comments"},"review_comment":{"href":"https://api.github.com/repos/klutometis/roxygen/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/klutometis/roxygen/pulls/387/commits"},"statuses":{"href":"https://api.github.com/repos/klutometis/roxygen/statuses/612ebd9f00eb77e78ca18eba461151c4cad9dc3f"}}}}