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

Unified Diff: utils/pub/io.dart

Issue 11444018: Add a validator that checks package names. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Fix tests. Created 8 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | utils/pub/validator.dart » ('j') | utils/tests/pub/validator_test.dart » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: utils/pub/io.dart
diff --git a/utils/pub/io.dart b/utils/pub/io.dart
index 5f5f70ce4046f7ae14bd554e26743e8359378fe9..968f3546fbc4bcf77b02797f0ab46dc99357435c 100644
--- a/utils/pub/io.dart
+++ b/utils/pub/io.dart
@@ -41,7 +41,7 @@ void printError(value) {
* [File] objects.
*/
String join(part1, [part2, part3, part4]) {
- final parts = _sanitizePath(part1).split('/');
+ final parts = sanitizePath(part1).split('/');
for (final part in [part2, part3, part4]) {
if (part == null) continue;
@@ -63,7 +63,7 @@ String join(part1, [part2, part3, part4]) {
}
/// Splits [path] into its individual components.
-List<String> splitPath(path) => _sanitizePath(path).split('/');
+List<String> splitPath(path) => sanitizePath(path).split('/');
/**
* Gets the basename, the file name without any leading directory path, for
@@ -72,7 +72,7 @@ List<String> splitPath(path) => _sanitizePath(path).split('/');
// TODO(rnystrom): Copied from file_system (so that we don't have to add
// file_system to the SDK). Should unify.
String basename(file) {
- file = _sanitizePath(file);
+ file = sanitizePath(file);
int lastSlash = file.lastIndexOf('/', file.length);
if (lastSlash == -1) {
@@ -89,7 +89,7 @@ String basename(file) {
// TODO(nweiz): Copied from file_system (so that we don't have to add
// file_system to the SDK). Should unify.
String dirname(file) {
- file = _sanitizePath(file);
+ file = sanitizePath(file);
int lastSlash = file.lastIndexOf('/', file.length);
if (lastSlash == -1) {
@@ -102,7 +102,7 @@ String dirname(file) {
/// Returns whether or not [entry] is nested somewhere within [dir]. This just
/// performs a path comparison; it doesn't look at the actual filesystem.
bool isBeneath(entry, dir) =>
- _sanitizePath(entry).startsWith('${_sanitizePath(dir)}/');
+ sanitizePath(entry).startsWith('${sanitizePath(dir)}/');
/**
* Asynchronously determines if [path], which can be a [String] file path, a
@@ -994,9 +994,9 @@ String _getPath(entry) {
throw 'Entry $entry is not a supported type.';
}
-/// Gets the path string for [entry] as in [_getPath], but normalizes
-/// backslashes to forward slashes on Windows.
-String _sanitizePath(entry) {
+/// Gets the path string for [entry], normalizing backslashes to forward slashes
+/// on Windows.
+String sanitizePath(entry) {
entry = _getPath(entry);
if (Platform.operatingSystem != 'windows') return entry;
« no previous file with comments | « no previous file | utils/pub/validator.dart » ('j') | utils/tests/pub/validator_test.dart » ('J')

Powered by Google App Engine
This is Rietveld 408576698