Skip to content
This repository was archived by the owner on Jan 13, 2025. It is now read-only.

Commit 947982a

Browse files
authored
Update to 1.1.0-g3, which has the API of 2.0.0 but works with Dart SDK 1.23.0-dev.9.0 (#10)
1 parent 8ae6f90 commit 947982a

File tree

5 files changed

+27
-12
lines changed

5 files changed

+27
-12
lines changed

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
### 1.1.0-g3
2+
3+
* Added `stdinSupportsAnsi` and `stdinSupportsAnsi`
4+
* Removed `ansiSupported`
5+
16
### 1.1.0
27

38
* Added `ansiSupported`

lib/src/interface/local_platform.dart

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,5 +48,8 @@ class LocalPlatform extends Platform {
4848
String get version => io.Platform.version;
4949

5050
@override
51-
bool get ansiSupported => io.Platform.ansiSupported;
51+
bool get stdinSupportsAnsi => io.Platform.ansiSupported;
52+
53+
@override
54+
bool get stdoutSupportsAnsi => io.Platform.ansiSupported;
5255
}

lib/src/interface/platform.dart

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -114,11 +114,11 @@ abstract class Platform {
114114
/// whitespace and other version and build details.
115115
String get version;
116116

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

123123
/// Returns a JSON-encoded representation of this platform.
124124
String toJson() {
@@ -135,7 +135,8 @@ abstract class Platform {
135135
'packageRoot': packageRoot,
136136
'packageConfig': packageConfig,
137137
'version': version,
138-
'ansiSupported': ansiSupported,
138+
'stdinSupportsAnsi': stdinSupportsAnsi,
139+
'stdoutSupportsAnsi': stdoutSupportsAnsi,
139140
});
140141
}
141142
}

lib/src/testing/fake_platform.dart

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,8 @@ class FakePlatform extends Platform {
2525
this.packageRoot,
2626
this.packageConfig,
2727
this.version,
28-
this.ansiSupported,
28+
this.stdinSupportsAnsi,
29+
this.stdoutSupportsAnsi,
2930
});
3031

3132
/// Creates a new [FakePlatform] with properties whose initial values mirror
@@ -43,7 +44,8 @@ class FakePlatform extends Platform {
4344
packageRoot = platform.packageRoot,
4445
packageConfig = platform.packageConfig,
4546
version = platform.version,
46-
ansiSupported = platform.ansiSupported;
47+
stdinSupportsAnsi = platform.stdinSupportsAnsi,
48+
stdoutSupportsAnsi = platform.stdoutSupportsAnsi;
4749

4850
/// Creates a new [FakePlatform] with properties extracted from the encoded
4951
/// JSON string.
@@ -65,7 +67,8 @@ class FakePlatform extends Platform {
6567
packageRoot : map['packageRoot'],
6668
packageConfig : map['packageConfig'],
6769
version : map['version'],
68-
ansiSupported: map['ansiSupported'],
70+
stdinSupportsAnsi: map['stdinSupportsAnsi'],
71+
stdoutSupportsAnsi: map['stdoutSupportsAnsi'],
6972
);
7073
}
7174

@@ -106,5 +109,8 @@ class FakePlatform extends Platform {
106109
String version;
107110

108111
@override
109-
bool ansiSupported;
112+
bool stdinSupportsAnsi;
113+
114+
@override
115+
bool stdoutSupportsAnsi;
110116
}

pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name: platform
2-
version: 1.1.0
2+
version: 1.1.0-g3
33
authors:
44
- Todd Volkert <[email protected]>
55
description: A pluggable, mockable platform abstraction for Dart.

0 commit comments

Comments
 (0)