ehbrs-tools 0.21.0 → 0.24.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/exe/ehbrs +2 -2
- data/lib/ehbrs/core_ext.rb +4 -0
- data/lib/ehbrs/music/album.rb +2 -0
- data/{vendor/eac_cli/lib/eac_cli/patches/module.rb → lib/ehbrs/patches.rb} +1 -1
- data/lib/ehbrs/tools/runner.rb +21 -0
- data/lib/ehbrs/tools/runner/cooking_book.rb +32 -0
- data/lib/ehbrs/tools/runner/cooking_book/build.rb +52 -0
- data/lib/ehbrs/{runner/videos/series.rb → tools/runner/finances.rb} +4 -4
- data/lib/ehbrs/tools/runner/finances/bb_browser.rb +66 -0
- data/lib/ehbrs/tools/runner/fs.rb +18 -0
- data/lib/ehbrs/tools/runner/fs/selected.rb +81 -0
- data/lib/ehbrs/tools/runner/fs/used_space.rb +161 -0
- data/lib/ehbrs/tools/runner/google.rb +18 -0
- data/lib/ehbrs/tools/runner/google/translate.rb +89 -0
- data/lib/ehbrs/tools/runner/music.rb +18 -0
- data/lib/ehbrs/tools/runner/music/selected.rb +28 -0
- data/lib/ehbrs/tools/runner/self.rb +18 -0
- data/lib/ehbrs/tools/runner/self/test.rb +27 -0
- data/lib/ehbrs/tools/runner/telegram.rb +28 -0
- data/lib/ehbrs/tools/runner/telegram/send_message.rb +31 -0
- data/lib/ehbrs/tools/runner/vg.rb +18 -0
- data/lib/ehbrs/tools/runner/vg/ips.rb +134 -0
- data/lib/ehbrs/tools/runner/vg/wii.rb +74 -0
- data/lib/ehbrs/{runner/web_utils → tools/runner}/videos.rb +3 -3
- data/lib/ehbrs/tools/runner/videos/extract.rb +70 -0
- data/lib/ehbrs/tools/runner/videos/probe.rb +34 -0
- data/lib/ehbrs/tools/runner/videos/series.rb +20 -0
- data/lib/ehbrs/tools/runner/videos/series/rename.rb +74 -0
- data/lib/ehbrs/tools/runner/videos/unsupported.rb +61 -0
- data/lib/ehbrs/tools/runner/web_utils.rb +26 -0
- data/lib/ehbrs/tools/runner/web_utils/videos.rb +20 -0
- data/lib/ehbrs/tools/runner/web_utils/videos/download.rb +65 -0
- data/lib/ehbrs/tools/runner/web_utils/videos/upload.rb +77 -0
- data/lib/ehbrs/tools/version.rb +1 -1
- data/lib/ehbrs/vg/wii/game_file.rb +10 -0
- data/lib/ehbrs/videos/unsupported/check_support.rb +12 -8
- data/vendor/aranha-parsers/aranha-parsers.gemspec +2 -2
- data/vendor/aranha-parsers/lib/aranha/parsers/rspec.rb +11 -0
- data/vendor/aranha-parsers/lib/aranha/parsers/rspec/setup_include.rb +17 -0
- data/vendor/aranha-parsers/lib/aranha/parsers/{spec → rspec}/source_target_fixtures_example.rb +0 -0
- data/vendor/aranha-parsers/lib/aranha/parsers/source_address.rb +10 -8
- data/vendor/aranha-parsers/lib/aranha/parsers/version.rb +1 -1
- data/vendor/aranha-parsers/spec/lib/rubocop_check_spec.rb +1 -5
- data/vendor/aranha-parsers/spec/spec_helper.rb +2 -6
- data/vendor/aranha-selenium/aranha-selenium.gemspec +2 -2
- data/vendor/aranha-selenium/lib/aranha/selenium/version.rb +1 -1
- data/vendor/aranha-selenium/spec/rubocop_check_spec.rb +1 -5
- data/vendor/aranha-selenium/spec/spec_helper.rb +2 -98
- data/vendor/eac_cli/eac_cli.gemspec +3 -4
- data/vendor/eac_cli/lib/eac_cli/config.rb +18 -0
- data/vendor/eac_cli/lib/eac_cli/config/entry.rb +46 -0
- data/vendor/eac_cli/lib/eac_cli/config/entry/options.rb +57 -0
- data/vendor/eac_cli/lib/eac_cli/config/entry/undefined.rb +26 -0
- data/vendor/eac_cli/lib/eac_cli/definition/help_formatter.rb +3 -2
- data/vendor/eac_cli/lib/eac_cli/definition/positional_argument.rb +6 -1
- data/vendor/eac_cli/lib/eac_cli/old_configs.rb +0 -1
- data/vendor/eac_cli/lib/eac_cli/old_configs/entry_reader.rb +2 -2
- data/vendor/eac_cli/lib/eac_cli/old_configs_bridge.rb +39 -0
- data/vendor/eac_cli/lib/eac_cli/runner.rb +0 -2
- data/vendor/eac_cli/lib/eac_cli/runner/after_class_methods.rb +20 -3
- data/vendor/eac_cli/lib/eac_cli/runner/instance_methods.rb +5 -1
- data/vendor/eac_cli/lib/eac_cli/runner_with/help.rb +9 -4
- data/vendor/eac_cli/lib/eac_cli/runner_with/help/builder.rb +73 -0
- data/vendor/eac_cli/lib/eac_cli/runner_with/help/builder/alternative.rb +56 -0
- data/vendor/eac_cli/lib/eac_cli/runner_with/subcommands.rb +6 -4
- data/vendor/eac_cli/lib/eac_cli/speaker.rb +15 -19
- data/vendor/eac_cli/lib/eac_cli/speaker/_constants.rb +1 -1
- data/vendor/eac_cli/lib/eac_cli/speaker/list.rb +1 -1
- data/vendor/eac_cli/lib/eac_cli/speaker/options.rb +38 -0
- data/vendor/eac_cli/lib/eac_cli/version.rb +1 -1
- data/vendor/eac_cli/spec/lib/eac_cli/parser/alternative_spec.rb +1 -1
- data/vendor/eac_cli/spec/lib/eac_cli/runner_spec.rb +0 -1
- data/vendor/eac_cli/spec/lib/eac_cli/speaker_spec.rb +5 -9
- data/vendor/eac_cli/spec/rubocop_spec.rb +1 -1
- data/vendor/eac_cli/spec/spec_helper.rb +2 -101
- data/vendor/eac_config/Gemfile +5 -0
- data/vendor/eac_config/eac_config.gemspec +19 -0
- data/vendor/eac_config/lib/eac_config.rb +7 -0
- data/vendor/eac_config/lib/eac_config/entry.rb +49 -0
- data/vendor/eac_config/lib/eac_config/entry_path.rb +41 -0
- data/vendor/eac_config/lib/eac_config/envvars_node.rb +25 -0
- data/vendor/eac_config/lib/eac_config/envvars_node/entry.rb +54 -0
- data/vendor/eac_config/lib/eac_config/load_nodes_search.rb +39 -0
- data/vendor/eac_config/lib/eac_config/load_path.rb +28 -0
- data/vendor/eac_config/lib/eac_config/node.rb +67 -0
- data/vendor/eac_config/lib/eac_config/node_entry.rb +18 -0
- data/vendor/eac_config/lib/eac_config/node_uri.rb +38 -0
- data/vendor/eac_config/lib/eac_config/old_configs.rb +75 -0
- data/vendor/eac_config/lib/eac_config/old_configs/base.rb +43 -0
- data/vendor/eac_config/lib/eac_config/old_configs/file.rb +47 -0
- data/vendor/eac_config/lib/eac_config/paths_hash.rb +56 -0
- data/vendor/eac_config/lib/eac_config/paths_hash/entry_key_error.rb +8 -0
- data/vendor/eac_config/lib/eac_config/paths_hash/node.rb +67 -0
- data/vendor/eac_config/lib/eac_config/paths_hash/path_search.rb +39 -0
- data/vendor/eac_config/lib/eac_config/version.rb +5 -0
- data/vendor/eac_config/lib/eac_config/yaml_file_node.rb +48 -0
- data/vendor/eac_config/lib/eac_config/yaml_file_node/entry.rb +37 -0
- data/vendor/eac_config/spec/lib/eac_config/entry_path_spec.rb +30 -0
- data/vendor/eac_config/spec/lib/eac_config/envvars_node/entry_spec.rb +14 -0
- data/vendor/eac_config/spec/lib/eac_config/envvars_node_spec.rb +40 -0
- data/vendor/eac_config/spec/lib/eac_config/old_configs_spec.rb +46 -0
- data/vendor/eac_config/spec/lib/eac_config/paths_hash_spec.rb +88 -0
- data/vendor/eac_config/spec/lib/eac_config/yaml_file_node_spec.rb +52 -0
- data/vendor/eac_config/spec/lib/eac_config/yaml_file_node_spec_files/storage1.yaml +6 -0
- data/vendor/eac_config/spec/lib/eac_config/yaml_file_node_spec_files/storage1_1.yaml +2 -0
- data/vendor/eac_config/spec/lib/eac_config/yaml_file_node_spec_files/storage1_2.yaml +4 -0
- data/vendor/eac_config/spec/lib/eac_config/yaml_file_node_spec_files/storage1_2/storage1_2_1.yaml +2 -0
- data/vendor/eac_config/spec/rubocop_spec.rb +3 -0
- data/vendor/eac_config/spec/spec_helper.rb +4 -0
- data/vendor/eac_docker/eac_docker.gemspec +2 -2
- data/vendor/eac_docker/lib/eac_docker/container.rb +7 -3
- data/vendor/eac_docker/lib/eac_docker/debug.rb +15 -0
- data/vendor/eac_docker/lib/eac_docker/images/coded.rb +4 -0
- data/vendor/eac_docker/lib/eac_docker/images/templatized.rb +16 -2
- data/vendor/eac_docker/lib/eac_docker/rspec.rb +2 -10
- data/vendor/eac_docker/lib/eac_docker/rspec/setup_include.rb +23 -0
- data/vendor/eac_docker/lib/eac_docker/version.rb +1 -1
- data/vendor/eac_docker/spec/rubocop_spec.rb +1 -1
- data/vendor/eac_docker/spec/spec_helper.rb +2 -104
- data/vendor/eac_ruby_base0/eac_ruby_base0.gemspec +4 -4
- data/vendor/eac_ruby_base0/lib/eac_ruby_base0/application.rb +23 -9
- data/vendor/eac_ruby_base0/lib/eac_ruby_base0/application_xdg.rb +34 -0
- data/vendor/eac_ruby_base0/lib/eac_ruby_base0/jobs_runner.rb +2 -2
- data/vendor/eac_ruby_base0/lib/eac_ruby_base0/runner.rb +19 -7
- data/vendor/eac_ruby_base0/lib/eac_ruby_base0/runner_with/confirmation.rb +8 -1
- data/vendor/eac_ruby_base0/lib/eac_ruby_base0/version.rb +1 -1
- data/vendor/eac_ruby_base0/spec/rubocop_spec.rb +1 -1
- data/vendor/eac_ruby_base0/spec/spec_helper.rb +2 -101
- data/vendor/eac_ruby_utils/eac_ruby_utils.gemspec +1 -1
- data/vendor/eac_ruby_utils/lib/eac_ruby_utils/boolean.rb +1 -1
- data/vendor/eac_ruby_utils/lib/eac_ruby_utils/context.rb +31 -0
- data/vendor/eac_ruby_utils/lib/eac_ruby_utils/contextualizable.rb +12 -7
- data/vendor/eac_ruby_utils/lib/eac_ruby_utils/envs/executable.rb +15 -3
- data/vendor/eac_ruby_utils/lib/eac_ruby_utils/gems_registry.rb +36 -0
- data/vendor/eac_ruby_utils/lib/eac_ruby_utils/gems_registry/gem.rb +39 -0
- data/vendor/eac_ruby_utils/lib/eac_ruby_utils/patches/module/context.rb +11 -0
- data/vendor/eac_ruby_utils/lib/eac_ruby_utils/patches/module/speaker.rb +9 -0
- data/vendor/eac_ruby_utils/lib/eac_ruby_utils/patches/pathname/parent_n.rb +11 -0
- data/vendor/eac_ruby_utils/lib/eac_ruby_utils/rspec/default_setup.rb +18 -0
- data/vendor/eac_ruby_utils/lib/eac_ruby_utils/rspec/setup.rb +45 -0
- data/vendor/eac_ruby_utils/lib/eac_ruby_utils/simple_cache.rb +10 -2
- data/vendor/eac_ruby_utils/lib/eac_ruby_utils/speaker.rb +16 -0
- data/vendor/eac_ruby_utils/lib/eac_ruby_utils/speaker/receiver.rb +57 -0
- data/vendor/eac_ruby_utils/lib/eac_ruby_utils/speaker/sender.rb +32 -0
- data/vendor/eac_ruby_utils/lib/eac_ruby_utils/version.rb +1 -1
- data/vendor/{eac_cli/spec/lib → eac_ruby_utils/spec/lib/eac_ruby_utils/patches}/module/speaker_spec.rb +2 -2
- data/vendor/eac_ruby_utils/spec/lib/eac_ruby_utils/patches/pathname/parent_n_spec.rb +33 -0
- data/vendor/eac_ruby_utils/spec/lib/eac_ruby_utils/simple_cache_spec.rb +18 -0
- data/vendor/eac_ruby_utils/spec/rubocop_check_spec.rb +1 -1
- data/vendor/eac_ruby_utils/spec/spec_helper.rb +6 -6
- data/vendor/ehbrs_ruby_utils/ehbrs_ruby_utils.gemspec +4 -2
- data/vendor/ehbrs_ruby_utils/lib/ehbrs_ruby_utils/finances/bb_browser/docker_image.rb +18 -0
- data/vendor/ehbrs_ruby_utils/lib/ehbrs_ruby_utils/patches/object/template.rb +6 -0
- data/vendor/ehbrs_ruby_utils/lib/ehbrs_ruby_utils/version.rb +1 -1
- data/vendor/ehbrs_ruby_utils/lib/ehbrs_ruby_utils/videos/stream.rb +11 -1
- data/vendor/ehbrs_ruby_utils/spec/lib/ehbrs_ruby_utils/videos/stream_spec.rb +13 -0
- data/vendor/ehbrs_ruby_utils/spec/lib/ehbrs_ruby_utils/videos/stream_spec_files/menina_ovo_attachment.source.yaml +28 -0
- data/vendor/ehbrs_ruby_utils/spec/lib/ehbrs_ruby_utils/videos/stream_spec_files/menina_ovo_attachment.target.yaml +7 -0
- data/vendor/ehbrs_ruby_utils/spec/lib/ehbrs_ruby_utils/videos/stream_spec_files/menina_ovo_audio.source.yaml +49 -0
- data/vendor/ehbrs_ruby_utils/spec/lib/ehbrs_ruby_utils/videos/stream_spec_files/menina_ovo_audio.target.yaml +7 -0
- data/vendor/ehbrs_ruby_utils/spec/lib/ehbrs_ruby_utils/videos/stream_spec_files/menina_ovo_subtitle.source.yaml +43 -0
- data/vendor/ehbrs_ruby_utils/spec/lib/ehbrs_ruby_utils/videos/stream_spec_files/menina_ovo_subtitle.target.yaml +7 -0
- data/vendor/ehbrs_ruby_utils/spec/lib/ehbrs_ruby_utils/videos/stream_spec_files/menina_ovo_video.source.yaml +59 -0
- data/vendor/ehbrs_ruby_utils/spec/lib/ehbrs_ruby_utils/videos/stream_spec_files/menina_ovo_video.target.yaml +7 -0
- data/vendor/ehbrs_ruby_utils/spec/rubocop_check_spec.rb +1 -5
- data/vendor/ehbrs_ruby_utils/spec/spec_helper.rb +2 -98
- data/vendor/ehbrs_ruby_utils/template/ehbrs_ruby_utils/finances/bb_browser/docker_image/Dockerfile +44 -0
- data/vendor/ehbrs_ruby_utils/template/ehbrs_ruby_utils/finances/bb_browser/docker_image/Makefile +35 -0
- data/vendor/ehbrs_ruby_utils/template/ehbrs_ruby_utils/finances/bb_browser/docker_image/README.md +16 -0
- data/vendor/ehbrs_ruby_utils/template/ehbrs_ruby_utils/finances/bb_browser/docker_image/context/firefox.service +8 -0
- data/vendor/ehbrs_ruby_utils/template/ehbrs_ruby_utils/finances/bb_browser/docker_image/context/startbrowser.sh +9 -0
- metadata +115 -52
- data/lib/ehbrs/runner.rb +0 -19
- data/lib/ehbrs/runner/cooking_book.rb +0 -30
- data/lib/ehbrs/runner/cooking_book/build.rb +0 -50
- data/lib/ehbrs/runner/finances.rb +0 -16
- data/lib/ehbrs/runner/finances/bb_browser.rb +0 -35
- data/lib/ehbrs/runner/fs.rb +0 -16
- data/lib/ehbrs/runner/fs/used_space.rb +0 -160
- data/lib/ehbrs/runner/google.rb +0 -16
- data/lib/ehbrs/runner/google/translate.rb +0 -87
- data/lib/ehbrs/runner/music.rb +0 -16
- data/lib/ehbrs/runner/music/selected.rb +0 -63
- data/lib/ehbrs/runner/self.rb +0 -16
- data/lib/ehbrs/runner/self/test.rb +0 -25
- data/lib/ehbrs/runner/telegram.rb +0 -26
- data/lib/ehbrs/runner/telegram/send_message.rb +0 -29
- data/lib/ehbrs/runner/vg.rb +0 -16
- data/lib/ehbrs/runner/vg/ips.rb +0 -132
- data/lib/ehbrs/runner/vg/wii.rb +0 -72
- data/lib/ehbrs/runner/videos.rb +0 -16
- data/lib/ehbrs/runner/videos/extract.rb +0 -68
- data/lib/ehbrs/runner/videos/probe.rb +0 -32
- data/lib/ehbrs/runner/videos/series/rename.rb +0 -72
- data/lib/ehbrs/runner/videos/unsupported.rb +0 -59
- data/lib/ehbrs/runner/web_utils.rb +0 -24
- data/lib/ehbrs/runner/web_utils/videos/download.rb +0 -63
- data/lib/ehbrs/runner/web_utils/videos/upload.rb +0 -75
- data/vendor/eac_cli/lib/eac_cli/docopt/doc_builder.rb +0 -71
- data/vendor/eac_cli/lib/eac_cli/docopt/doc_builder/alternative.rb +0 -50
- data/vendor/eac_cli/lib/eac_cli/docopt/runner_context_replacement.rb +0 -15
- data/vendor/eac_cli/lib/eac_cli/docopt/runner_extension.rb +0 -51
- data/vendor/eac_cli/lib/eac_cli/docopt_runner.rb +0 -43
- data/vendor/eac_cli/lib/eac_cli/docopt_runner/_class_methods.rb +0 -16
- data/vendor/eac_cli/lib/eac_cli/docopt_runner/_doc.rb +0 -23
- data/vendor/eac_cli/lib/eac_cli/docopt_runner/_settings.rb +0 -17
- data/vendor/eac_cli/lib/eac_cli/docopt_runner/_subcommands.rb +0 -152
- data/vendor/eac_cli/lib/eac_cli/patches/module/speaker.rb +0 -10
- data/vendor/eac_cli/lib/eac_cli/speaker/_class_methods.rb +0 -37
- data/vendor/eac_cli/lib/eac_cli/speaker/node.rb +0 -24
- data/vendor/eac_cli/spec/lib/eac_cli/docopt/runner_extension_spec.rb +0 -35
- data/vendor/eac_cli/spec/lib/eac_cli/docopt_runner_spec.rb +0 -136
data/lib/ehbrs/runner.rb
DELETED
@@ -1,19 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
require 'eac_ruby_base0/runner'
|
4
|
-
require 'ehbrs/tools/application'
|
5
|
-
|
6
|
-
module Ehbrs
|
7
|
-
class Runner
|
8
|
-
require_sub __FILE__
|
9
|
-
include ::EacRubyBase0::Runner
|
10
|
-
|
11
|
-
runner_definition do
|
12
|
-
desc 'Tools for EHB/RS.'
|
13
|
-
end
|
14
|
-
|
15
|
-
def application
|
16
|
-
::Ehbrs::Tools.application
|
17
|
-
end
|
18
|
-
end
|
19
|
-
end
|
@@ -1,30 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
require 'eac_cli/core_ext'
|
4
|
-
require 'ehbrs/cooking_book/project'
|
5
|
-
|
6
|
-
module Ehbrs
|
7
|
-
class Runner
|
8
|
-
class CookingBook
|
9
|
-
require_sub __FILE__
|
10
|
-
|
11
|
-
DEFAULT_SOURCE_DIR = '.'
|
12
|
-
|
13
|
-
runner_with :help, :subcommands do
|
14
|
-
desc 'Operações para livros de receitas.'
|
15
|
-
arg_opt '-C', '--source-dir', 'Caminho para o diretório do código-fonte.'
|
16
|
-
subcommands
|
17
|
-
end
|
18
|
-
|
19
|
-
private
|
20
|
-
|
21
|
-
def source_dir_uncached
|
22
|
-
(parsed.source_dir || DEFAULT_SOURCE_DIR).to_pathname.expand_path
|
23
|
-
end
|
24
|
-
|
25
|
-
def project_uncached
|
26
|
-
::Ehbrs::CookingBook::Project.new(source_dir)
|
27
|
-
end
|
28
|
-
end
|
29
|
-
end
|
30
|
-
end
|
@@ -1,50 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
require 'eac_cli/core_ext'
|
4
|
-
require 'ehbrs/cooking_book/build'
|
5
|
-
require 'os'
|
6
|
-
|
7
|
-
module Ehbrs
|
8
|
-
class Runner
|
9
|
-
class CookingBook
|
10
|
-
class Build
|
11
|
-
runner_with :help, :subcommands do
|
12
|
-
desc 'Operações para livros de receitas.'
|
13
|
-
arg_opt '-d', '--target-dir', 'Caminho para o diretório destino da construção.'
|
14
|
-
bool_opt '--open', 'Show the result.'
|
15
|
-
end
|
16
|
-
|
17
|
-
def run
|
18
|
-
start_banner
|
19
|
-
build.run
|
20
|
-
open
|
21
|
-
success 'Done'
|
22
|
-
end
|
23
|
-
|
24
|
-
private
|
25
|
-
|
26
|
-
def build_uncached
|
27
|
-
::Ehbrs::CookingBook::Build.new(
|
28
|
-
runner_context.call(:project), target_dir: parsed.target_dir
|
29
|
-
)
|
30
|
-
end
|
31
|
-
|
32
|
-
def open
|
33
|
-
return unless parsed.open?
|
34
|
-
|
35
|
-
infom "Opening \"#{open_path}\"..."
|
36
|
-
::EacRubyUtils::Envs.local.command(OS.open_file_command, open_path).system!
|
37
|
-
end
|
38
|
-
|
39
|
-
def open_path
|
40
|
-
build.index_page.target_path
|
41
|
-
end
|
42
|
-
|
43
|
-
def start_banner
|
44
|
-
infov 'Project', build.project
|
45
|
-
infov 'Target directory', build.target_dir
|
46
|
-
end
|
47
|
-
end
|
48
|
-
end
|
49
|
-
end
|
50
|
-
end
|
@@ -1,16 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
require 'eac_cli/core_ext'
|
4
|
-
|
5
|
-
module Ehbrs
|
6
|
-
class Runner
|
7
|
-
class Finances
|
8
|
-
require_sub __FILE__
|
9
|
-
|
10
|
-
runner_with :help, :subcommands do
|
11
|
-
desc 'Utilidades financeiras.'
|
12
|
-
subcommands
|
13
|
-
end
|
14
|
-
end
|
15
|
-
end
|
16
|
-
end
|
@@ -1,35 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
require 'eac_cli/core_ext'
|
4
|
-
require 'ehbrs/videos/extract/package'
|
5
|
-
require 'eac_docker/images/named'
|
6
|
-
|
7
|
-
module Ehbrs
|
8
|
-
class Runner
|
9
|
-
class Finances
|
10
|
-
class BbBrowser
|
11
|
-
runner_with :help do
|
12
|
-
desc 'Bankline para Banco do Brasil com módulo de segurança.'
|
13
|
-
end
|
14
|
-
|
15
|
-
def run
|
16
|
-
infov 'Docker run arguments', docker_container.run_command_args
|
17
|
-
infov 'System result', docker_container.run_command.system
|
18
|
-
end
|
19
|
-
|
20
|
-
private
|
21
|
-
|
22
|
-
def docker_image_uncached
|
23
|
-
::EacDocker::Images::Named.new('lichti/warsaw-browser')
|
24
|
-
end
|
25
|
-
|
26
|
-
def docker_container_uncached
|
27
|
-
docker_image.container.env('DISPLAY', "unix#{ENV.fetch('DISPLAY')}")
|
28
|
-
.volume(::File.join(ENV['HOME'], 'Downloads'), '/home/bank/Downloads')
|
29
|
-
.volume('/tmp/.X11-unix', '/tmp/.X11-unix').command_arg('bb')
|
30
|
-
.temporary(true).interactive(true).tty(true)
|
31
|
-
end
|
32
|
-
end
|
33
|
-
end
|
34
|
-
end
|
35
|
-
end
|
data/lib/ehbrs/runner/fs.rb
DELETED
@@ -1,16 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
require 'eac_cli/core_ext'
|
4
|
-
|
5
|
-
module Ehbrs
|
6
|
-
class Runner
|
7
|
-
class Fs
|
8
|
-
require_sub __FILE__
|
9
|
-
|
10
|
-
runner_with :help, :subcommands do
|
11
|
-
desc 'Ferramentas para o sistema de arquivos.'
|
12
|
-
subcommands
|
13
|
-
end
|
14
|
-
end
|
15
|
-
end
|
16
|
-
end
|
@@ -1,160 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
require 'eac_cli/core_ext'
|
4
|
-
require 'ehbrs/self/observers/used_space'
|
5
|
-
require 'filesize'
|
6
|
-
|
7
|
-
module Ehbrs
|
8
|
-
class Runner
|
9
|
-
class Fs
|
10
|
-
class UsedSpace
|
11
|
-
runner_with :help do
|
12
|
-
desc 'Verifica e anota alterações de espaço usado de um objeto de sistema de arquivos.'
|
13
|
-
bool_opt '-c', '--check', 'Anota o espaço em disco.'
|
14
|
-
bool_opt '-v', '--verbose', 'Verbose.'
|
15
|
-
pos_arg :paths, repeat: true
|
16
|
-
end
|
17
|
-
|
18
|
-
def run
|
19
|
-
root_banner
|
20
|
-
paths.each(&:run)
|
21
|
-
end
|
22
|
-
|
23
|
-
def check?
|
24
|
-
parsed.check
|
25
|
-
end
|
26
|
-
|
27
|
-
private
|
28
|
-
|
29
|
-
def root_banner
|
30
|
-
return unless verbose?
|
31
|
-
|
32
|
-
infov 'Paths', paths.count
|
33
|
-
infov 'Check?', check?
|
34
|
-
infov 'Verbose?', verbose?
|
35
|
-
end
|
36
|
-
|
37
|
-
def path_class
|
38
|
-
verbose? ? PathVerbose : PathUnverbose
|
39
|
-
end
|
40
|
-
|
41
|
-
def paths_uncached
|
42
|
-
parsed.paths.map { |path| path_class.new(self, path) }
|
43
|
-
end
|
44
|
-
|
45
|
-
def verbose?
|
46
|
-
parsed.verbose
|
47
|
-
end
|
48
|
-
|
49
|
-
class PathBase
|
50
|
-
enable_simple_cache
|
51
|
-
enable_speaker
|
52
|
-
common_constructor :runner, :path do
|
53
|
-
self.path = path.to_pathname
|
54
|
-
end
|
55
|
-
|
56
|
-
private
|
57
|
-
|
58
|
-
def last_change_time
|
59
|
-
time_label(observer.observer.last_change_time)
|
60
|
-
end
|
61
|
-
|
62
|
-
def last_check
|
63
|
-
time_label(observer.observer.last_check_time)
|
64
|
-
end
|
65
|
-
|
66
|
-
def last_value
|
67
|
-
bytes_label(observer.observer.last_value)
|
68
|
-
end
|
69
|
-
|
70
|
-
def current_value
|
71
|
-
bytes_label(observer.current_value).colorize(
|
72
|
-
observer.changing_value? ? :green : :light_black
|
73
|
-
)
|
74
|
-
end
|
75
|
-
|
76
|
-
def changing_value?
|
77
|
-
changing_label(observer.changing_value?)
|
78
|
-
end
|
79
|
-
|
80
|
-
def observer_uncached
|
81
|
-
::Ehbrs::Self::Observers::UsedSpace.new(path)
|
82
|
-
end
|
83
|
-
|
84
|
-
def changing_label(bool)
|
85
|
-
bool.to_s.colorize(bool ? :green : :light_black)
|
86
|
-
end
|
87
|
-
|
88
|
-
def time_label(time)
|
89
|
-
time.if_present('-', &:to_s)
|
90
|
-
end
|
91
|
-
end
|
92
|
-
|
93
|
-
class PathVerbose < PathBase
|
94
|
-
def run
|
95
|
-
infom path.to_s
|
96
|
-
on_speaker_node do |node|
|
97
|
-
node.stderr_line_prefix = ' '
|
98
|
-
banner
|
99
|
-
check
|
100
|
-
end
|
101
|
-
end
|
102
|
-
|
103
|
-
private
|
104
|
-
|
105
|
-
def banner
|
106
|
-
{ 'Path' => observer.path,
|
107
|
-
'Persistence path' => observer.persistence_path,
|
108
|
-
'Last check' => last_check,
|
109
|
-
'Last change' => last_change_time,
|
110
|
-
'Last value' => last_value,
|
111
|
-
'Current value' => current_value,
|
112
|
-
'Changing?' => changing_value? }.each do |k, v|
|
113
|
-
infov k, v
|
114
|
-
end
|
115
|
-
end
|
116
|
-
|
117
|
-
def check
|
118
|
-
return unless runner.check?
|
119
|
-
|
120
|
-
infom 'Checking...'
|
121
|
-
if observer.check_current_value
|
122
|
-
success 'A new value was recorded'
|
123
|
-
else
|
124
|
-
info 'No new value was recorded'
|
125
|
-
end
|
126
|
-
end
|
127
|
-
|
128
|
-
def bytes_label(number)
|
129
|
-
number.if_present('-') { |v| "#{v} (#{::Filesize.from("#{v} B").pretty})" }
|
130
|
-
end
|
131
|
-
end
|
132
|
-
|
133
|
-
class PathUnverbose < PathBase
|
134
|
-
def run
|
135
|
-
self.puts output_line
|
136
|
-
end
|
137
|
-
|
138
|
-
def output_line
|
139
|
-
[path.to_s.cyan, last_change_time, last_value, current_value, check_result]
|
140
|
-
.reject(&:blank?).join('|')
|
141
|
-
end
|
142
|
-
|
143
|
-
def check_result
|
144
|
-
return nil unless runner.check?
|
145
|
-
|
146
|
-
observer.check_current_value ? 'Recorded'.green : 'Unchanged'.light_black
|
147
|
-
end
|
148
|
-
|
149
|
-
def bytes_label(number)
|
150
|
-
number.if_present('-') { |v| ::Filesize.from("#{v} B").pretty }
|
151
|
-
end
|
152
|
-
|
153
|
-
def time_label(time)
|
154
|
-
time.if_present('-') { |t| t.strftime('%d/%m/%y %H:%M') }
|
155
|
-
end
|
156
|
-
end
|
157
|
-
end
|
158
|
-
end
|
159
|
-
end
|
160
|
-
end
|
data/lib/ehbrs/runner/google.rb
DELETED
@@ -1,87 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
require 'eac_cli/default_runner'
|
4
|
-
require 'eac_ruby_utils/core_ext'
|
5
|
-
require 'ehbrs/google/translate/session'
|
6
|
-
|
7
|
-
module Ehbrs
|
8
|
-
class Runner
|
9
|
-
class Google
|
10
|
-
class Translate
|
11
|
-
runner_with :help do
|
12
|
-
desc 'Traduz um documento com Google Translate.'
|
13
|
-
arg_opt '-o', '--output-file', 'Salva saída em <output-file>.'
|
14
|
-
bool_opt '-w', '--overwrite', 'Permite sobreescrever arquivo de saída.'
|
15
|
-
pos_arg 'source-file'
|
16
|
-
end
|
17
|
-
|
18
|
-
def run
|
19
|
-
start_banner
|
20
|
-
validate
|
21
|
-
if output_to_stdout?
|
22
|
-
out(translated_content)
|
23
|
-
else
|
24
|
-
::File.write(output_file, translated_content)
|
25
|
-
end
|
26
|
-
success 'Concluído'
|
27
|
-
end
|
28
|
-
|
29
|
-
def start_banner
|
30
|
-
infov 'Source file', source_file
|
31
|
-
infov 'Target file', output_file
|
32
|
-
end
|
33
|
-
|
34
|
-
def translated_content_uncached
|
35
|
-
session.translate(source_file)
|
36
|
-
end
|
37
|
-
|
38
|
-
delegate :source_file, to: :parsed
|
39
|
-
|
40
|
-
def output_file
|
41
|
-
parsed.output_file || default_output_file
|
42
|
-
end
|
43
|
-
|
44
|
-
def default_output_file
|
45
|
-
::File.join(
|
46
|
-
::File.dirname(source_file),
|
47
|
-
::File.basename(source_file, '.*') + '_translated.html'
|
48
|
-
)
|
49
|
-
end
|
50
|
-
|
51
|
-
def session_uncached
|
52
|
-
::Ehbrs::Google::Translate::Session.new
|
53
|
-
end
|
54
|
-
|
55
|
-
def validate
|
56
|
-
validate_source_file
|
57
|
-
validate_output_file
|
58
|
-
validate_output_content
|
59
|
-
end
|
60
|
-
|
61
|
-
def validate_source_file
|
62
|
-
return if ::File.exist?(source_file)
|
63
|
-
|
64
|
-
fatal_error "Source file \"#{source_file}\" does not exist"
|
65
|
-
end
|
66
|
-
|
67
|
-
def validate_output_file
|
68
|
-
return if output_to_stdout?
|
69
|
-
return unless ::File.exist?(output_file)
|
70
|
-
return if parsed.overwrite?
|
71
|
-
|
72
|
-
fatal_error "Output file \"#{output_file}\" already exists"
|
73
|
-
end
|
74
|
-
|
75
|
-
def validate_output_content
|
76
|
-
return if translated_content.present?
|
77
|
-
|
78
|
-
fatal_error 'Output content is empty'
|
79
|
-
end
|
80
|
-
|
81
|
-
def output_to_stdout?
|
82
|
-
output_file == '-'
|
83
|
-
end
|
84
|
-
end
|
85
|
-
end
|
86
|
-
end
|
87
|
-
end
|
data/lib/ehbrs/runner/music.rb
DELETED