| OLD | NEW |
| 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 library barback.test.transformer.rewrite; |
| 6 |
| 5 import 'dart:async'; | 7 import 'dart:async'; |
| 6 | 8 |
| 7 import 'package:barback/barback.dart'; | 9 import 'package:barback/barback.dart'; |
| 8 | 10 |
| 9 import 'mock.dart'; | 11 import 'mock.dart'; |
| 10 | 12 |
| 11 /// A [Transformer] that takes assets ending with one extension and generates | 13 /// A [Transformer] that takes assets ending with one extension and generates |
| 12 /// assets with a given extension. | 14 /// assets with a given extension. |
| 13 /// | 15 /// |
| 14 /// Appends the output extension to the contents of the input file. | 16 /// Appends the output extension to the contents of the input file. |
| (...skipping 17 matching lines...) Expand all Loading... |
| 32 var id = transform.primaryId.changeExtension(".$extension"); | 34 var id = transform.primaryId.changeExtension(".$extension"); |
| 33 return input.readAsString().then((content) { | 35 return input.readAsString().then((content) { |
| 34 transform.addOutput(new Asset.fromString(id, "$content.$extension")); | 36 transform.addOutput(new Asset.fromString(id, "$content.$extension")); |
| 35 }); | 37 }); |
| 36 })); | 38 })); |
| 37 }); | 39 }); |
| 38 } | 40 } |
| 39 | 41 |
| 40 String toString() => "$from->$to"; | 42 String toString() => "$from->$to"; |
| 41 } | 43 } |
| OLD | NEW |