memory 0.8.3 → 0.8.4

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: 3b83713d537a03a16799ac6f3cde42daad364061ac4baeadaced28a1ebf3206f
4
- data.tar.gz: cde6c17579def23346ad980303d1d2cb57a7574ca59eec2656ae62ca132ff8d9
3
+ metadata.gz: cbe94b9b53feb63ebeef3069e3632f08084467a2670714f9680c881a88a3f133
4
+ data.tar.gz: 95c23b5b6cd0be124e9370b7631118bf24e5fbcc0b19091588d01ff723769d06
5
5
  SHA512:
6
- metadata.gz: c4ded3952cdb38c6f9e0d15e9f98a0da1267da1bd85b9f0810b0d16385fa16246d40925e2ffb58942cd73a20ca7038d1b49d99e6a9b9292d27fe75ec57b0e65e
7
- data.tar.gz: 16eef76d5864170493759bed3c39aec78a4696b5ccd4ba91d2cc8caad13d0578c89e1d2f37dabc9713b21e9ee0a4f6d6a4fceea233cdfefe32ca3c8185bda4c2
6
+ metadata.gz: b94371ccdf66d56362320b83370c9b59d7db1d4b75d62c8506fa19392cf9da62b14eaecf8c981f518edf18c10bb65627c55687146c7fe9af0c4faa3a92f86982
7
+ data.tar.gz: 764fc3157811e87be1a6d220425ee5c1c3135c9e47a3ce99066968d82948f8cbdf01dad47538cf22ac25a062c2d5c486bff024fa5ee862686779dade668dc046
checksums.yaml.gz.sig CHANGED
Binary file
@@ -36,7 +36,7 @@ module Memory
36
36
  end
37
37
 
38
38
  # Sort totals by a given key.
39
- # @parameter key [Symbol] The key to sort by (e.g., :memory or :count).
39
+ # @parameter key [Symbol] The key to sort by (e.g., :size or :count).
40
40
  # @returns [Array] Sorted array of [metric, total] pairs.
41
41
  def totals_by(key)
42
42
  @totals.sort_by{|metric, total| [total[key], metric]}
@@ -50,7 +50,7 @@ module Memory
50
50
  def print(io = $stderr, limit: 10, title: @title, level: 2)
51
51
  io.puts "#{'#' * level} #{title} #{@total}", nil
52
52
 
53
- totals_by(:memory).last(limit).reverse_each do |metric, total|
53
+ totals_by(:size).last(limit).reverse_each do |metric, total|
54
54
  io.puts "- #{total}\t#{metric}"
55
55
  end
56
56
 
data/lib/memory/usage.rb CHANGED
@@ -19,10 +19,17 @@ module Memory
19
19
  attr_accessor :size
20
20
 
21
21
  alias memsize size
22
+ alias memory size
22
23
 
23
24
  # @attribute count [Integer] The total count of the usage in object instances.
24
25
  attr_accessor :count
25
26
 
27
+ # Access usage attributes by key.
28
+ # @parameter key [Symbol] The attribute name (:size, :count, :memory, :memsize).
29
+ def [](key)
30
+ public_send(key)
31
+ end
32
+
26
33
  # Add an allocation to this usage.
27
34
  # @parameter allocation [Allocation] The allocation to add.
28
35
  def << allocation
@@ -7,5 +7,5 @@
7
7
  # Copyright, 2020-2025, by Samuel Williams.
8
8
 
9
9
  module Memory
10
- VERSION = "0.8.3"
10
+ VERSION = "0.8.4"
11
11
  end
data/readme.md CHANGED
@@ -94,6 +94,10 @@ end
94
94
 
95
95
  Please see the [project releases](https://socketry.github.io/memory/releases/index) for all releases.
96
96
 
97
+ ### v0.8.4
98
+
99
+ - Fix bugs when printing reports due to interface mismatch with `Memory::Usage`.
100
+
97
101
  ### v0.8.3
98
102
 
99
103
  - Handle `Memory::Usage.of(number)` without error.
data/releases.md CHANGED
@@ -1,5 +1,9 @@
1
1
  # Releases
2
2
 
3
+ ## v0.8.4
4
+
5
+ - Fix bugs when printing reports due to interface mismatch with `Memory::Usage`.
6
+
3
7
  ## v0.8.3
4
8
 
5
9
  - Handle `Memory::Usage.of(number)` without error.
data.tar.gz.sig CHANGED
Binary file
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: memory
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.8.3
4
+ version: 0.8.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sam Saffron
metadata.gz.sig CHANGED
@@ -1,4 +1,3 @@
1
- G;�
2
- ��d3�u�(�Q9q�X��
3
- �:�L�@�3\��5K�F����@G6[�%�g�p��To�y�m�xo��M�}Q��Y5k5�ݚ����H�]_��e��鬁E�\�k�w1s��h!��~0#2��B P���/ȗ�4��Diw�c�Qj���~��r3y�:���&j��R�9M�ޖ�
4
- ��Fx�Z��t_�\])c�}7�j}O��v�ܺ�����|ӈ��\i������dʺ�N� � ��8K���v��9@rC1 1<p�[?R��:^� ��m% ��E*D?J��x؄v�=to�����jٖ,\P�냢�$Ņ�
1
+ .ӗ�9ϋ-���(��̏�)9jq����RaS�OZ�@ ��T�0�c� H7@�kƢ���=@��EU��PkDJۢ��/㫉V�����7��rkaO
2
+ ��Y;r��l���QR��B*ȧ���o��-�j���hW1F1� /�u�ew�/����cL�M �;]�I�)^1DF{fr���@¤S2U#�8��(潗�k4 $
3
+ ����zqX���uieLYgՕ{�ũwΧ��.fO����