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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 275a1cdc26964260f5ee4cf9fb3b7a29b11529284991424f362ea2458c6981f0
4
- data.tar.gz: 40c2da81a31c35a032c3cda8864e3814d3c8097d885a7036d6ed20e2e3c18090
3
+ metadata.gz: 1b84335e16ea21d2d12c991e25dd858f26f2a7d1a5da8770edd6f1e98715f8ea
4
+ data.tar.gz: 5c7d6d35e3191e70643aae739e2701be68c3dc9338303c3d8fa67c6d75ad097f
5
5
  SHA512:
6
- metadata.gz: f6a3c8fbd5f39a5a354e669473e60b1b14059f6846237def36d5eb9e7b8d2941602b473038225dbf95bb8540850e7ca6e581bbf36835a3c587876bbe9b4ff928
7
- data.tar.gz: 6a536400f0d83044a6fc641cb1f787b2e5be2928e6d1bda147ab56915804ef1ce9e4da3346c4a7c7602d89dc543e06e814505a58800f63f989f8102425bfcdd3
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
- new_string = old_string.gsub(/([{ ])(\w+): /, '\1:\2=>')
11
- new_string = new_string.gsub(" => ", "=>")
12
-
13
- return new_string
14
- "asdfafasdff"
10
+ Inspect.convert_hash_inspect(old_string)
11
+ end
15
12
 
16
- # if Gem::Version.new(RUBY_VERSION) < Gem::Version.new("2.7.0") || RUBY_ENGINE == 'jruby'
17
- # "#{name}"
18
- # else
19
- # ":#{name}"
20
- # end
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
@@ -1,7 +1,7 @@
1
1
  module Trailblazer
2
2
  module Core
3
3
  module Utils
4
- VERSION = "0.0.3"
4
+ VERSION = "0.0.5"
5
5
  end
6
6
  end
7
7
  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.3
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: 2024-11-07 00:00:00.000000000 Z
11
+ date: 2025-01-23 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description:
14
14
  email: