Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(715)

Issue 10638002: Add methods to dart:io Path. (Closed)

Created:
8 years, 6 months ago by Bill Hesse
Modified:
8 years, 6 months ago
CC:
reviews_dartlang.org
Visibility:
Public.

Description

Add methods to dart:io Path. Add .append, which adds a segment to the end of a Path, and .pathWithoutExtension, which removes the extension (part after .), from the filename at the end of a path, and returns the new path. BUG= TEST= Committed: https://code.google.com/p/dart/source/detail?r=9028

Patch Set 1 #

Patch Set 2 : Remove .concat method. #

Total comments: 3

Patch Set 3 : Add more tests for .relativeTo #

Total comments: 3

Patch Set 4 : Address comments. Only one method left. #

Patch Set 5 : Remove pathWithoutExtension from path_test.dart. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+127 lines, -53 lines) Patch
M runtime/bin/path.dart View 1 2 3 3 chunks +10 lines, -2 lines 0 comments Download
M runtime/bin/path_impl.dart View 1 2 3 7 chunks +37 lines, -26 lines 0 comments Download
M tests/standalone/io/path_test.dart View 1 2 3 4 4 chunks +80 lines, -25 lines 0 comments Download

Messages

Total messages: 4 (0 generated)
Bill Hesse
https://chromiumcodereview.appspot.com/10638002/diff/1001/tests/standalone/io/path_test.dart File tests/standalone/io/path_test.dart (right): https://chromiumcodereview.appspot.com/10638002/diff/1001/tests/standalone/io/path_test.dart#newcode46 tests/standalone/io/path_test.dart:46: 'canonical directory trailing'); Remove 'directory' https://chromiumcodereview.appspot.com/10638002/diff/1001/tests/standalone/io/path_test.dart#newcode65 tests/standalone/io/path_test.dart:65: 'absolute directory ...
8 years, 6 months ago (2012-06-21 15:07:33 UTC) #1
Anders Johnsen
LGTM, very neat. https://chromiumcodereview.appspot.com/10638002/diff/3001/runtime/bin/path.dart File runtime/bin/path.dart (right): https://chromiumcodereview.appspot.com/10638002/diff/3001/runtime/bin/path.dart#newcode173 runtime/bin/path.dart:173: String get pathWithoutExtension(); Return type not ...
8 years, 6 months ago (2012-06-22 07:33:45 UTC) #2
Mads Ager (google)
https://chromiumcodereview.appspot.com/10638002/diff/3001/runtime/bin/path.dart File runtime/bin/path.dart (right): https://chromiumcodereview.appspot.com/10638002/diff/3001/runtime/bin/path.dart#newcode173 runtime/bin/path.dart:173: String get pathWithoutExtension(); I would remove this one. That ...
8 years, 6 months ago (2012-06-22 07:41:40 UTC) #3
Bill Hesse
8 years, 6 months ago (2012-06-22 11:01:55 UTC) #4
https://chromiumcodereview.appspot.com/10638002/diff/3001/runtime/bin/path.dart
File runtime/bin/path.dart (right):

https://chromiumcodereview.appspot.com/10638002/diff/3001/runtime/bin/path.da...
runtime/bin/path.dart:173: String get pathWithoutExtension();
Agreed - append makes it easier to write this.

On 2012/06/22 07:41:41, Mads Ager wrote:
> I would remove this one. That does not seem like a very common operation to me
> and it is easy to write:
> 
> new Path(p.directoryPath).append(p.filenameWithoutExtension)
> 
> I would be in favor of keeping the API small instead of adding methods for
> things like this.
> 
> The same argument can be made for append:
> 
> p.append(final) could be written as p.join(new Path(final))
> 
> but that seems like a more common operation to me so I'm OK with that one.

Powered by Google App Engine
This is Rietveld 408576698