string-text 0.2.3 → 0.3.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/string-text/version.rb +1 -1
- data/lib/string-text.rb +4 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a0aca29ea9d4de27eee11ec5fcbc58a7a0daad9fb2ed31507bb919b1bca3b9e2
|
4
|
+
data.tar.gz: a01a8670c95fca9090d484a6defd0fed7b02dc81c8175d10450f6dff03be6c3e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5f9ec6576c3c0ecd16637cc8e7f9e806d08c8478480f87812a362831677cd7abc1287d979d200e010d7b9ff2f9954495e279436482362eaff1c1f703ccb27e2d
|
7
|
+
data.tar.gz: d441c56ceefd09be12f512c34e72cb15787719a25107e3aef186206eb8d8fa1962884bc9549de6fa16b6bc4e85be151ee5fc5c5c07e92808c2dcbcc04b725548
|
data/lib/string-text/version.rb
CHANGED
data/lib/string-text.rb
CHANGED
@@ -4,7 +4,7 @@ require_relative "string-text/version"
|
|
4
4
|
|
5
5
|
module String::Text
|
6
6
|
class Error < StandardError; end
|
7
|
-
|
7
|
+
|
8
8
|
refine String do
|
9
9
|
# Indent or outdent a block of text to the given column (default 1). It
|
10
10
|
# uses the indent of the least indented non-empty line as the indent of the
|
@@ -29,6 +29,9 @@ module String::Text
|
|
29
29
|
lines.map { |line| line[indent..-1]&.rstrip || "" }.join("\n")
|
30
30
|
end
|
31
31
|
|
32
|
+
# Like #align but replaces the string
|
33
|
+
def align!(column = 1) = self.replace align(column)
|
34
|
+
|
32
35
|
# Converts a string to a boolean so that "true" becomes true and that
|
33
36
|
# "false" and the empty string becomes false. Any other string is an error
|
34
37
|
#
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: string-text
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Claus Rasmussen
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-
|
11
|
+
date: 2024-09-22 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: Gem string-text
|
14
14
|
email:
|