Skip to content
Snippets Groups Projects
Commit dc8b25da authored by Kevin Moore's avatar Kevin Moore
Browse files

update dependencies

parent 34e583b8
No related branches found
No related tags found
No related merge requests found
...@@ -6,9 +6,7 @@ ...@@ -6,9 +6,7 @@
* Some utility methods for stagehand. * Some utility methods for stagehand.
*/ */
import 'dart:convert' show UTF8; import 'dart:convert' show BASE64, UTF8;
import 'package:crypto/crypto.dart';
import '../stagehand.dart'; import '../stagehand.dart';
...@@ -17,15 +15,17 @@ const int _RUNE_SPACE = 32; ...@@ -17,15 +15,17 @@ const int _RUNE_SPACE = 32;
final _substitueRegExp = new RegExp(r'__([a-zA-Z]+)__'); final _substitueRegExp = new RegExp(r'__([a-zA-Z]+)__');
final _nonValidSubstitueRegExp = new RegExp('[^a-zA-Z]'); final _nonValidSubstitueRegExp = new RegExp('[^a-zA-Z]');
final _whiteSpace = new RegExp(r'\s+');
List<TemplateFile> decodeConcatenatedData(List<String> data) { List<TemplateFile> decodeConcatenatedData(List<String> data) {
List<TemplateFile> results = []; List<TemplateFile> results = [];
for (int i = 0; i < data.length; i += 3) { for (int i = 0; i < data.length; i += 3) {
String path = data[i]; String path = data[i];
String type = data[i + 1]; String type = data[i + 1];
String raw = data[i + 2]; String raw = data[i + 2].replaceAll(_whiteSpace, '');
List<int> decoded = CryptoUtils.base64StringToBytes(raw); List<int> decoded = BASE64.decode(raw);
if (type == 'binary') { if (type == 'binary') {
results.add(new TemplateFile.fromBinary(path, decoded)); results.add(new TemplateFile.fromBinary(path, decoded));
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
name: stagehand name: stagehand
# When changing this version, change the lib/src/cli_app.dart version as well. # When changing this version, change the lib/src/cli_app.dart version as well.
version: 1.0.9 version: 1.0.10-dev
description: > description: >
A scaffolding generator for your Dart projects. Stagehand helps you get set A scaffolding generator for your Dart projects. Stagehand helps you get set
up! up!
...@@ -15,7 +15,7 @@ authors: ...@@ -15,7 +15,7 @@ authors:
- Kathy Walrath <kathyw@google.com> - Kathy Walrath <kathyw@google.com>
environment: environment:
sdk: '>=1.9.0 <2.0.0' sdk: '>=1.13.0 <2.0.0'
# Add the bin/stagehand.dart script to the scripts pub installs. # Add the bin/stagehand.dart script to the scripts pub installs.
executables: executables:
...@@ -23,14 +23,13 @@ executables: ...@@ -23,14 +23,13 @@ executables:
dependencies: dependencies:
args: '>=0.12.0+1 <0.14.0' args: '>=0.12.0+1 <0.14.0'
crypto: ^0.9.0
http: ^0.11.0 http: ^0.11.0
path: ^1.3.0 path: ^1.3.0
usage: ^1.0.0 usage: ^1.0.0
dev_dependencies: dev_dependencies:
browser: ^0.10.0 browser: ^0.10.0
ghpages_generator: ^0.2.4 ghpages_generator: ^0.3.0
grinder: ^0.8.0 grinder: ^0.8.0
test: ^0.12.0 test: ^0.12.0
yaml: ^2.1.2 yaml: ^2.1.2
...@@ -3,8 +3,9 @@ ...@@ -3,8 +3,9 @@
// license that can be found in the LICENSE file. // license that can be found in the LICENSE file.
import 'dart:io'; import 'dart:io';
import 'dart:convert';
import 'dart:math' as math;
import 'package:crypto/crypto.dart';
import 'package:ghpages_generator/ghpages_generator.dart' as ghpages; import 'package:ghpages_generator/ghpages_generator.dart' as ghpages;
import 'package:grinder/grinder.dart'; import 'package:grinder/grinder.dart';
import 'package:path/path.dart' as path; import 'package:path/path.dart' as path;
...@@ -95,8 +96,24 @@ Iterable<String> _traverse(Directory dir, String root) sync* { ...@@ -95,8 +96,24 @@ Iterable<String> _traverse(Directory dir, String root) sync* {
} else { } else {
yield '${root}${name}'; yield '${root}${name}';
yield _isBinaryFile(name) ? 'binary' : 'text'; yield _isBinaryFile(name) ? 'binary' : 'text';
yield BASE64.encode((entity as File).readAsBytesSync(),
addLineSeparator: true); var encoded = BASE64.encode((entity as File).readAsBytesSync());
//
// Logic to cut lines into 76-character chunks
// – makes for prettier source code
//
var lines = <String>[];
var index = 0;
while (index < encoded.length) {
var line =
encoded.substring(index, math.min(index + 76, encoded.length));
lines.add(line);
index += line.length;
}
yield lines.join('\r\n');
} }
} }
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment