Parser class

Creates key-value pairs from strings formatted as environment variable definitions.

Constructors

Parser.new()
Parser methods are pure functions.
const

Properties

hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

getSurroundingQuoteCharacter(String val) String
If val is wrapped in single or double quotes, returns the quote character. Otherwise, returns the empty string.
interpolate(String val, Map<String, String?> env) String
Substitutes $bash_vars in val with values from env.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
parse(Iterable<String> lines) Map<String, String>
Creates a Map. Duplicate keys are silently discarded.
parseOne(String line, {Map<String, String> envMap = const {}}) Map<String, String>
Parses a single line into a key-value pair.
removeCommentsFromLine(String line, {bool includeQuotes = false}) String
Strips comments (trailing or whole-line).
removeSurroundingQuotes(String val) String
Removes quotes (single or double) surrounding a value.
toString() String
A string representation of this object.
inherited
trimExportKeyword(String line) String
Omits 'export' keyword.

Operators

operator ==(Object other) bool
The equality operator.
inherited