Skip to content
This repository has been archived by the owner on Oct 18, 2024. It is now read-only.

Commit

Permalink
Update to 1.1.0-g3, which has the API of 2.0.0 but works with Dart SD…
Browse files Browse the repository at this point in the history
…K 1.23.0-dev.9.0 (#10)
  • Loading branch information
tvolkert authored Apr 7, 2017
1 parent 8ae6f90 commit 947982a
Show file tree
Hide file tree
Showing 5 changed files with 27 additions and 12 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
### 1.1.0-g3

* Added `stdinSupportsAnsi` and `stdinSupportsAnsi`
* Removed `ansiSupported`

### 1.1.0

* Added `ansiSupported`
Expand Down
5 changes: 4 additions & 1 deletion lib/src/interface/local_platform.dart
Original file line number Diff line number Diff line change
Expand Up @@ -48,5 +48,8 @@ class LocalPlatform extends Platform {
String get version => io.Platform.version;

@override
bool get ansiSupported => io.Platform.ansiSupported;
bool get stdinSupportsAnsi => io.Platform.ansiSupported;

@override
bool get stdoutSupportsAnsi => io.Platform.ansiSupported;
}
13 changes: 7 additions & 6 deletions lib/src/interface/platform.dart
Original file line number Diff line number Diff line change
Expand Up @@ -114,11 +114,11 @@ abstract class Platform {
/// whitespace and other version and build details.
String get version;

/// When stdio is connected to a terminal, whether ANSI codes are supported.
///
/// This value is hard-coded to true, except on Windows where only more recent
/// versions of Windows 10 support the codes.
bool get ansiSupported;
/// When stdin is connected to a terminal, whether ANSI codes are supported.
bool get stdinSupportsAnsi;

/// When stdout is connected to a terminal, whether ANSI codes are supported.
bool get stdoutSupportsAnsi;

/// Returns a JSON-encoded representation of this platform.
String toJson() {
Expand All @@ -135,7 +135,8 @@ abstract class Platform {
'packageRoot': packageRoot,
'packageConfig': packageConfig,
'version': version,
'ansiSupported': ansiSupported,
'stdinSupportsAnsi': stdinSupportsAnsi,
'stdoutSupportsAnsi': stdoutSupportsAnsi,
});
}
}
14 changes: 10 additions & 4 deletions lib/src/testing/fake_platform.dart
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,8 @@ class FakePlatform extends Platform {
this.packageRoot,
this.packageConfig,
this.version,
this.ansiSupported,
this.stdinSupportsAnsi,
this.stdoutSupportsAnsi,
});

/// Creates a new [FakePlatform] with properties whose initial values mirror
Expand All @@ -43,7 +44,8 @@ class FakePlatform extends Platform {
packageRoot = platform.packageRoot,
packageConfig = platform.packageConfig,
version = platform.version,
ansiSupported = platform.ansiSupported;
stdinSupportsAnsi = platform.stdinSupportsAnsi,
stdoutSupportsAnsi = platform.stdoutSupportsAnsi;

/// Creates a new [FakePlatform] with properties extracted from the encoded
/// JSON string.
Expand All @@ -65,7 +67,8 @@ class FakePlatform extends Platform {
packageRoot : map['packageRoot'],
packageConfig : map['packageConfig'],
version : map['version'],
ansiSupported: map['ansiSupported'],
stdinSupportsAnsi: map['stdinSupportsAnsi'],
stdoutSupportsAnsi: map['stdoutSupportsAnsi'],
);
}

Expand Down Expand Up @@ -106,5 +109,8 @@ class FakePlatform extends Platform {
String version;

@override
bool ansiSupported;
bool stdinSupportsAnsi;

@override
bool stdoutSupportsAnsi;
}
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: platform
version: 1.1.0
version: 1.1.0-g3
authors:
- Todd Volkert <tvolkert@google.com>
description: A pluggable, mockable platform abstraction for Dart.
Expand Down

0 comments on commit 947982a

Please sign in to comment.