leto 2.1.0 → 2.2.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: 0ed0d190b234b4976a219ba5b50a3e9cb4f394be7b1a27aa2f1d7bdfe93887b0
4
- data.tar.gz: eafafd24510514cf7ba4e59cdf1a967c7464d175b8ceed1f3cafa2e78fffcc1e
3
+ metadata.gz: b0362bb08490e1bd600bb8996a1be449584295433c047472864578b2d43a6cb5
4
+ data.tar.gz: de8244c6e7d6bd2a58453effbadf1e93f9956a0aace1fc0fcef1c97660e486f4
5
5
  SHA512:
6
- metadata.gz: 79b0be7884c86be4a14977e5aaae6147da85b857f632013bd82f9fe95addf28a4014ea7adeba1c75dfc63b9988ab7426c622cb79bc2c2886dca04be246ee2db5
7
- data.tar.gz: 961a19be85b69aac0763828648c09100af4a9f84eff07a45e2b9c0c247c84e5b7ae9647a9bd4a7de791eb7cd0f0342b91f82d2cd50a85286425e4a8f915bd2fe
6
+ metadata.gz: a8a4a40c37e53158ce69775451a56a2b939cecb01df5c8441a0c7a18b9e4c88db68d350dd57abbc2d87fd03c770335f2e92344e2fba4370280796bb46fce1d6e
7
+ data.tar.gz: b73106dde5c5f19b65c6b95ac6f0fdf4039ab84eaf6dfb53abe705e54e4b7c2f8951fd3ebe205cf53ca46faaccf3812cc1fc2e534979a8adfd99df07bc0a66fb
data/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  ## [Unreleased]
2
2
 
3
+ ## [2.2.0] - 2026-09-03
4
+
5
+ ### Added
6
+
7
+ - support for varargs in `::shared_mutable_state?`
8
+
3
9
  ## [2.1.0] - 2023-05-20
4
10
 
5
11
  ### Added
data/README.md CHANGED
@@ -82,7 +82,7 @@ Leto.dig(object, [[:[], 0], [:[], :a], [:[], 1], [:end]]) # => "d"
82
82
  - stricter version of `#eql?` that takes all ivars into consideration
83
83
  - [`Leto.deep_dup(obj)`](https://github.com/search?q=deep_dup+repo%3Ajaynetics%2Fleto+path%3Alib%2Fleto%2Futils.rb&type=code)
84
84
  - more thorough than [`active_support`](https://www.rubydoc.info/search/gems/activesupport?q=deep_dup) or [`deep_dup`](https://github.com/ollie/deep_dup) gems, e.g. dups ivars
85
- - [`Leto.shared_mutable_state?(obj1, obj2)`](https://github.com/search?q=shared_mutable_state+repo%3Ajaynetics%2Fleto+path%3Alib%2Fleto%2Futils.rb&type=code)
85
+ - [`Leto.shared_mutable_state?(obj1, obj2, ...)`](https://github.com/search?q=shared_mutable_state+repo%3Ajaynetics%2Fleto+path%3Alib%2Fleto%2Futils.rb&type=code)
86
86
  - useful for debugging or verifying that a `#dup` implementation is sane
87
87
  - [`Leto.shared_mutables(obj1, obj2)`](https://github.com/search?q=shared_mutables+repo%3Ajaynetics%2Fleto+path%3Alib%2Fleto%2Futils.rb&type=code)
88
88
  - useful for debugging or verifying that a `#dup` implementation is sane
data/lib/leto/utils.rb CHANGED
@@ -10,8 +10,7 @@ module Leto
10
10
  def self.deep_print(obj, print_method: :inspect, indent: 4, show_path: true)
11
11
  trace(obj) do |el, path|
12
12
  puts "#{' ' * path.count * indent}#{el.send(print_method)}" \
13
- "#{" @ #{path.inspect}" if show_path}" \
14
- [0..78]
13
+ "#{" @ #{path.inspect}" if show_path}"[0..78]
15
14
  end
16
15
  nil
17
16
  end
@@ -43,8 +42,10 @@ module Leto
43
42
  copy
44
43
  end
45
44
 
46
- def self.shared_mutable_state?(obj1, obj2)
47
- each_shared_object(obj1, obj2, filter: method(:mutable?)).any?
45
+ def self.shared_mutable_state?(*objects)
46
+ objects.combination(2).any? do |obj1, obj2|
47
+ each_shared_object(obj1, obj2, filter: method(:mutable?)).any?
48
+ end
48
49
  end
49
50
 
50
51
  # returns [[shared_object, path1, path2], ...], e.g.:
@@ -87,7 +88,7 @@ module Leto
87
88
  if defined?(Integer)
88
89
  Integer
89
90
  else
90
- Fixnum # rubocop:disable Lint/UnifiedInteger for Ruby < 2.4
91
+ Fixnum # rubocop:disable Lint/UnifiedInteger -- for Ruby < 2.4
91
92
  end,
92
93
  NilClass,
93
94
  Symbol,
data/lib/leto/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Leto
4
- VERSION = "2.1.0"
4
+ VERSION = "2.2.0"
5
5
  end
metadata CHANGED
@@ -1,16 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: leto
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.1.0
4
+ version: 2.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Janosch Müller
8
- autorequire:
9
8
  bindir: bin
10
9
  cert_chain: []
11
- date: 2023-05-20 00:00:00.000000000 Z
10
+ date: 1980-01-02 00:00:00.000000000 Z
12
11
  dependencies: []
13
- description:
14
12
  email:
15
13
  - janosch84@gmail.com
16
14
  executables: []
@@ -38,7 +36,6 @@ licenses:
38
36
  metadata:
39
37
  changelog_uri: https://github.com/jaynetics/leto/blob/main/CHANGELOG.md
40
38
  homepage_uri: https://github.com/jaynetics/leto
41
- post_install_message:
42
39
  rdoc_options: []
43
40
  require_paths:
44
41
  - lib
@@ -53,8 +50,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
53
50
  - !ruby/object:Gem::Version
54
51
  version: '0'
55
52
  requirements: []
56
- rubygems_version: 3.4.13
57
- signing_key:
53
+ rubygems_version: 4.0.3
58
54
  specification_version: 4
59
55
  summary: Generic object traverser
60
56
  test_files: []