trailblazer-core-utils 0.0.3 → 0.0.4

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: 275a1cdc26964260f5ee4cf9fb3b7a29b11529284991424f362ea2458c6981f0
4
- data.tar.gz: 40c2da81a31c35a032c3cda8864e3814d3c8097d885a7036d6ed20e2e3c18090
3
+ metadata.gz: af512b40998be4b879e0cf9d98d69281ff32f5744314f6d182876f4018bf7083
4
+ data.tar.gz: c09107e6e03086da057c28ec62ca9f3229dd477e2aaf06fae7b559075dade14a
5
5
  SHA512:
6
- metadata.gz: f6a3c8fbd5f39a5a354e669473e60b1b14059f6846237def36d5eb9e7b8d2941602b473038225dbf95bb8540850e7ca6e581bbf36835a3c587876bbe9b4ff928
7
- data.tar.gz: 6a536400f0d83044a6fc641cb1f787b2e5be2928e6d1bda147ab56915804ef1ce9e4da3346c4a7c7602d89dc543e06e814505a58800f63f989f8102425bfcdd3
6
+ metadata.gz: ded16b8aa275b3347701b1ba0670cfb6d5340d47c48b3ba2dbde284d6ddbc1379d2fd6f4bc25be6959250926d5737d2ce5daccae68cdf4f12ee3c3b54ff9e5bb
7
+ data.tar.gz: 7cf816374b9950a298bdc354688839f0295fc6c051cfef84abd01dfde82887e5c8a4909a7aa1d775ee0929816af46e74403d541e3fa65bd9b6004a5ba7b0bbc0
data/CHANGELOG.md CHANGED
@@ -1,3 +1,7 @@
1
+ ## [0.0.4]
2
+
3
+ * Extend `Utils.inspect` so we can feed it strings that may contain hash inspects.
4
+
1
5
  ## [0.0.3]
2
6
 
3
7
  * 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.4"
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.4
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: 2024-11-12 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description:
14
14
  email: