ehbrs-tools 0.42.0 → 0.43.1

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: 17103baebd9aeaadd439e2f9d655af21e97ce4e5e717e4d95220cef79eb5822e
4
- data.tar.gz: 41818ac788289578893d8f4c3717e848029c59d9a43ed2c60f2c99fd8db8a8db
3
+ metadata.gz: e45e64b77ae77e9af92cfafbb577fa7987e606d7f0fa93664a75deb062f67a27
4
+ data.tar.gz: 3dc86a1836d04c33388fb6507b9f97445e401fb9018f6c6c83ea4d517262eccf
5
5
  SHA512:
6
- metadata.gz: cdb1007d0ad9b51d7833bf82914e9f1c64082a43c08f6dc5fadab0301ed20d9feccca382e00ecdafc052b3f7d3063693143db976ae4c92ea614365b736e0277d
7
- data.tar.gz: 9c39e8cda2a8bf90ffa4cf96bedeab2fbbca4bca8c48961636b32d3017fd60b208e29787d3899b11c4d314ce5ed00aa34e7240926c06435555c5ff25b68e8f34
6
+ metadata.gz: daa939efe9ee2a69b8157ff770ef8b6fea1438500504da2caa4dd15ae74ee233b4ce6f59e3a8a34ff227fe1b7a26cee413bfd5de31defcda34dc98745c039460
7
+ data.tar.gz: acb4a84c2577bb957dc821a991ae4651b2026daccf07b46301a7eee0a7e5cb61021536ae8663ad494ffab7a7256c0d08529d9601c61eddaa28b10258d761357d
data/Gemfile.lock CHANGED
@@ -1,47 +1,43 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- ehbrs-tools (0.42.0)
5
- avm-files (~> 0.7)
4
+ ehbrs-tools (0.43.1)
5
+ avm-files (~> 0.8, >= 0.8.1)
6
+ avm-tools (~> 0.162)
6
7
  eac_cli (~> 0.42)
8
+ eac_fs (~> 0.18, >= 0.18.1)
7
9
  eac_ruby_base0 (~> 0.19)
8
- eac_ruby_utils (~> 0.122)
9
- ehbrs_ruby_utils (~> 0.44)
10
+ eac_ruby_utils (~> 0.124)
11
+ ehbrs_ruby_utils (~> 0.44, >= 0.44.3)
10
12
  filesize (~> 0.2)
11
13
  os (~> 1.1, >= 1.1.4)
12
14
  telegram-bot-ruby (~> 0.23)
13
15
 
14
16
  PATH
15
- remote: sub/aranha-selenium
16
- specs:
17
- aranha-selenium (0.11.0)
18
- eac_fs (~> 0.17)
19
- eac_ruby_utils (~> 0.122)
20
- eac_templates (~> 0.7)
21
- selenium-webdriver (~> 3.142, >= 3.142.7)
22
-
23
- PATH
24
- remote: sub/eac_cli
17
+ remote: sub/aranha-parsers
25
18
  specs:
26
- eac_cli (0.42.0)
27
- colorize (~> 0.8, >= 0.8.1)
28
- eac_config (~> 0.14, >= 0.14.2)
29
- eac_ruby_utils (~> 0.122)
30
- tty-table (~> 0.12)
19
+ aranha-parsers (0.25.0)
20
+ activesupport (>= 4.0.0)
21
+ addressable (~> 2.8, >= 2.8.7)
22
+ eac_envs-http (~> 0.6, >= 0.6.1)
23
+ eac_ruby_utils (~> 0.124)
24
+ nokogiri (~> 1.15, >= 1.15.7)
25
+ ofx-parser (~> 1.1)
31
26
 
32
27
  PATH
33
28
  remote: sub/ehbrs_ruby_utils
34
29
  specs:
35
- ehbrs_ruby_utils (0.44.0)
30
+ ehbrs_ruby_utils (0.44.3)
36
31
  aranha (~> 0.19, >= 0.19.2)
37
- aranha-parsers (~> 0.22)
38
- aranha-selenium (~> 0.11)
39
- avm (~> 0.92)
40
- dentaku (~> 3.5, >= 3.5.2)
41
- eac_fs (~> 0.17)
32
+ aranha-parsers (~> 0.25)
33
+ aranha-selenium (~> 0.11, >= 0.11.1)
34
+ avm (~> 0.94, >= 0.94.1)
35
+ avm-eac_rails_base0 (~> 0.11, >= 0.11.1)
36
+ dentaku (~> 3.5, >= 3.5.4)
37
+ eac_fs (~> 0.18, >= 0.18.1)
42
38
  eac_rest (~> 0.12)
43
- eac_ruby_utils (~> 0.122)
44
- eac_templates (~> 0.7)
39
+ eac_ruby_utils (~> 0.124)
40
+ eac_templates (~> 0.7, >= 0.7.1)
45
41
  inifile (~> 3.0)
46
42
  srt (~> 0.1, >= 0.1.5)
47
43
  taglib-ruby (~> 1.1, >= 1.1.3)
@@ -50,84 +46,118 @@ PATH
50
46
  GEM
51
47
  remote: https://rubygems.org/
52
48
  specs:
53
- activesupport (6.1.7.8)
49
+ activesupport (6.1.7.10)
54
50
  concurrent-ruby (~> 1.0, >= 1.0.2)
55
51
  i18n (>= 1.6, < 2)
56
52
  minitest (>= 5.1)
57
53
  tzinfo (~> 2.0)
58
54
  zeitwerk (~> 2.3)
59
- addressable (2.8.6)
60
- public_suffix (>= 2.0.2, < 6.0)
55
+ addressable (2.8.7)
56
+ public_suffix (>= 2.0.2, < 7.0)
61
57
  aranha (0.19.2)
62
58
  aranha-parsers (~> 0.18)
63
59
  aranha-selenium (~> 0.5)
64
60
  eac_ruby_utils (~> 0.116)
65
- aranha-parsers (0.22.0)
66
- activesupport (>= 4.0.0)
67
- addressable (~> 2.8, >= 2.8.5)
68
- eac_envs-http (~> 0.4, >= 0.4.1)
69
- eac_ruby_utils (~> 0.119, >= 0.119.2)
70
- nokogiri (~> 1.15, >= 1.15.4)
71
- ofx-parser (~> 1.1)
72
- ast (2.4.2)
73
- avm (0.92.0)
74
- eac_cli (~> 0.41)
75
- eac_config (~> 0.14, >= 0.14.2)
76
- eac_docker (~> 0.7)
61
+ aranha-selenium (0.11.1)
77
62
  eac_fs (~> 0.17)
78
63
  eac_ruby_utils (~> 0.122)
79
64
  eac_templates (~> 0.7)
80
- minitar (~> 0.9)
65
+ selenium-webdriver (~> 3.142, >= 3.142.7)
66
+ ast (2.4.2)
67
+ avm (0.94.1)
68
+ eac_cli (~> 0.42)
69
+ eac_config (~> 0.14, >= 0.14.3)
70
+ eac_docker (~> 0.7)
71
+ eac_fs (~> 0.18, >= 0.18.1)
72
+ eac_ruby_utils (~> 0.124)
73
+ eac_templates (~> 0.7, >= 0.7.1)
74
+ minitar (~> 0.12, >= 0.12.1)
81
75
  ruby-progressbar (~> 1.13)
82
- avm-eac_generic_base0 (0.13.0)
83
- avm (~> 0.90)
76
+ avm-eac_generic_base0 (0.14.0)
77
+ avm (~> 0.94, >= 0.94.1)
78
+ eac_ruby_utils (~> 0.124)
79
+ avm-eac_postgresql_base0 (0.5.3)
80
+ avm (~> 0.85)
81
+ eac_ruby_utils (~> 0.121)
82
+ avm-eac_rails_base0 (0.11.1)
83
+ avm-eac_rails_base1 (~> 0.10)
84
84
  eac_ruby_utils (~> 0.121)
85
- avm-eac_ruby_base1 (0.34.1)
86
- avm (~> 0.92)
85
+ avm-eac_rails_base1 (0.10.2)
86
+ avm (~> 0.94)
87
+ avm-eac_ruby_base1 (~> 0.35, >= 0.35.1)
88
+ avm-eac_webapp_base0 (~> 0.20, >= 0.20.1)
89
+ eac_ruby_utils (~> 0.123)
90
+ avm-eac_ruby_base1 (0.35.1)
91
+ avm (~> 0.94)
87
92
  avm-eac_generic_base0 (~> 0.13)
88
93
  eac_envs-http (~> 0.5, >= 0.5.1)
89
94
  eac_ruby_utils (~> 0.122)
90
- avm-files (0.7.0)
91
- avm (~> 0.84, >= 0.84.2)
92
- eac_cli (~> 0.40)
93
- eac_fs (~> 0.17)
95
+ avm-eac_ubuntu_base0 (0.5.1)
96
+ avm (~> 0.86, >= 0.86.2)
94
97
  eac_ruby_utils (~> 0.121)
95
98
  eac_templates (~> 0.5, >= 0.5.1)
99
+ avm-eac_webapp_base0 (0.20.1)
100
+ avm (~> 0.94)
101
+ avm-eac_generic_base0 (~> 0.13)
102
+ avm-eac_postgresql_base0 (~> 0.5, >= 0.5.3)
103
+ avm-eac_ubuntu_base0 (~> 0.5, >= 0.5.1)
104
+ avm-files (~> 0.8)
105
+ eac_ruby_utils (~> 0.122)
106
+ htmlbeautifier (~> 1.4, >= 1.4.3)
107
+ avm-files (0.8.1)
108
+ avm (~> 0.93)
109
+ eac_cli (~> 0.42)
110
+ eac_fs (~> 0.18)
111
+ eac_ruby_utils (~> 0.122)
112
+ eac_templates (~> 0.7, >= 0.7.1)
113
+ avm-tools (0.162.0)
114
+ avm (~> 0.94)
115
+ clipboard (~> 1.4, >= 1.4.1)
116
+ eac_ruby_base0 (~> 0.19)
96
117
  axiom-types (0.1.1)
97
118
  descendants_tracker (~> 0.0.4)
98
119
  ice_nine (~> 0.11.0)
99
120
  thread_safe (~> 0.3, >= 0.3.1)
100
121
  base64 (0.2.0)
122
+ bigdecimal (3.1.8)
101
123
  childprocess (3.0.0)
124
+ clipboard (1.4.1)
102
125
  coercible (1.0.0)
103
126
  descendants_tracker (~> 0.0.1)
104
127
  colorize (0.8.1)
105
- concurrent-ruby (1.3.2)
128
+ concurrent-ruby (1.3.4)
106
129
  content-type (0.0.2)
107
130
  parslet (~> 2.0)
108
- dentaku (3.5.2)
131
+ dentaku (3.5.4)
132
+ bigdecimal
109
133
  concurrent-ruby
110
134
  descendants_tracker (0.0.4)
111
135
  thread_safe (~> 0.3, >= 0.3.1)
112
136
  diff-lcs (1.5.1)
113
- dry-inflector (1.0.0)
114
- eac_config (0.14.2)
115
- addressable (~> 2.8, >= 2.8.6)
116
- eac_ruby_utils (~> 0.121)
137
+ dry-inflector (1.1.0)
138
+ eac_cli (0.42.0)
139
+ colorize (~> 0.8, >= 0.8.1)
140
+ eac_config (~> 0.14, >= 0.14.2)
141
+ eac_ruby_utils (~> 0.122)
142
+ tty-table (~> 0.12)
143
+ eac_config (0.14.3)
144
+ addressable (~> 2.8, >= 2.8.7)
145
+ eac_ruby_utils (~> 0.124)
117
146
  eac_docker (0.7.0)
118
147
  eac_ruby_utils (~> 0.112)
119
148
  eac_templates (~> 0.3, >= 0.3.2)
120
- eac_envs-http (0.5.1)
121
- eac_fs (~> 0.17)
122
- eac_ruby_utils (~> 0.120)
123
- faraday (~> 2.7, >= 2.7.12)
149
+ eac_envs-http (0.6.1)
150
+ eac_fs (~> 0.18, >= 0.18.1)
151
+ eac_ruby_utils (~> 0.123)
152
+ faraday (~> 2.8, >= 2.8.1)
124
153
  faraday-follow_redirects (~> 0.3)
125
154
  faraday-gzip (~> 0.1)
126
155
  faraday-multipart (~> 1.0, >= 1.0.4)
127
- faraday-retry (~> 2.2)
128
- eac_fs (0.17.0)
156
+ faraday-retry (~> 2.2, >= 2.2.1)
157
+ random-port (~> 0.7, >= 0.7.1)
158
+ eac_fs (0.18.1)
129
159
  content-type (~> 0.0, >= 0.0.2)
130
- eac_ruby_utils (~> 0.120)
160
+ eac_ruby_utils (~> 0.123)
131
161
  ruby-filemagic (~> 0.7, >= 0.7.3)
132
162
  eac_rest (0.12.0)
133
163
  eac_envs-http (~> 0.5)
@@ -144,13 +174,13 @@ GEM
144
174
  rubocop (~> 1.60, >= 1.60.1)
145
175
  rubocop-rails (~> 2.23, >= 2.23.1)
146
176
  rubocop-rspec (~> 2.26, >= 2.26.1)
147
- eac_ruby_utils (0.122.0)
177
+ eac_ruby_utils (0.124.0)
148
178
  activesupport (>= 4, < 7)
