refinements 12.7.0 → 12.8.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: d95a713a69dbbeaec7c6c2f76c634f576d763e86d32b1f46bad9817ac6eacd70
4
- data.tar.gz: 5d972fa9193dab8743c5ed1aa7980a9b11be3b34e951f885377d25742d791eb1
3
+ metadata.gz: 81ecb80884f2fcc3c01f67b069fc4d8e46bf6c0dec1a03013a0f4183800c971e
4
+ data.tar.gz: 85ced417ccf67b5940b1441df1cacc2d9ca32812e4bc9f89d775e17574cce1e9
5
5
  SHA512:
6
- metadata.gz: cec359f8d82a7e98889f2913e8330857d15f9d7a99ae0024e3895b6b4ec61c7a6c6a17897fb19b3ae1f10224d02be2affca6c81093d7965c6acfdb58d0b5c535
7
- data.tar.gz: b967aed2a285c8ca49b5ef6a54f830721a19ccdc7521ac7857bedcec849b781e7b6a357b770c4f99cd47fe4197f2f0b2cbecd149e89096cd4193c841a64dc623
6
+ metadata.gz: a9d24dfcb5491cda43127501056b1cbb74fa13286964bcfca60107e42ca2bb67c56e22e35fd8773f83e91c16122c97d2723ac6ca0fc1094c6bd746bee7c5bff6
7
+ data.tar.gz: c8bbde575d08783fbf64d303fac8cb8cc0b0215b7bdc8e532ce1180f8451bc12e02391c9e22300edaba464ee50a1d2b1eb31b4081e8a234350e174ddc8cc7c08
checksums.yaml.gz.sig CHANGED
Binary file
data/README.adoc CHANGED
@@ -1524,6 +1524,32 @@ io.reread(buffer:) # "This is a test."
1524
1524
  buffer # "This is a test."
1525
1525
  ----
1526
1526
 
1527
+ ===== #to_s
1528
+
1529
+ Answers underlying string representation for _explicit_ conversion.
1530
+
1531
+ [source,ruby]
1532
+ ----
1533
+ io = StringIO.new
1534
+ io.write "One"
1535
+ io.write ", "
1536
+ io.write "Two."
1537
+ io.to_s # "One, Two."
1538
+ ----
1539
+
1540
+ ===== #to_str
1541
+
1542
+ Answers underlying string representation for _implicit_ conversion.
1543
+
1544
+ [source,ruby]
1545
+ ----
1546
+ io = StringIO.new
1547
+ io.write "One"
1548
+ io.write ", "
1549
+ io.write "Two."
1550
+ io.to_str # "One, Two."
1551
+ ----
1552
+
1527
1553
  ==== Struct
1528
1554
 
1529
1555
  ===== .with_positions
