Icarus-Mod-Tools 2.1.3 → 2.2.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: c6d319cdda834c36f092c7e2ec601beccba56c07c982d515039566a0dfcde470
4
- data.tar.gz: ab8646c60970f163bc749d2a42267a122454d6fe13f9e7cd2a717ff841f57182
3
+ metadata.gz: db2fc2f47e7cb01b3694b407294f2eaf7a309b243ea80f176a81d90f657492e5
4
+ data.tar.gz: 876bad1efb1796450f17ea4e9359ccffb51f28df5189050bdc1d077bdeea815f
5
5
  SHA512:
6
- metadata.gz: 9f4ca058de03df31d7791de1a3e5ecbf77cbb43d0ad6f7c646e22c9ac4183ee2bd7081383c55f08cc555e5ff74267c4e910bacf5e9aaec37f462644ceb807288
7
- data.tar.gz: 226221b51db91108f1bc4c41f2fe7f9f360f492b0bf4374eb38a6d9214952ef943f10ae6465c934376e894b6c5c1eacb6395f9ebe75ff5f34cb88e872f3d171a
6
+ metadata.gz: e7ebb4620d99595413206557bc22bd6b34f8199262c337825c69cf19e62e969ede2e7e791b830e3c65451bc778228e1e47d2e6369741a3dbc465579ffb2e6b5c
7
+ data.tar.gz: 54c5f97421e4657da914e08f56a606e56668f9d7e42b0bed46d1a4754ee57f37b9bb7659b8474c835b9374a4ee8edeee1f249a00c2fe3333c81b986811f8613e
data/.ruby-version CHANGED
@@ -1 +1 @@
1
- 3.1.3
1
+ 3.4
data/.standard.yml ADDED
@@ -0,0 +1,2 @@
1
+ extend_config:
2
+ - .standard_rubocop_extensions.yml
@@ -0,0 +1,10 @@
1
+ require:
2
+ - rubocop-rspec
3
+
4
+ AllCops:
5
+ TargetRubyVersion: 3.1
6
+ NewCops: enable
7
+ SuggestExtensions: false
8
+
9
+ RSpec/MultipleMemoizedHelpers:
10
+ Max: 10
data/Gemfile CHANGED
@@ -8,11 +8,12 @@ gemspec
8
8
  gem "rake", "~> 13.0"
9
9
 
10
10
  group :develop do
11
+ gem "fuubar"
11
12
  gem "guard", "~> 2.18"
12
13
  gem "guard-rspec", "~> 4.7"
13
14
  gem "pry", "~> 0.14.1"
14
15
  gem "rspec", "~> 3.12"
15
16
  gem "rubocop", "~> 1.41"
16
17
  gem "rubocop-rspec", "~> 2.16", require: false
17
- gem "standard"
18
+ gem "standard", ">= 1.35.1"
18
19
  end
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- Icarus-Mod-Tools (2.1.3)
4
+ Icarus-Mod-Tools (2.2.0)
5
5
  google-cloud-firestore (~> 2.7)
6
6
  octokit (~> 6.0)
7
7
  paint (~> 2.3)
@@ -10,73 +10,94 @@ PATH
10
10
  GEM
11
11
  remote: https://rubygems.org/
12
12
  specs:
13
- addressable (2.8.1)
14
- public_suffix (>= 2.0.2, < 6.0)
15
- ast (2.4.2)
13
+ addressable (2.8.7)
14
+ public_suffix (>= 2.0.2, < 7.0)
15
+ ast (2.4.3)
16
+ base64 (0.3.0)
17
+ bigdecimal (3.3.1)
16
18
  coderay (1.1.3)
17
- concurrent-ruby (1.2.2)
18
- diff-lcs (1.5.0)
19
- faraday (2.7.4)
20
- faraday-net_http (>= 2.0, < 3.1)
21
- ruby2_keywords (>= 0.0.4)
22
- faraday-net_http (3.0.2)
23
- faraday-retry (2.1.0)
19
+ concurrent-ruby (1.3.5)
20
+ diff-lcs (1.6.2)
21
+ faraday (2.14.0)
22
+ faraday-net_http (>= 2.0, < 3.5)
23
+ json
24
+ logger
25
+ faraday-net_http (3.4.2)
26
+ net-http (~> 0.5)
27
+ faraday-retry (2.3.2)
24
28
  faraday (~> 2.0)
25
- ffi (1.15.5)
26
- formatador (1.1.0)
27
- gapic-common (0.18.0)
29
+ ffi (1.17.2-x86_64-darwin)
30
+ ffi (1.17.2-x86_64-linux-gnu)
31
+ formatador (1.2.2)
32
+ reline
33
+ fuubar (2.5.1)
34
+ rspec-core (~> 3.0)
35
+ ruby-progressbar (~> 1.4)
36
+ gapic-common (1.2.0)
28
37
  faraday (>= 1.9, < 3.a)
29
38
  faraday-retry (>= 1.0, < 3.a)
30
- google-protobuf (~> 3.14)
31
- googleapis-common-protos (>= 1.3.12, < 2.a)
32
- googleapis-common-protos-types (>= 1.3.1, < 2.a)
33
- googleauth (~> 1.0)
34
- grpc (~> 1.36)
35
- google-cloud-core (1.6.0)
36
- google-cloud-env (~> 1.0)
39
+ google-cloud-env (~> 2.2)
40
+ google-logging-utils (~> 0.1)
41
+ google-protobuf (~> 4.26)
42
+ googleapis-common-protos (~> 1.6)
43
+ googleapis-common-protos-types (~> 1.15)
44
+ googleauth (~> 1.12)
45
+ grpc (~> 1.66)
46
+ google-cloud-core (1.8.0)
47
+ google-cloud-env (>= 1.0, < 3.a)
37
48
  google-cloud-errors (~> 1.0)
38
- google-cloud-env (1.6.0)
39
- faraday (>= 0.17.3, < 3.0)
40
- google-cloud-errors (1.3.1)
41
- google-cloud-firestore (2.11.0)
49
+ google-cloud-env (2.3.1)
50
+ base64 (~> 0.2)
51
+ faraday (>= 1.0, < 3.a)
52
+ google-cloud-errors (1.5.0)
53
+ google-cloud-firestore (2.16.1)
54
+ bigdecimal (~> 3.0)
42
55
  concurrent-ruby (~> 1.0)
43
56
  google-cloud-core (~> 1.5)
44
- google-cloud-firestore-v1 (~> 0.10)
57
+ google-cloud-firestore-v1 (>= 0.10, < 2.a)
45
58
  rbtree (~> 0.4.2)
46
- google-cloud-firestore-v1 (0.10.0)
47
- gapic-common (>= 0.17.1, < 2.a)
59
+ google-cloud-firestore-v1 (1.3.0)
60
+ gapic-common (>= 0.25.0, < 2.a)
48
61
  google-cloud-errors (~> 1.0)
49
- google-cloud-location (>= 0.4, < 2.a)
50
- google-cloud-location (0.4.0)
51
- gapic-common (>= 0.17.1, < 2.a)
62
+ google-cloud-location (>= 0.7, < 2.a)
63
+ google-cloud-location (1.2.1)
64
+ gapic-common (~> 1.2)
52
65
  google-cloud-errors (~> 1.0)
53
- google-protobuf (3.22.2-x86_64-darwin)
54
- google-protobuf (3.22.2-x86_64-linux)
55
- googleapis-common-protos (1.4.0)
56
- google-protobuf (~> 3.14)
57
- googleapis-common-protos-types (~> 1.2)
58
- grpc (~> 1.27)
59
- googleapis-common-protos-types (1.5.0)
60
- google-protobuf (~> 3.14)
61
- googleauth (1.5.0)
62
- faraday (>= 0.17.3, < 3.a)
63
- jwt (>= 1.4, < 3.0)
64
- memoist (~> 0.16)
66
+ google-logging-utils (0.2.0)
67
+ google-protobuf (4.33.0-x86_64-darwin)
68
+ bigdecimal
69
+ rake (>= 13)
70
+ google-protobuf (4.33.0-x86_64-linux-gnu)
71
+ bigdecimal
72
+ rake (>= 13)
73
+ googleapis-common-protos (1.9.0)
74
+ google-protobuf (~> 4.26)
75
+ googleapis-common-protos-types (~> 1.21)
76
+ grpc (~> 1.41)
77
+ googleapis-common-protos-types (1.22.0)
78
+ google-protobuf (~> 4.26)
79
+ googleauth (1.15.1)
80
+ faraday (>= 1.0, < 3.a)
81
+ google-cloud-env (~> 2.2)
82
+ google-logging-utils (~> 0.1)
83
+ jwt (>= 1.4, < 4.0)
65
84
  multi_json (~> 1.11)
66
85
  os (>= 0.9, < 2.0)
67
86
  signet (>= 0.16, < 2.a)
68
- grpc (1.53.0-x86_64-darwin)
69
- google-protobuf (~> 3.21)
87
+ grpc (1.76.0-x86_64-darwin)
88
+ google-protobuf (>= 3.25, < 5.0)
70
89
  googleapis-common-protos-types (~> 1.0)
71
- grpc (1.53.0-x86_64-linux)
72
- google-protobuf (~> 3.21)
90
+ grpc (1.76.0-x86_64-linux-gnu)
91
+ google-protobuf (>= 3.25, < 5.0)
73
92
  googleapis-common-protos-types (~> 1.0)
74
- guard (2.18.0)
93
+ guard (2.19.1)
75
94
  formatador (>= 0.2.4)
76
95
  listen (>= 2.7, < 4.0)
96
+ logger (~> 1.6)
77
97
  lumberjack (>= 1.0.12, < 2.0)
78
98
  nenv (~> 0.1)
79
99
  notiffany (~> 0.0)
100
+ ostruct (~> 0.6)
80
101
  pry (>= 0.13.0)
81
102
  shellany (~> 0.0)
82
103
  thor (>= 0.18.1)
@@ -85,90 +106,121 @@ GEM
85
106
  guard (~> 2.1)
86
107
  guard-compat (~> 1.1)
87
108
  rspec (>= 2.99.0, < 4.0)
88
- json (2.6.3)
89
- jwt (2.7.0)
90
- language_server-protocol (3.17.0.3)
91
- listen (3.8.0)
109
+ io-console (0.8.1)
110
+ json (2.16.0)
111
+ jwt (3.1.2)
112
+ base64
113
+ language_server-protocol (3.17.0.5)
114
+ lint_roller (1.1.0)
115
+ listen (3.9.0)
92
116
  rb-fsevent (~> 0.10, >= 0.10.3)
93
117
  rb-inotify (~> 0.9, >= 0.9.10)
94
- lumberjack (1.2.8)
95
- memoist (0.16.2)
96
- method_source (1.0.0)
97
- multi_json (1.15.0)
118
+ logger (1.7.0)
119
+ lumberjack (1.4.2)
120
+ method_source (1.1.0)
121
+ multi_json (1.17.0)
98
122
  nenv (0.3.0)
123
+ net-http (0.7.0)
124
+ uri
99
125
  notiffany (0.1.3)
100
126
  nenv (~> 0.1)
101
127
  shellany (~> 0.0)
102
- octokit (6.1.0)
128
+ octokit (6.1.1)
103
129
  faraday (>= 1, < 3)
104
130
  sawyer (~> 0.9)
105
131
  os (1.1.4)
132
+ ostruct (0.6.3)
106
133
  paint (2.3.0)
107
- parallel (1.22.1)
108
- parser (3.2.1.1)
134
+ parallel (1.27.0)
135
+ parser (3.3.10.0)
109
136
  ast (~> 2.4.1)
137
+ racc
138
+ prism (1.6.0)
110
139
  pry (0.14.2)
111
140
  coderay (~> 1.1)
112
141
  method_source (~> 1.0)
113
- public_suffix (5.0.1)
142
+ public_suffix (6.0.2)
143
+ racc (1.8.1)
114
144
  rainbow (3.1.1)
115
- rake (13.0.6)
145
+ rake (13.3.1)
116
146
  rb-fsevent (0.11.2)
117
- rb-inotify (0.10.1)
147
+ rb-inotify (0.11.1)
118
148
  ffi (~> 1.0)
119
149
  rbtree (0.4.6)
120
- regexp_parser (2.7.0)
121
- rexml (3.2.5)
122
- rspec (3.12.0)
123
- rspec-core (~> 3.12.0)
124
- rspec-expectations (~> 3.12.0)
125
- rspec-mocks (~> 3.12.0)
126
- rspec-core (3.12.1)
127
- rspec-support (~> 3.12.0)
128
- rspec-expectations (3.12.2)
150
+ regexp_parser (2.11.3)
151
+ reline (0.6.2)
152
+ io-console (~> 0.5)
153
+ rspec (3.13.2)
154
+ rspec-core (~> 3.13.0)
155
+ rspec-expectations (~> 3.13.0)
156
+ rspec-mocks (~> 3.13.0)
157
+ rspec-core (3.13.6)
158
+ rspec-support (~> 3.13.0)
159
+ rspec-expectations (3.13.5)
129
160
  diff-lcs (>= 1.2.0, < 2.0)
130
- rspec-support (~> 3.12.0)
131
- rspec-mocks (3.12.4)
161
+ rspec-support (~> 3.13.0)
162
+ rspec-mocks (3.13.7)
132
163
  diff-lcs (>= 1.2.0, < 2.0)
133
- rspec-support (~> 3.12.0)
134
- rspec-support (3.12.0)
135
- rubocop (1.48.1)
164
+ rspec-support (~> 3.13.0)
165
+ rspec-support (3.13.6)
166
+ rubocop (1.80.2)
136
167
  json (~> 2.3)
168
+ language_server-protocol (~> 3.17.0.2)
169
+ lint_roller (~> 1.1.0)
137
170
  parallel (~> 1.10)
138
- parser (>= 3.2.0.0)
171
+ parser (>= 3.3.0.2)
139
172
  rainbow (>= 2.2.2, < 4.0)
140
- regexp_parser (>= 1.8, < 3.0)
141
- rexml (>= 3.2.5, < 4.0)
142
- rubocop-ast (>= 1.26.0, < 2.0)
173
+ regexp_parser (>= 2.9.3, < 3.0)
174
+ rubocop-ast (>= 1.46.0, < 2.0)
143
175
  ruby-progressbar (~> 1.7)
144
- unicode-display_width (>= 2.4.0, < 3.0)
145
- rubocop-ast (1.28.0)
146
- parser (>= 3.2.1.0)
147
- rubocop-capybara (2.17.1)
148
- rubocop (~> 1.41)
149
- rubocop-performance (1.16.0)
150
- rubocop (>= 1.7.0, < 2.0)
151
- rubocop-ast (>= 0.4.0)
152
- rubocop-rspec (2.19.0)
153
- rubocop (~> 1.33)
176
+ unicode-display_width (>= 2.4.0, < 4.0)
177
+ rubocop-ast (1.48.0)
178
+ parser (>= 3.3.7.2)
179
+ prism (~> 1.4)
180
+ rubocop-capybara (2.22.1)
181
+ lint_roller (~> 1.1)
182
+ rubocop (~> 1.72, >= 1.72.1)
183
+ rubocop-factory_bot (2.27.1)
184
+ lint_roller (~> 1.1)
185
+ rubocop (~> 1.72, >= 1.72.1)
186
+ rubocop-performance (1.25.0)
187
+ lint_roller (~> 1.1)
188
+ rubocop (>= 1.75.0, < 2.0)
189
+ rubocop-ast (>= 1.38.0, < 2.0)
190
+ rubocop-rspec (2.31.0)
191
+ rubocop (~> 1.40)
154
192
  rubocop-capybara (~> 2.17)
