Icarus-Mod-Tools 2.1.1 → 2.1.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: fe1b8b682bc6fad9f3f3e1ff5d59ce91c01d0b0bbc2829559d02de377b6aa2cd
4
- data.tar.gz: a603939b3a22718bf4ade414b948b7e61a9e63fbe8fc2f6d91d5e19a44c8ab87
3
+ metadata.gz: 6b11076691550f236dbbe8cffc43ab3f4e87d0d6bc3796a05249586884df9af7
4
+ data.tar.gz: 7c0c0dbeee725796ebea01ea3b8f0d1fd11418fc92aaad54ceca055ef36c83f0
5
5
  SHA512:
6
- metadata.gz: 5f6233e58dfcc6813490c722c815de710bebd68fc63d41183f3ee2ca50ed99b30ce17c0d126c53e87725716e94bd0a6df86ee115e3a469d24a4fe04988c08a4b
7
- data.tar.gz: d6f40ff2935cd7d01db4a0b8e1c734c25ea3735e3dd090b3621e1f5c765abc6bdc60c964a43bb2f3c24c24452b37ab1e31adca786f5cc9d487699bfa1748f820
6
+ metadata.gz: bb68f166b13d2d62e696d880a7ce63da51a0d941fd00211a6c63df28109808ee85f390090dcbf0c5bad35f5905b79d05b902a4be72b3366cc31a96ee908cc9d7
7
+ data.tar.gz: 55e3a9b353561d231cc58f6081f06f98d0204b9229d1fe1f404b0516e2dbd8e37a82297bb0bd610a3e11afc6f5409020409f9d3aec524d26c44b90b3790abfc7
data/CHANGELOG.md CHANGED
@@ -4,13 +4,10 @@ All notable changes to this project will be documented in this file.
4
4
 
5
5
  ## History (reverse chronological order)
6
6
 
7
- ## [2.0.2](https://github.com/DonovanMods/icarus-mod-tools/compare/v2.0.1...v2.0.2) (2023-02-04)
7
+ ### v2.1 - 2023-02-11
8
8
 
9
-
10
- ### Bug Fixes
11
-
12
- * Create fileType and fileURL along with files ([a5294a4](https://github.com/DonovanMods/icarus-mod-tools/commit/a5294a479bcc68f6e4125f5062db9a0dbd48bdf8))
13
- * Create fileType and fileURL along with files ([db5620f](https://github.com/DonovanMods/icarus-mod-tools/commit/db5620fafefd750196d6470f00e4000971adae1f))
9
+ - Remove support for `fileType` and `fileURL` in `modinfo.json` files
10
+ - bugfixes
14
11
 
15
12
  ### v2.0 - 2023-02-03
16
13
 
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- Icarus-Mod-Tools (2.1.1)
4
+ Icarus-Mod-Tools (2.1.2)
5
5
  google-cloud-firestore (~> 2.7)
6
6
  octokit (~> 6.0)
7
7
  paint (~> 2.3)
@@ -75,14 +75,12 @@ module Icarus
75
75
  return true if @validated
76
76
 
77
77
  validate_version
78
- validate_files if @data.key?(:files)
79
- validate_filetype(fileType) if @data.key?(:fileType)
80
78
 
81
79
  %w[name author description].each do |key|
82
80
  @errors << "#{key.capitalize} cannot be blank" unless validate_string(@data[key.to_sym])
83
81
  end
84
82
 
85
- %w[fileURL imageURL readmeURL].each do |key|
83
+ %w[imageURL readmeURL].each do |key|
86
84
  @errors << "Invalid URL #{key.capitalize}: #{@data[key.to_sym] || "blank"}" unless validate_url(@data[key.to_sym])
87
85
  end
88
86
 
@@ -128,8 +126,8 @@ module Icarus
128
126
  end
129
127
 
130
128
  def validate_files
131
- @errors << "This mod uses deprecated fields (fileType and fileURL)" if @data.key?(:file_type) || @data.key?(:file_url)
132
- @errors << "files cannot be blank" if @data.key?(:files) && @data[:files].keys.empty?
129
+ @warnings << "This mod uses deprecated fields (fileType and fileURL)" if @data.key?(:fileType) || @data.key?(:fileURL)
130
+ @warnings << "files should not be empty" if file_types.empty?
133
131
 
134
132
  file_types.each { |file_type| validate_filetype(file_type) }
135
133
 
@@ -14,19 +14,13 @@ module Icarus
14
14
  db_hash
15
15
  end
16
16
 
17
- def file_types
18
- files&.keys || [@data[:fileType] || "pak"]
19
- end
17
+ def validate
18
+ return true if @validated
20
19
 
21
- def file_urls
22
- files&.values || [@data[:fileURL]].compact
23
- end
20
+ validate_files
24
21
 
25
- # rubocop:disable Naming/MethodName
26
- def fileType
27
- @data[:fileType] || "pak"
22
+ super
28
23
  end
29
- # rubocop:enable Naming/MethodName
30
24
  end
31
25
  end
32
26
  end
@@ -24,6 +24,15 @@ module Icarus
24
24
  def filetype_pattern
25
25
  /(zip|exe)/i
26
26
  end
27
+
28
+ def validate
29
+ return true if @validated
30
+
31
+ validate_filetype(fileType)
32
+ @errors << "Invalid fileURL: #{@data[:fileURL] || "blank"}" unless validate_url(fileURL)
33
+
34
+ super
35
+ end
27
36
  end
28
37
  end
29
38
  end
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Icarus
4
4
  module Mod
5
- VERSION = "2.1.1"
5
+ VERSION = "2.1.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: 2.1.1
4
+ version: 2.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Donovan Young