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

Unified Diff: pkg/barback/example/lazy_transformer/lib/transformer.dart

Issue 808713003: Remove barback from the repo. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years 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 side-by-side diff with in-line comments
Download patch
Index: pkg/barback/example/lazy_transformer/lib/transformer.dart
diff --git a/pkg/barback/example/lazy_transformer/lib/transformer.dart b/pkg/barback/example/lazy_transformer/lib/transformer.dart
deleted file mode 100644
index 5d3e70785373532741885c39e1b53019a46662c4..0000000000000000000000000000000000000000
--- a/pkg/barback/example/lazy_transformer/lib/transformer.dart
+++ /dev/null
@@ -1,46 +0,0 @@
-// Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file
-// for details. All rights reserved. Use of this source code is governed by a
-// BSD-style license that can be found in the LICENSE file.
-
-import 'package:barback/barback.dart';
-
-import 'dart:async';
-
-class CodedMessageConverter extends Transformer
- implements LazyTransformer {
-
- // A constructor named "asPlugin" is required. It can be empty, but
- // it must be present.
- CodedMessageConverter.asPlugin();
-
- Future<bool> isPrimary(AssetId id) {
- return new Future.value(id.extension == '.txt');
- }
-
- Future declareOutputs(DeclaringTransform transform) {
- return new Future.value(transform.primaryId.changeExtension('.shhhhh'));
- }
-
- Future apply(Transform transform) {
- return transform.primaryInput.readAsString().then((content) {
-
- // The output file is created with the '.shhhhh' extension.
- var id = transform.primaryInput.id.changeExtension('.shhhhh');
-
- StringBuffer newContent = new StringBuffer();
- for (int i = 0; i < content.length; i++ ) {
- newContent.write(rot13(content[i]));
- }
- transform.addOutput(new Asset.fromString(id, newContent.toString()));
- });
- }
-
- rot13(var ch) {
- var c = ch.codeUnitAt(0);
- if (c >= 'a'.codeUnitAt(0) && c <= 'm'.codeUnitAt(0)) c += 13;
- else if (c >= 'A'.codeUnitAt(0) && c <= 'M'.codeUnitAt(0)) c += 13;
- else if (c >= 'n'.codeUnitAt(0) && c <= 'z'.codeUnitAt(0)) c -= 13;
- else if (c >= 'N'.codeUnitAt(0) && c <= 'Z'.codeUnitAt(0)) c -= 13;
- return new String.fromCharCode(c);
- }
-}
« no previous file with comments | « pkg/barback/example/lazy_transformer/lib/message.txt ('k') | pkg/barback/example/lazy_transformer/pubspec.yaml » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698