149
- addressable (~> 2.8, >= 2.8.6)
179
+ addressable (~> 2.8, >= 2.8.7)
150
180
  bundler
151
181
  filesize (~> 0.2)
152
182
  net-ssh (~> 4.2)
153
- eac_templates (0.7.0)
183
+ eac_templates (0.7.1)
154
184
  eac_config (~> 0.14, >= 0.14.2)
155
185
  eac_ruby_utils (~> 0.122)
156
186
  faraday (2.8.1)
@@ -169,77 +199,76 @@ GEM
169
199
  faraday (~> 2.0)
170
200
  filesize (0.2.0)
171
201
  hpricot (0.8.6)
172
- i18n (1.14.5)
202
+ htmlbeautifier (1.4.3)
203
+ i18n (1.14.6)
173
204
  concurrent-ruby (~> 1.0)
174
205
  ice_nine (0.11.2)
175
206
  inifile (3.0.0)
176
- json (2.7.2)
207
+ json (2.9.0)
177
208
  language_server-protocol (3.17.0.3)
178
- minitar (0.9)
179
- minitest (5.23.1)
209
+ minitar (0.12.1)
210
+ minitest (5.25.4)
180
211
  multipart-post (2.4.1)
181
212
  net-ssh (4.2.0)
182
- nokogiri (1.15.6-x86_64-linux)
213
+ nokogiri (1.15.7-x86_64-linux)
183
214
  racc (~> 1.4)
184
215
  ofx-parser (1.1.0)
185
216
  hpricot (>= 0.6)
186
217
  os (1.1.4)
187
- parallel (1.25.1)
188
- parser (3.3.2.0)
218
+ parallel (1.26.3)
219
+ parser (3.3.6.0)
189
220
  ast (~> 2.4.1)
190
221
  racc
191
222
  parslet (2.0.0)
192
223
  pastel (0.8.0)
193
224
  tty-color (~> 0.5)
194
- public_suffix (5.0.5)
195
- racc (1.8.0)
196
- rack (3.0.11)
225
+ public_suffix (5.1.1)
226
+ racc (1.8.1)
227
+ rack (3.1.8)
197
228
  rainbow (3.1.1)
198
- regexp_parser (2.9.2)
199
- rexml (3.2.9)
200
- strscan
229
+ random-port (0.7.1)
230
+ regexp_parser (2.9.3)
201
231
  rspec (3.13.0)
202
232
  rspec-core (~> 3.13.0)
203
233
  rspec-expectations (~> 3.13.0)
204
234
  rspec-mocks (~> 3.13.0)
205
- rspec-core (3.13.0)
235
+ rspec-core (3.13.2)
206
236
  rspec-support (~> 3.13.0)
207
- rspec-expectations (3.13.0)
237
+ rspec-expectations (3.13.3)
208
238
  diff-lcs (>= 1.2.0, < 2.0)
209
239
  rspec-support (~> 3.13.0)
210
- rspec-mocks (3.13.1)
240
+ rspec-mocks (3.13.2)
211
241
  diff-lcs (>= 1.2.0, < 2.0)
212
242
  rspec-support (~> 3.13.0)
213
- rspec-support (3.13.1)
214
- rubocop (1.64.1)
243
+ rspec-support (3.13.2)
244
+ rubocop (1.69.1)
215
245
  json (~> 2.3)
216
246
  language_server-protocol (>= 3.17.0)
217
247
  parallel (~> 1.10)
218
248
  parser (>= 3.3.0.2)
219
249
  rainbow (>= 2.2.2, < 4.0)
220
- regexp_parser (>= 1.8, < 3.0)
221
- rexml (>= 3.2.5, < 4.0)
222
- rubocop-ast (>= 1.31.1, < 2.0)
250
+ regexp_parser (>= 2.9.3, < 3.0)
251
+ rubocop-ast (>= 1.36.2, < 2.0)
223
252
  ruby-progressbar (~> 1.7)
224
- unicode-display_width (>= 2.4.0, < 3.0)
225
- rubocop-ast (1.31.3)
253
+ unicode-display_width (>= 2.4.0, < 4.0)
254
+ rubocop-ast (1.36.2)
226
255
  parser (>= 3.3.1.0)
227
256
  rubocop-capybara (2.21.0)
228
257
  rubocop (~> 1.41)
229
- rubocop-factory_bot (2.26.0)
230
- rubocop (~> 1.41)
231
- rubocop-rails (2.25.0)
258
+ rubocop-factory_bot (2.26.1)
259
+ rubocop (~> 1.61)
260
+ rubocop-rails (2.27.0)
232
261
  activesupport (>= 4.2.0)