@@ -1681,19 +1707,19 @@ An alias of `#merge` and identical in behavior (see `#merge` documentation for d
1681
1707
 
1682
1708
  ===== #call
1683
1709
 
1684
- Enhances symbol-to-proc by allowing you to send additional arguments and/or a block. This only works
1685
- with public methods in order to not break encapsulation.
1710
+ Enhances symbol-to-proc functionality by allowing you to send positional, keyword, and/or a block arguments. This only works with public methods in order to not break encapsulation.
1686
1711
 
1687
1712
  [source,ruby]
1688
1713
  ----
1714
+
1689
1715
  %w[clue crow cow].map(&:tr.call("c", "b")) # ["blue", "brow", "bow"]
1716
+ [1.3, 1.5, 1.9].map(&:round.call(half: :up)) # [1, 2, 2]
1690
1717
  [%w[a b c], %w[c a b]].map(&:index.call { |element| element == "b" }) # [1, 2]
1691
- %w[1.outside 2.inside].map(&:sub.call(/\./) { |bullet| bullet + " " }) # ["1. outside", "2. inside"]
1718
+ %w[1.out 2.in].map(&:sub.call(/\./) { |bullet| bullet + " " }) # ["1. out", "2. in"]
1692
1719
  [1, 2, 3].map(&:to_s.call) # ["1", "2", "3"]
1693
1720
  ----
1694
1721
 
1695
- ⚠️ Use of `#call` without any arguments or block should be avoided in order to not incur extra
1696
- processing costs since the original symbol-to-proc call can be used instead.
1722
+ ⚠️ Use of `#call` without any arguments should be avoided in order to not incur extra processing costs since the original symbol-to-proc call can be used instead.
1697
1723
 
1698
1724
  == Development
1699
1725
 
@@ -1730,6 +1756,8 @@ bin/rake
1730
1756
 
1731
1757
  == link:https://alchemists.io/policies/contributions[Contributions]
1732
1758
 
1759
+ == link:https://alchemists.io/policies/developer_certificate_of_origin[Developer Certificate of Origin]
1760
+
1733
1761
  == link:https://alchemists.io/projects/refinements/versions[Versions]
1734
1762
 
1735
1763
  == link:https://alchemists.io/community[Community]
@@ -8,6 +8,9 @@ module Refinements
8
8
  module StringIO
9
9
  refine ::StringIO do
10
10
  import_methods Shared::Reread
11
+
12
+ alias_method :to_s, :string
13
+ alias_method :to_str, :string
11
14
  end
12
15
  end
13
16
  end
@@ -4,8 +4,8 @@ module Refinements
4
4
  # Provides additional enhancements to the Symbol primitive.
5
5
  module Symbol
6
6
  refine ::Symbol do
7
- def call(*arguments, &block)
8
- proc { |receiver| receiver.public_send self, *arguments, &block }
7
+ def call(*positionals, **keywords, &block)
8
+ proc { |receiver| receiver.public_send self, *positionals, **keywords, &block }
9
9
  end
10
10
  end
11
11
  end
data/refinements.gemspec CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  Gem::Specification.new do |spec|
4
4
  spec.name = "refinements"
5
- spec.version = "12.7.0"
5
+ spec.version = "12.8.0"
6
6
  spec.authors = ["Brooke Kuhlmann"]
7
7
  spec.email = ["brooke@alchemists.io"]
8
8
  spec.homepage = "https://alchemists.io/projects/refinements"
@@ -12,7 +12,7 @@ Gem::Specification.new do |spec|
12
12
  spec.metadata = {
13
13
  "bug_tracker_uri" => "https://github.com/bkuhlmann/refinements/issues",
14
14
  "changelog_uri" => "https://alchemists.io/projects/refinements/versions",
15
- "documentation_uri" => "https://alchemists.io/projects/refinements",
15
+ "homepage_uri" => "https://alchemists.io/projects/refinements",
16
16
  "funding_uri" => "https://github.com/sponsors/bkuhlmann",
17
17
  "label" => "Refinements",
18
18
  "rubygems_mfa_required" => "true",
@@ -22,7 +22,7 @@ Gem::Specification.new do |spec|
22
22
  spec.signing_key = Gem.default_key_path
23
23
  spec.cert_chain = [Gem.default_cert_path]
24
24
 
25
- spec.required_ruby_version = "~> 3.3"
25
+ spec.required_ruby_version = ">= 3.3", "<= 3.4"
26
26
 
27
27
  spec.files = Dir["*.gemspec", "lib/**/*"]
28
28
  spec.extra_rdoc_files = Dir["README*", "LICENSE*"]
data.tar.gz.sig CHANGED
Binary file
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: refinements
3
3
  version: !ruby/object:Gem::Version
4
- version: 12.7.0
4
+ version: 12.8.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Brooke Kuhlmann
@@ -35,7 +35,7 @@ cert_chain:
35
35
  3n5C8/6Zh9DYTkpcwPSuIfAga6wf4nXc9m6JAw8AuMLaiWN/r/2s4zJsUHYERJEu
36
36
  gZGm4JqtuSg8pYjPeIJxS960owq+SfuC+jxqmRA54BisFCv/0VOJi7tiJVY=
37
37
  -----END CERTIFICATE-----
38
- date: 2024-07-15 00:00:00.000000000 Z
38
+ date: 2024-09-01 00:00:00.000000000 Z
39
39
  dependencies: []
40
40
  description:
41
41
  email:
@@ -73,7 +73,7 @@ licenses:
73
73
  metadata:
74
74
  bug_tracker_uri: https://github.com/bkuhlmann/refinements/issues
75
75
  changelog_uri: https://alchemists.io/projects/refinements/versions
76
- documentation_uri: https://alchemists.io/projects/refinements
76
+ homepage_uri: https://alchemists.io/projects/refinements
77
77
  funding_uri: https://github.com/sponsors/bkuhlmann
78
78
  label: Refinements
79
79
  rubygems_mfa_required: 'true'
@@ -84,16 +84,19 @@ require_paths:
84
84
  - lib
85
85
  required_ruby_version: !ruby/object:Gem::Requirement
86
86
  requirements:
87
- - - "~>"
87
+ - - ">="
88
88
  - !ruby/object:Gem::Version
89
89
  version: '3.3'
90
+ - - "<="
91
+ - !ruby/object:Gem::Version
92
+ version: '3.4'
90
93
  required_rubygems_version: !ruby/object:Gem::Requirement
91
94
  requirements:
92
95
  - - ">="
93
96
  - !ruby/object:Gem::Version
94
97
  version: '0'
95
98
  requirements: []
96
- rubygems_version: 3.5.15
99
+ rubygems_version: 3.5.18
97
100
  signing_key:
98
101
  specification_version: 4
99
102
  summary: A collection of core object refinements.
metadata.gz.sig CHANGED
Binary file