console 1.32.0 → 1.33.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- checksums.yaml.gz.sig +0 -0
- data/lib/console/output/default.rb +12 -5
- data/lib/console/version.rb +1 -1
- data.tar.gz.sig +0 -0
- metadata +1 -1
- metadata.gz.sig +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4b92920438b2ae5759283657c427b3cfa3cc62641812514fec429cf25fcdbb36
|
4
|
+
data.tar.gz: 43c242c0749d45d12e39c6065d38ffe138f3b048293538dc3d641c30a9f109dd
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b48c46824e19b5c30facf56903fd0a7f67306399bc7e1fa13e79b6cbbe0f9a467fafe3d30f3b6b086bcf64654c1dbccc49a653d99854c60bdf0b3a3417168c12
|
7
|
+
data.tar.gz: 0cd9d81f771252a0a9fefb04faafc182cbb4913d8f49656b6cbecfad4e4eff4a045ae62c13a7b69018b7083f1bf523be387745ce44a1fd4c9d30c96dbf28bd7a
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
@@ -20,8 +20,12 @@ module Console
|
|
20
20
|
def self.new(stream, env: ENV, **options)
|
21
21
|
stream ||= $stderr
|
22
22
|
|
23
|
-
if stream.tty?
|
23
|
+
if stream.tty?
|
24
24
|
output = Terminal.new(stream, **options)
|
25
|
+
elsif self.mail?(env)
|
26
|
+
output = Text.new(stream, **options)
|
27
|
+
elsif self.github_actions?(env)
|
28
|
+
output = XTerm.new(stream, **options)
|
25
29
|
else
|
26
30
|
output = Serialized.new(stream, **options)
|
27
31
|
end
|
@@ -34,10 +38,13 @@ module Console
|
|
34
38
|
# Detect if we're running in a cron job or mail context where human-readable output is preferred.
|
35
39
|
# Cron jobs often have MAILTO set and lack TERM, or have minimal TERM values.
|
36
40
|
def self.mail?(env = ENV)
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
+
env.key?("MAILTO") && !env["MAILTO"].empty?
|
42
|
+
end
|
43
|
+
|
44
|
+
# Detect if we're running in GitHub Actions, where human-readable output is preferred.
|
45
|
+
# GitHub Actions sets the GITHUB_ACTIONS environment variable to "true".
|
46
|
+
def self.github_actions?(env = ENV)
|
47
|
+
env["GITHUB_ACTIONS"] == "true"
|
41
48
|
end
|
42
49
|
end
|
43
50
|
end
|
data/lib/console/version.rb
CHANGED
data.tar.gz.sig
CHANGED
Binary file
|
metadata
CHANGED
metadata.gz.sig
CHANGED
Binary file
|