console 1.36.0 → 1.37.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: 749f01df7fec2a4868a2b4958b23ee328ddb2911b0fc2a635bdf298d901cae60
4
- data.tar.gz: 32daa46920a77f0fa713685d0176dc24ed034fe39fe99cde3d1d789ecfb1c48b
3
+ metadata.gz: 885a16aa891f4867dc3ef9811178e121750a5f8395e88beb9f9a96b02d009ba9
4
+ data.tar.gz: 919cce15d67d7922a444f4d764864de5d1d4bb1ef04b59e723062040cbb7f5d6
5
5
  SHA512:
6
- metadata.gz: 51796e3366c0778f6e811428ff9e8aeffb0a34fe99ce0528488fd9931c392596c1a654f34e49781f68afd1377898ef16ce6aeaaa3a35c82c201bf4579f423073
7
- data.tar.gz: 82af50570a7e55a26562cda15f7ccf5622bcc956ef6b6a065f4a1e38ecf663911f84ccf6a47de1443bc85f1b1e79effeec1fcbdccc21480c0b18b53872efdc13
6
+ metadata.gz: 922158e79dccdfa2db29f3dd46d1763542449a6ec8c96cfde6b28459e6b6f17e380108e3260b7ff74142eca57158e4191321ebe569a267010629ba408606a78e
7
+ data.tar.gz: 82feebd861439923efa6fd4b772a0767f83cd150925f876a620ac745a3e1da45ade27dd850f40751c3118abbffd6102f04dfccfe76418e7b194a36204da5df80
checksums.yaml.gz.sig CHANGED
@@ -1,3 +1,4 @@
1
- 2S*��F#4/�Pb �(�d��"�Xa�È9G�' ��^�j����Պ��hm�ե2Vg�W�ųӮ�Dy�.��Hr]%�X'6��'�e���3��m��r;pִ��F‰�IոR�b
2
- O��م-� ����f�!zh��� �;���|=dl�̲*�d��E�ŽrIו`���s'X��r���SQ ��[���@���m����p6iLu��]�_U�/����a�=8�*������GkBbC���¹v8>�Ƴ��n�Ӭ���{�'��`�m��7
3
- ��v[Z���
1
+ G9]c�id H�=%��N^)1(Rn}�5�> \��ܦߝ
2
+ _VD;���F������e M/�������_=�7o�+p��gǏ]�=�B���
4
3
  {
4
+ ����5�K��� Lq�2�qn�4�H�ݛbƒ.����m"<���}M#�<3Y? �6��f�͠S����IΗ
5
+ ���h����_д����rwJ��pplι�~�7g@bF,���儀�PK��B_܏��=:Y�Y� �ާd�]�"\�7�u�j���U�~6q�/���Y)*T��źF�����7374�,��zLથ�F�Uw�?h�
data/lib/console/clock.rb CHANGED
@@ -16,21 +16,28 @@ module Console
16
16
  return format("%.2fs", duration)
17
17
  end
18
18
 
19
- duration /= 60.0
19
+ minutes = duration / 60.0
20
20
 
21
- if duration < 60.0
22
- return "#{duration.floor}m"
21
+ if minutes < 60.0
22
+ seconds = duration % 60
23
+ return format("%dm%02ds", minutes, seconds)
23
24
  end
24
25
 
25
- duration /= 60.0
26
+ hours = minutes / 60.0
26
27
 
27
- if duration < 24.0
28
- return "#{duration.floor}h"
28
+ if hours < 24.0
29
+ minutes = minutes % 60
30
+ return format("%dh%02dm", hours, minutes)
29
31
  end
30
32
 
31
- duration /= 24.0
33
+ days = hours / 24.0
34
+
35
+ if days < 100.0
36
+ hours = hours % 24
37
+ return format("%dd%02dh", days, hours)
38
+ end
32
39
 
33
- return "#{duration.floor}d"
40
+ return format("%dd", days)
34
41
  end
35
42
 
36
43
  # @returns [Time] The current monotonic time.
@@ -61,7 +61,7 @@ module Console
61
61
  #
62
62
  # @parameter status [Process::Status] The status of the command.
63
63
  def status=(status)
64
- @end_time = Time.now
64
+ @end_time = self.now
65
65
  @status = status
66
66
  end
67
67
 
@@ -100,6 +100,12 @@ module Console
100
100
  options[:severity] ||= :info
101
101
  super
102
102
  end
103
+
104
+ private
105
+
106
+ def now
107
+ Clock.now
108
+ end
103
109
  end
104
110
  end
105
111
  end
@@ -103,8 +103,13 @@ module Console
103
103
  #
104
104
  # @parameter trace_point [TracePoint] The trace point that triggered the event.
105
105
  def resolve(trace_point)
106
- if block = @names.delete(trace_point.self.to_s)
107
- block.call(trace_point.self)
106
+ resolve_class(trace_point.self)
107
+ end
108
+
109
+ # @parameter klass [Class] The class that was resolved.
110
+ def resolve_class(klass)
111
+ if block = @names.delete(klass.to_s)
112
+ block.call(klass)
108
113
  end
109
114
 
110
115
  if @names.empty?
@@ -4,5 +4,5 @@
4
4
  # Copyright, 2019-2026, by Samuel Williams.
5
5
 
6
6
  module Console
7
- VERSION = "1.36.0"
7
+ VERSION = "1.37.0"
8
8
  end
data/readme.md CHANGED
@@ -34,6 +34,10 @@ 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.37.0
38
+
39
+ - Show compound units in elapsed time display.
40
+
37
41
  ### v1.36.0
38
42
 
39
43
  - Add a `size_limit` to `Console::Format::Safe` (default 16KiB) which rebuilds oversized records field-by-field, keeping as many top-level fields as fit within the limit.
@@ -76,10 +80,6 @@ Please see the [project releases](https://socketry.github.io/console/releases/in
76
80
 
77
81
  - Always return `nil` from `Console::Filter` logging methods.
78
82
 
79
- ### v1.29.1
80
-
81
- - Fix logging `exception:` keyword argument when the value was not an exception.
82
-
83
83
  ## Contributing
84
84
 
85
85
  We welcome contributions to this project.
data/releases.md CHANGED
@@ -1,5 +1,9 @@
1
1
  # Releases
2
2
 
3
+ ## v1.37.0
4
+
5
+ - Show compound units in elapsed time display.
6
+
3
7
  ## v1.36.0
4
8
 
5
9
  - Add a `size_limit` to `Console::Format::Safe` (default 16KiB) which rebuilds oversized records field-by-field, keeping as many top-level fields as fit within the limit.
data.tar.gz.sig CHANGED
Binary file
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: console
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.36.0
4
+ version: 1.37.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Samuel Williams
metadata.gz.sig CHANGED
@@ -1,2 +1,2 @@
1
- g����`���n��P)nk�&�J��bd#wMp�([R ���N��.���g��g_��QRT��vư0׌L&Z{]�� ���K��1�o ?+���\}�E��$���Y�@�j�\3�lF
2
- ����CM��A�Ă���@�����F"��"SM,$uF�\!����y�[<�r1+[�9n�i�F����8;��j��f�,Q�æ���~�'&�Y�� �"XT"`N�6F�d�2���h�^׋ܣ�i�(�MI]�z�nj9?��g&.@���?RRh$^t��? �zMo�/RE���1���9�t�Ї� �\rk�.��u��㇡��'�9��j�$�� C](�c�^Ko�^[�?],^�r��'�i�AK��
1
+ �&{2��i�"wj"��
2
+ �������\��Jdl�ލ-4kظwλ