Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

new feature: source_gist and source_https #49

Merged
merged 4 commits into from
Feb 23, 2012
Merged

Conversation

kohske
Copy link
Contributor

@kohske kohske commented Jan 22, 2012

No description provided.

#' @importFrom RCurl getURL
#' @export
source_https <- function(url, ...) {
message("Running: ", url)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think this is needed for this function

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK, I will remove.

#'
#' @param entry either full url (character), gist ID (numeric or character of
#' numeric). If only an entry ID is specified and the entry has multiple code
#' block, the first entry is sourced.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it should source all files by default (if that's not too tricky) - that's why I suggested vectorising source_url

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A problem is that a entry of the gist can contain different types of files, so maybe one is *.R, the other is *.txt.
But as the gist wisely identify the type of file, maybe we can wisely detect and source only *.R. I will check if it is possible.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One way is to download tar.gz that contains all entries, extract it, inspect the extension, and run the file if it is *.R.
Not sure which way is most convenient.
What do you think?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, good point. Let's leave it as is.

@hadley
Copy link
Member

hadley commented Feb 1, 2012

Could you please add a note to NEWS, and then I'll pull in.

hadley added a commit that referenced this pull request Feb 23, 2012
new feature: source_gist and source_https
@hadley hadley merged commit df9accc into r-lib:master Feb 23, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants