order_already 0.3.1 → 0.3.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/order_already/version.rb +1 -1
- data/lib/order_already.rb +8 -2
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e9133e5102bbf4b0b4f6ef2207ee536e63dc6ac7d44181aedae6f1e179ebd22c
|
4
|
+
data.tar.gz: 69ce14225f00f535e165be4c951692bdb5d7c372595e59c9bd2ba9c51496d009
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 76eca41dc67a98dd12273bbd49eb4a4f21db9d2540ed976939adb4c66099a1d9216c2d178667536ff4e79f4a41b85c71f8dfa5fab9dbfdf9886130b98ab2041e
|
7
|
+
data.tar.gz: '04979a7b87e416ac7d81df70a3f4f8c2e12f7b1b04211c879dc86cdb13124c8ebdbea5010fb76e52c5b87edc10030497444248c269c05db4f776038097626921'
|
data/lib/order_already.rb
CHANGED
@@ -81,7 +81,9 @@ module OrderAlready
|
|
81
81
|
# @param arr [Array]
|
82
82
|
# @return [Array]
|
83
83
|
def self.deserialize(arr)
|
84
|
-
|
84
|
+
arr = arr&.compact || []
|
85
|
+
arr = arr.reject(&:empty?)
|
86
|
+
return [] if arr.empty?
|
85
87
|
|
86
88
|
sort(arr).map do |val|
|
87
89
|
get_value(val)
|
@@ -95,7 +97,9 @@ module OrderAlready
|
|
95
97
|
# @param arr [Array]
|
96
98
|
# @return [Array]
|
97
99
|
def self.serialize(arr)
|
98
|
-
|
100
|
+
arr = arr&.compact || []
|
101
|
+
arr = arr.reject(&:empty?)
|
102
|
+
return [] if arr.empty?
|
99
103
|
|
100
104
|
arr = sanitize(arr)
|
101
105
|
|
@@ -108,6 +112,8 @@ module OrderAlready
|
|
108
112
|
end
|
109
113
|
|
110
114
|
def self.sanitize(values)
|
115
|
+
return if values.nil?
|
116
|
+
|
111
117
|
full_sanitizer = Rails::Html::FullSanitizer.new
|
112
118
|
sanitized_values = Array.new(values.size, '')
|
113
119
|
empty = TOKEN_DELIMITER * 3
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: order_already
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jeremy Friesen
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: exe
|
11
11
|
cert_chain: []
|
12
|
-
date:
|
12
|
+
date: 2024-09-19 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rails-html-sanitizer
|
@@ -100,7 +100,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
100
100
|
- !ruby/object:Gem::Version
|
101
101
|
version: '0'
|
102
102
|
requirements: []
|
103
|
-
rubygems_version: 3.3
|
103
|
+
rubygems_version: 3.5.3
|
104
104
|
signing_key:
|
105
105
|
specification_version: 4
|
106
106
|
summary: A tiny gem to provide naive sorting for Fedora Commons properties.
|