233
262
  rack (>= 1.1)
234
- rubocop (>= 1.33.0, < 2.0)
263
+ rubocop (>= 1.52.0, < 2.0)
235
264
  rubocop-ast (>= 1.31.1, < 2.0)
236
265
  rubocop-rspec (2.31.0)
237
266
  rubocop (~> 1.40)
238
267
  rubocop-capybara (~> 2.17)
239
268
  rubocop-factory_bot (~> 2.22)
240
269
  rubocop-rspec_rails (~> 2.28)
241
- rubocop-rspec_rails (2.29.0)
242
- rubocop (~> 1.40)
270
+ rubocop-rspec_rails (2.29.1)
271
+ rubocop (~> 1.61)
243
272
  ruby-filemagic (0.7.3)
244
273
  ruby-progressbar (1.13.0)
245
274
  ruby2_keywords (0.0.5)
@@ -253,7 +282,6 @@ GEM
253
282
  unicode-display_width (>= 1.5, < 3.0)
254
283
  unicode_utils (~> 1.4)
255
284
  strings-ansi (0.2.0)
256
- strscan (3.1.0)
257
285
  taglib-ruby (1.1.3)
258
286
  telegram-bot-ruby (0.23.0)
259
287
  dry-inflector
@@ -272,22 +300,21 @@ GEM
272
300
  ultimate_lyrics (0.1.3)
273
301
  aranha-parsers (~> 0.10)
274
302
  eac_ruby_utils (~> 0.102, >= 0.102.1)
275
- unicode-display_width (2.5.0)
303
+ unicode-display_width (2.6.0)
276
304
  unicode_utils (1.4.0)
277
305
  virtus (2.0.0)
278
306
  axiom-types (~> 0.1)
279
307
  coercible (~> 1.0)
280
308
  descendants_tracker (~> 0.0, >= 0.0.3)
281
- zeitwerk (2.6.15)
309
+ zeitwerk (2.6.18)
282
310
  zlib (2.1.1)
283
311
 
284
312
  PLATFORMS
285
313
  x86_64-linux
286
314
 
287
315
  DEPENDENCIES
288
- aranha-selenium!
289
- eac_cli!
290
- eac_ruby_gem_support (~> 0.9)
316
+ aranha-parsers!
317
+ eac_ruby_gem_support (~> 0.10)
291
318
  ehbrs-tools!
292
319
  ehbrs_ruby_utils!
293
320
 
@@ -16,7 +16,8 @@ module Ehbrs
16
16
  private
17
17
 
18
18
  {
19
- '--version' => %w[flips]
19
+ '--version' => %w[flips],
20
+ '-V' => %w[xdelta3]
20
21
  }.each do |validate_arg, commands|
21
22
  commands.each do |command|
22
23
  define_method("#{command}_uncached") do
@@ -2,13 +2,14 @@
2
2
 
3
3
  require 'eac_cli/core_ext'
4
4
  require 'eac_ruby_utils/fs/temp'
5
- require 'ehbrs/tools/executables'
5
+ require 'ehbrs/tools/vg/patches/applier_factory'
6
+ require 'ehbrs/tools/vg/patches/temp_files'
6
7
 
7
8
  module Ehbrs
8
9
  module Tools
9
10
  class Runner
10
11
  class Vg
11
- class Ips
12
+ class Patch
12
13
  runner_with :help do
13
14
  desc 'Aplica patches IPS em roms.'
14
15
  arg_opt '-o', '--output-file', ' Saída no arquivo <output-file>.'
@@ -29,21 +30,14 @@ module Ehbrs
29
30
  def on_temp_files
30
31
  ::EacRubyUtils::Fs::Temp.on_file do |input|
31
32
  ::EacRubyUtils::Fs::Temp.on_file do |output|
32
- yield TempFiles.new(source_file, input, output)
33
+ yield ::Ehbrs::Tools::Vg::Patches::TempFiles.new(source_file, input, output)
33
34
  end
34
35
  end
35
36
  end
36
37
 
37
38
  def run_patch(source_path, ips_path, output_path)
38
- command = ::Ehbrs::Tools::Executables.flips.command
39
- .append(['--apply', ips_path, source_path, output_path])
40
-
41
- command.system!
42
-
43
- return if output_path.exist?
44
-
45
- fatal_error("\"#{command}\" exited without error, but output file \"#{output_path}\"" \
46
- 'does not exist')
39
+ ::Ehbrs::Tools::Vg::Patches::ApplierFactory.new(ips_path)
40
+ .apply(source_path, output_path)
47
41
  end
48
42
 
49
43
  def run_patches
@@ -105,35 +99,6 @@ module Ehbrs
105
99
 
106
100
  fatal_error("Arquivo de saída \"#{output_file}\" já existe")
107
101
  end
108
-
109
- class TempFiles
110
- common_constructor :initial, :temp0, :temp1
111
-
112
- def input
113
- swaped? ? temp0 : initial
114
- end
115
-
116
- def move_result_to(dest)
117
- return unless swaped?
118
-
119
- ::FileUtils.mv(temp0.to_path, dest.to_path)
120
- end
121
-
122
- def output
123
- temp1
124
- end
125
-
126
- def swap
127
- temp0_current = temp0
128
- self.temp0 = temp1
129
- self.temp1 = temp0_current
130
- @swaped = true
131
- end
132
-
133
- def swaped?
134
- @swaped ? true : false
135
- end
136
- end
137
102
  end
138
103
  end
139
104
  end
@@ -1,5 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
+ require 'avm/tools/runner'
3
4
  require 'eac_ruby_base0/runner'
4
5
  require 'ehbrs/tools/application'
5
6
 
@@ -16,6 +17,12 @@ module Ehbrs
16
17
  def application
17
18
  ::Ehbrs::Tools.application
18
19
  end
20
+
21
+ def extra_available_subcommands
22
+ {
23
+ 'avm' => ::Avm::Tools::Runner
24
+ }
25
+ end
19
26
  end
20
27
  end
21
28
  end
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Ehbrs
4
4
  module Tools
5
- VERSION = '0.42.0'
5
+ VERSION = '0.43.1'
6
6
  end
7
7
  end
