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

Allow responses to be written directly to disk #77

Merged
merged 2 commits into from Feb 21, 2018

Conversation

noamross
Copy link
Contributor

  • Add destfile=NULL and overwrite=FALSE args
  • Use httr::write_disk() when destfile provided
  • Make print function path-friendly
  • Document
  • Add tests
  • Update to disk

-  Add `destfile=NULL` and `overwrite=FALSE` args
-  Use httr::write_disk() when destfile provided
-  Make print function path-friendly
-  Document
-  Add tests
-  Update to disk
@codecov-io
Copy link

codecov-io commented Feb 15, 2018

Codecov Report

Merging #77 into master will decrease coverage by 11.04%.
The diff coverage is 60%.

Impacted file tree graph

@@             Coverage Diff             @@
##           master      #77       +/-   ##
===========================================
- Coverage   63.57%   52.53%   -11.05%     
===========================================
  Files           8        8               
  Lines         302      316       +14     
===========================================
- Hits          192      166       -26     
- Misses        110      150       +40
Impacted Files Coverage Δ
R/gh_response.R 45.83% <0%> (-28.8%) ⬇️
R/print.R 0% <0%> (ø) ⬆️
R/package.R 52% <100%> (-18.84%) ⬇️
R/gh_request.R 90.12% <90%> (-1.66%) ⬇️
R/gh_whoami.R 42.1% <0%> (-57.9%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update c06001a...b0706c5. Read the comment docs.

Copy link
Member

@gaborcsardi gaborcsardi left a comment

Choose a reason for hiding this comment

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

Thanks! Looks great! Can you please change the argument names? Thanks again!

R/package.R Outdated
gh <- function(endpoint, ..., .token = NULL,
.api_url = NULL, .method = "GET",
gh <- function(endpoint, ..., .token = NULL, destfile = NULL,
overwrite = FALSE, .api_url = NULL, .method = "GET",
Copy link
Member

Choose a reason for hiding this comment

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

The argument names have to start with dots, to avoid conflicts with the GH API's parameters.

@noamross
Copy link
Contributor Author

Done. Also fixed overwriting, which wasn't being carried through properly.

@gaborcsardi
Copy link
Member

Great, thanks!

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.

None yet

3 participants