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:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 1480b5ca9cc629346af546708524c4c5a9fa47fcfa9a9d241a37d3d8cf3a9092
|
|
4
|
+
data.tar.gz: 331e6e05f364ff31e5923e95cb17e73a405d92617c128dfdfe2131a3ddd3b423
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
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
|
-
|
|
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
|
-
|
|
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
|
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.
|
|
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-
|
|
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
|