193
+ rubocop-factory_bot (~> 2.22)
194
+ rubocop-rspec_rails (~> 2.28)
195
+ rubocop-rspec_rails (2.29.1)
196
+ rubocop (~> 1.61)
155
197
  ruby-progressbar (1.13.0)
156
- ruby2_keywords (0.0.5)
157
- sawyer (0.9.2)
198
+ sawyer (0.9.3)
158
199
  addressable (>= 2.3.5)
159
200
  faraday (>= 0.17.3, < 3)
160
201
  shellany (0.0.1)
161
- signet (0.17.0)
202
+ signet (0.21.0)
162
203
  addressable (~> 2.8)
163
204
  faraday (>= 0.17.5, < 3.a)
164
- jwt (>= 1.5, < 3.0)
205
+ jwt (>= 1.5, < 4.0)
165
206
  multi_json (~> 1.10)
166
- standard (1.25.3)
207
+ standard (1.51.1)
167
208
  language_server-protocol (~> 3.17.0.2)
168
- rubocop (~> 1.48.1)
169
- rubocop-performance (~> 1.16.0)
170
- thor (1.2.1)
171
- unicode-display_width (2.4.2)
209
+ lint_roller (~> 1.0)
210
+ rubocop (~> 1.80.2)
211
+ standard-custom (~> 1.0.0)
212
+ standard-performance (~> 1.8)
213
+ standard-custom (1.0.2)
214
+ lint_roller (~> 1.0)
215
+ rubocop (~> 1.50)
216
+ standard-performance (1.8.0)
217
+ lint_roller (~> 1.1)
218
+ rubocop-performance (~> 1.25.0)
219
+ thor (1.4.0)
220
+ unicode-display_width (3.2.0)
221
+ unicode-emoji (~> 4.1)
222
+ unicode-emoji (4.1.0)
223
+ uri (1.1.1)
172
224
 
173
225
  PLATFORMS
174
226
  x86_64-darwin-22
@@ -176,6 +228,7 @@ PLATFORMS
176
228
 
177
229
  DEPENDENCIES
178
230
  Icarus-Mod-Tools!
231
+ fuubar
179
232
  guard (~> 2.18)
180
233
  guard-rspec (~> 4.7)
181
234
  pry (~> 0.14.1)
@@ -183,7 +236,7 @@ DEPENDENCIES
183
236
  rspec (~> 3.12)
184
237
  rubocop (~> 1.41)
185
238
  rubocop-rspec (~> 2.16)
186
- standard
239
+ standard (>= 1.35.1)
187
240
 
188
241
  BUNDLED WITH
189
242
  2.3.26
data/Rakefile CHANGED
@@ -3,14 +3,10 @@
3
3
  require "bundler/gem_tasks"
4
4
  require "rake/testtask"
5
5
  require "rspec/core/rake_task"
6
- require "rubocop/rake_task"
6
+ require "standard/rake"
7
7
 
8
- RuboCop::RakeTask.new
9
-
10
- # Default directory to look in is `/specs`
11
- # Run with `rake spec`
12
8
  RSpec::Core::RakeTask.new(:spec) do |task|
13
- task.rspec_opts = ["--color", "--format", "doc"]
9
+ task.rspec_opts = ["--color", "--format", "Fuubar"]
14
10
  end
15
11
 
16
- task default: %i[spec rubocop]
12
+ task default: %i[spec standard]
@@ -11,12 +11,12 @@ module Icarus
11
11
  # The Base CLI class for Icarus Mod Tools. This is inherited by all subcommands.
12
12
  class Base < Thor
13
13
  class_option :config,
14
- aliases: "-C", type: :string, default: File.join(Dir.home, "/.imtconfig.json"),
15
- desc: "Path to the config file"
14
+ aliases: "-C", type: :string, default: File.join(Dir.home, "/.imtconfig.json"),
15
+ desc: "Path to the config file"
16
16
 
