Icarus-Mod-Tools 1.3.1 → 1.3.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/lib/icarus/mod/cli/list.rb +11 -5
- data/lib/icarus/mod/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 78fcf7a73092b07f142e4d227f108081a5dbadeeeef6a972ec1cb0f9ba064233
|
4
|
+
data.tar.gz: 88139f274dcf2fc0a716cc17b58b8a7f89364aa7dd1f9f7209aafaa9280952fa
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 835fa42f41b672cc7b025f3aca5e58e39b398ea0ed38889b34094446c21c3611d06304936d42cea5fe8602563b2d70fa3adeda1114ae18023fd64fe335745267
|
7
|
+
data.tar.gz: 2b315fb5e807cd0ba223544a1ffa47f5c64aa452228047f75e507b3522b4b9c85580c10b21c844bee1778978b66d42ca061a1b5ca2b4a28f20c2c3d386c0499f
|
data/Gemfile.lock
CHANGED
data/lib/icarus/mod/cli/list.rb
CHANGED
@@ -23,13 +23,19 @@ module Icarus
|
|
23
23
|
method_option :filter, type: :array, default: [], desc: "Filter by field (name, author, etc.)"
|
24
24
|
def mods
|
25
25
|
valid_keys = Icarus::Mod::Tools::Modinfo::HASHKEYS + [:updated_at]
|
26
|
-
sort_field = options[:sort].to_sym
|
27
|
-
filter_field = options[:filter].first.to_sym
|
28
|
-
filter_value = options[:filter].last.to_s
|
29
26
|
|
30
|
-
|
27
|
+
sort_field = options[:sort]&.to_sym
|
31
28
|
|
32
|
-
|
29
|
+
filter = !options[:filter].empty?
|
30
|
+
|
31
|
+
if filter
|
32
|
+
filter_field = options[:filter].first&.to_sym
|
33
|
+
filter_value = options[:filter].last&.to_s
|
34
|
+
|
35
|
+
raise "Invalid filter option" unless options[:filter].empty? || options[:filter]&.count == 2
|
36
|
+
|
37
|
+
raise "Invalid filter field '#{filter_field}'" unless filter_field && valid_keys.include?(filter_field)
|
38
|
+
end
|
33
39
|
|
34
40
|
raise "Invalid sort field '#{sort_field}'" unless valid_keys.include?(sort_field)
|
35
41
|
|
data/lib/icarus/mod/version.rb
CHANGED