ehbrs-tools 0.3.1 → 0.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (38) hide show
  1. checksums.yaml +4 -4
  2. data/exe/ehbrs +2 -2
  3. data/lib/ehbrs/executables.rb +8 -7
  4. data/lib/ehbrs/runner.rb +33 -0
  5. data/lib/ehbrs/runner/vg.rb +19 -0
  6. data/lib/ehbrs/runner/vg/ips.rb +88 -0
  7. data/lib/ehbrs/runner/vg/wii.rb +75 -0
  8. data/lib/ehbrs/runner/videos.rb +23 -0
  9. data/lib/ehbrs/runner/videos/unsupported.rb +63 -0
  10. data/lib/ehbrs/tools/version.rb +1 -1
  11. data/lib/ehbrs/vg.rb +9 -0
  12. data/lib/ehbrs/vg/wii.rb +11 -0
  13. data/lib/ehbrs/vg/wii/file_move.rb +89 -0
  14. data/lib/ehbrs/vg/wii/game_file.rb +64 -0
  15. data/lib/ehbrs/vg/wii/wit.rb +13 -0
  16. data/lib/ehbrs/vg/wii/wit/image_format.rb +46 -0
  17. data/lib/ehbrs/vg/wii/wit/parsers/dump.rb +62 -0
  18. data/lib/ehbrs/vg/wii/wit/parsers/info.rb +39 -0
  19. data/lib/ehbrs/vg/wii/wit/path.rb +55 -0
  20. data/lib/ehbrs/videos/unsupported/search.rb +13 -10
  21. data/vendor/eac_ruby_utils/lib/eac_ruby_utils.rb +1 -19
  22. data/vendor/eac_ruby_utils/lib/eac_ruby_utils/by_reference.rb +1 -1
  23. data/vendor/eac_ruby_utils/lib/eac_ruby_utils/custom_format.rb +53 -0
  24. data/vendor/eac_ruby_utils/lib/eac_ruby_utils/envs/command.rb +7 -0
  25. data/vendor/eac_ruby_utils/lib/eac_ruby_utils/envs/spawn.rb +32 -0
  26. data/vendor/eac_ruby_utils/lib/eac_ruby_utils/fs.rb +9 -0
  27. data/vendor/eac_ruby_utils/lib/eac_ruby_utils/fs/traversable.rb +47 -0
  28. data/vendor/eac_ruby_utils/lib/eac_ruby_utils/fs/traverser.rb +74 -0
  29. data/vendor/eac_ruby_utils/lib/eac_ruby_utils/patches/class/common_constructor.rb +2 -2
  30. data/vendor/eac_ruby_utils/lib/eac_ruby_utils/version.rb +1 -1
  31. data/vendor/eac_ruby_utils/spec/lib/eac_ruby_utils/custom_format_spec.rb +60 -0
  32. metadata +37 -8
  33. data/lib/ehbrs/tools/runner.rb +0 -35
  34. data/lib/ehbrs/tools/runner/vg.rb +0 -26
  35. data/lib/ehbrs/tools/runner/vg/ips.rb +0 -90
  36. data/lib/ehbrs/tools/runner/videos.rb +0 -25
  37. data/lib/ehbrs/tools/runner/videos/unsupported.rb +0 -65
  38. data/vendor/eac_ruby_utils/lib/eac_ruby_utils/filesystem_traverser.rb +0 -56
