-
Notifications
You must be signed in to change notification settings - Fork 152
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 ref/pull format in install_dev #279
Conversation
Thanks! I wonder if we could do this with a single regex. E.g. sg like
will split up the input, and then you just add back the ref, like you already do. I would put this in a |
Sounds good! I'm on it! |
R/install-dev.R
Outdated
} | ||
|
||
url <- build_url(cran_url, "web", "packages", package, "DESCRIPTION") | ||
url <- build_url(cran_url, "web", "packages", dev_split_ref(package)[["pkg"]], "DESCRIPTION") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't know if it's the best way to access "pkg" and "ref" values, but I used double brackets and column names.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, that's good, but can we call dev_split_ref
only once? Not a big a deal performance-wise, more of a principle. Store the result here, and use it later below.
expect_equal(dev_split_ref("with@v1.0.0.999")[["pkg"]], "with") | ||
expect_equal(dev_split_ref("with#279")[["ref"]], "#279") | ||
expect_equal(dev_split_ref("with#1")[["pkg"]], "with") | ||
}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These tests all assume input format is (pkg[(@ref|#pull)]?)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, these look great!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, this looks great! Just one more tiny change, please. Thanks again!
R/install-dev.R
Outdated
} | ||
|
||
url <- build_url(cran_url, "web", "packages", package, "DESCRIPTION") | ||
url <- build_url(cran_url, "web", "packages", dev_split_ref(package)[["pkg"]], "DESCRIPTION") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, that's good, but can we call dev_split_ref
only once? Not a big a deal performance-wise, more of a principle. Store the result here, and use it later below.
expect_equal(dev_split_ref("with@v1.0.0.999")[["pkg"]], "with") | ||
expect_equal(dev_split_ref("with#279")[["ref"]], "#279") | ||
expect_equal(dev_split_ref("with#1")[["pkg"]], "with") | ||
}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, these look great!
Seriously github, no newline at the end of the file when using your online editor???
As requested in #206. Checks and then stores ref/pull format to include in install_repo call.