pixar-ruby-extensions 1.11.1 → 1.12.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: 5a04889a5f74e6ac42d916b2eaa70fdb2c4fc32440e9e4197216b75f7fe14782
4
- data.tar.gz: dd3b29c31ef90da3a272bf24f35647bdec3411495f61b5a0ec634dbc9a3aa17d
3
+ metadata.gz: 1480b5ca9cc629346af546708524c4c5a9fa47fcfa9a9d241a37d3d8cf3a9092
4
+ data.tar.gz: 331e6e05f364ff31e5923e95cb17e73a405d92617c128dfdfe2131a3ddd3b423
5
5
  SHA512:
6
- metadata.gz: 1211b16e2eff5e1b8868e0ddf3c7ba6e26f4d91b15f9e44cd752c5157e1b92776562c36e5ccd4caba2b9129f268af0839ed62326636f3a7003f7d1e2f84b20d0
7
- data.tar.gz: 4d9ec47bf87cb4eb2d9d7389ac1a71c64a3d93cc789e6dbc00d3ab91a09fe688ec825abba7220415ebd04e037770c8e1a680ca5ff0bd5417e0162c01e1f21ad5
6
+ metadata.gz: 707c57139571cc71f39fee62304fc9afd38df093361df7d8e60124a25b6f9e3e8f140ae712fdbec53b29d0a14bdee083570d1262dbd3b6af50e0e438d9d919c4
7
+ data.tar.gz: 1a0d74c37ff4ac515ed32d1c15f5bb5ace597799981c698392676850088c9884091ad7a0414173d28879000b8e546e64b690d04d28b4b84137733a71e97522e1
@@ -14,6 +14,9 @@ module PixarRubyExtensions
14
14
  INTEGER_RE = /\A-?[0-9]+\Z/.freeze
15
15
  FLOAT_RE = /\A-?[0-9]+\.[0-9]+\Z/.freeze
16
16
 
17
+ DELIM_PLACEHOLDER = '_DELIM_'
18
+ UUID_RE_STR = "\\A[a-f0-9]{8}#{DELIM_PLACEHOLDER}([a-f0-9]{4}#{DELIM_PLACEHOLDER}){3}[a-f0-9]{12}\\z"
19
+
17
20
  # Does this string contain an integer?
18
21
  # (i.e. it consists only of numeric digits,
19
22
  # maybe with a dash in front)
@@ -21,10 +24,10 @@ module PixarRubyExtensions
21
24
  # @return [Boolean]
22
25
  #
23
26
  def pix_integer?
24
- self =~ INTEGER_RE ? true : false
27
+ INTEGER_RE.match? self
25
28
  end
26
29
 
27
- # Does this string contain a float?
30
+ # Does this string contain a simple float?
28
31
  # (i.e. it consists only of numeric digits,
29
32
  # maybe with a dash in front followed by one
30
33
  # dot, followed by at least one more digit)
@@ -32,7 +35,7 @@ module PixarRubyExtensions
32
35
  # @return [Boolean]
33
36
  #
34
37
  def pix_float?
35
- self =~ FLOAT_RE ? true : false
38
+ FLOAT_RE.match? self
36
39
  end
37
40
 
38
41
  # is this some representation of a number?
@@ -45,6 +48,23 @@ module PixarRubyExtensions
45
48
  false
46
49
  end
47
50
 
51
+ # Is this string a UUID?
52
+ #
53
+ # Looks for the standard hyphenated form: 32 hexadecimal characters (0-9, a-f)
54
+ # and four hyphen delimiters in this pattern: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
55
+ #
56
+ # You can specify a different delimiter if needed.
57
+ #
58
+ # @param delimiter [String] the delimiter used in the UUID, default '-'
59
+ #
60
+ # @return [Boolean]
61
+ #
62
+ def pix_uuid?(delimiter = '-')
63
+ re_str = UUID_RE_STR.gsub DELIM_PLACEHOLDER, Regexp.escape(delimiter)
64
+ regex = Regexp.new re_str, 'i'
65
+ regex.match? self
66
+ end
67
+
48
68
  end # module
49
69
 
50
70
  end # module
@@ -10,6 +10,6 @@
10
10
  # our version
11
11
  module PixarRubyExtensions
12
12
 
13
- VERSION = '1.11.1'
13
+ VERSION = '1.12.0'
14
14
 
15
15
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pixar-ruby-extensions
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.11.1
4
+ version: 1.12.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Chris Lasell
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2025-09-28 00:00:00.000000000 Z
11
+ date: 2025-12-01 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: |
14
14
  This gem contans extensions to the Ruby core and standard libraries which have been used in many