trailblazer-core-utils 0.0.3 → 0.0.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +8 -0
- data/lib/trailblazer/core/utils/inspect.rb +8 -11
- data/lib/trailblazer/core/utils/version.rb +1 -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: 1b84335e16ea21d2d12c991e25dd858f26f2a7d1a5da8770edd6f1e98715f8ea
|
4
|
+
data.tar.gz: 5c7d6d35e3191e70643aae739e2701be68c3dc9338303c3d8fa67c6d75ad097f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2d1e09c33dc9b7e67a6ce97896107d91eddd38f069984ba603520c4e00a2f9d2e380ca4ae50b91e45f47e3afe956d4d89cdeb4d63fd21f9c98c541e747f78fcc
|
7
|
+
data.tar.gz: b316ae70454e2ec7763c69582ccfec7c9da50d60b9a17649b14849732c886b5a69cc3dba13cdbea7da7afe9249ed628288d93931b56b85222da3d0be6d2f5b90
|
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,11 @@
|
|
1
|
+
## [0.0.5]
|
2
|
+
|
3
|
+
* In `Utils.inspect`, limit the regex to one liner hashes.
|
4
|
+
|
5
|
+
## [0.0.4]
|
6
|
+
|
7
|
+
* Extend `Utils.inspect` so we can feed it strings that may contain hash inspects.
|
8
|
+
|
1
9
|
## [0.0.3]
|
2
10
|
|
3
11
|
* Introduce `Utils.inspect` to cover `Hash#inspect` tests across all Rubies, including 3.4.
|
@@ -2,22 +2,19 @@ module Trailblazer
|
|
2
2
|
module Core
|
3
3
|
module Utils
|
4
4
|
def self.inspect(object)
|
5
|
+
return Inspect.convert_hash_inspect(object) if object.is_a?(String)
|
5
6
|
return object.inspect unless object.is_a?(Hash)
|
6
7
|
|
7
8
|
old_string = object.inspect
|
8
|
-
# old_string = %({{symbol: 1, "string" => 2},"string" => 1})
|
9
9
|
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
return new_string
|
14
|
-
"asdfafasdff"
|
10
|
+
Inspect.convert_hash_inspect(old_string)
|
11
|
+
end
|
15
12
|
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
13
|
+
module Inspect
|
14
|
+
def self.convert_hash_inspect(hash_inspect)
|
15
|
+
new_string = hash_inspect.gsub(/({|, )(\w+): /, '\1:\2=>')
|
16
|
+
new_string.gsub(" => ", "=>")
|
17
|
+
end
|
21
18
|
end
|
22
19
|
end
|
23
20
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: trailblazer-core-utils
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Nick Sutterer
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2025-01-23 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description:
|
14
14
|
email:
|