console 1.31.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 356c92cbef3eb3269b7dada97f281c832304e0cad9885102e63c7d6725196df2
4
- data.tar.gz: 1f957d68282bea484c6abddd507dcb886930c727d148f9dfa4f02f482724c234
3
+ metadata.gz: 4b92920438b2ae5759283657c427b3cfa3cc62641812514fec429cf25fcdbb36
4
+ data.tar.gz: 43c242c0749d45d12e39c6065d38ffe138f3b048293538dc3d641c30a9f109dd
5
5
  SHA512:
6
- metadata.gz: c7400992949682404ecd931375c098c103105c5d513897c933f56be31ac7b8d96e81ea12eb85ad012b91358ee14309684f3321a7704dd25717f581c04cb51fdc
7
- data.tar.gz: 02a3052cb5169303820e55bbe7c13bc6d9564ffd1df810b8a0329814fd2b84a0a1da3b12c008569cb4133cdd2e7e63d08153ec24ee72f786487c049f60432893
6
+ metadata.gz: b48c46824e19b5c30facf56903fd0a7f67306399bc7e1fa13e79b6cbbe0f9a467fafe3d30f3b6b086bcf64654c1dbccc49a653d99854c60bdf0b3a3417168c12
7
+ data.tar.gz: 0cd9d81f771252a0a9fefb04faafc182cbb4913d8f49656b6cbecfad4e4eff4a045ae62c13a7b69018b7083f1bf523be387745ce44a1fd4c9d30c96dbf28bd7a
checksums.yaml.gz.sig CHANGED
@@ -1,3 +1,2 @@
1
- Zl��:���]?��@���u�%��n�L���?���7�>$w�O�v�e����������byE �z��7g������� �"��ZW�#3Ь�1���h�<8��ɷͣg�]�['�vT�$ �u�%��v�^�� p�8븥�a�#����P�]T��C��vL60����Ve��a�����!\���j#?R�ն��ޤխ ����jN����/�x������SWl�XjZ���<��nb������
2
- !V���c�a>�!�Yi)L��i��5e ��7��}'7w�=_M��it5f���N�א[�r����gk�r��OTa����Fq[j
3
- �0pS n���~�NI�:X�
1
+ NG��g�XR��Q/^����� �́�FQZ1��%/��䆟�ET-Yw�GJpU����o��w_p�|bH�^Q�rF�` 5qƴ���k#��4\��Cg7c��68x<�� 5O�����
2
+ x .}O�<�9G��`�[��.����T2q+a��7g3wƕ�6����2YYrS�=�� �|h����H!r��PyaL6w#n��ބ�#�Z�W��,��64�Fk�)����������|N��0u��ל� Q��l:���7�� 44��F>v]MDoL�ժ<yo��6���pd3��
@@ -18,9 +18,10 @@ module Console
18
18
  # @attribute [Array(Hash)] All records captured by this buffer.
19
19
  attr :records
20
20
 
21
- # @deprecated Use {#records} instead of {#buffer}.
21
+ # @deprecated Use {records} instead of {buffer}.
22
22
  alias buffer records
23
23
 
24
+ # @deprecated Use {records} instead of {to_a}.
24
25
  alias to_a records
25
26
 
26
27
  # @attribute [Boolean] If true, the buffer will capture verbose messages.
@@ -11,7 +11,7 @@ module Console
11
11
 
12
12
  # A log filter which can be used to filter log messages based on severity, subject, and other criteria.
13
13
  class Filter
14
- if Object.const_defined?(:Ractor) and RUBY_VERSION >= "3.1"
14
+ if Object.const_defined?(:Ractor) and RUBY_VERSION >= "3.4"
15
15
  # Define a method which can be shared between ractors.
16
16
  def self.define_immutable_method(name, &block)
17
17
  block = Ractor.make_shareable(block)
@@ -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? || mail?(env)
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
- # Check for common cron environment indicators
38
- return true if env.key?("MAILTO") && !env["MAILTO"].empty?
39
-
40
- false
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
@@ -51,8 +51,9 @@ module Console
51
51
  record = {
52
52
  time: Time.now.iso8601,
53
53
  severity: severity,
54
- oid: subject.object_id,
55
54
  pid: Process.pid,
55
+ oid: subject.object_id,
56
+ fiber_id: Fiber.current.object_id,
56
57
  }
57
58
 
58
59
  # We want to log just a brief subject:
@@ -41,6 +41,7 @@ module Console
41
41
  end
42
42
  end
43
43
 
44
+ # Write a line to the buffer.
44
45
  alias << puts
45
46
  end
46
47
 
@@ -2,6 +2,7 @@
2
2
 
3
3
  # Released under the MIT License.
4
4
  # Copyright, 2019-2025, by Samuel Williams.
5
+ # Copyright, 2025, by Patrik Wenger.
5
6
 
6
7
  require "io/console"
7
8
 
@@ -4,5 +4,5 @@
4
4
  # Copyright, 2019-2025, by Samuel Williams.
5
5
 
6
6
  module Console
7
- VERSION = "1.31.0"
7
+ VERSION = "1.33.0"
8
8
  end
data/license.md CHANGED
@@ -10,7 +10,7 @@ Copyright, 2021, by Robert Schulze.
10
10
  Copyright, 2022, by Anton Sozontov.
11
11
  Copyright, 2022, by William T. Nelson.
12
12
  Copyright, 2023, by Felix Yan.
13
- Copyright, 2024, by Patrik Wenger.
13
+ Copyright, 2024-2025, by Patrik Wenger.
14
14
  Copyright, 2025, by Shigeru Nakajima.
15
15
 
16
16
  Permission is hereby granted, free of charge, to any person obtaining a copy
data/readme.md CHANGED
@@ -34,6 +34,11 @@ Please see the [project documentation](https://socketry.github.io/console/) for
34
34
 
35
35
  Please see the [project releases](https://socketry.github.io/console/releases/index) for all releases.
36
36
 
37
+ ### v1.32.0
38
+
39
+ - Add `fiber_id` to serialized output records to help identify which fiber logged the message.
40
+ - Ractor support appears broken in older Ruby versions, so we now require Ruby 3.4 or later for Ractor compatibility, if you need Ractor support.
41
+
37
42
  ### v1.31.0
38
43
 
39
44
  - [Ractor compatibility.](https://socketry.github.io/console/releases/index#ractor-compatibility.)
data/releases.md CHANGED
@@ -1,5 +1,10 @@
1
1
  # Releases
2
2
 
3
+ ## v1.32.0
4
+
5
+ - Add `fiber_id` to serialized output records to help identify which fiber logged the message.
6
+ - Ractor support appears broken in older Ruby versions, so we now require Ruby 3.4 or later for Ractor compatibility, if you need Ractor support.
7
+
3
8
  ## v1.31.0
4
9
 
5
10
  ### Ractor compatibility.
data.tar.gz.sig CHANGED
Binary file
metadata CHANGED
@@ -1,19 +1,19 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: console
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.31.0
4
+ version: 1.33.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Samuel Williams
8
8
  - Robert Schulze
9
9
  - Bryan Powell
10
10
  - Michael Adams
11
+ - Patrik Wenger
11
12
  - Anton Sozontov
12
13
  - Cyril Roelandt
13
14
  - Cédric Boutillier
14
15
  - Felix Yan
15
16
  - Olle Jonsson
16
- - Patrik Wenger
17
17
  - Shigeru Nakajima
18
18
  - William T. Nelson
19
19
  bindir: bin
metadata.gz.sig CHANGED
@@ -1,3 +1 @@
1
- s��R�����]J���?����c#M3t���z{h�����uu��� s����5��>����pR �}�EC���K��ETE0�N��eX��]�!�<�p��M=k5w��<�� �`5\������u��"l[Two�ӛGuGi>j�{Y��50&D��Wf|fR��:M(1Qi
2
- �u��U�}C 3��
3
- �l��܆��vn9pYqľ^Ѐ��5]�?��nvB�l!���a��΀��E>� _�U�^�)�p ���� ��-@�~}��xݯܓ(� ����xW�,�HH �b�,d�I�K`TD{�h�>S
1
+ k���)���6O��6��&��BFȡ@wC��Κ���Ц�^���:I��7X��S�)��wL��,q-g�z�V��Dj> N ���EYB��S(���kR�[X�<V� ��@� ���*6�����Y6MTUw%�RhUl{P��=���[}��Q��8o��{RFI��-�6 ��n��pw�����*$�O+@�=ot��LDh�N��6sٴn�oIH�a�p�U�����$Z�+}kR��u�FI�a0BN}u��E�0�_Lkmב,�?��nC^d0�6�l�H#Z"��w�H0@��W����)i�!���;e"[����QB7/P .���D:��ujEԈXM�`��wǧ�;��aE��v�#���&�E