ehbrs-tools 0.38.0 → 0.39.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: efdf00a40c51048bd3a312af6ff2919482f488aebdda650b372b0351b140c665
4
- data.tar.gz: 53f183eac080097ba44aeefbb11844aa6b290552c04415291388f25114feac66
3
+ metadata.gz: 05eba951b36f326e76fa27e5264caecd9533f10ce8ec1f3775c6b6b10be3678b
4
+ data.tar.gz: 1c6caca39da80381d76cd9cee1f8f40989b428d19e3a0d749e7cbf9fdb4f99b1
5
5
  SHA512:
6
- metadata.gz: ec429dacb5ec9a1a26021b8fad7cf7e0ab9dd184d4772c26cb7ea84ecf4e76f18718d4451cea2055a33e756cc9e4d8a3b5588d898415dbb15dd901a4c723ab57
7
- data.tar.gz: f910b6b22feef5fe31096dc92748c6484b71905cf514059d29ade024be209dfea15eb703e9be734cbf3a13c245936abb22a4fb1c7974777c1f9abfb581fe54fc
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,38 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- ehbrs-tools (0.38.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.36, >= 0.36.1)
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.36.1)
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)
27
36
  srt (~> 0.1, >= 0.1.5)
28
37
  taglib-ruby (~> 1.1, >= 1.1.3)
29
38
  ultimate_lyrics (~> 0.1, >= 0.1.3)
@@ -43,35 +52,35 @@ GEM
43
52
  aranha-parsers (~> 0.18)
44
53
  aranha-selenium (~> 0.5)
45
54
  eac_ruby_utils (~> 0.116)
46
- aranha-parsers (0.21.0)
55
+ aranha-parsers (0.22.0)
47
56
  activesupport (>= 4.0.0)
48
- addressable (~> 2.8, >= 2.8.4)
49
- eac_envs-http (~> 0.4)
50
- eac_ruby_utils (~> 0.117, >= 0.117.1)
51
- 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)
52
61
  ofx-parser (~> 1.1)
53
62
  aranha-selenium (0.7.0)
54
63
  eac_ruby_utils (~> 0.117, >= 0.117.1)
55
64
  selenium-webdriver (~> 3.142, >= 3.142.7)
56
65
  ast (2.4.2)
57
- avm (0.80.0)
58
- aranha-parsers (~> 0.21)
59
- eac_cli (~> 0.38)
66
+ avm (0.84.2)
67
+ aranha-parsers (~> 0.22)
68
+ eac_cli (~> 0.39)
60
69
  eac_config (~> 0.14, >= 0.14.1)
61
70
  eac_docker (~> 0.7)
62
71
  eac_fs (~> 0.16)
63
72
  eac_git (~> 0.14, >= 0.14.1)
64
- eac_ruby_utils (~> 0.119, >= 0.119.2)
73
+ eac_ruby_utils (~> 0.120)
65
74
  eac_templates (~> 0.5)
66
75
  filesize (~> 0.2)
67
76
  htmlbeautifier (~> 1.4, >= 1.4.2)
68
77
  minitar (~> 0.9)
69
- avm-eac_generic_base0 (0.12.1)
70
- avm (~> 0.79)
71
- eac_ruby_utils (~> 0.119, >= 0.119.2)
72
- avm-eac_ruby_base1 (0.32.1)
73
- aranha-parsers (~> 0.21)
74
- 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)
75
84
  avm-eac_generic_base0 (~> 0.12, >= 0.12.1)
76
85
  eac_envs-http (~> 0.4, >= 0.4.1)
77
86
  eac_ruby_utils (~> 0.119, >= 0.119.2)
@@ -85,19 +94,19 @@ GEM
85
94
  eac_fs (~> 0.16)
86
95
  eac_ruby_utils (~> 0.112)
87
96
  eac_templates (~> 0.5)
88
- avm-git (0.13.4)
89
- avm (~> 0.79)
97
+ avm-git (0.14.0)
98
+ avm (~> 0.82)
90
99
  avm-files (~> 0.6, >= 0.6.2)
91
100
  eac_git (~> 0.14, >= 0.14.1)
92
- eac_ruby_utils (~> 0.119, >= 0.119.1)
101
+ eac_ruby_utils (~> 0.119, >= 0.119.2)
93
102
  git (~> 1.18)
94
- avm-tools (0.156.0)
103
+ avm-tools (0.159.0)
95
104
  aranha-parsers (~> 0.21)
96
- avm (~> 0.80)
97
- avm-eac_ruby_base1 (~> 0.32, >= 0.32.1)
105
+ avm (~> 0.83)
106
+ avm-eac_ruby_base1 (~> 0.33)
98
107
  avm-eac_ubuntu_base0 (~> 0.5)
99
108
  avm-files (~> 0.6, >= 0.6.2)
100
- avm-git (~> 0.13, >= 0.13.4)
109
+ avm-git (~> 0.14)
101
110
  clipboard (~> 1.3, >= 1.3.6)
102
111
  curb (~> 0.9, >= 0.9.11)
103
112
  eac_git (~> 0.14, >= 0.14.1)
@@ -109,7 +118,7 @@ GEM
109
118
  descendants_tracker (~> 0.0.4)
110
119
  ice_nine (~> 0.11.0)
111
120
  thread_safe (~> 0.3, >= 0.3.1)
112
- base64 (0.1.1)
121
+ base64 (0.2.0)
113
122
  childprocess (3.0.0)
114
123
  clipboard (1.3.6)
115
124
  coercible (1.0.0)
@@ -125,10 +134,6 @@ GEM
125
134
  thread_safe (~> 0.3, >= 0.3.1)
126
135
  diff-lcs (1.5.0)
127
136
  dry-inflector (1.0.0)
128
- eac_cli (0.38.0)
129
- colorize (~> 0.8, >= 0.8.1)
130
- eac_config (~> 0.14)
131
- eac_ruby_utils (~> 0.119, >= 0.119.2)
132
137
  eac_config (0.14.1)
133
138
  addressable (~> 2.8, >= 2.8.5)
134
139
  eac_ruby_utils (~> 0.119, >= 0.119.2)
@@ -159,13 +164,13 @@ GEM
159
164
  eac_cli (~> 0.35)
160
165
  eac_fs (~> 0.16)
161
166
  eac_ruby_utils (~> 0.117)
162
- eac_ruby_gem_support (0.8.2)
167
+ eac_ruby_gem_support (0.9.0)
163
168
  eac_ruby_utils (~> 0.119, >= 0.119.2)
164
169
  rspec (~> 3.12)
165
- rubocop (~> 1.57, >= 1.57.1)
166
- rubocop-rails (~> 2.21, >= 2.21.2)
167
- rubocop-rspec (~> 2.24, >= 2.24.1)
168
- eac_ruby_utils (0.119.2)
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)
169
174
  activesupport (>= 4, < 7)
170
175
  addressable (~> 2.8, >= 2.8.5)
171
176
  bundler
@@ -174,7 +179,7 @@ GEM
174
179
  eac_templates (0.5.0)
175
180
  eac_config (~> 0.12)
176
181
  eac_ruby_utils (~> 0.112)
177
- faraday (2.7.11)
182
+ faraday (2.7.12)
178
183
  base64
179
184
  faraday-net_http (>= 2.0, < 3.1)
180
185
  ruby2_keywords (>= 0.0.4)
@@ -204,7 +209,7 @@ GEM
204
209
  minitest (5.20.0)
205
210
  multipart-post (2.3.0)
206
211
  net-ssh (4.2.0)
207
- nokogiri (1.15.4-x86_64-linux)
212
+ nokogiri (1.15.5-x86_64-linux)
208
213
  racc (~> 1.4)
209
214
  ofx-parser (1.1.0)
210
215
  hpricot (>= 0.6)
@@ -215,8 +220,10 @@ GEM
215
220
  ast (~> 2.4.1)
216
221
  racc
217
222
  parslet (2.0.0)
218
- public_suffix (5.0.3)
219
- 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)
220
227
  rack (3.0.8)
221
228
  rainbow (3.1.1)
222
229
  rchardet (1.8.0)
@@ -252,10 +259,11 @@ GEM
252
259
  rubocop (~> 1.41)
253
260
  rubocop-factory_bot (2.24.0)
254
261
  rubocop (~> 1.33)
255
- rubocop-rails (2.22.1)
262
+ rubocop-rails (2.22.2)
256
263
  activesupport (>= 4.2.0)
257
264
  rack (>= 1.1)
258
265
  rubocop (>= 1.33.0, < 2.0)
266
+ rubocop-ast (>= 1.30.0, < 2.0)
259
267
  rubocop-rspec (2.25.0)
260
268
  rubocop (~> 1.40)
261
269
  rubocop-capybara (~> 2.17)
@@ -268,6 +276,11 @@ GEM
268
276
  childprocess (>= 0.5, < 4.0)
269
277
  rubyzip (>= 1.2.2)
270
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)
271
284
  taglib-ruby (1.1.3)
272
285
  telegram-bot-ruby (0.23.0)
273
286
  dry-inflector
@@ -275,12 +288,19 @@ GEM
275
288
  faraday-multipart (~> 1.0)
276
289
  virtus (~> 2.0)
277
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)
278
297
  tzinfo (2.0.6)
279
298
  concurrent-ruby (~> 1.0)
280
299
  ultimate_lyrics (0.1.3)
281
300
  aranha-parsers (~> 0.10)
282
301
  eac_ruby_utils (~> 0.102, >= 0.102.1)
283
302
  unicode-display_width (2.5.0)
303
+ unicode_utils (1.4.0)
284
304
  virtus (2.0.0)
285
305
  axiom-types (~> 0.1)
286
306
  coercible (~> 1.0)
@@ -292,7 +312,8 @@ PLATFORMS
292
312
  x86_64-linux
293
313
 
294
314
  DEPENDENCIES
295
- eac_ruby_gem_support (~> 0.8, >= 0.8.2)
315
+ eac_cli!
316
+ eac_ruby_gem_support (~> 0.9)
296
317
  ehbrs-tools!
297
318
  ehbrs_ruby_utils!
298
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
@@ -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
 
@@ -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
 
@@ -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?
@@ -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
@@ -0,0 +1,103 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'eac_cli/core_ext'
4
+
5
+ module Ehbrs
6
+ module Tools
7
+ module RunnerWith
8
+ module FilesystemRenamer
9
+ common_concern do
10
+ runner_with :confirmation, :filesystem_traverser
11
+ prepend PrependMethods
12
+ end
13
+
14
+ class RenameFile
15
+ enable_speaker
16
+ common_constructor :runner, :file
17
+ delegate :path, :target_path, :valid?, to: :file
18
+
19
+ CONFIRM_MESSAGE = 'Rename?'
20
+
21
+ def show
22
+ if rename?
23
+ puts [target_path_to_s, '<='.green, path_to_s].join(' ')
24
+ else
25
+ puts path_to_s
26
+ end
27
+ end
28
+
29
+ def rename
30
+ return unless rename?
31
+
32
+ show
33
+ do_rename if runner.confirm?(CONFIRM_MESSAGE)
34
+ end
35
+
36
+ # @return [Boolean]
37
+ def rename?
38
+ path.to_pathname != target_path.to_pathname
39
+ end
40
+
41
+ private
42
+
43
+ def do_rename
44
+ ::FileUtils.mv(path, target_path)
45
+ end
46
+
47
+ # @return [String]
48
+ def path_to_s
49
+ path.basename.to_path.light_black
50
+ end
51
+
52
+ # @return [String]
53
+ def target_path_to_s
54
+ target_path.relative_path_from(path.dirname).to_path
55
+ end
56
+ end
57
+
58
+ module PrependMethods
59
+ # @param path [Pathname]
60
+ # @return [void]
61
+ def traverser_check_file(path)
62
+ file = RenameFile.new(self, file_class.new(path))
63
+ files << file if file.valid?
64
+ end
65
+ end
66
+
67
+ FILE_WRAPPER_CLASS_BASENAME = 'FileWrapper'
68
+
69
+ # @return [Class]
70
+ def file_class
71
+ self.class.const_get(FILE_WRAPPER_CLASS_BASENAME)
72
+ end
73
+
74
+ # @return [void]
75
+ def run_filesystem_renamer
76
+ self.files = []
77
+ run_filesystem_traverser
78
+ show_files
79
+ rename_files
80
+ success 'Done'
81
+ end
82
+
83
+ # @return [void]
84
+ def show_files
85
+ infov 'Files found', files.count
86
+ files.each(&:show)
87
+ end
88
+
89
+ # @return [void]
90
+ def rename_files
91
+ return if parsed.no? || files.none?(&:rename?)
92
+
93
+ infom 'Renaming files...'
94
+ files.each(&:rename)
95
+ end
96
+
97
+ private
98
+
99
+ attr_accessor :files
100
+ end
101
+ end
102
+ end
103
+ 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 RunnerWith
8
+ require_sub __FILE__
9
+ end
10
+ end
11
+ end
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Ehbrs
4
4
  module Tools
5
- VERSION = '0.38.0'
5
+ VERSION = '0.39.0'
6
6
  end
7
7
  end
@@ -15,7 +15,7 @@ module Ehbrs
15
15
  private
16
16
 
17
17
  def user_home_dir_uncached
18
- ::EacFs::StorageTree.new(ENV['HOME'])
18
+ ::EacFs::StorageTree.new(Dir.home)
19
19
  end
20
20
 
21
21
  def cache_uncached
@@ -1,7 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  require 'eac_ruby_utils/core_ext'
4
- require 'ehbrs/executables'
4
+ require 'ehbrs_ruby_utils/executables'
5
5
  require 'fileutils'
6
6
 
7
7
  module Ehbrs
@@ -46,7 +46,7 @@ module Ehbrs
46
46
 
47
47
  def convert
48
48
  infov 'Convert args', command_args.shelljoin
49
- ::Ehbrs::Executables.ffmpeg.command.append(command_args).system!
49
+ ::EhbrsRubyUtils::Executables.ffmpeg.command.append(command_args).system!
50
50
  end
51
51
 
52
52
  def format_by_args_uncached
@@ -76,7 +76,7 @@ module Ehbrs
76
76
  end
77
77
 
78
78
  def converting
79
- target + '.converting'
79
+ "#{target}.converting"
80
80
  end
81
81
 
82
82
  def converted
@@ -53,7 +53,7 @@ module Ehbrs
53
53
  end
54
54
 
55
55
  def duration_uncached
56
- m = /Duration\:\s*(#{TIME_PATTERN})/.match(content)
56
+ m = /Duration:\s*(#{TIME_PATTERN})/.match(content)
57
57
  raise 'Duration pattern not find in content' unless m
58
58
 
59
59
  self.class.time_to_seconds(m[1])
@@ -11,8 +11,9 @@ module Ehbrs
11
11
  end
12
12
 
13
13
  def to_s
14
- "[#{codec_type}(#{index}): #{codec_name}/#{language || '-'}" +
15
- extra.if_present('') { |v| " | #{v}" } + ']'
14
+ "[#{codec_type}(#{index}): #{codec_name}/#{language || '-'}#{extra.if_present('') do |v|
15
+ " | #{v}"
16
+ end}]"
16
17
  end
17
18
  end
18
19
  end
@@ -52,19 +52,17 @@ module Ehbrs
52
52
  end
53
53
 
54
54
  def fixes_uncached
55
- checks.reject(&:passed?).map { |c| c.check.fix }.reject(&:blank?)
55
+ checks.reject(&:passed?).map { |c| c.check.fix }.compact_blank
56
56
  end
57
57
 
58
- def pad_speaker
59
- ::EacRubyUtils::Speaker.context.on(::EacCli::Speaker.new(err_line_prefix: ' ')) do
60
- yield
61
- end
58
+ def pad_speaker(&block)
59
+ ::EacRubyUtils::Speaker.context.on(::EacCli::Speaker.new(err_line_prefix: ' '), &block)
62
60
  end
63
61
 
64
62
  def new_padded_cli_speaker
65
63
  ::EacCli::Speaker.new(
66
- err_line_prefix(::EacRubyUtils::Speaker.context.optional_current
67
- .if_present('') { |v| v.is_a?(::EacCli::Speaker) ? v.err_line_prefix : '' } + ' ')
64
+ err_line_prefix("#{::EacRubyUtils::Speaker.context.optional_current
65
+ .if_present('') { |v| v.is_a?(::EacCli::Speaker) ? v.err_line_prefix : '' }} ")
68
66
  )
69
67
  end
70
68
  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.38.0
4
+ version: 0.39.0
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: 2023-10-31 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: avm-tools
@@ -16,68 +16,56 @@ dependencies:
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: '0.156'
19
+ version: '0.159'
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - "~>"
25
25
  - !ruby/object:Gem::Version
26
- version: '0.156'
26
+ version: '0.159'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: eac_cli
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
31
  - - "~>"
32
32
  - !ruby/object:Gem::Version
33
- version: '0.38'
33
+ version: '0.40'
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
38
  - - "~>"
39
39
  - !ruby/object:Gem::Version
40
- version: '0.38'
40
+ version: '0.40'
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: eac_ruby_utils
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
45
  - - "~>"
46
46
  - !ruby/object:Gem::Version
47
- version: '0.119'
48
- - - ">="
49
- - !ruby/object:Gem::Version
50
- version: 0.119.2
47
+ version: '0.120'
51
48
  type: :runtime
52
49
  prerelease: false
53
50
  version_requirements: !ruby/object:Gem::Requirement
54
51
  requirements:
55
52
  - - "~>"
56
53
  - !ruby/object:Gem::Version
57
- version: '0.119'
58
- - - ">="
59
- - !ruby/object:Gem::Version
60
- version: 0.119.2
54
+ version: '0.120'
61
55
  - !ruby/object:Gem::Dependency
62
56
  name: ehbrs_ruby_utils
63
57
  requirement: !ruby/object:Gem::Requirement
64
58
  requirements:
65
59
  - - "~>"
66
60
  - !ruby/object:Gem::Version
67
- version: '0.36'
68
- - - ">="
69
- - !ruby/object:Gem::Version
70
- version: 0.36.1
61
+ version: '0.38'
71
62
  type: :runtime
72
63
  prerelease: false
73
64
  version_requirements: !ruby/object:Gem::Requirement
74
65
  requirements:
75
66
  - - "~>"
76
67
  - !ruby/object:Gem::Version
77
- version: '0.36'
78
- - - ">="
79
- - !ruby/object:Gem::Version
80
- version: 0.36.1
68
+ version: '0.38'
81
69
  - !ruby/object:Gem::Dependency
82
70
  name: filesize
83
71
  requirement: !ruby/object:Gem::Requirement
@@ -92,20 +80,6 @@ dependencies:
92
80
  - - "~>"
93
81
  - !ruby/object:Gem::Version
94
82
  version: '0.2'
95
- - !ruby/object:Gem::Dependency
96
- name: inifile
97
- requirement: !ruby/object:Gem::Requirement
98
- requirements:
99
- - - "~>"
100
- - !ruby/object:Gem::Version
101
- version: '3.0'
102
- type: :runtime
103
- prerelease: false
104
- version_requirements: !ruby/object:Gem::Requirement
105
- requirements:
106
- - - "~>"
107
- - !ruby/object:Gem::Version
108
- version: '3.0'
109
83
  - !ruby/object:Gem::Dependency
110
84
  name: os
111
85
  requirement: !ruby/object:Gem::Requirement
@@ -146,20 +120,14 @@ dependencies:
146
120
  requirements:
147
121
  - - "~>"
148
122
  - !ruby/object:Gem::Version
149
- version: '0.8'
150
- - - ">="
151
- - !ruby/object:Gem::Version
152
- version: 0.8.2
123
+ version: '0.9'
153
124
  type: :development
154
125
  prerelease: false
155
126
  version_requirements: !ruby/object:Gem::Requirement
156
127
  requirements:
157
128
  - - "~>"
158
129
  - !ruby/object:Gem::Version
159
- version: '0.8'
160
- - - ">="
161
- - !ruby/object:Gem::Version
162
- version: 0.8.2
130
+ version: '0.9'
163
131
  description:
164
132
  email:
165
133
  executables:
@@ -173,7 +141,6 @@ files:
173
141
  - exe/ehbrs
174
142
  - lib/ehbrs.rb
175
143
  - lib/ehbrs/executables.rb
176
- - lib/ehbrs/gems.rb
177
144
  - lib/ehbrs/google.rb
178
145
  - lib/ehbrs/google/translate.rb
179
146
  - lib/ehbrs/google/translate/session.rb
@@ -209,6 +176,8 @@ files:
209
176
  - lib/ehbrs/tools/runner/telegram/send_message.rb
210
177
  - lib/ehbrs/tools/runner/vg.rb
211
178
  - lib/ehbrs/tools/runner/vg/ips.rb
179
+ - lib/ehbrs/tools/runner/vg/ps2.rb
180
+ - lib/ehbrs/tools/runner/vg/ps2/rename.rb
212
181
  - lib/ehbrs/tools/runner/vg/wii.rb
213
182
  - lib/ehbrs/tools/runner/videos.rb
214
183
  - lib/ehbrs/tools/runner/videos/extract.rb
@@ -231,6 +200,8 @@ files:
231
200
  - lib/ehbrs/tools/runner/web_utils/videos.rb
232
201
  - lib/ehbrs/tools/runner/web_utils/videos/download.rb
233
202
  - lib/ehbrs/tools/runner/web_utils/videos/upload.rb
203
+ - lib/ehbrs/tools/runner_with.rb
204
+ - lib/ehbrs/tools/runner_with/filesystem_renamer.rb
234
205
  - lib/ehbrs/tools/version.rb
235
206
  - lib/ehbrs/user_dirs.rb
236
207
  - lib/ehbrs/videos.rb
data/lib/ehbrs/gems.rb DELETED
@@ -1,37 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require 'avm/eac_ruby_base1/sources/base'
4
-
5
- module Ehbrs
6
- module Gems
7
- class << self
8
- enable_simple_cache
9
-
10
- def app_path
11
- ::Pathname.new('../..').expand_path(__dir__)
12
- end
13
-
14
- def vendor_gems_root
15
- app_path.join('vendor')
16
- end
17
-
18
- private
19
-
20
- def app_uncached
21
- ::Avm::EacRubyBase1::Sources::Base.new(app_path)
22
- end
23
-
24
- def all_uncached
25
- vendor_gems + [app]
26
- end
27
-
28
- def vendor_gems_uncached
29
- r = []
30
- vendor_gems_root.each_child.each do |child|
31
- r << ::EacRubyGemsUtils::Gem.new(child) if child.directory?
32
- end
33
- r
34
- end
35
- end
36
- end
37
- end