@@ -0,0 +1,43 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'eac_fs/core_ext'
4
+ require 'ehbrs/tools/vg/patches/ips_applier'
5
+ require 'ehbrs/tools/vg/patches/vcdiff_applier'
6
+
7
+ module Ehbrs
8
+ module Tools
9
+ module Vg
10
+ module Patches
11
+ class ApplierFactory
12
+ APPLIERS_BY_TYPE = {
13
+ 'IPS patch file' => ::Ehbrs::Tools::Vg::Patches::IpsApplier,
14
+ 'VCDIFF binary diff' => ::Ehbrs::Tools::Vg::Patches::VcdiffApplier
15
+ }.freeze
16
+
17
+ enable_simple_cache
18
+ common_constructor :patch_path do
19
+ self.patch_path = patch_path.to_pathname
20
+ end
21
+ delegate :apply, to: :applier_instance
22
+
23
+ # @return [String]
24
+ def patch_type
25
+ patch_path.info.description
26
+ end
27
+
28
+ protected
29
+
30
+ # @return [Class]
31
+ def applier_class_uncached
32
+ APPLIERS_BY_TYPE.fetch(patch_type)
33
+ end
34
+
35
+ # @return [Object]
36
+ def applier_instance_uncached
37
+ applier_class.new(patch_path)
38
+ end
39
+ end
40
+ end
41
+ end
42
+ end
43
+ end
@@ -0,0 +1,37 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'eac_ruby_utils/core_ext'
4
+
5
+ module Ehbrs
6
+ module Tools
7
+ module Vg
8
+ module Patches
9
+ class BaseApplier
10
+ acts_as_abstract
11
+ common_constructor :patch_path
12
+
13
+ # @param source_path [Pathname]
14
+ # @param output_path [Pathname]
15
+ # @raise [RuntimeError] Se o arquivo de saída não é criado.
16
+ def apply(source_path, output_path)
17
+ source_path = source_path.to_pathname
18
+ output_path = output_path.to_pathname
19
+ command(source_path, output_path).system!
20
+
21
+ return if output_path.exist?
22
+
23
+ fatal_error("Applier returned without error, but output file \"#{output_path}\"" \
24
+ 'does not exist')
25
+ end
26
+
27
+ # @param source_path [Pathname]
28
+ # @param output_path [Pathname]
29
+ # @return [EacRubyUtils::Envs::Command]
30
+ def command(source_path, output_path)
31
+ raise_abstract_method __method__, source_path, output_path
32
+ end
33
+ end
34
+ end
35
+ end
36
+ end
37
+ end
@@ -0,0 +1,23 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'eac_ruby_utils/core_ext'
4
+ require 'ehbrs/tools/executables'
5
+ require 'ehbrs/tools/vg/patches/base_applier'
6
+
7
+ module Ehbrs
8
+ module Tools
9
+ module Vg
10
+ module Patches
11
+ class IpsApplier < ::Ehbrs::Tools::Vg::Patches::BaseApplier
12
+ # @param source_path [Pathname]
13
+ # @param output_path [Pathname]
14
+ # @return [EacRubyUtils::Envs::Command]
15
+ def command(source_path, output_path)
16
+ ::Ehbrs::Tools::Executables.flips.command
17
+ .append(['--apply', patch_path, source_path, output_path])
18
+ end
19
+ end
20
+ end
21
+ end
22
+ end
23
+ end
@@ -0,0 +1,40 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'eac_ruby_utils/core_ext'
4
+
5
+ module Ehbrs
6
+ module Tools
7
+ module Vg
8
+ module Patches
9
+ class TempFiles
10
+ common_constructor :initial, :temp0, :temp1
11
+
12
+ def input
13
+ swaped? ? temp0 : initial
14
+ end
15
+
16
+ def move_result_to(dest)
17
+ return unless swaped?
18
+
19
+ ::FileUtils.mv(temp0.to_path, dest.to_path)
20
+ end
21
+
22
+ def output
23
+ temp1
24
+ end
25
+
26
+ def swap
27
+ temp0_current = temp0
28
+ self.temp0 = temp1
29
+ self.temp1 = temp0_current
30
+ @swaped = true
31
+ end
32
+
33
+ def swaped?
34
+ @swaped ? true : false
35
+ end
36
+ end
37
+ end
38
+ end
39
+ end
40
+ end
@@ -0,0 +1,23 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'eac_ruby_utils/core_ext'
4
+ require 'ehbrs/tools/executables'
5
+ require 'ehbrs/tools/vg/patches/base_applier'
6
+
7
+ module Ehbrs
8
+ module Tools
9
+ module Vg
10
+ module Patches
11
+ class VcdiffApplier < ::Ehbrs::Tools::Vg::Patches::BaseApplier
12
+ # @param source_path [Pathname]
13
+ # @param output_path [Pathname]
14
+ # @return [EacRubyUtils::Envs::Command]
15
+ def command(source_path, output_path)
16
+ ::Ehbrs::Tools::Executables.xdelta3.command
17
+ .append(['-d', '-s', source_path, patch_path, output_path])
18
+ end
19
+ end
20
+ end
21
+ end
22
+ end
23
+ end
@@ -0,0 +1,13 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'eac_ruby_utils/core_ext'
4
+
5
+ module Ehbrs
6
+ module Tools
7
+ module Vg
8
+ module Patches
9
+ require_sub __FILE__
10
+ end
11
+ end
12
+ end
13
+ end
@@ -0,0 +1,11 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'eac_ruby_utils/core_ext'
4
+
5
+ module Ehbrs
6
+ module Tools
7
+ module Vg
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-tools
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.42.0
4
+ version: 0.43.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Esquilo Azul Company
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2024-06-09 00:00:00.000000000 Z
11
+ date: 2024-12-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: avm-files
@@ -16,14 +16,34 @@ dependencies:
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: '0.7'
19
+ version: '0.8'
20
+ - - ">="
21
+ - !ruby/object:Gem::Version
22
+ version: 0.8.1
20
23
  type: :runtime
21
24
  prerelease: false
22
25
  version_requirements: !ruby/object:Gem::Requirement
23
26
  requirements:
24
27
  - - "~>"
25
28
  - !ruby/object:Gem::Version
26
- version: '0.7'
29
+ version: '0.8'
30
+ - - ">="
31
+ - !ruby/object:Gem::Version
32
+ version: 0.8.1
33
+ - !ruby/object:Gem::Dependency
34
+ name: avm-tools
35
+ requirement: !ruby/object:Gem::Requirement
36
+ requirements:
37
+ - - "~>"
38
+ - !ruby/object:Gem::Version
39
+ version: '0.162'
40
+ type: :runtime
41
+ prerelease: false
42
+ version_requirements: !ruby/object:Gem::Requirement
43
+ requirements:
44
+ - - "~>"
45
+ - !ruby/object:Gem::Version
46
+ version: '0.162'
27
47
  - !ruby/object:Gem::Dependency
28
48
  name: eac_cli
29
49
  requirement: !ruby/object:Gem::Requirement
@@ -38,6 +58,26 @@ dependencies:
38
58
  - - "~>"
39
59
  - !ruby/object:Gem::Version
40
60
  version: '0.42'
