ehbrs_ruby_utils 0.37.0 → 0.38.0

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: '0365428616b36993e94133bfda1881b65c61c70bd8cc2ae01ec04519f526aa90'
4
- data.tar.gz: 7e78ef2db711de57520a6972d866a12dd1bda77f9005afde8cbd00205f0400fd
3
+ metadata.gz: 375d67ec113f9773d1c7f89211884746357a5a56078b21d4f3dd0780385f87ac
4
+ data.tar.gz: fc600162f063b6c2bcd529876687422d62abcb2b663f0903f234b1724c7147a5
5
5
  SHA512:
6
- metadata.gz: 99b4c9666e6ffc6354ceb8844f00cbbde6589babd2e2510b3b79532ac2ca11c7fa1e33e922981dd84350e07b60bdb5404e24de20205bda44cb6c9f8cbe51e24d
7
- data.tar.gz: 49319dd7d128cbf917be5b8a0b8fcbf466b12a557a90d68f8c5d835bc1cee1a1691d4c3259520cfcb37791f6d763dae85b670aaae34120075aa1b451eb09da13
6
+ metadata.gz: 3e5e2d657e5fec5a8938a70cb69616572dea93bfbce5b855f5e34f8b2d9d621a6cf0de651cec2420873fd437997e0ee146d67bcbffbcaf0f35df6174cb51c66b
7
+ data.tar.gz: c23ae3131b15e9f96d8b59072950b916e36e52b4cfdf60c32498becc377d666acaefcd7e6a82f91c693bdb33bf689a3248f78af0057c2482b87bc085449ed550
@@ -17,7 +17,8 @@ module EhbrsRubyUtils
17
17
  {
18
18
  '-?' => %w[rar],
19
19
  '-h' => %w[unzip],
20
- '-version' => %w[ffmpeg ffprobe tar wit]
20
+ '-version' => %w[ffmpeg ffprobe],
21
+ '--version' => %w[isoinfo tar wit]
21
22
  }.each do |validate_arg, commands|
22
23
  commands.each do |command|
23
24
  define_method("#{command}_uncached") do
@@ -0,0 +1,32 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'eac_ruby_utils/core_ext'
4
+ require 'ehbrs_ruby_utils/executables'
5
+
6
+ module EhbrsRubyUtils
7
+ module Fs
8
+ class Iso9660File
9
+ DEFAULT_EXTNAME = '.iso'
10
+
11
+ common_constructor :path do
12
+ self.path = path.to_pathname
13
+ end
14
+
15
+ # @return [Array<String>]
16
+ def list
17
+ isoinfo_command('-f').execute!.each_line
18
+ end
19
+
20
+ # @param command_args [Array<String>]
21
+ # @return [EacRubyUtils::Envs::Command]
22
+ def isoinfo_command(*command_args)
23
+ ::EacRubyUtils::Envs.local.command('isoinfo', '-i', path, *command_args)
24
+ end
25
+
26
+ # @return [Boolean]
27
+ def valid?
28
+ isoinfo_command.execute.fetch(:exit_code).zero?
29
+ end
30
+ end
31
+ end
32
+ end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module EhbrsRubyUtils
4
- VERSION = '0.37.0'
4
+ VERSION = '0.38.0'
5
5
  end
