foobara-util 0.0.12 → 1.0.1

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: 79a087a92959466cb6c3840be55b4d04f1269acd3638453094c5b59953479143
4
- data.tar.gz: 22ede0274067d130a68cca48188bddcaaba4985a86cc575d57774079a69b47f6
3
+ metadata.gz: 5a174eb2a495f75a94027741d239c7f5b3a3fa20cdf1bf051b2073495a5d0094
4
+ data.tar.gz: 84dbc9eaeb498408dedb7bd2f73fdab5dd9173b37e8dd7387eacc810d2bc3207
5
5
  SHA512:
6
- metadata.gz: 30535eaddea9bb49ee9f96b63fa6d36f31ac22371bb2be72f8952d7f07b870a5cecad2610b79c27c91ea3aa99f9958222c003383c1339ba6ea8f0a93a5349b89
7
- data.tar.gz: 40a9bb809b51fa53298af159ec25d707a941e1d42c44eeba63c41ddbea933651144c688b9f652f2da8b4d35022993a01af50b973eb1229520d3489de7e2a4457
6
+ metadata.gz: 5db55ff06bf816b239f5c4d2b4656bb29dfb065c4bf334feffda90573247bcd67f61a3f41106aa14124dc5b6c2a572fecdf8ed1030b2ecee58cf7b3b45267483
7
+ data.tar.gz: b2c59e7ca45bf763d694fbdb50ca8874877303f9e2ed28a7071d38a8fbd093a6bcf5f6ee31e58437e92f52d95ed65ecfe08f5f2a9543244808ea8c6a506db779
data/CHANGELOG.md CHANGED
@@ -1,3 +1,12 @@
1
+ ## [1.0.1] - 2025-07-07
2
+
3
+ - Add Util.start_with? for array comparisons
4
+
5
+ ## [1.0.0] - 2025-06-06
6
+
7
+ - Add + unary operator to a couple strings that are mutated for forward-compatibility
8
+ with upcoming frozen string literals
9
+
1
10
  ## [0.0.12] - 2025-05-03
2
11
 
3
12
  - Add .deep_symbolize_keys
@@ -36,5 +36,15 @@ module Foobara
36
36
  )
37
37
  end
38
38
  end
39
+
40
+ def start_with?(large_array, small_array)
41
+ return false unless large_array.size >= small_array.size
42
+
43
+ small_array.each.with_index do |item, index|
44
+ return false unless large_array[index] == item
45
+ end
46
+
47
+ true
48
+ end
39
49
  end
40
50
  end
@@ -13,7 +13,7 @@ module Foobara
13
13
  string = string.to_s
14
14
  end
15
15
 
16
- retval = ""
16
+ retval = +""
17
17
 
18
18
  string.each_char do |char|
19
19
  if ["_", "-"].include?(char)
@@ -61,7 +61,7 @@ module Foobara
61
61
 
62
62
  string = string.gsub(/[-.]/, "_")
63
63
 
64
- retval = ""
64
+ retval = +""
65
65
  is_start = true
66
66
 
67
67
  string.each_char do |char|
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: foobara-util
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.12
4
+ version: 1.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Miles Georgi
8
8
  bindir: bin
9
9
  cert_chain: []
10
- date: 2025-05-04 00:00:00.000000000 Z
10
+ date: 1980-01-02 00:00:00.000000000 Z
11
11
  dependencies: []
12
12
  email:
13
13
  - azimux@gmail.com
@@ -55,7 +55,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
55
55
  - !ruby/object:Gem::Version
56
56
  version: '0'
57
57
  requirements: []
58
- rubygems_version: 3.6.2
58
+ rubygems_version: 3.6.9
59
59
  specification_version: 4
60
60
  summary: Utility functions used across various Foobara projects
61
61
  test_files: []