Icarus-Mod-Tools 2.1.3 → 2.1.4
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 +4 -4
- data/.standard.yml +2 -0
- data/.standard_rubocop_extensions.yml +10 -0
- data/Gemfile +1 -0
- data/Gemfile.lock +5 -5
- data/Rakefile +3 -7
- data/lib/icarus/mod/cli/base.rb +4 -4
- data/lib/icarus/mod/cli/list.rb +3 -3
- data/lib/icarus/mod/cli/subcommand_base.rb +2 -2
- data/lib/icarus/mod/github.rb +4 -4
- data/lib/icarus/mod/tools/baseinfo.rb +3 -3
- data/lib/icarus/mod/tools/modinfo.rb +1 -1
- data/lib/icarus/mod/tools/sync/tools.rb +1 -1
- data/lib/icarus/mod/tools/validator.rb +7 -7
- data/lib/icarus/mod/version.rb +1 -1
- metadata +4 -3
- data/.rubocop.yml +0 -61
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d6567527e650542f138580d498b0096d41595a10703b25a572ffc624baba6610
|
4
|
+
data.tar.gz: '09e582fbbd638e722b5bd54a232f491f94d190226015d9d95ca0c26d126d57c8'
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 615be569c373d31071b5ee747a4ad28183d5db7cefc0409105a42511bd853ec9a3a89aff3c187a1908b0ca16f83e2f613db88899b329ca3358804542fe0f31fd
|
7
|
+
data.tar.gz: f496b73c26b7b98afbcc7a8521b1d955116dfb7fedc8b0999d87baaefcb917128310ff0122f35aa8c492f7e358f0c4e59d7e68361cc49ff5a59f700aa4ce9490
|
data/.standard.yml
ADDED
data/Gemfile
CHANGED
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
Icarus-Mod-Tools (2.1.
|
4
|
+
Icarus-Mod-Tools (2.1.4)
|
5
5
|
google-cloud-firestore (~> 2.7)
|
6
6
|
octokit (~> 6.0)
|
7
7
|
paint (~> 2.3)
|
@@ -24,6 +24,9 @@ GEM
|
|
24
24
|
faraday (~> 2.0)
|
25
25
|
ffi (1.15.5)
|
26
26
|
formatador (1.1.0)
|
27
|
+
fuubar (2.5.1)
|
28
|
+
rspec-core (~> 3.0)
|
29
|
+
ruby-progressbar (~> 1.4)
|
27
30
|
gapic-common (0.18.0)
|
28
31
|
faraday (>= 1.9, < 3.a)
|
29
32
|
faraday-retry (>= 1.0, < 3.a)
|
@@ -50,7 +53,6 @@ GEM
|
|
50
53
|
google-cloud-location (0.4.0)
|
51
54
|
gapic-common (>= 0.17.1, < 2.a)
|
52
55
|
google-cloud-errors (~> 1.0)
|
53
|
-
google-protobuf (3.22.2-x86_64-darwin)
|
54
56
|
google-protobuf (3.22.2-x86_64-linux)
|
55
57
|
googleapis-common-protos (1.4.0)
|
56
58
|
google-protobuf (~> 3.14)
|
@@ -65,9 +67,6 @@ GEM
|
|
65
67
|
multi_json (~> 1.11)
|
66
68
|
os (>= 0.9, < 2.0)
|
67
69
|
signet (>= 0.16, < 2.a)
|
68
|
-
grpc (1.53.0-x86_64-darwin)
|
69
|
-
google-protobuf (~> 3.21)
|
70
|
-
googleapis-common-protos-types (~> 1.0)
|
71
70
|
grpc (1.53.0-x86_64-linux)
|
72
71
|
google-protobuf (~> 3.21)
|
73
72
|
googleapis-common-protos-types (~> 1.0)
|
@@ -176,6 +175,7 @@ PLATFORMS
|
|
176
175
|
|
177
176
|
DEPENDENCIES
|
178
177
|
Icarus-Mod-Tools!
|
178
|
+
fuubar
|
179
179
|
guard (~> 2.18)
|
180
180
|
guard-rspec (~> 4.7)
|
181
181
|
pry (~> 0.14.1)
|
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 "
|
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", "
|
9
|
+
task.rspec_opts = ["--color", "--format", "Fuubar"]
|
14
10
|
end
|
15
11
|
|
16
|
-
task default: %i[spec
|
12
|
+
task default: %i[spec standard]
|
data/lib/icarus/mod/cli/base.rb
CHANGED
@@ -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
|
-
|
15
|
-
|
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
|
-
|
19
|
-
|
18
|
+
aliases: "-V", type: :boolean,
|
19
|
+
desc: "Print the version and exit"
|
20
20
|
|
21
21
|
def self.exit_on_failure?
|
22
22
|
true
|
data/lib/icarus/mod/cli/list.rb
CHANGED
@@ -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
|
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
|
-
|
12
|
-
|
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
|
data/lib/icarus/mod/github.rb
CHANGED
@@ -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
|
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
|
45
|
+
block&.call(entry)
|
46
46
|
@resources << entry # cache the file
|
47
47
|
end
|
48
48
|
end
|
49
49
|
|
50
|
-
@resources unless
|
50
|
+
@resources unless block
|
51
51
|
end
|
52
52
|
|
53
53
|
def find(pattern)
|
54
|
-
all_files { |file| return file if
|
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.
|
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.
|
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
|
147
|
+
@warnings << "Version should be a version string" unless /^\d+[.\d+]*/.match?(version)
|
148
148
|
end
|
149
149
|
end
|
150
150
|
end
|
@@ -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
|
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
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
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
|
data/lib/icarus/mod/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: Icarus-Mod-Tools
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.1.
|
4
|
+
version: 2.1.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Donovan Young
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-03-
|
11
|
+
date: 2023-03-27 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: google-cloud-firestore
|
@@ -75,8 +75,9 @@ extensions: []
|
|
75
75
|
extra_rdoc_files: []
|
76
76
|
files:
|
77
77
|
- ".rspec"
|
78
|
-
- ".rubocop.yml"
|
79
78
|
- ".ruby-version"
|
79
|
+
- ".standard.yml"
|
80
|
+
- ".standard_rubocop_extensions.yml"
|
80
81
|
- CHANGELOG.md
|
81
82
|
- Gemfile
|
82
83
|
- Gemfile.lock
|
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
|