diff --git a/lib/dotenv.dart b/lib/dotenv.dart index 3e35f97..a9a2489 100644 --- a/lib/dotenv.dart +++ b/lib/dotenv.dart @@ -20,7 +20,7 @@ library dotenv; import 'dart:io'; - +import 'package:meta/meta.dart'; part 'src/parser.dart'; var _env = new Map.from(Platform.environment); diff --git a/lib/src/parser.dart b/lib/src/parser.dart index 7ba6490..bc203fb 100644 --- a/lib/src/parser.dart +++ b/lib/src/parser.dart @@ -27,7 +27,7 @@ class Parser { } /// Parses a single line into a key-value pair. - @Deprecated('Exposed for testing') // FIXME + @visibleForTesting Map parseOne(String line, {Map env: const {}}) { var stripped = strip(line); @@ -49,7 +49,7 @@ class Parser { } /// Substitutes $bash_vars in [val] with values from [env]. - @Deprecated('Exposed for testing') // FIXME + @visibleForTesting String interpolate(String val, Map env) => val.replaceAllMapped(_bashVar, (m) { var k = m.group(2); @@ -59,23 +59,23 @@ class Parser { /// If [val] is wrapped in single or double quotes, returns the quote character. /// Otherwise, returns the empty string. - @Deprecated('Exposed for testing') // FIXME + @visibleForTesting String surroundingQuote(String val) { if (!_surroundQuotes.hasMatch(val)) return ''; return _surroundQuotes.firstMatch(val).group(1); } /// Removes quotes (single or double) surrounding a value. - @Deprecated('Exposed for testing') // FIXME + @visibleForTesting String unquote(String val) => val.replaceFirstMapped(_surroundQuotes, (m) => m[2]).trim(); /// Strips comments (trailing or whole-line). - @Deprecated('Exposed for testing') // FIXME + @visibleForTesting String strip(String line) => line.replaceAll(_comment, '').trim(); /// Omits 'export' keyword. - @Deprecated('Exposed for testing') // FIXME + @visibleForTesting String swallow(String line) => line.replaceAll(_keyword, '').trim(); bool _isValid(String s) => s.isNotEmpty && s.contains('='); diff --git a/pubspec.yaml b/pubspec.yaml index 9b9fde3..adae182 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -11,3 +11,4 @@ dependencies: dev_dependencies: test: any collection: any + meta: any