refinements 12.3.1 → 12.5.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: 2ad9824c396e6d0d68450b4751c1f1e947325459dc9cb511353ab7aa1e084526
4
- data.tar.gz: 2b71506a5943c9766fd4d24a2c7d1ae3c71fe41ebbdc04be90247a1a40e0dba5
3
+ metadata.gz: 4820c08dee6ea3a2f4a521ebe6ee9cfd778879b35f997c1cb9a82c4c4f56eb67
4
+ data.tar.gz: 15b35014f7462130864f3b35c7aab5908bd2bef21b75d25be70ec456b5065e38
5
5
  SHA512:
6
- metadata.gz: cb23d45b7298a03a4ebf3feb33076d6514d30bdd4e68beab718651a4b71cdb1e8f4c16d2215c354dc4595c01e7bbc337a2ca4d7e9392111f6c2bff3278aaff30
7
- data.tar.gz: 4ed015ab25a9c79914487f12a584cdd8c4ccf998a73e8623cc341ca48895e1236deb4a7602fb11857302bf5febd3e3abf8c6550f10473bdf5fd3edc938f52af0
6
+ metadata.gz: 53b1fda6b7ca55389d305c8e99d5a095405d50490cefe246ea77a56ea0daee8f46237afa3bafced988ef65e3b6f4f095dbf9e038e9aaafe55fdc6e67288ed89c
7
+ data.tar.gz: 882417652e5925b6c9c8d1a24ed8f756dae15f6b5a65692e159ccc147fb686cf530ada3c5b93f33a98afc5a3ef852c7e9ef34db6d07680910ac7bfd93ca30ea8
checksums.yaml.gz.sig CHANGED
Binary file
data/README.adoc CHANGED
@@ -1128,6 +1128,19 @@ Answers file name without extension.
1128
1128
  Pathname("example.txt").name # Pathname("example")
1129
1129
  ----
1130
1130
 
1131
+ ===== #puts
1132
+
1133
+ Wraps `#write` by writing content to file with new line and answering itself. Allows you to more easily swap out a `Pathname` object with similar IO objects who support `#puts`: `IO`, `StringIO`, `File`, `Kernel`, and so forth.
1134
+
1135
+ [source,ruby]
1136
+ ----
1137
+ path = Pathname("test.txt").touch
1138
+ path.puts "Test."
1139
+ path.read # "Test.\n"
1140
+
1141
+ Pathname("text.txt").touch.puts("Test.").read # "Test.\n"
1142
+ ----
1143
+
1131
1144
  ===== #relative_parent
1132
1145
 
1133
1146
  Answers relative path from parent directory. This complements: `#relative_path_from`.
@@ -78,6 +78,8 @@ module Refinements
78
78
 
79
79
  def name = basename extname
80
80
 
81
+ def puts(content) = write "#{content}\n"
82
+
81
83
  def relative_parent(root_dir) = relative_path_from(root_dir).parent
82
84
 
83
85
  def remove_dir = exist? ? (rmdir and self) : self
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.3.1"
5
+ spec.version = "12.5.0"
6
6
  spec.authors = ["Brooke Kuhlmann"]
7
7
  spec.email = ["brooke@alchemists.io"]
8
8
  spec.homepage = "https://alchemists.io/projects/refinements"
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.3.1
4
+ version: 12.5.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-05-07 00:00:00.000000000 Z
38
+ date: 2024-06-22 00:00:00.000000000 Z
39
39
  dependencies: []
40
40
  description:
41
41
  email:
@@ -91,7 +91,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
91
91
  - !ruby/object:Gem::Version
92
92
  version: '0'
93
93
  requirements: []
94
- rubygems_version: 3.5.10
94
+ rubygems_version: 3.5.14
95
95
  signing_key:
96
96
  specification_version: 4
97
97
  summary: A collection of core object refinements.
metadata.gz.sig CHANGED
Binary file