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

Side by Side Diff: utils/pub/command_uploader.dart

Issue 12052038: Rename new Uri.fromString to Uri.parse. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Reupload because of Error. 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/command_lish.dart ('k') | utils/pub/hosted_source.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 command_uploader; 5 library command_uploader;
6 6
7 import 'dart:async'; 7 import 'dart:async';
8 import 'dart:io'; 8 import 'dart:io';
9 import 'dart:uri'; 9 import 'dart:uri';
10 10
(...skipping 20 matching lines...) Expand all
31 // dart:io for HTTPS requests. 31 // dart:io for HTTPS requests.
32 parser.addOption('server', defaultsTo: 'https://pub.dartlang.org', 32 parser.addOption('server', defaultsTo: 'https://pub.dartlang.org',
33 help: 'The package server on which the package is hosted'); 33 help: 'The package server on which the package is hosted');
34 parser.addOption('package', help: 'The package whose uploaders will be ' 34 parser.addOption('package', help: 'The package whose uploaders will be '
35 'modified\n' 35 'modified\n'
36 '(defaults to the current package)'); 36 '(defaults to the current package)');
37 return parser; 37 return parser;
38 } 38 }
39 39
40 /// The URL of the package hosting server. 40 /// The URL of the package hosting server.
41 Uri get server => new Uri.fromString(commandOptions['server']); 41 Uri get server => Uri.parse(commandOptions['server']);
42 42
43 Future onRun() { 43 Future onRun() {
44 if (commandOptions.rest.isEmpty) { 44 if (commandOptions.rest.isEmpty) {
45 log.error('No uploader command given.'); 45 log.error('No uploader command given.');
46 this.printUsage(); 46 this.printUsage();
47 exit(exit_codes.USAGE); 47 exit(exit_codes.USAGE);
48 } 48 }
49 49
50 var command = commandOptions.rest.removeAt(0); 50 var command = commandOptions.rest.removeAt(0);
51 if (!['add', 'remove'].contains(command)) { 51 if (!['add', 'remove'].contains(command)) {
(...skipping 23 matching lines...) Expand all
75 "/uploaders/${encodeUriComponent(uploader)}.json"); 75 "/uploaders/${encodeUriComponent(uploader)}.json");
76 return client.delete(url); 76 return client.delete(url);
77 } 77 }
78 }); 78 });
79 }).then(handleJsonSuccess).catchError((asyncError) { 79 }).then(handleJsonSuccess).catchError((asyncError) {
80 if (asyncError.error is! PubHttpException) throw asyncError; 80 if (asyncError.error is! PubHttpException) throw asyncError;
81 handleJsonError(asyncError.error.response); 81 handleJsonError(asyncError.error.response);
82 }); 82 });
83 } 83 }
84 } 84 }
OLDNEW
« no previous file with comments | « utils/pub/command_lish.dart ('k') | utils/pub/hosted_source.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698