pixar-ruby-extensions 1.12.0 → 1.13.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: 1480b5ca9cc629346af546708524c4c5a9fa47fcfa9a9d241a37d3d8cf3a9092
4
- data.tar.gz: 331e6e05f364ff31e5923e95cb17e73a405d92617c128dfdfe2131a3ddd3b423
3
+ metadata.gz: a63c902db12bba0b26953ee5e310ed409ac8790d4142f4a2e93112f52254ea83
4
+ data.tar.gz: 38197de21323ebcbecee7d390482a45f1bbe44caeaff4c21030cc2a1a0f61408
5
5
  SHA512:
6
- metadata.gz: 707c57139571cc71f39fee62304fc9afd38df093361df7d8e60124a25b6f9e3e8f140ae712fdbec53b29d0a14bdee083570d1262dbd3b6af50e0e438d9d919c4
7
- data.tar.gz: 1a0d74c37ff4ac515ed32d1c15f5bb5ace597799981c698392676850088c9884091ad7a0414173d28879000b8e546e64b690d04d28b4b84137733a71e97522e1
6
+ metadata.gz: 2555c58e00f97631668d6f68adb52ac23ea109e199caf1e60fac1d0686af1c95aa0a1463a343ebd7e77fbb6b025e882ef0f8a4b73d7b269baa621a5e4e43ac3a
7
+ data.tar.gz: 06316dfb30b8b554233d6744192d24620d59aa59eed2044c59ab7ef03654726e243c20ddd61f43b3a39bb507e9840ad980c9a9109f0994bb83606ec61c5b7a67
@@ -180,6 +180,24 @@ module PixarRubyExtensions
180
180
  "#{hsize} #{unit}"
181
181
  end
182
182
 
183
+ # Taken from Rails...
184
+ #
185
+ # @return [String] The English ordinal version of the integer, e.g. 1 => '1st', 225 => '225th'
186
+ #############
187
+ def pix_ordinalize
188
+ # Handle 11th, 12th, 13th, etc.
189
+ if (11..13).include?(abs % 100)
190
+ "#{self}th"
191
+ else
192
+ case abs % 10
193
+ when 1 then "#{self}st"
194
+ when 2 then "#{self}nd"
195
+ when 3 then "#{self}rd"
196
+ else "#{self}th"
197
+ end
198
+ end
199
+ end
200
+
183
201
  end # module
184
202
 
185
203
  end # module
@@ -39,8 +39,20 @@ module PixarRubyExtensions
39
39
  strftime("%FT%T.#{pix_msec}%z")
40
40
  end
41
41
 
42
- end
42
+ # @param full_dayname [Boolean] The day name is the full version (strftime %A)
43
+ # instead of the default 3-letter short version (strftime %a)
44
+ # @return [String] The English ordinal weekday of the month:
45
+ # Time.now.ordinal_weekday => "2nd Wed"
46
+ #
47
+ def pix_ordinal_weekday(full_dayname: false)
48
+ require 'pixar_ruby_extensions/integer'
49
+ weeknum = (((day - 1) / 7) + 1)
50
+ dayname_format = full_dayname ? '%A' : '%a'
51
+ "#{weeknum.pix_ordinalize} #{strftime dayname_format}"
52
+ end
53
+
54
+ end # Module Utils
43
55
 
44
- end
56
+ end # Module
45
57
 
46
- end
58
+ end # Module
@@ -10,6 +10,6 @@
10
10
  # our version
11
11
  module PixarRubyExtensions
12
12
 
13
- VERSION = '1.12.0'
13
+ VERSION = '1.13.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.12.0
4
+ version: 1.13.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-12-01 00:00:00.000000000 Z
11
+ date: 2026-09-27 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