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

doc: Add windows example for Path.format #5700

Closed
wants to merge 3 commits into from

Conversation

mithun-daa
Copy link
Contributor

Pull Request check-list

Please make sure to review and check all of these items:

  • Does make -j8 test (UNIX) or vcbuild test nosign (Windows) pass with
    this change (including linting)?
  • Is the commit message formatted according to CONTRIBUTING.md?
  • If this change fixes a bug (or a performance problem), is a regression
    test (or a benchmark) included?
  • Is a documentation update included (if this change modifies
    existing APIs, or introduces new ones)?

NOTE: these things are not required to open a PR and can be done
afterwards / while the PR is open.

Affected core subsystem(s)

Please provide affected core subsystem(s) (like buffer, cluster, crypto, etc)

Description of change

Please provide a description of the change here.
Add windows sample for Path.format as requested in Issue #5671

@thefourtheye thefourtheye added doc Issues and PRs related to the documentations. path Issues and PRs related to the path subsystem. labels Mar 14, 2016
@mithun-daa
Copy link
Contributor Author

FYI: The path is not formatted if the dir or base are not provided. Hence skipped the second example:

// `root` will be used if `dir` is not specified and `name` + `ext` will be used
// if `base` is not specified
path.format({
    root : "/",
    ext : ".txt",
    name : "file"
})
// returns
'/file.txt'

@@ -95,6 +95,8 @@ path.extname('.index')

Returns a path string from an object, the opposite of [`path.parse`][].

An example on \*nix:
Copy link
Member

Choose a reason for hiding this comment

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

Minor nit... rather than \*nix:, perhaps just say An example on Posix systems:

@jasnell
Copy link
Member

jasnell commented Mar 14, 2016

LGTM with a nit

@mithun-daa
Copy link
Contributor Author

Updated with the requested changes.

@jasnell
Copy link
Member

jasnell commented Mar 14, 2016

LGTM

1 similar comment
@thefourtheye
Copy link
Contributor

LGTM

name : "file"
})
// returns
'C:\\path\\dir\\file.txt'
Copy link
Contributor

Choose a reason for hiding this comment

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

This line should probably also be commented or moved to the end of the previous line.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sorry, I did not follow you @mscdex . Did you mean comment out the return value?

Copy link
Member

Choose a reason for hiding this comment

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

@mscdex How it is done here is how it is for the other examples in the doc. This is unfortunate in my opinion and I opened a pull request to change it, but the reviews have been mixed. I invite you to comment at #5670

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@Trott did you want me to make the changes as mentioned in #5670 in this PR?

Copy link
Member

Choose a reason for hiding this comment

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

@mithun-daa I would say no, or at least not until #5670 lands. It might now land. I think what you've done here is fine.

Copy link
Member

Choose a reason for hiding this comment

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

It landed now, so I think it's best to update this PR to use the newer style.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Pushed the requested changes.

Change the *nix to Posix systems
The return value of the windows example should be commented to conform to the system wide style
jasnell pushed a commit that referenced this pull request Mar 21, 2016
PR-URL: #5700
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com>
@jasnell
Copy link
Member

jasnell commented Mar 21, 2016

Landed in 54e6a8d
commits squashed when landed.

@jasnell jasnell closed this Mar 21, 2016
@mithun-daa
Copy link
Contributor Author

@jasnell Noob question - what do you mean by commits squashed?

@jasnell
Copy link
Member

jasnell commented Mar 21, 2016

@mithun-daa ... the pull request contains 3 commits, I merged them into 1

@mithun-daa
Copy link
Contributor Author

Thanks for clearing that up @jasnell

@benjamingr
Copy link
Member

Thanks for stepping up @mithun-data hope to see you more around :)

@mithun-daa
Copy link
Contributor Author

Anytime @benjamingr - hope I can contribute more and hopefully more meaningful stuff.

Fishrock123 pushed a commit that referenced this pull request Mar 22, 2016
PR-URL: #5700
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com>

Conflicts:
	doc/api/path.markdown
MylesBorins pushed a commit that referenced this pull request Mar 30, 2016
PR-URL: #5700
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com>
MylesBorins pushed a commit that referenced this pull request Mar 30, 2016
PR-URL: #5700
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
doc Issues and PRs related to the documentations. path Issues and PRs related to the path subsystem.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants