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

Export file-writing helpers #389

Merged
merged 10 commits into from Jun 20, 2018

Conversation

Projects
None yet
3 participants
@jennybc
Member

jennybc commented Jun 19, 2018

Closes #366 any chance you'd consider exporting write_union?
Closes #344 Export edit_file

  • Re-locate some functions. helper.R had gotten quite large and diffuse.
  • Make is_in_proj() resilient to there being no active project
  • Export edit_file(), write_union(), write_over(); mark with @keywords internal
  • Process input path with user_path_prep() now that it's user-accessible

@jennybc jennybc requested a review from hadley as a code owner Jun 19, 2018

@jennybc jennybc removed the request for review from hadley Jun 19, 2018

@jennybc

This comment has been minimized.

Show comment
Hide comment
@jennybc

jennybc Jun 19, 2018

Member

Might be nice to add "Export edit_file" #344 to this PR, yes?

Member

jennybc commented Jun 19, 2018

Might be nice to add "Export edit_file" #344 to this PR, yes?

Show outdated Hide outdated R/write.R
@jennybc

This comment has been minimized.

Show comment
Hide comment
@jennybc

jennybc Jun 19, 2018

Member

Now includes #344 (Export edit_file) + a lot of moving functions around that I have long wanted to do.

Member

jennybc commented Jun 19, 2018

Now includes #344 (Export edit_file) + a lot of moving functions around that I have long wanted to do.

Show outdated Hide outdated R/write.R
#' }
edit_file <- function(path) {
path <- user_path_prep(path)
dir_create(path_dir(path), recursive = TRUE)

This comment has been minimized.

@hadley

hadley Jun 19, 2018

Member

Should this call use_directory()? The additional messaging seems like it would be nice.

@hadley

hadley Jun 19, 2018

Member

Should this call use_directory()? The additional messaging seems like it would be nice.

This comment has been minimized.

@jennybc

jennybc Jun 19, 2018

Member

Hmm, I'm a bit boxed into a corner atm. use_directory() assumes that input path is relative to the active project. Whereas all the write_*() helpers and edit_file() assume the input path can be taken at face value.

I'll take this as evidence that the functions re: directory creation aren't quite right yet. Will work on that.

@jennybc

jennybc Jun 19, 2018

Member

Hmm, I'm a bit boxed into a corner atm. use_directory() assumes that input path is relative to the active project. Whereas all the write_*() helpers and edit_file() assume the input path can be taken at face value.

I'll take this as evidence that the functions re: directory creation aren't quite right yet. Will work on that.

This comment has been minimized.

@hadley

hadley Jun 19, 2018

Member

Oh good point; can definitely happen after this PR.

@hadley

hadley Jun 19, 2018

Member

Oh good point; can definitely happen after this PR.

This comment has been minimized.

@jennybc

jennybc Jun 19, 2018

Member

Will sort this out here: #393

@jennybc

jennybc Jun 19, 2018

Member

Will sort this out here: #393

@jennybc

This comment has been minimized.

Show comment
Hide comment
@jennybc

jennybc Jun 19, 2018

Member

Assuming CI goes well, I think this is done.

Member

jennybc commented Jun 19, 2018

Assuming CI goes well, I think this is done.

@jennybc jennybc changed the title from Export write_union() to Export file-writing and -editing helpers Jun 19, 2018

@jennybc jennybc changed the title from Export file-writing and -editing helpers to Export file-writing helpers Jun 19, 2018

@hadley

hadley approved these changes Jun 20, 2018

@jennybc jennybc merged commit 979a865 into master Jun 20, 2018

3 of 4 checks passed

continuous-integration/travis-ci/push The Travis CI build is in progress
Details
continuous-integration/appveyor/branch AppVeyor build succeeded
Details
continuous-integration/appveyor/pr AppVeyor build succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
@cboettig

This comment has been minimized.

Show comment
Hide comment
@cboettig

cboettig commented Jun 20, 2018

🎉

@jennybc jennybc deleted the export-write-union branch Jun 20, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment