ehbrs-tools 0.37.0 → 0.39.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (53) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile +5 -5
  3. data/Gemfile.lock +97 -60
  4. data/exe/ehbrs +1 -1
  5. data/lib/ehbrs/executables.rb +1 -8
  6. data/lib/ehbrs/google/translate/session.rb +1 -1
  7. data/lib/ehbrs/observers/base.rb +2 -3
  8. data/lib/ehbrs/observers/with_persistence.rb +1 -1
  9. data/lib/ehbrs/self/observers/with_persistence.rb +1 -1
  10. data/lib/ehbrs/tools/runner/finances/bb_browser.rb +4 -4
  11. data/lib/ehbrs/tools/runner/fs/used_space.rb +1 -1
  12. data/lib/ehbrs/tools/runner/google/translate.rb +1 -1
  13. data/lib/ehbrs/tools/runner/telegram/send_message.rb +3 -3
  14. data/lib/ehbrs/tools/runner/vg/ips.rb +2 -2
  15. data/lib/ehbrs/tools/runner/vg/ps2/rename.rb +34 -0
  16. data/lib/ehbrs/tools/runner/vg/ps2.rb +19 -0
  17. data/lib/ehbrs/tools/runner/videos/languages/file_runner.rb +2 -1
  18. data/lib/ehbrs/tools/runner/videos/languages.rb +1 -1
  19. data/lib/ehbrs/tools/runner/videos/series/rename.rb +1 -1
  20. data/lib/ehbrs/tools/runner/videos/subtitles/sanitize.rb +38 -0
  21. data/lib/ehbrs/tools/runner/videos/subtitles.rb +20 -0
  22. data/lib/ehbrs/tools/runner/videos/unsupported.rb +1 -1
  23. data/lib/ehbrs/tools/runner/web_utils/videos/upload.rb +1 -1
  24. data/lib/ehbrs/tools/runner_with/filesystem_renamer.rb +103 -0
  25. data/lib/ehbrs/tools/runner_with.rb +11 -0
  26. data/lib/ehbrs/tools/version.rb +1 -1
  27. data/lib/ehbrs/user_dirs.rb +1 -1
  28. data/lib/ehbrs/videos/convert_job.rb +3 -3
  29. data/lib/ehbrs/videos/extract/package_file.rb +1 -1
  30. data/lib/ehbrs/videos/file.rb +2 -2
  31. data/lib/ehbrs/videos/track.rb +3 -2
  32. data/lib/ehbrs/videos/unsupported/check_support.rb +5 -7
  33. data/lib/ehbrs/videos/unsupported/profiles/samsung.rb +1 -0
  34. metadata +20 -71
  35. data/.rspec +0 -1
  36. data/.rubocop.yml +0 -39
  37. data/lib/ehbrs/gems.rb +0 -37
  38. data/spec/code/rubocop_spec.rb +0 -3
  39. data/spec/lib/ehbrs/observers/base_spec.rb +0 -93
  40. data/spec/lib/ehbrs/tools/runner/fs/used_space_spec.rb +0 -62
  41. data/spec/lib/ehbrs/tools/runner/vg/ips_spec.rb +0 -31
  42. data/spec/lib/ehbrs/tools/runner/vg/ips_spec_files/expected.rom +0 -0
  43. data/spec/lib/ehbrs/tools/runner/vg/ips_spec_files/patch_0.ips +0 -0
  44. data/spec/lib/ehbrs/tools/runner/vg/ips_spec_files/patch_1.ips +0 -0
  45. data/spec/lib/ehbrs/tools/runner/vg/ips_spec_files/source.rom +0 -0
  46. data/spec/lib/ehbrs/tools/runner/videos/probe_spec.rb +0 -19
  47. data/spec/lib/ehbrs/tools/runner/videos/probe_spec_files/fixed.target.yaml +0 -105
  48. data/spec/lib/ehbrs/tools/runner/videos/unsupported_spec.rb +0 -75
  49. data/spec/lib/ehbrs/tools/runner/videos/unsupported_spec_files/dts_audio.probe.yaml +0 -91
  50. data/spec/lib/ehbrs/tools/runner_spec.rb +0 -16
  51. data/spec/spec_helper/videos.rb +0 -30
  52. data/spec/spec_helper/videos_files/stub_source.mp4 +0 -0
  53. data/spec/spec_helper.rb +0 -7
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: d0db0050f90e36dc79b898e1d7b7aebf2586c85c8fd3df674f03035d802484d3
4
- data.tar.gz: 789d052e717913eae662e59fe1f9975d2960d2ba8e31cc087c6fefa42d79dcd8
3
+ metadata.gz: 05eba951b36f326e76fa27e5264caecd9533f10ce8ec1f3775c6b6b10be3678b
4
+ data.tar.gz: 1c6caca39da80381d76cd9cee1f8f40989b428d19e3a0d749e7cbf9fdb4f99b1
5
5
  SHA512:
6
- metadata.gz: 9de584955eacbd3ff6884ef57bf3c14a90b462dfb15b816cd08fa297fa94b9a9b82b77a7c31a8871ae37f2dc0a09d7786f074a576219404dbec6a83485a07a1b
7
- data.tar.gz: 3a648b506ac3867457dede4027da13fb85e76b6a367ba296f012b391f968e5bd6ec848d1aab3e70dce80f953c842161f9b9b6f65ce1d8adf8f8cb035938f8c9c
6
+ metadata.gz: 38e39c046a9c1ba26c2624d3ba7769100ad1b4941c1bdac7eaa58d48d2d75da80d02c75fb99d94051498cd6efb245f650139ef70df978a4111e7327e4a118595
7
+ data.tar.gz: acbaed41a43a3e7a9c9dea2afdddaf2704eee2033f208e3d400b739a484ba15c832f4c1fffafdd36d4797391d4d78762824c2d4a8481ed77711245515c27c07a
data/Gemfile CHANGED
@@ -4,11 +4,11 @@ source 'https://rubygems.org'
4
4
 
5
5
  gemspec
6
6
 
7
- ::Dir["#{::File.join(__dir__, 'sub')}/*"].each do |dir|
8
- next unless ::File.exist?(::File.join(dir, "#{::File.basename(dir)}.gemspec"))
7
+ Dir["#{File.join(__dir__, 'sub')}/*"].each do |dir|
8
+ next unless File.exist?(File.join(dir, "#{File.basename(dir)}.gemspec"))
9
9
 
10
- gem ::File.basename(dir), path: dir, require: false
10
+ gem File.basename(dir), path: dir, require: false
11
11
  end
12
12
 
13
- local_gemfile = ::File.join(::File.dirname(__FILE__), 'Gemfile.local')
14
- eval_gemfile local_gemfile if ::File.exist?(local_gemfile)
13
+ local_gemfile = File.join(File.dirname(__FILE__), 'Gemfile.local')
14
+ eval_gemfile local_gemfile if File.exist?(local_gemfile)
data/Gemfile.lock CHANGED
@@ -1,29 +1,39 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- ehbrs-tools (0.37.0)
5
- avm-tools (~> 0.156)
6
- eac_cli (~> 0.38)
7
- eac_ruby_utils (~> 0.119, >= 0.119.2)
8
- ehbrs_ruby_utils (~> 0.35)
4
+ ehbrs-tools (0.39.0)
5
+ avm-tools (~> 0.159)
6
+ eac_cli (~> 0.40)
7
+ eac_ruby_utils (~> 0.120)
8
+ ehbrs_ruby_utils (~> 0.38)
9
9
  filesize (~> 0.2)
10
- inifile (~> 3.0)
11
10
  os (~> 1.1, >= 1.1.4)
12
11
  telegram-bot-ruby (~> 0.23)
13
12
 
13
+ PATH
14
+ remote: sub/eac_cli
15
+ specs:
16
+ eac_cli (0.40.0)
17
+ colorize (~> 0.8, >= 0.8.1)
18
+ eac_config (~> 0.14, >= 0.14.1)
19
+ eac_ruby_utils (~> 0.120)
20
+ tty-table (~> 0.12)
21
+
14
22
  PATH
15
23
  remote: sub/ehbrs_ruby_utils
16
24
  specs:
17
- ehbrs_ruby_utils (0.35.0)
25
+ ehbrs_ruby_utils (0.38.0)
18
26
  aranha (~> 0.19, >= 0.19.2)
19
- aranha-parsers (~> 0.21)
27
+ aranha-parsers (~> 0.22)
20
28
  aranha-selenium (~> 0.7)
21
- avm (~> 0.80)
29
+ avm (~> 0.84, >= 0.84.2)
22
30
  dentaku (~> 3.5, >= 3.5.1)
23
31
  eac_fs (~> 0.16)
24
32
  eac_rest (~> 0.10)
25
- eac_ruby_utils (~> 0.119, >= 0.119.2)
33
+ eac_ruby_utils (~> 0.120)
26
34
  eac_templates (~> 0.5)
35
+ inifile (~> 3.0)
36
+ srt (~> 0.1, >= 0.1.5)
27
37
  taglib-ruby (~> 1.1, >= 1.1.3)
28
38
  ultimate_lyrics (~> 0.1, >= 0.1.3)
29
39
 
@@ -42,35 +52,35 @@ GEM
42
52
  aranha-parsers (~> 0.18)
43
53
  aranha-selenium (~> 0.5)
44
54
  eac_ruby_utils (~> 0.116)
45
- aranha-parsers (0.21.0)
55
+ aranha-parsers (0.22.0)
46
56
  activesupport (>= 4.0.0)
47
- addressable (~> 2.8, >= 2.8.4)
48
- eac_envs-http (~> 0.4)
49
- eac_ruby_utils (~> 0.117, >= 0.117.1)
50
- nokogiri (~> 1.15, >= 1.15.2)
57
+ addressable (~> 2.8, >= 2.8.5)
58
+ eac_envs-http (~> 0.4, >= 0.4.1)
59
+ eac_ruby_utils (~> 0.119, >= 0.119.2)
60
+ nokogiri (~> 1.15, >= 1.15.4)
51
61
  ofx-parser (~> 1.1)
52
62
  aranha-selenium (0.7.0)
53
63
  eac_ruby_utils (~> 0.117, >= 0.117.1)
54
64
  selenium-webdriver (~> 3.142, >= 3.142.7)
55
65
  ast (2.4.2)
56
- avm (0.80.0)
57
- aranha-parsers (~> 0.21)
58
- eac_cli (~> 0.38)
66
+ avm (0.84.2)
67
+ aranha-parsers (~> 0.22)
68
+ eac_cli (~> 0.39)
59
69
  eac_config (~> 0.14, >= 0.14.1)
60
70
  eac_docker (~> 0.7)
61
71
  eac_fs (~> 0.16)
62
72
  eac_git (~> 0.14, >= 0.14.1)
63
- eac_ruby_utils (~> 0.119, >= 0.119.2)
73
+ eac_ruby_utils (~> 0.120)
64
74
  eac_templates (~> 0.5)
65
75
  filesize (~> 0.2)
66
76
  htmlbeautifier (~> 1.4, >= 1.4.2)
67
77
  minitar (~> 0.9)
68
- avm-eac_generic_base0 (0.12.1)
69
- avm (~> 0.79)
70
- eac_ruby_utils (~> 0.119, >= 0.119.2)
71
- avm-eac_ruby_base1 (0.32.1)
72
- aranha-parsers (~> 0.21)
73
- avm (~> 0.80)
78
+ avm-eac_generic_base0 (0.12.2)
79
+ avm (~> 0.84, >= 0.84.2)
80
+ eac_ruby_utils (~> 0.120)
81
+ avm-eac_ruby_base1 (0.33.1)
82
+ aranha-parsers (~> 0.22)
83
+ avm (~> 0.84)
74
84
  avm-eac_generic_base0 (~> 0.12, >= 0.12.1)
75
85
  eac_envs-http (~> 0.4, >= 0.4.1)
76
86
  eac_ruby_utils (~> 0.119, >= 0.119.2)
@@ -84,19 +94,19 @@ GEM
84
94
  eac_fs (~> 0.16)
85
95
  eac_ruby_utils (~> 0.112)
86
96
  eac_templates (~> 0.5)
87
- avm-git (0.13.4)
88
- avm (~> 0.79)
97
+ avm-git (0.14.0)
98
+ avm (~> 0.82)
89
99
  avm-files (~> 0.6, >= 0.6.2)
90
100
  eac_git (~> 0.14, >= 0.14.1)
91
- eac_ruby_utils (~> 0.119, >= 0.119.1)
101
+ eac_ruby_utils (~> 0.119, >= 0.119.2)
92
102
  git (~> 1.18)
93
- avm-tools (0.156.0)
103
+ avm-tools (0.159.0)
94
104
  aranha-parsers (~> 0.21)
95
- avm (~> 0.80)
96
- avm-eac_ruby_base1 (~> 0.32, >= 0.32.1)
105
+ avm (~> 0.83)
106
+ avm-eac_ruby_base1 (~> 0.33)
97
107
  avm-eac_ubuntu_base0 (~> 0.5)
98
108
  avm-files (~> 0.6, >= 0.6.2)
99
- avm-git (~> 0.13, >= 0.13.4)
109
+ avm-git (~> 0.14)
100
110
  clipboard (~> 1.3, >= 1.3.6)
101
111
  curb (~> 0.9, >= 0.9.11)
102
112
  eac_git (~> 0.14, >= 0.14.1)
@@ -108,7 +118,7 @@ GEM
108
118
  descendants_tracker (~> 0.0.4)
109
119
  ice_nine (~> 0.11.0)
110
120
  thread_safe (~> 0.3, >= 0.3.1)
111
- base64 (0.1.1)
121
+ base64 (0.2.0)
112
122
  childprocess (3.0.0)
113
123
  clipboard (1.3.6)
114
124
  coercible (1.0.0)
@@ -124,10 +134,6 @@ GEM
124
134
  thread_safe (~> 0.3, >= 0.3.1)
125
135
  diff-lcs (1.5.0)
126
136
  dry-inflector (1.0.0)
127
- eac_cli (0.38.0)
128
- colorize (~> 0.8, >= 0.8.1)
129
- eac_config (~> 0.14)
130
- eac_ruby_utils (~> 0.119, >= 0.119.2)
131
137
  eac_config (0.14.1)
132
138
  addressable (~> 2.8, >= 2.8.5)
133
139
  eac_ruby_utils (~> 0.119, >= 0.119.2)
@@ -158,13 +164,13 @@ GEM
158
164
  eac_cli (~> 0.35)
159
165
  eac_fs (~> 0.16)
160
166
  eac_ruby_utils (~> 0.117)
161
- eac_ruby_gem_support (0.5.1)
162
- eac_ruby_utils (~> 0.74)
163
- rspec (~> 3.9)
164
- rubocop (~> 0.80.1)
165
- rubocop-rails (~> 2.4.2)
166
- rubocop-rspec (~> 1.38.1)
167
- eac_ruby_utils (0.119.2)
167
+ eac_ruby_gem_support (0.9.0)
168
+ eac_ruby_utils (~> 0.119, >= 0.119.2)
169
+ rspec (~> 3.12)
170
+ rubocop (~> 1.57, >= 1.57.2)
171
+ rubocop-rails (~> 2.22, >= 2.22.1)
172
+ rubocop-rspec (~> 2.25)
173
+ eac_ruby_utils (0.120.0)
168
174
  activesupport (>= 4, < 7)
169
175
  addressable (~> 2.8, >= 2.8.5)
170
176
  bundler
@@ -173,7 +179,7 @@ GEM
173
179
  eac_templates (0.5.0)
174
180
  eac_config (~> 0.12)
175
181
  eac_ruby_utils (~> 0.112)
176
- faraday (2.7.11)
182
+ faraday (2.7.12)
177
183
  base64
178
184
  faraday-net_http (>= 2.0, < 3.1)
179
185
  ruby2_keywords (>= 0.0.4)
@@ -197,12 +203,13 @@ GEM
197
203
  concurrent-ruby (~> 1.0)
198
204
  ice_nine (0.11.2)
199
205
  inifile (3.0.0)
200
- jaro_winkler (1.5.6)
206
+ json (2.6.3)
207
+ language_server-protocol (3.17.0.3)
201
208
  minitar (0.9)
202
209
  minitest (5.20.0)
203
210
  multipart-post (2.3.0)
204
211
  net-ssh (4.2.0)
205
- nokogiri (1.15.4-x86_64-linux)
212
+ nokogiri (1.15.5-x86_64-linux)
206
213
  racc (~> 1.4)
207
214
  ofx-parser (1.1.0)
208
215
  hpricot (>= 0.6)
@@ -213,11 +220,14 @@ GEM
213
220
  ast (~> 2.4.1)
214
221
  racc
215
222
  parslet (2.0.0)
216
- public_suffix (5.0.3)
217
- racc (1.7.1)
223
+ pastel (0.8.0)
224
+ tty-color (~> 0.5)
225
+ public_suffix (5.0.4)
226
+ racc (1.7.3)
218
227
  rack (3.0.8)
219
228
  rainbow (3.1.1)
220
229
  rchardet (1.8.0)
230
+ regexp_parser (2.8.2)
221
231
  rexml (3.2.6)
222
232
  rspec (3.12.0)
223
233
  rspec-core (~> 3.12.0)
@@ -232,19 +242,32 @@ GEM
232
242
  diff-lcs (>= 1.2.0, < 2.0)
233
243
  rspec-support (~> 3.12.0)
234
244
  rspec-support (3.12.1)
235
- rubocop (0.80.1)
236
- jaro_winkler (~> 1.5.1)
245
+ rubocop (1.57.2)
246
+ json (~> 2.3)
247
+ language_server-protocol (>= 3.17.0)
237
248
  parallel (~> 1.10)
238
- parser (>= 2.7.0.1)
249
+ parser (>= 3.2.2.4)
239
250
  rainbow (>= 2.2.2, < 4.0)
240
- rexml
251
+ regexp_parser (>= 1.8, < 3.0)
252
+ rexml (>= 3.2.5, < 4.0)
253
+ rubocop-ast (>= 1.28.1, < 2.0)
241
254
  ruby-progressbar (~> 1.7)
242
- unicode-display_width (>= 1.4.0, < 1.7)
243
- rubocop-rails (2.4.2)
255
+ unicode-display_width (>= 2.4.0, < 3.0)
256
+ rubocop-ast (1.30.0)
257
+ parser (>= 3.2.1.0)
258
+ rubocop-capybara (2.19.0)
259
+ rubocop (~> 1.41)
260
+ rubocop-factory_bot (2.24.0)
261
+ rubocop (~> 1.33)
262
+ rubocop-rails (2.22.2)
263
+ activesupport (>= 4.2.0)
244
264
  rack (>= 1.1)
245
- rubocop (>= 0.72.0)
246
- rubocop-rspec (1.38.1)
247
- rubocop (>= 0.68.1)
265
+ rubocop (>= 1.33.0, < 2.0)
266
+ rubocop-ast (>= 1.30.0, < 2.0)
267
+ rubocop-rspec (2.25.0)
268
+ rubocop (~> 1.40)
269
+ rubocop-capybara (~> 2.17)
270
+ rubocop-factory_bot (~> 2.22)
248
271
  ruby-filemagic (0.7.3)
249
272
  ruby-progressbar (1.13.0)
250
273
  ruby2_keywords (0.0.5)
@@ -252,6 +275,12 @@ GEM
252
275
  selenium-webdriver (3.142.7)
253
276
  childprocess (>= 0.5, < 4.0)
254
277
  rubyzip (>= 1.2.2)
278
+ srt (0.1.5)
279
+ strings (0.2.1)
280
+ strings-ansi (~> 0.2)
281
+ unicode-display_width (>= 1.5, < 3.0)
282
+ unicode_utils (~> 1.4)
283
+ strings-ansi (0.2.0)
255
284
  taglib-ruby (1.1.3)
256
285
  telegram-bot-ruby (0.23.0)
257
286
  dry-inflector
@@ -259,12 +288,19 @@ GEM
259
288
  faraday-multipart (~> 1.0)
260
289
  virtus (~> 2.0)
261
290
  thread_safe (0.3.6)
291
+ tty-color (0.6.0)
292
+ tty-screen (0.8.1)
293
+ tty-table (0.12.0)
294
+ pastel (~> 0.8)
295
+ strings (~> 0.2.0)
296
+ tty-screen (~> 0.8)
262
297
  tzinfo (2.0.6)