@@ -0,0 +1,45 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'eac_ruby_utils/core_ext'
4
+ require 'ehbrs_ruby_utils/fs/iso_9660_file'
5
+
6
+ module EhbrsRubyUtils
7
+ module Vg
8
+ module Ps2
9
+ class IsoFile < ::EhbrsRubyUtils::Fs::Iso9660File
10
+ CODE_PATTERN = /[a-zA-Z]{4}_[0-9]{3}\.[0-9]{2}/.freeze
11
+ CODE_PARSER = CODE_PATTERN.to_parser(&:to_s)
12
+
13
+ # @return [String]
14
+ def code
15
+ list.lazy.map { |line| CODE_PARSER.parse(line) }.find(&:present?)
16
+ end
17
+
18
+ # @return [String]
19
+ def basename_nocode_noext
20
+ path.basename_noext.to_path.gsub(/\A#{::Regexp.quote(code)}/, '')
21
+ end
22
+
23
+ # @return [Path]
24
+ def target_path
25
+ path.basename_sub do |_b|
26
+ "#{code}.#{path_basename}#{DEFAULT_EXTNAME}"
27
+ end
28
+ end
29
+
30
+ # @return [Boolean]
31
+ def valid?
32
+ super && code.present?
33
+ end
34
+
35
+ private
36
+
37
+ # @return [String]
38
+ def path_basename
39
+ path.basename_noext.to_path.gsub(/\A#{::Regexp.quote(code)}/, '')
40
+ .gsub(/[^0-9a-zA-Z]+/, '_').gsub(/\A_+/, '').gsub(/_+\z/, '')
41
+ end
42
+ end
43
+ end
44
+ end
45
+ end
@@ -0,0 +1,11 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'eac_ruby_utils/core_ext'
4
+
5
+ module EhbrsRubyUtils
6
+ module Vg
7
+ module Ps2
8
+ require_sub __FILE__
9
+ end
10
+ end
11
+ end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ehbrs_ruby_utils
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.37.0
4
+ version: 0.38.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Eduardo H. Bogoni
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-11-04 00:00:00.000000000 Z
11
+ date: 2023-11-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: aranha
@@ -36,14 +36,14 @@ dependencies:
36
36
  requirements:
37
37
  - - "~>"
38
38
  - !ruby/object:Gem::Version
39
- version: '0.21'
39
+ version: '0.22'
40
40
  type: :runtime
41
41
  prerelease: false
42
42
  version_requirements: !ruby/object:Gem::Requirement
43
43
  requirements:
44
44
  - - "~>"
45
45
  - !ruby/object:Gem::Version
46
- version: '0.21'
46
+ version: '0.22'
47
47
  - !ruby/object:Gem::Dependency
48
48
  name: aranha-selenium
49
49
  requirement: !ruby/object:Gem::Requirement
@@ -64,14 +64,20 @@ dependencies:
64
64
  requirements:
65
65
  - - "~>"
66
66
  - !ruby/object:Gem::Version
67
- version: '0.81'
67
+ version: '0.84'
68
+ - - ">="
69
+ - !ruby/object:Gem::Version
70
+ version: 0.84.2
68
71
  type: :runtime
69
72
  prerelease: false
70
73
  version_requirements: !ruby/object:Gem::Requirement
71
74
  requirements:
72
75
  - - "~>"
73
76
  - !ruby/object:Gem::Version
74
- version: '0.81'
77
+ version: '0.84'
78
+ - - ">="
79
+ - !ruby/object:Gem::Version
80
+ version: 0.84.2
75
81
  - !ruby/object:Gem::Dependency
76
82
  name: dentaku
77
83
  requirement: !ruby/object:Gem::Requirement
@@ -126,20 +132,14 @@ dependencies:
126
132
  requirements:
127
133
  - - "~>"
128
134
  - !ruby/object:Gem::Version
129
- version: '0.119'
130
- - - ">="
131
- - !ruby/object:Gem::Version
132
- version: 0.119.2
135
+ version: '0.120'
133
136
  type: :runtime
134
137
  prerelease: false
135
138
  version_requirements: !ruby/object:Gem::Requirement
136
139
  requirements:
137
140
  - - "~>"
138
141
  - !ruby/object:Gem::Version
139
- version: '0.119'
140
- - - ">="
141
- - !ruby/object:Gem::Version
142
- version: 0.119.2
142
+ version: '0.120'
143
143
  - !ruby/object:Gem::Dependency
144
144
  name: eac_templates
145
145
  requirement: !ruby/object:Gem::Requirement
@@ -228,40 +228,20 @@ dependencies:
228
228
  - - ">="
229
229
  - !ruby/object:Gem::Version
230
230
  version: 0.1.3
231
- - !ruby/object:Gem::Dependency
232
- name: aranha-parsers
233
- requirement: !ruby/object:Gem::Requirement
234
- requirements:
235
- - - "~>"
236
- - !ruby/object:Gem::Version
237
- version: '0.8'
238
- type: :development
239
- prerelease: false
240
- version_requirements: !ruby/object:Gem::Requirement
241
- requirements:
242
- - - "~>"
243
- - !ruby/object:Gem::Version
244
- version: '0.8'
245
231
  - !ruby/object:Gem::Dependency
246
232
  name: eac_ruby_gem_support
247
233
  requirement: !ruby/object:Gem::Requirement
248
234
  requirements:
249
235
  - - "~>"
250
236
  - !ruby/object:Gem::Version
251
- version: '0.8'
252
- - - ">="
253
- - !ruby/object:Gem::Version
254
- version: 0.8.2
237
+ version: '0.9'
255
238
  type: :development
256
239
  prerelease: false
257
240
  version_requirements: !ruby/object:Gem::Requirement
258
241
  requirements:
259
242
  - - "~>"
260
243
  - !ruby/object:Gem::Version
261
- version: '0.8'
262
- - - ">="
263
- - !ruby/object:Gem::Version
264
- version: 0.8.2
244
+ version: '0.9'
265
245
  description:
266
246
  email:
267
247
  executables: []
@@ -320,6 +300,7 @@ files:
320
300
  - lib/ehbrs_ruby_utils/finances/bb_browser/docker_image.rb
321
301
  - lib/ehbrs_ruby_utils/fs.rb
322
302
  - lib/ehbrs_ruby_utils/fs/compressed_package.rb
303
+ - lib/ehbrs_ruby_utils/fs/iso_9660_file.rb
323
304
  - lib/ehbrs_ruby_utils/fs/selected.rb
324
305
  - lib/ehbrs_ruby_utils/fs/selected/build.rb
325
306
  - lib/ehbrs_ruby_utils/fs/selected/build_file.rb
@@ -344,6 +325,8 @@ files:
344
325
  - lib/ehbrs_ruby_utils/patches/object/template.rb
345
326
  - lib/ehbrs_ruby_utils/version.rb
346
327
  - lib/ehbrs_ruby_utils/vg.rb
328
+ - lib/ehbrs_ruby_utils/vg/ps2.rb
329
+ - lib/ehbrs_ruby_utils/vg/ps2/iso_file.rb
347
330
  - lib/ehbrs_ruby_utils/vg/wii.rb
348
331
  - lib/ehbrs_ruby_utils/vg/wii/file_move.rb
349
332
  - lib/ehbrs_ruby_utils/vg/wii/game_file.rb