@@ -1,25 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require 'eac_ruby_utils/core_ext'
4
- require 'eac_ruby_utils/console/docopt_runner'
5
-
6
- module Ehbrs
7
- module Tools
8
- class Runner < ::EacRubyUtils::Console::DocoptRunner
9
- class Videos < ::EacRubyUtils::Console::DocoptRunner
10
- require_sub __FILE__
11
-
12
- DOC = <<~DOCOPT
13
- Video tools for EHB/RS.
14
-
15
- Usage:
16
- __PROGRAM__ [options] __SUBCOMMANDS__
17
- __PROGRAM__ -h | --help
18
-
19
- Options:
20
- -h --help Show this screen.
21
- DOCOPT
22
- end
23
- end
24
- end
25
- end
@@ -1,65 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require 'eac_cli/default_runner'
4
- require 'eac_ruby_utils/core_ext'
5
- require 'eac_ruby_utils/console/docopt_runner'
6
- require 'ehbrs/videos/unsupported/check_set'
7
- require 'ehbrs/videos/unsupported/search'
8
- require 'ehbrs/videos/unsupported/profiles'
9
-
10
- module Ehbrs
11
- module Tools
12
- class Runner < ::EacRubyUtils::Console::DocoptRunner
13
- class Videos < ::EacRubyUtils::Console::DocoptRunner
14
- class Unsupported < ::EacRubyUtils::Console::DocoptRunner
15
- include ::EacCli::DefaultRunner
16
-
17
- PROFILES = %w[philco samsung].freeze
18
-
19
- runner_definition do
20
- desc 'Procura e converte vídeos não suportados pelas TVs de EHB/RS.'
21
- bool_opt '-f', '--fix', 'Converte vídeos para o formato apropriado.'
22
- arg_opt '-p', '--profiles', "Seleciona os perfis (#{PROFILES.join(', ')})."
23
- pos_arg 'paths', repeat: true
24
- end
25
-
26
- def run
27
- infov 'Profiles', profiles.join(', ')
28
- infov 'Paths', paths
29
- paths.each do |d|
30
- ::Ehbrs::Videos::Unsupported::Search.new(d, file_options)
31
- end
32
- end
33
-
34
- private
35
-
36
- def file_check_set_uncached
37
- ::Ehbrs::Videos::Unsupported::CheckSet.build(profiles, :file)
38
- end
39
-
40
- def track_check_set_uncached
41
- ::Ehbrs::Videos::Unsupported::CheckSet.build(profiles, :track)
42
- end
43
-
44
- def paths
45
- options.fetch('<paths>')
46
- end
47
-
48
- def file_options
49
- { file_check_set: file_check_set, track_check_set: track_check_set,
50
- fix: options.fetch('--fix') }
51
- end
52
-
53
- def profiles_uncached
54
- options.fetch('--profiles').if_present(PROFILES) { |v| v.split(',').map(&:strip) }
55
- .map { |name| profile_class(name).instance }
56
- end
57
-
58
- def profile_class(profile_name)
59
- ::Ehbrs::Videos::Unsupported::Profiles.const_get(profile_name.camelize)
60
- end
61
- end
62
- end
63
- end
64
- end
65
- end
@@ -1,56 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module EacRubyUtils
4
- class FilesystemTraverser
5
- attr_accessor :check_directory, :check_file, :recursive, :hidden_directories
6
-
7
- def check_path(path)
8
- path = ::Pathname.new(path.to_s) unless path.is_a?(::Pathname)
9
- internal_check_path(path, 0)
10
- end
11
-
12
- def hidden_directories?
13
- hidden_directories ? true : false
14
- end
15
-
16
- def recursive?
17
- recursive ? true : false
18
- end
19
-
20
- private
21
-
22
- def process_directory?(level)
23
- level.zero? || recursive?
24
- end
25
-
26
- def inner_check_directory(dir, level)
27
- return unless process_directory?(level)
28
-
29
- user_check_directory(dir)
30
- dir.each_entry do |e|
31
- next if %(. ..).include?(e.basename.to_s)
32
- next unless !e.basename.to_s.start_with?('.') || hidden_directories?
33
-
34
- internal_check_path(dir.join(e), level + 1)
35
- end
36
- end
37
-
38
- def internal_check_path(path, level)
39
- if path.file?
40
- user_check_file(path)
41
- elsif path.directory?
42
- inner_check_directory(path, level)
43
- else
44
- raise "Unknown filesystem object: #{path}"
45
- end
46
- end
47
-
48
- def user_check_file(path)
49
- check_file&.call(path)
50
- end
51
-
52
- def user_check_directory(path)
53
- check_directory&.call(path)
54
- end
55
- end
56
- end