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

Side by Side Diff: lib/src/command.dart

Issue 2044253003: Refactor Source and SourceRegistry. (Closed) Base URL: git@github.com:dart-lang/pub.git@master
Patch Set: Rename LiveSource to BoundSource. Created 4 years, 6 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
« no previous file with comments | « lib/src/barback/asset_environment.dart ('k') | lib/src/command/cache_add.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) 2013, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2013, 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 import 'package:args/args.dart'; 5 import 'package:args/args.dart';
6 import 'package:args/command_runner.dart'; 6 import 'package:args/command_runner.dart';
7 7
8 import 'entrypoint.dart'; 8 import 'entrypoint.dart';
9 import 'log.dart' as log; 9 import 'log.dart' as log;
10 import 'global_packages.dart'; 10 import 'global_packages.dart';
11 import 'system_cache.dart'; 11 import 'system_cache.dart';
12 12
13 /// The base class for commands for the pub executable. 13 /// The base class for commands for the pub executable.
14 /// 14 ///
15 /// A command may either be a "leaf" command or it may be a parent for a set 15 /// A command may either be a "leaf" command or it may be a parent for a set
16 /// of subcommands. Only leaf commands are ever actually invoked. If a command 16 /// of subcommands. Only leaf commands are ever actually invoked. If a command
17 /// has subcommands, then one of those must always be chosen. 17 /// has subcommands, then one of those must always be chosen.
18 abstract class PubCommand extends Command { 18 abstract class PubCommand extends Command {
19 SystemCache get cache { 19 SystemCache get cache {
20 if (_cache == null) { 20 if (_cache == null) _cache = new SystemCache(isOffline: isOffline);
21 _cache = new SystemCache.withSources(isOffline: isOffline);
22 }
23 return _cache; 21 return _cache;
24 } 22 }
25 SystemCache _cache; 23 SystemCache _cache;
26 24
27 GlobalPackages get globals { 25 GlobalPackages get globals {
28 if (_globals == null) { 26 if (_globals == null) {
29 _globals = new GlobalPackages(cache); 27 _globals = new GlobalPackages(cache);
30 } 28 }
31 return _globals; 29 return _globals;
32 } 30 }
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
82 /// 80 ///
83 /// If the parsing fails, prints a usage message and exits. 81 /// If the parsing fails, prints a usage message and exits.
84 int parseInt(String intString, String name) { 82 int parseInt(String intString, String name) {
85 try { 83 try {
86 return int.parse(intString); 84 return int.parse(intString);
87 } on FormatException catch (_) { 85 } on FormatException catch (_) {
88 usageException('Could not parse $name "$intString".'); 86 usageException('Could not parse $name "$intString".');
89 } 87 }
90 } 88 }
91 } 89 }
OLDNEW
« no previous file with comments | « lib/src/barback/asset_environment.dart ('k') | lib/src/command/cache_add.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698