263
298
  concurrent-ruby (~> 1.0)
264
299
  ultimate_lyrics (0.1.3)
265
300
  aranha-parsers (~> 0.10)
266
301
  eac_ruby_utils (~> 0.102, >= 0.102.1)
267
- unicode-display_width (1.6.1)
302
+ unicode-display_width (2.5.0)
303
+ unicode_utils (1.4.0)
268
304
  virtus (2.0.0)
269
305
  axiom-types (~> 0.1)
270
306
  coercible (~> 1.0)
@@ -276,7 +312,8 @@ PLATFORMS
276
312
  x86_64-linux
277
313
 
278
314
  DEPENDENCIES
279
- eac_ruby_gem_support (~> 0.5.1)
315
+ eac_cli!
316
+ eac_ruby_gem_support (~> 0.9)
280
317
  ehbrs-tools!
281
318
  ehbrs_ruby_utils!
282
319
 
data/exe/ehbrs CHANGED
@@ -3,4 +3,4 @@
3
3
 
4
4
  $LOAD_PATH.unshift("#{__dir__}/../lib")
5
5
  require 'ehbrs/tools/runner'
6
- ::Ehbrs::Tools::Runner.run
6
+ Ehbrs::Tools::Runner.run
@@ -15,10 +15,7 @@ module Ehbrs
15
15
  private
16
16
 
17
17
  {
18
- '-?' => %w[rar],
19
- '-h' => %w[unzip],
20
- '-version' => %w[ffmpeg],
21
- '--version' => %w[flips tar wit]
18
+ '--version' => %w[flips]
22
19
  }.each do |validate_arg, commands|
23
20
  commands.each do |command|
24
21
  define_method("#{command}_uncached") do
@@ -26,10 +23,6 @@ module Ehbrs
26
23
  end
27
24
  end
28
25
  end
29
-
30
- def sevenzip_uncached
31
- env.executable('7z', '--help')
32
- end
33
26
  end
34
27
  end
35
28
  end
@@ -10,7 +10,7 @@ module Ehbrs
10
10
  CLOSE_POPUP_CSS = '.dismiss-button'
11
11
  FILE_INPUT_XPATH = '//*[@id = "tlid-file-input"]'
12
12
  SUBMIT_XPATH = '//form[@action="//translate.googleusercontent.com/translate_f"]' \
13
- '//input[@type="submit"]'
13
+ '//input[@type="submit"]'
14
14
  RESULT_XPATHS = [
15
15
  '//script[contains(@src, "https://translate.google.com/translate_a")]',
16
16
  '/html/body/pre'
@@ -1,7 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  require 'eac_ruby_utils/core_ext'
4
- require 'ostruct'
5
4
 
6
5
  module Ehbrs
7
6
  module Observers
@@ -45,12 +44,12 @@ module Ehbrs
45
44
  def check_with_blank_value_add(value, time)
46
45
  return false unless changing_value?(value)
47
46
 
48
- records << ::OpenStruct.new(value: value, time: time)
47
+ records << { value: value, time: time }.to_struct
49
48
  true
50
49
  end
51
50
 
52
51
  def check_with_blank_value_ignore(value, date)
53
- return false if value.blank? ? false : check_with_blank_value_add(value, date)
52
+ false if value.blank? ? false : check_with_blank_value_add(value, date)
54
53
  end
55
54
 
56
55
  def check_with_blank_value_raise(value, date)
@@ -21,7 +21,7 @@ module Ehbrs
21
21
  def load
22
22
  save unless path.exist?
23
23
  data = ::YAML.load_file(path.to_path)
24
- @records = data.fetch(:records).map { |h| ::OpenStruct.new(h) }
24
+ @records = data.fetch(:records).map(&:to_struct)
25
25
  @last_check_time = data.fetch(:last_check_time)
26
26
  end
27
27
 
@@ -30,7 +30,7 @@ module Ehbrs
30
30
 
31
31
  def persistence_path_uncached
32
32
  ::Ehbrs::UserDirs.data.child('observers', label.to_s.parameterize)
33
- .content_path.to_pathname
33
+ .content_path.to_pathname
34
34
  end
35
35
  end
36
36
  end
@@ -25,8 +25,8 @@ module Ehbrs
25
25
 
26
26
  def docker_container_uncached
27
27
  r = docker_image.container
28
- .temporary(true).interactive(true).tty(true)
29
- .command_arg('seg.bb.com.br')
28
+ .temporary(true).interactive(true).tty(true)
29
+ .command_arg('seg.bb.com.br')
30
30
  %w[capabilities environment_variables volumes].inject(r) do |a, e|
31
31
  send("docker_container_#{e}", a)
32
32
  end
@@ -45,8 +45,8 @@ module Ehbrs
45
45
 
46
46
  def docker_container_volumes(container)
47
47
  {
48
- ::File.join(ENV.fetch('HOME'), 'Downloads') => '/home/user/Downloads',
49
- ::File.join(ENV.fetch('HOME'), '.Xauthority') => '/home/user/.Xauthority:ro',
48
+ ::File.join(Dir.home, 'Downloads') => '/home/user/Downloads',
49
+ ::File.join(Dir.home, '.Xauthority') => '/home/user/.Xauthority:ro',
50
50
  '/tmp/.X11-unix' => '/tmp/.X11-unix:ro',
51
51
  '/etc/machine-id' => '/etc/machine-id:ro'
52
52
  }.inject(container) { |a, e| a.volume(e[0], e[1]) }
@@ -137,7 +137,7 @@ module Ehbrs
137
137
 
138
138
  def output_line
139
139
  [path.to_s.cyan, last_change_time, last_value, current_value, check_result]
140
- .reject(&:blank?).join('|')
140
+ .compact_blank.join('|')
141
141
  end
142
142
 
143
143
  def check_result
@@ -45,7 +45,7 @@ module Ehbrs
45
45
  def default_output_file
46
46
  ::File.join(
47
47
  ::File.dirname(source_file),
48
- ::File.basename(source_file, '.*') + '_translated.html'
48
+ "#{::File.basename(source_file, '.*')}_translated.html"
49
49
  )
50
50
  end
51
51
 
@@ -20,9 +20,9 @@ module Ehbrs
20
20
 
21
21
  def message_sending_uncached
22
22
  parsed.recipients_ids
23
- .inject(::Ehbrs::Telegram::MessageSending.new) { |a, e| a.recipient_id(e) }
24
- .bot_token(runner_context.call(:bot_token))
25
- .message(parsed.message)
23
+ .inject(::Ehbrs::Telegram::MessageSending.new) { |a, e| a.recipient_id(e) }
24
+ .bot_token(runner_context.call(:bot_token))
25
+ .message(parsed.message)
26
26
  end
27
27
  end
28
28
  end
@@ -36,14 +36,14 @@ module Ehbrs
36
36
 
37
37
  def run_patch(source_path, ips_path, output_path)
38
38
  command = ::Ehbrs::Executables.flips.command
39
- .append(['--apply', ips_path, source_path, output_path])
39
+ .append(['--apply', ips_path, source_path, output_path])
40
40
 
41
41
  command.system!
42
42
 
43
43
  return if output_path.exist?
44
44
 
45
45
  fatal_error("\"#{command}\" exited without error, but output file \"#{output_path}\"" \
46
- 'does not exist')
46
+ 'does not exist')
47
47
  end
48
48
 
49
49
  def run_patches
@@ -0,0 +1,34 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'ehbrs_ruby_utils/vg/ps2/iso_file'
4
+ require 'eac_ruby_base0/core_ext'
5
+
6
+ module Ehbrs
7
+ module Tools
8
+ class Runner
9
+ class Vg
10
+ class Ps2
11
+ class Rename
12
+ DEFAULT_TRAVERSER_RECURSIVE = true
13
+
14
+ runner_with :help, :filesystem_renamer do
15
+ desc 'Renomeia ISOS de PS2'
16
+ end
17
+
18
+ # @return [void]
19
+ def run
20
+ run_filesystem_renamer
21
+ end
22
+
23
+ private
24
+
25
+ # @return [Class]
26
+ def file_class
27
+ ::EhbrsRubyUtils::Vg::Ps2::IsoFile
28
+ end
29
+ end
30
+ end
31
+ end
32
+ end
33
+ end
34
+ end
@@ -0,0 +1,19 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'eac_ruby_base0/core_ext'
4
+
5
+ module Ehbrs
6
+ module Tools
7
+ class Runner
8
+ class Vg
9
+ class Ps2
10
+ runner_with :help, :subcommands do
11
+ subcommands
12
+ end
13
+
14
+ require_sub __FILE__
15
+ end
16
+ end
17
+ end
18
+ end
19
+ end
@@ -1,6 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  require 'eac_ruby_utils/core_ext'
4
+ require 'ehbrs_ruby_utils/executables'
4
5
 
5
6
  module Ehbrs
6
7
  module Tools
@@ -100,7 +101,7 @@ module Ehbrs
100
101
  end
101
102
 
102
103
  def extract_tracks_command_uncached
103
- ::Ehbrs::Executables.ffmpeg.command(*extract_tracks_job_args)
104
+ ::EhbrsRubyUtils::Executables.ffmpeg.command(*extract_tracks_job_args)
104
105
  end
105
106
  end
106
107
  end
@@ -31,7 +31,7 @@ module Ehbrs
31
31
  end
32
32
 
33
33
  def keep_languages
34
- parsed.keep.map(&:strip).reject(&:blank?)
34
+ parsed.keep.map(&:strip).compact_blank
35
35
  end
36
36
 
37
37
  def include_audios?
@@ -50,7 +50,7 @@ module Ehbrs
50
50
 
51
51
  def traverser_check_file(path)
52
52
  @files << ::EhbrsRubyUtils::Videos::Series::Rename::File
53
- .new(path, series_file_options)
53
+ .new(path, series_file_options)
54
54
  end
55
55
 
56
56
  def series_file_options_uncached
@@ -0,0 +1,38 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'eac_ruby_base0/core_ext'
4
+ require 'ehbrs_ruby_utils/videos/subtitles/sanitize'
5
+
6
+ module Ehbrs
7
+ module Tools
8
+ class Runner
9
+ class Videos
10
+ class Subtitles
11
+ class Sanitize
12
+ runner_with :help, :filesystem_traverser do
13
+ desc 'Conserta legendas.'
14
+ end
15
+
16
+ def keep_languages?
17
+ keep_languages.present?
18
+ end
19
+
20
+ delegate :delete?, :extract?, to: :parsed
21
+
22
+ def run
23
+ run_filesystem_traverser
24
+ end
25
+
26
+ def traverser_check_file(file)
27
+ sub = ::EhbrsRubyUtils::Videos::Subtitles::Sanitize.new(file)
28
+ return unless sub.subtitle?
29
+
30
+ infov 'Subtitle found', sub.file
31
+ sub.run
32
+ end
33
+ end
34
+ end
35
+ end
36
+ end
37
+ end
38
+ end
@@ -0,0 +1,20 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'eac_ruby_base0/core_ext'
4
+
5
+ module Ehbrs
6
+ module Tools
7
+ class Runner
8
+ class Videos
9
+ class Subtitles
10
+ runner_with :help, :subcommands do
11
+ desc 'Ferramentas para seriados.'
12
+ subcommands
13
+ end
14
+
15
+ require_sub __FILE__
16
+ end
17
+ end
18
+ end
19
+ end
20
+ end
@@ -48,7 +48,7 @@ module Ehbrs
48
48
 
49
49
  def profiles_uncached
50
50
  parsed.profiles.if_present(PROFILES) { |v| v.split(',').map(&:strip) }
51
- .map { |name| profile_class(name).instance }
51
+ .map { |name| profile_class(name).instance }
52
52
  end
53
53
 
54
54
  def profile_class(profile_name)
@@ -44,7 +44,7 @@ module Ehbrs
44
44
  upload_request(files_list_path).body
45
45
  rescue ::EhbrsRubyUtils::WebUtils::RequestError => e
46
46
  system('firefox', e.body_file_path.to_path)
47
- fatal_error('Retornou com erro: ' + e.message)
47
+ fatal_error("Retornou com erro: #{e.message}")
48
48
  end
49
49
 
50
50
  def series_files_list_uncached