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

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

Issue 11783009: Big merge from experimental to bleeding edge. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 11 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:io'; 7 import 'dart:io';
8 8
9 import '../../../pkg/path/lib/path.dart' as path; 9 import '../../../pkg/path/lib/path.dart' as path;
10 import '../entrypoint.dart'; 10 import '../entrypoint.dart';
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
42 }); 42 });
43 } 43 }
44 44
45 /// Returns a list of all libraries in the current package as paths relative 45 /// Returns a list of all libraries in the current package as paths relative
46 /// to the package's root directory. 46 /// to the package's root directory.
47 Future<List<String>> get _libraries { 47 Future<List<String>> get _libraries {
48 var libDir = join(entrypoint.root.dir, "lib"); 48 var libDir = join(entrypoint.root.dir, "lib");
49 return dirExists(libDir).chain((libDirExists) { 49 return dirExists(libDir).chain((libDirExists) {
50 if (!libDirExists) return new Future.immediate([]); 50 if (!libDirExists) return new Future.immediate([]);
51 return listDir(libDir, recursive: true); 51 return listDir(libDir, recursive: true);
52 }).transform((files) { 52 }).then((files) {
53 return files.map((file) => relativeTo(file, dirname(libDir))) 53 return files.map((file) => relativeTo(file, dirname(libDir)))
54 .filter((file) { 54 .filter((file) {
55 return !splitPath(file).contains("src") && 55 return !splitPath(file).contains("src") &&
56 path.extension(file) == '.dart'; 56 path.extension(file) == '.dart';
57 }); 57 });
58 }); 58 });
59 } 59 }
60 60
61 void _checkName(String name, String description) { 61 void _checkName(String name, String description) {
62 if (name == "") { 62 if (name == "") {
(...skipping 21 matching lines...) Expand all
84 builder 84 builder
85 ..add(source.substring(lastMatchEnd, match.start + 1)) 85 ..add(source.substring(lastMatchEnd, match.start + 1))
86 ..add("_") 86 ..add("_")
87 ..add(match.group(1).toLowerCase()); 87 ..add(match.group(1).toLowerCase());
88 lastMatchEnd = match.end; 88 lastMatchEnd = match.end;
89 } 89 }
90 builder.add(source.substring(lastMatchEnd)); 90 builder.add(source.substring(lastMatchEnd));
91 return builder.toString().toLowerCase(); 91 return builder.toString().toLowerCase();
92 } 92 }
93 } 93 }
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