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

Side by Side Diff: utils/pub/validator/name.dart

Issue 12090093: Reapply "Rename mappedBy to map." (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Fixed bug in previous commit. Created 7 years, 10 months 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « utils/pub/validator/license.dart ('k') | utils/pub/version.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 library name_validator; 5 library name_validator;
6 6
7 import 'dart:async'; 7 import 'dart:async';
8 import 'dart:io'; 8 import 'dart:io';
9 9
10 import '../../../pkg/path/lib/path.dart' as path; 10 import '../../../pkg/path/lib/path.dart' as path;
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
45 45
46 /// Returns a list of all libraries in the current package as paths relative 46 /// Returns a list of all libraries in the current package as paths relative
47 /// to the package's root directory. 47 /// to the package's root directory.
48 Future<List<String>> get _libraries { 48 Future<List<String>> get _libraries {
49 var libDir = join(entrypoint.root.dir, "lib"); 49 var libDir = join(entrypoint.root.dir, "lib");
50 return dirExists(libDir).then((libDirExists) { 50 return dirExists(libDir).then((libDirExists) {
51 if (!libDirExists) return []; 51 if (!libDirExists) return [];
52 return listDir(libDir, recursive: true); 52 return listDir(libDir, recursive: true);
53 }).then((files) { 53 }).then((files) {
54 return files 54 return files
55 .mappedBy((file) => relativeTo(file, dirname(libDir))) 55 .map((file) => relativeTo(file, dirname(libDir)))
56 .where((file) => !splitPath(file).contains("src") && 56 .where((file) => !splitPath(file).contains("src") &&
57 path.extension(file) == '.dart') 57 path.extension(file) == '.dart')
58 .toList(); 58 .toList();
59 }); 59 });
60 } 60 }
61 61
62 void _checkName(String name, String description) { 62 void _checkName(String name, String description) {
63 if (name == "") { 63 if (name == "") {
64 errors.add("$description may not be empty."); 64 errors.add("$description may not be empty.");
65 } else if (!new RegExp(r"^[a-zA-Z0-9_]*$").hasMatch(name)) { 65 } else if (!new RegExp(r"^[a-zA-Z0-9_]*$").hasMatch(name)) {
(...skipping 19 matching lines...) Expand all
85 builder 85 builder
86 ..add(source.substring(lastMatchEnd, match.start + 1)) 86 ..add(source.substring(lastMatchEnd, match.start + 1))
87 ..add("_") 87 ..add("_")
88 ..add(match.group(1).toLowerCase()); 88 ..add(match.group(1).toLowerCase());
89 lastMatchEnd = match.end; 89 lastMatchEnd = match.end;
90 } 90 }
91 builder.add(source.substring(lastMatchEnd)); 91 builder.add(source.substring(lastMatchEnd));
92 return builder.toString().toLowerCase(); 92 return builder.toString().toLowerCase();
93 } 93 }
94 } 94 }
OLDNEW
« no previous file with comments | « utils/pub/validator/license.dart ('k') | utils/pub/version.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698