61
+ - !ruby/object:Gem::Dependency
62
+ name: eac_fs
63
+ requirement: !ruby/object:Gem::Requirement
64
+ requirements:
65
+ - - "~>"
66
+ - !ruby/object:Gem::Version
67
+ version: '0.18'
68
+ - - ">="
69
+ - !ruby/object:Gem::Version
70
+ version: 0.18.1
71
+ type: :runtime
72
+ prerelease: false
73
+ version_requirements: !ruby/object:Gem::Requirement
74
+ requirements:
75
+ - - "~>"
76
+ - !ruby/object:Gem::Version
77
+ version: '0.18'
78
+ - - ">="
79
+ - !ruby/object:Gem::Version
80
+ version: 0.18.1
41
81
  - !ruby/object:Gem::Dependency
42
82
  name: eac_ruby_base0
43
83
  requirement: !ruby/object:Gem::Requirement
@@ -58,14 +98,14 @@ dependencies:
58
98
  requirements:
59
99
  - - "~>"
60
100
  - !ruby/object:Gem::Version
61
- version: '0.122'
101
+ version: '0.124'
62
102
  type: :runtime
63
103
  prerelease: false
64
104
  version_requirements: !ruby/object:Gem::Requirement
65
105
  requirements:
66
106
  - - "~>"
67
107
  - !ruby/object:Gem::Version
68
- version: '0.122'
108
+ version: '0.124'
69
109
  - !ruby/object:Gem::Dependency
70
110
  name: ehbrs_ruby_utils
71
111
  requirement: !ruby/object:Gem::Requirement
@@ -73,6 +113,9 @@ dependencies:
73
113
  - - "~>"
74
114
  - !ruby/object:Gem::Version
75
115
  version: '0.44'
116
+ - - ">="
117
+ - !ruby/object:Gem::Version
118
+ version: 0.44.3
76
119
  type: :runtime
77
120
  prerelease: false
78
121
  version_requirements: !ruby/object:Gem::Requirement
@@ -80,6 +123,9 @@ dependencies:
80
123
  - - "~>"
81
124
  - !ruby/object:Gem::Version
82
125
  version: '0.44'
126
+ - - ">="
127
+ - !ruby/object:Gem::Version
128
+ version: 0.44.3
83
129
  - !ruby/object:Gem::Dependency
84
130
  name: filesize
85
131
  requirement: !ruby/object:Gem::Requirement
@@ -134,14 +180,14 @@ dependencies:
134
180
  requirements:
135
181
  - - "~>"
136
182
  - !ruby/object:Gem::Version
137
- version: '0.9'
183
+ version: '0.10'
138
184
  type: :development
139
185
  prerelease: false
140
186
  version_requirements: !ruby/object:Gem::Requirement
141
187
  requirements:
142
188
  - - "~>"
143
189
  - !ruby/object:Gem::Version
144
- version: '0.9'
190
+ version: '0.10'
145
191
  description:
146
192
  email:
147
193
  executables:
@@ -195,7 +241,7 @@ files:
195
241
  - lib/ehbrs/tools/runner/telegram.rb
196
242
  - lib/ehbrs/tools/runner/telegram/send_message.rb
197
243
  - lib/ehbrs/tools/runner/vg.rb
198
- - lib/ehbrs/tools/runner/vg/ips.rb
244
+ - lib/ehbrs/tools/runner/vg/patch.rb
199
245
  - lib/ehbrs/tools/runner/vg/ps2.rb
200
246
  - lib/ehbrs/tools/runner/vg/ps2/rename.rb
201
247
  - lib/ehbrs/tools/runner/vg/wii.rb
@@ -221,6 +267,13 @@ files:
221
267
  - lib/ehbrs/tools/runner/web_utils/videos/download.rb
222
268
  - lib/ehbrs/tools/runner/web_utils/videos/upload.rb
223
269
  - lib/ehbrs/tools/version.rb
270
+ - lib/ehbrs/tools/vg.rb
271
+ - lib/ehbrs/tools/vg/patches.rb
272
+ - lib/ehbrs/tools/vg/patches/applier_factory.rb
273
+ - lib/ehbrs/tools/vg/patches/base_applier.rb
274
+ - lib/ehbrs/tools/vg/patches/ips_applier.rb
275
+ - lib/ehbrs/tools/vg/patches/temp_files.rb
276
+ - lib/ehbrs/tools/vg/patches/vcdiff_applier.rb
224
277
  - lib/ehbrs/user_dirs.rb
225
278
  - template/ehbrs/cooking_book/build/base_page/layout.html.erb
226
279
  - template/ehbrs/cooking_book/build/index_page/inner.html.erb