refinements 12.7.0 → 12.8.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 +4 -4
- checksums.yaml.gz.sig +0 -0
- data/README.adoc +33 -5
- data/lib/refinements/string_io.rb +3 -0
- data/lib/refinements/symbol.rb +2 -2
- data/refinements.gemspec +3 -3
- data.tar.gz.sig +0 -0
- metadata +8 -5
- metadata.gz.sig +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 81ecb80884f2fcc3c01f67b069fc4d8e46bf6c0dec1a03013a0f4183800c971e
|
4
|
+
data.tar.gz: 85ced417ccf67b5940b1441df1cacc2d9ca32812e4bc9f89d775e17574cce1e9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
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.
|
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
|
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]
|
data/lib/refinements/symbol.rb
CHANGED
@@ -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(*
|
8
|
-
proc { |receiver| receiver.public_send self, *
|
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.
|
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
|
-
"
|
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 = "
|
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.
|
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-
|
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
|
-
|
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.
|
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
|