17
17
  class_option :version,
18
- aliases: "-V", type: :boolean,
19
- desc: "Print the version and exit"
18
+ aliases: "-V", type: :boolean,
19
+ desc: "Print the version and exit"
20
20
 
21
21
  def self.exit_on_failure?
22
22
  true
@@ -45,10 +45,10 @@ module Icarus
45
45
 
46
46
  no_commands do
47
47
  def list_for_type(type)
48
- klass = type == :mods ? Icarus::Mod::Tools::Modinfo : Icarus::Mod::Tools::Toolinfo
48
+ klass = (type == :mods) ? Icarus::Mod::Tools::Modinfo : Icarus::Mod::Tools::Toolinfo
49
49
  valid_keys = klass::HASHKEYS + [:updated_at]
50
50
  sort_field = options[:sort]&.to_sym
51
- filter = !options[:filter].empty?
51
+ filter = !options[:filter].empty?
52
52
 
53
53
  if filter
54
54
  filter_field = options[:filter].first&.to_sym
@@ -90,7 +90,7 @@ module Icarus
90
90
  end
91
91
 
92
92
  # Sort by field, optionally subsorting by name
93
- (sort_field == :name ? items.sort_by(&:name) : items.sort_by { |item| [item.send(sort_field), item.name] }).each do |item|
93
+ ((sort_field == :name) ? items.sort_by(&:name) : items.sort_by { |item| [item.send(sort_field), item.name] }).each do |item|
94
94
  data_format = "%-<name>50s %-<author>20s v%-<version>10s%-<updated_at>20s"
95
95
  data_format += " %-<id>20s %<description>s" if verbose > 1
96
96
 
@@ -8,8 +8,8 @@ module Icarus
8
8
  # Base class for all subcommands
9
9
  class SubcommandBase < Base
10
10
  class_option :verbose,
11
- aliases: "-v", type: :boolean, repeatable: true, default: [true],
12
- desc: "Increase verbosity. May be repeated for even more verbosity."
11
+ aliases: "-v", type: :boolean, repeatable: true, default: [true],
12
+ desc: "Increase verbosity. May be repeated for even more verbosity."
13
13
 
14
14
  no_commands do
15
15
  def check_false
@@ -144,7 +144,7 @@ module Icarus
144
144
 
145
145
  puts "Deleting outdated items..." if verbose?
146
146
  delete_array.each do |list|
