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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: daeaf600cc95360b7002385ce3c955b75ef0de606893bf5b73d34ce5d76dbba7
4
- data.tar.gz: 8ca92cb968f6d7f1cd23a14fc3a393b32d8acac0ac10039b91d8265a5a8bdd9d
3
+ metadata.gz: 78fcf7a73092b07f142e4d227f108081a5dbadeeeef6a972ec1cb0f9ba064233
4
+ data.tar.gz: 88139f274dcf2fc0a716cc17b58b8a7f89364aa7dd1f9f7209aafaa9280952fa
5
5
  SHA512:
6
- metadata.gz: '094d0be08425875bbdc181e3a01f70b63b082e08903ab9d8da6795e0813c85102d34a0c37e37e7de4319f8ae7d37e372b37f2cb1f4a2669d873814a9c45f9211'
7
- data.tar.gz: c9904e4b40ba8f8bd72818146c8edfa9c07d9150152aa087e9c2aa13292fd20425b4ef85426dada71e99ada4983ac40c347889c8c2bafef9e508bf0e1ebd2ee2
6
+ metadata.gz: 835fa42f41b672cc7b025f3aca5e58e39b398ea0ed38889b34094446c21c3611d06304936d42cea5fe8602563b2d70fa3adeda1114ae18023fd64fe335745267
7
+ data.tar.gz: 2b315fb5e807cd0ba223544a1ffa47f5c64aa452228047f75e507b3522b4b9c85580c10b21c844bee1778978b66d42ca061a1b5ca2b4a28f20c2c3d386c0499f
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- Icarus-Mod-Tools (1.3.1)
4
+ Icarus-Mod-Tools (1.3.2)
5
5
  google-cloud-firestore (~> 2.7)
6
6
  octokit (~> 6.0)
7
7
  thor (~> 1.2)
@@ -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
- raise "Invalid filter option" unless options[:filter]&.count == 2
27
+ sort_field = options[:sort]&.to_sym
31
28
 
32
- raise "Invalid filter field '#{filter_field}'" unless filter_field && valid_keys.include?(filter_field)
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
 
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Icarus
4
4
  module Mod
5
- VERSION = "1.3.1"
5
+ VERSION = "1.3.2"
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: Icarus-Mod-Tools
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.3.1
4
+ version: 1.3.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Donovan Young