147
- print format("Deleting %-<name>60s", name: "'#{list.author || "NoOne"}/#{list.name || "Unnamed'"}") if verbose > 1
147
+ print "Deleting '#{list.author || "NoOne"}/#{list.name || "Unnamed'"}'#{" " * 20}" if verbose > 1
148
148
  response = sync.delete(list)
149
149
  puts success_or_failure(status: response) if verbose > 1
150
150
  end
@@ -1,6 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  require "json"
4
+ require "ostruct"
4
5
 
5
6
  module Icarus
6
7
  module Mod
@@ -34,7 +34,7 @@ module Icarus
34
34
  use_cache = @resources.any? && cache
35
35
 
36
36
  if use_cache
37
- @resources.each { |file| block.call(file) } if block_given?
37
+ @resources.each { |file| block.call(file) } if block
38
38
  else
39
39
  @client.contents(repository, path:).each do |entry|
40
40
  if entry[:type] == "dir"
@@ -42,16 +42,16 @@ module Icarus
42
42
  next # we don't need directories in our output
43
43
  end
44
44
 
45
- block.call(entry) if block_given?
45
+ block&.call(entry)
46
46
  @resources << entry # cache the file
47
47
  end
48
48
  end
49
49
 
50
- @resources unless block_given?
50
+ @resources unless block
51
51
  end
52
52
 
53
53
  def find(pattern)
54
- all_files { |file| return file if file[:name] =~ /#{pattern}/i }
54
+ all_files { |file| return file if /#{pattern}/i.match?(file[:name]) }
55
55
  end
56
56
 
57
57
  def get_contents(url)
@@ -102,11 +102,11 @@ module Icarus
102
102
  end
103
103
 
104
104
  def method_missing(method_name, *_args, &_block)
105
- @data[method_name.to_sym] if @data.keys.include?(method_name.to_sym)
105
+ @data[method_name.to_sym] if @data.key?(method_name.to_sym)
106
106
  end
107
107
 
108
108
  def respond_to_missing?(method_name, include_private = false)
109
- @data.keys.include?(method_name.to_sym) || super
109
+ @data.key?(method_name.to_sym) || super
110
110
  end
111
111
 
112
112
  private
@@ -144,7 +144,7 @@ module Icarus
144
144
  if version.nil?
145
145
  @warnings << "Version was nil, it has been defaulted to 1.0"
146
146
  else
147
- @warnings << "Version should be a version string" unless version =~ /^\d+[.\d+]*/
147
+ @warnings << "Version should be a version string" unless /^\d+[.\d+]*/.match?(version)
148
148
  end
149
149
  end
150
150
  end
@@ -9,7 +9,7 @@ module Icarus
9
9
  class Modinfo < Baseinfo
10
10
  def to_h
11
11
  db_hash = super
12
- db_hash[:meta] = { status: } # Add metadata
12
+ db_hash[:meta] = {status:} # Add metadata
13
13
 
14
14
  db_hash
15
15
  end
@@ -3,6 +3,7 @@
3
3
  require "uri"
4
4
  require "net/http"
5
5
  require "json"
6
+ require "openssl"
6
7
 
7
8
  module Icarus
8
9
  module Mod
@@ -15,7 +16,23 @@ module Icarus
15
16
  def retrieve_from_url(url)
16
17
  raise RequestFailed, "Invalid URI: '#{url}'" unless url && url =~ URI::DEFAULT_PARSER.make_regexp
17
18
 
18
- res = Net::HTTP.get_response(URI(url))
19
+ uri = URI(url)
20
+ http = Net::HTTP.new(uri.host, uri.port)
21
+
22
+ if uri.scheme == "https"
23
+ http.use_ssl = true
24
+ http.verify_mode = OpenSSL::SSL::VERIFY_PEER
25
+ # Disable CRL checking which is causing the issue
26
+ http.verify_callback = proc { |preverify_ok, ssl_context|
27
+ if ssl_context.error == OpenSSL::X509::V_ERR_UNABLE_TO_GET_CRL
28
+ true
29
+ else
30
+ preverify_ok
31
+ end
32
+ }
33
+ end
34
+
35
+ res = http.get(uri.path.empty? ? "/" : uri.path)
19
36
 
20
37
  raise RequestFailed, "HTTP Request failed for #{url} (#{res.code}): #{res.message}" unless res&.code == "200"
21
38
 
@@ -23,7 +23,7 @@ module Icarus
23
23
  @info_array ||= @firestore.toolinfo.map do |url|
24
24
  next unless url
25
25
 
26
- retrieve_from_url(url)[:tools].map { |tool| Icarus::Mod::Tools::Toolinfo.new(tool) if tool[:name] =~ /[a-z0-9]+/i }
26
+ retrieve_from_url(url)[:tools].map { |tool| Icarus::Mod::Tools::Toolinfo.new(tool) if /[a-z0-9]+/i.match?(tool[:name]) }
27
27
  rescue Icarus::Mod::Tools::Sync::RequestFailed
28
28
  warn "Skipped; Failed to retrieve #{url}"
29
29
  next
@@ -9,13 +9,13 @@ module Icarus
9
9
 
10
10
  def initialize(type)
11
11
  @array = case type
12
- when :modinfo
13
- Sync::Mods.new.info_array
14
- when :toolinfo
15
- Sync::Tools.new.info_array
16
- else
17
- raise ArgumentError, "Invalid type: #{type}"
18
- end
12
+ when :modinfo
13
+ Sync::Mods.new.info_array
14
+ when :toolinfo
15
+ Sync::Tools.new.info_array
16
+ else
17
+ raise ArgumentError, "Invalid type: #{type}"
18
+ end
19
19
  end
20
20
  end
21
21
  end
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Icarus
4
4
  module Mod
5
- VERSION = "2.1.3"
5
+ VERSION = "2.2.0"
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,14 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: Icarus-Mod-Tools
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.1.3
4
+ version: 2.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Donovan Young
8
- autorequire:
9
8
  bindir: exe
10
9
  cert_chain: []
11
- date: 2023-03-26 00:00:00.000000000 Z
10
+ date: 1980-01-02 00:00:00.000000000 Z
12
11
  dependencies:
13
12
  - !ruby/object:Gem::Dependency
14
13
  name: google-cloud-firestore
@@ -75,8 +74,9 @@ extensions: []
75
74
  extra_rdoc_files: []
76
75
  files:
77
76
  - ".rspec"
78
- - ".rubocop.yml"
79
77
  - ".ruby-version"
78
+ - ".standard.yml"
79
+ - ".standard_rubocop_extensions.yml"
80
80
  - CHANGELOG.md
81
81
  - Gemfile
82
82
  - Gemfile.lock
@@ -116,7 +116,6 @@ metadata:
116
116
  source_code_uri: https://github.com/DonovanMods/icarus-mod-tools
117
117
  changelog_uri: https://github.com/DonovanMods/icarus-mod-tools/blob/main/CHANGELOG.md
118
118
  rubygems_mfa_required: 'true'
119
- post_install_message:
120
119
  rdoc_options: []
121
120
  require_paths:
122
121
  - lib
@@ -132,8 +131,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
132
131
  - !ruby/object:Gem::Version
133
132
  version: '0'
134
133
  requirements: []
135
- rubygems_version: 3.3.26
136
- signing_key:
134
+ rubygems_version: 3.6.9
137
135
  specification_version: 4
138
136
  summary: Various tools for Icarus Modding
139
137
  test_files: []
data/.rubocop.yml DELETED
@@ -1,61 +0,0 @@
1
- require: rubocop-rspec
2
-
3
- AllCops:
4
- TargetRubyVersion: 3.1
5
- NewCops: enable
6
- SuggestExtensions: false
7
-
8
- Style/StringLiterals:
9
- Enabled: true
10
- EnforcedStyle: double_quotes
11
-
12
- Style/StringLiteralsInInterpolation:
13
- Enabled: true
14
- EnforcedStyle: double_quotes
15
-
16
- Layout/LineLength:
17
- Max: 160
18
-
19
- Style/FrozenStringLiteralComment:
20
- Exclude:
21
- - Guardfile
22
- - spec/**/*_spec.rb
23
-
24
- Metrics/CyclomaticComplexity:
25
- Max: 15
26
- Exclude:
27
- - spec/**/*_spec.rb
28
- - lib/icarus/mod/cli/*.rb # Thor command files
29
-
30
- Metrics/PerceivedComplexity:
31
- Max: 15
32
- Exclude:
33
- - spec/**/*_spec.rb
34
- - lib/icarus/mod/cli/*.rb # Thor command files
35
-
36
- Metrics/AbcSize:
37
- Max: 35
38
- Exclude:
39
- - lib/icarus/mod/cli/*.rb # Thor command files
40
-
41
- Metrics/BlockLength:
42
- Enabled: false
43
-
44
- Metrics/ClassLength:
45
- Enabled: false
46
-
47
- Metrics/MethodLength:
48
- Enabled: false
49
-
50
- Naming/BlockForwarding:
51
- EnforcedStyle: explicit
52
-
53
- RSpec/MultipleMemoizedHelpers:
54
- Enabled: false
55
-
56
- Style/Documentation:
57
- Exclude:
58
- - lib/icarus/mod/cli/*.rb # Thor command files
59
-
60
- Style/OpenStructUse:
61
- Enabled: false