ehbrs-tools 0.16.5 → 0.21.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/ehbrs/cooking_book.rb +9 -0
- data/lib/ehbrs/cooking_book/build.rb +45 -0
- data/lib/ehbrs/cooking_book/build/base_page.rb +43 -0
- data/lib/ehbrs/cooking_book/build/index_page.rb +26 -0
- data/lib/ehbrs/cooking_book/build/recipe_page.rb +27 -0
- data/lib/ehbrs/cooking_book/project.rb +31 -0
- data/lib/ehbrs/cooking_book/recipe.rb +37 -0
- data/lib/ehbrs/cooking_book/recipe/ingredient.rb +21 -0
- data/lib/ehbrs/cooking_book/recipe/measure.rb +60 -0
- data/lib/ehbrs/cooking_book/recipe/part.rb +32 -0
- data/lib/ehbrs/music.rb +9 -0
- data/lib/ehbrs/music/album.rb +42 -0
- data/lib/ehbrs/observers/base.rb +1 -1
- data/lib/ehbrs/observers/with_persistence.rb +1 -1
- data/lib/ehbrs/patches/module/erb_template.rb +11 -0
- data/lib/ehbrs/patches/object/erb_template.rb +9 -0
- data/lib/ehbrs/patches/object/template.rb +7 -0
- data/lib/ehbrs/runner.rb +6 -13
- data/lib/ehbrs/runner/cooking_book.rb +30 -0
- data/lib/ehbrs/runner/cooking_book/build.rb +50 -0
- data/lib/ehbrs/runner/fs/used_space.rb +1 -1
- data/lib/ehbrs/runner/music.rb +16 -0
- data/lib/ehbrs/runner/music/selected.rb +63 -0
- data/lib/ehbrs/runner/telegram.rb +26 -0
- data/lib/ehbrs/runner/telegram/send_message.rb +29 -0
- data/lib/ehbrs/runner/videos/probe.rb +2 -2
- data/lib/ehbrs/runner/videos/unsupported.rb +1 -1
- data/lib/ehbrs/runner/web_utils/videos/upload.rb +1 -1
- data/lib/ehbrs/telegram.rb +9 -0
- data/lib/ehbrs/telegram/message_sending.rb +32 -0
- data/lib/ehbrs/tools/application.rb +13 -0
- data/lib/ehbrs/tools/instance.rb +16 -0
- data/lib/ehbrs/tools/version.rb +1 -1
- data/lib/ehbrs/videos/convert_job.rb +1 -1
- data/lib/ehbrs/videos/series/rename/line_result.rb +1 -1
- data/lib/ehbrs/videos/unsupported/check_support.rb +3 -2
- data/lib/ehbrs/videos/unsupported/fixes/supported_codec.rb +1 -1
- data/lib/ehbrs/videos/unsupported/profiles/aoc.rb +27 -0
- data/lib/ehbrs/videos/unsupported/search.rb +1 -1
- data/lib/ehbrs/videos/unsupported/track.rb +1 -1
- data/template/ehbrs/cooking_book/build/base_page/layout.html.erb +20 -0
- data/template/ehbrs/cooking_book/build/index_page/inner.html.erb +6 -0
- data/template/ehbrs/cooking_book/build/recipe_page/inner.html.erb +6 -0
- data/template/ehbrs/cooking_book/build/recipe_page/part.html.erb +27 -0
- data/vendor/aranha-selenium/lib/aranha/selenium/driver_factory/base.rb +8 -0
- data/vendor/aranha-selenium/lib/aranha/selenium/driver_factory/chrome.rb +10 -5
- data/vendor/aranha-selenium/lib/aranha/selenium/driver_factory/firefox.rb +25 -11
- data/vendor/aranha-selenium/lib/aranha/selenium/version.rb +1 -1
- data/vendor/eac_cli/eac_cli.gemspec +5 -2
- data/vendor/eac_cli/lib/eac_cli/core_ext.rb +2 -0
- data/vendor/eac_cli/lib/eac_cli/default_runner.rb +1 -1
- data/vendor/eac_cli/lib/eac_cli/definition/alternative.rb +4 -7
- data/vendor/eac_cli/lib/eac_cli/definition/argument_option.rb +8 -0
- data/vendor/eac_cli/lib/eac_cli/definition/base_option.rb +26 -10
- data/vendor/eac_cli/lib/eac_cli/definition/base_option/initialize_args_parser.rb +47 -0
- data/vendor/eac_cli/lib/eac_cli/definition/boolean_option.rb +8 -0
- data/vendor/eac_cli/lib/eac_cli/definition/help_formatter.rb +2 -2
- data/vendor/eac_cli/lib/eac_cli/definition/positional_argument.rb +12 -0
- data/vendor/eac_cli/lib/eac_cli/docopt/doc_builder.rb +18 -2
- data/vendor/eac_cli/lib/eac_cli/docopt/doc_builder/alternative.rb +3 -3
- data/vendor/eac_cli/lib/eac_cli/docopt/runner_context_replacement.rb +15 -0
- data/vendor/eac_cli/lib/eac_cli/docopt/runner_extension.rb +7 -2
- data/vendor/eac_cli/lib/eac_cli/docopt_runner.rb +43 -0
- data/vendor/eac_cli/lib/eac_cli/docopt_runner/_class_methods.rb +16 -0
- data/vendor/eac_cli/lib/eac_cli/docopt_runner/_doc.rb +23 -0
- data/vendor/eac_cli/lib/eac_cli/docopt_runner/_settings.rb +17 -0
- data/vendor/eac_cli/lib/eac_cli/docopt_runner/_subcommands.rb +152 -0
- data/vendor/eac_cli/lib/eac_cli/old_configs.rb +36 -0
- data/vendor/eac_cli/lib/eac_cli/old_configs/entry_reader.rb +80 -0
- data/vendor/eac_cli/lib/eac_cli/old_configs/password_entry_reader.rb +16 -0
- data/vendor/eac_cli/lib/eac_cli/old_configs/read_entry_options.rb +44 -0
- data/vendor/eac_cli/lib/eac_cli/old_configs/store_passwords_entry_reader.rb +25 -0
- data/vendor/eac_cli/lib/eac_cli/parser/alternative.rb +4 -4
- data/vendor/eac_cli/lib/eac_cli/parser/alternative/long_options.rb +37 -0
- data/vendor/eac_cli/lib/eac_cli/parser/alternative/option_argument.rb +29 -0
- data/vendor/eac_cli/lib/eac_cli/parser/alternative/options.rb +7 -36
- data/vendor/eac_cli/lib/eac_cli/parser/alternative/short_options.rb +47 -0
- data/vendor/eac_cli/lib/eac_cli/parser/collector.rb +3 -17
- data/vendor/eac_cli/lib/eac_cli/patches/module.rb +4 -0
- data/vendor/eac_cli/lib/eac_cli/patches/module/speaker.rb +10 -0
- data/vendor/eac_cli/lib/eac_cli/patches/object/runner_with.rb +3 -2
- data/vendor/eac_cli/lib/eac_cli/runner.rb +0 -48
- data/vendor/eac_cli/lib/eac_cli/runner/after_class_methods.rb +29 -0
- data/vendor/eac_cli/lib/eac_cli/runner/context.rb +2 -1
- data/vendor/eac_cli/lib/eac_cli/runner/instance_methods.rb +38 -0
- data/vendor/eac_cli/lib/eac_cli/runner_with/subcommands.rb +19 -3
- data/vendor/eac_cli/lib/eac_cli/runner_with/subcommands/definition_concern.rb +10 -0
- data/vendor/eac_cli/lib/eac_cli/runner_with_set.rb +50 -0
- data/vendor/eac_cli/lib/eac_cli/speaker.rb +131 -0
- data/vendor/eac_cli/lib/eac_cli/speaker/_class_methods.rb +37 -0
- data/vendor/eac_cli/lib/eac_cli/speaker/_constants.rb +12 -0
- data/vendor/eac_cli/lib/eac_cli/speaker/list.rb +61 -0
- data/vendor/eac_cli/lib/eac_cli/speaker/node.rb +24 -0
- data/vendor/eac_cli/lib/eac_cli/version.rb +1 -1
- data/vendor/eac_cli/spec/lib/eac_cli/definition/alternative_spec.rb +4 -0
- data/vendor/eac_cli/spec/lib/eac_cli/docopt/runner_extension_spec.rb +1 -1
- data/vendor/{eac_ruby_utils/spec/lib/eac_ruby_utils/console → eac_cli/spec/lib/eac_cli}/docopt_runner_spec.rb +5 -5
- data/vendor/{eac_ruby_utils/spec/lib/eac_ruby_utils/console/configs_spec.rb → eac_cli/spec/lib/eac_cli/old_configs_spec.rb} +2 -2
- data/vendor/eac_cli/spec/lib/eac_cli/runner_spec.rb +44 -5
- data/vendor/{eac_ruby_utils/spec/lib/eac_ruby_utils/console → eac_cli/spec/lib/eac_cli}/speaker_spec.rb +2 -2
- data/vendor/eac_cli/spec/lib/module/speaker_spec.rb +13 -0
- data/vendor/eac_cli/spec/rubocop_spec.rb +1 -5
- data/vendor/eac_cli/spec/spec_helper.rb +3 -0
- data/vendor/eac_docker/eac_docker.gemspec +3 -2
- data/vendor/eac_docker/lib/eac_docker/images/templatized.rb +1 -0
- data/vendor/eac_docker/lib/eac_docker/version.rb +1 -1
- data/vendor/eac_docker/spec/lib/eac_docker/images/templatized_spec.rb +2 -1
- data/vendor/eac_docker/spec/rubocop_spec.rb +1 -5
- data/vendor/eac_docker/spec/spec_helper.rb +3 -0
- data/vendor/eac_ruby_base0/Gemfile +5 -0
- data/vendor/eac_ruby_base0/eac_ruby_base0.gemspec +20 -0
- data/vendor/eac_ruby_base0/lib/eac_ruby_base0.rb +7 -0
- data/vendor/eac_ruby_base0/lib/eac_ruby_base0/application.rb +69 -0
- data/vendor/eac_ruby_base0/lib/eac_ruby_base0/core_ext.rb +4 -0
- data/vendor/eac_ruby_base0/lib/eac_ruby_base0/jobs_runner.rb +31 -0
- data/vendor/eac_ruby_base0/lib/eac_ruby_base0/patches.rb +4 -0
- data/vendor/eac_ruby_base0/lib/eac_ruby_base0/patches/class.rb +4 -0
- data/vendor/eac_ruby_base0/lib/eac_ruby_base0/patches/class/jobs_runner.rb +10 -0
- data/vendor/eac_ruby_base0/lib/eac_ruby_base0/patches/object.rb +5 -0
- data/vendor/eac_ruby_base0/lib/eac_ruby_base0/patches/object/runner_with.rb +5 -0
- data/vendor/eac_ruby_base0/lib/eac_ruby_base0/runner.rb +52 -0
- data/vendor/eac_ruby_base0/lib/eac_ruby_base0/runner/test_all.rb +22 -0
- data/vendor/eac_ruby_base0/lib/eac_ruby_base0/runner_with.rb +9 -0
- data/vendor/eac_ruby_base0/lib/eac_ruby_base0/runner_with/confirmation.rb +36 -0
- data/vendor/eac_ruby_base0/lib/eac_ruby_base0/runner_with/filesystem_traverser.rb +52 -0
- data/vendor/eac_ruby_base0/lib/eac_ruby_base0/runner_with/input.rb +36 -0
- data/vendor/eac_ruby_base0/lib/eac_ruby_base0/runner_with/output.rb +58 -0
- data/vendor/eac_ruby_base0/lib/eac_ruby_base0/version.rb +5 -0
- data/vendor/eac_ruby_base0/spec/lib/eac_ruby_base0/runner_with/confirmation_spec.rb +42 -0
- data/vendor/eac_ruby_base0/spec/lib/eac_ruby_base0/runner_with/output_spec.rb +81 -0
- data/vendor/eac_ruby_base0/spec/rubocop_spec.rb +3 -0
- data/vendor/eac_ruby_base0/spec/spec_helper.rb +103 -0
- data/vendor/eac_ruby_utils/eac_ruby_utils.gemspec +2 -3
- data/vendor/eac_ruby_utils/lib/eac_ruby_utils/common_concern/module_setup.rb +16 -6
- data/vendor/eac_ruby_utils/lib/eac_ruby_utils/common_constructor.rb +2 -99
- data/vendor/eac_ruby_utils/lib/eac_ruby_utils/common_constructor/class_initialize.rb +29 -0
- data/vendor/eac_ruby_utils/lib/eac_ruby_utils/common_constructor/instance_initialize.rb +53 -0
- data/vendor/eac_ruby_utils/lib/eac_ruby_utils/common_constructor/super_args.rb +54 -0
- data/vendor/eac_ruby_utils/lib/eac_ruby_utils/envs/command.rb +10 -5
- data/vendor/eac_ruby_utils/lib/eac_ruby_utils/filesystem_cache.rb +6 -0
- data/vendor/eac_ruby_utils/lib/eac_ruby_utils/fs/logs.rb +63 -0
- data/vendor/eac_ruby_utils/lib/eac_ruby_utils/fs/traverser.rb +0 -2
- data/vendor/eac_ruby_utils/lib/eac_ruby_utils/inflector.rb +13 -2
- data/vendor/eac_ruby_utils/lib/eac_ruby_utils/listable/list.rb +3 -2
- data/vendor/eac_ruby_utils/lib/eac_ruby_utils/local_time_zone.rb +48 -0
- data/vendor/eac_ruby_utils/lib/eac_ruby_utils/patches/class/settings_provider.rb +10 -0
- data/vendor/eac_ruby_utils/lib/eac_ruby_utils/patches/kernel.rb +4 -0
- data/vendor/eac_ruby_utils/lib/eac_ruby_utils/patches/kernel/nyi.rb +10 -0
- data/vendor/eac_ruby_utils/lib/eac_ruby_utils/patches/module/common_concern.rb +0 -1
- data/vendor/eac_ruby_utils/lib/eac_ruby_utils/patches/object/if_nil.rb +17 -0
- data/vendor/eac_ruby_utils/lib/eac_ruby_utils/patches/regexp/to_parser.rb +10 -0
- data/vendor/eac_ruby_utils/lib/eac_ruby_utils/patches/string/inflector.rb +4 -2
- data/vendor/eac_ruby_utils/lib/eac_ruby_utils/patches/time/required_zone.rb +11 -0
- data/vendor/eac_ruby_utils/lib/eac_ruby_utils/regexp_parser.rb +34 -0
- data/vendor/eac_ruby_utils/lib/eac_ruby_utils/rspec/conditional.rb +1 -4
- data/vendor/eac_ruby_utils/lib/eac_ruby_utils/settings_provider.rb +10 -29
- data/vendor/eac_ruby_utils/lib/eac_ruby_utils/settings_provider/setting_value.rb +69 -0
- data/vendor/eac_ruby_utils/lib/eac_ruby_utils/simple_cache.rb +18 -5
- data/vendor/eac_ruby_utils/lib/eac_ruby_utils/version.rb +1 -1
- data/vendor/eac_ruby_utils/lib/eac_ruby_utils/yaml.rb +8 -0
- data/vendor/eac_ruby_utils/spec/lib/eac_ruby_utils/common_concern_spec.rb +14 -4
- data/vendor/eac_ruby_utils/spec/lib/eac_ruby_utils/common_constructor_spec.rb +30 -0
- data/vendor/eac_ruby_utils/spec/lib/eac_ruby_utils/inflector_spec.rb +2 -1
- data/vendor/eac_ruby_utils/spec/lib/eac_ruby_utils/local_time_zone_spec.rb +17 -0
- data/vendor/eac_ruby_utils/spec/lib/eac_ruby_utils/settings_provider_spec.rb +8 -0
- data/vendor/eac_ruby_utils/spec/lib/eac_ruby_utils/simple_cache_spec.rb +9 -0
- data/vendor/eac_ruby_utils/spec/rubocop_check_spec.rb +1 -5
- data/vendor/eac_ruby_utils/spec/spec_helper.rb +3 -0
- data/vendor/ehbrs_ruby_utils/lib/ehbrs_ruby_utils/videos/convert_job.rb +1 -1
- data/vendor/ehbrs_ruby_utils/lib/ehbrs_ruby_utils/web_utils/videos/files_list.rb +1 -1
- metadata +134 -62
- data/vendor/eac_cli/lib/eac_cli/runner_with/output_file.rb +0 -30
- data/vendor/eac_cli/spec/lib/eac_cli/runner_with/output_file_spec.rb +0 -53
- data/vendor/eac_ruby_utils/lib/eac_ruby_utils/configs.rb +0 -74
- data/vendor/eac_ruby_utils/lib/eac_ruby_utils/configs/base.rb +0 -43
- data/vendor/eac_ruby_utils/lib/eac_ruby_utils/configs/file.rb +0 -47
- data/vendor/eac_ruby_utils/lib/eac_ruby_utils/console.rb +0 -5
- data/vendor/eac_ruby_utils/lib/eac_ruby_utils/console/configs.rb +0 -38
- data/vendor/eac_ruby_utils/lib/eac_ruby_utils/console/configs/entry_reader.rb +0 -81
- data/vendor/eac_ruby_utils/lib/eac_ruby_utils/console/configs/password_entry_reader.rb +0 -18
- data/vendor/eac_ruby_utils/lib/eac_ruby_utils/console/configs/read_entry_options.rb +0 -46
- data/vendor/eac_ruby_utils/lib/eac_ruby_utils/console/configs/store_passwords_entry_reader.rb +0 -27
- data/vendor/eac_ruby_utils/lib/eac_ruby_utils/console/docopt_runner.rb +0 -45
- data/vendor/eac_ruby_utils/lib/eac_ruby_utils/console/docopt_runner/_class_methods.rb +0 -18
- data/vendor/eac_ruby_utils/lib/eac_ruby_utils/console/docopt_runner/_doc.rb +0 -25
- data/vendor/eac_ruby_utils/lib/eac_ruby_utils/console/docopt_runner/_settings.rb +0 -19
- data/vendor/eac_ruby_utils/lib/eac_ruby_utils/console/docopt_runner/_subcommands.rb +0 -145
- data/vendor/eac_ruby_utils/lib/eac_ruby_utils/console/speaker.rb +0 -133
- data/vendor/eac_ruby_utils/lib/eac_ruby_utils/console/speaker/_class_methods.rb +0 -39
- data/vendor/eac_ruby_utils/lib/eac_ruby_utils/console/speaker/_constants.rb +0 -14
- data/vendor/eac_ruby_utils/lib/eac_ruby_utils/console/speaker/list.rb +0 -63
- data/vendor/eac_ruby_utils/lib/eac_ruby_utils/console/speaker/node.rb +0 -26
- data/vendor/eac_ruby_utils/lib/eac_ruby_utils/patches/module/console_speaker.rb +0 -10
- data/vendor/eac_ruby_utils/lib/eac_ruby_utils/patches/object/template.rb +0 -16
- data/vendor/eac_ruby_utils/lib/eac_ruby_utils/patches/time/default_time_zone_set.rb +0 -5
- data/vendor/eac_ruby_utils/lib/eac_ruby_utils/patches/time/local_time_zone.rb +0 -25
- data/vendor/eac_ruby_utils/lib/eac_ruby_utils/paths_hash.rb +0 -56
- data/vendor/eac_ruby_utils/lib/eac_ruby_utils/paths_hash/entry_key_error.rb +0 -8
- data/vendor/eac_ruby_utils/lib/eac_ruby_utils/paths_hash/node.rb +0 -67
- data/vendor/eac_ruby_utils/lib/eac_ruby_utils/paths_hash/path_search.rb +0 -39
- data/vendor/eac_ruby_utils/lib/eac_ruby_utils/templates.rb +0 -9
- data/vendor/eac_ruby_utils/lib/eac_ruby_utils/templates/directory.rb +0 -110
- data/vendor/eac_ruby_utils/lib/eac_ruby_utils/templates/file.rb +0 -50
- data/vendor/eac_ruby_utils/lib/eac_ruby_utils/templates/searcher.rb +0 -55
- data/vendor/eac_ruby_utils/lib/eac_ruby_utils/templates/variable_not_found_error.rb +0 -7
- data/vendor/eac_ruby_utils/lib/eac_ruby_utils/templates/variable_providers.rb +0 -25
- data/vendor/eac_ruby_utils/lib/eac_ruby_utils/templates/variable_providers/base.rb +0 -23
- data/vendor/eac_ruby_utils/lib/eac_ruby_utils/templates/variable_providers/entries_reader.rb +0 -25
- data/vendor/eac_ruby_utils/lib/eac_ruby_utils/templates/variable_providers/generic.rb +0 -25
- data/vendor/eac_ruby_utils/lib/eac_ruby_utils/templates/variable_providers/hash.rb +0 -29
- data/vendor/eac_ruby_utils/spec/lib/eac_ruby_utils/configs_spec.rb +0 -46
- data/vendor/eac_ruby_utils/spec/lib/eac_ruby_utils/patches/module/console_speaker_spec.rb +0 -13
- data/vendor/eac_ruby_utils/spec/lib/eac_ruby_utils/patches/object/template_spec.rb +0 -23
- data/vendor/eac_ruby_utils/spec/lib/eac_ruby_utils/paths_hash_spec.rb +0 -88
- data/vendor/eac_ruby_utils/spec/lib/eac_ruby_utils/templates/file_spec.rb +0 -35
- data/vendor/eac_ruby_utils/spec/lib/eac_ruby_utils/templates/file_spec_files/expected_content +0 -2
- data/vendor/eac_ruby_utils/spec/lib/eac_ruby_utils/templates/file_spec_files/source.template +0 -2
- data/vendor/eac_ruby_utils/spec/lib/eac_ruby_utils/templates/searcher_spec.rb +0 -30
- data/vendor/eac_ruby_utils/spec/lib/eac_ruby_utils/templates/searcher_spec_files/path1/subdir1/file1.template +0 -1
- data/vendor/eac_ruby_utils/spec/lib/eac_ruby_utils/templates/searcher_spec_files/path1/subdir1/file2 +0 -1
- data/vendor/eac_ruby_utils/spec/lib/eac_ruby_utils/templates/searcher_spec_files/path2/subdir1/file3.template +0 -1
data/lib/ehbrs/runner.rb
CHANGED
@@ -1,26 +1,19 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
require '
|
4
|
-
require 'ehbrs/tools/
|
3
|
+
require 'eac_ruby_base0/runner'
|
4
|
+
require 'ehbrs/tools/application'
|
5
5
|
|
6
6
|
module Ehbrs
|
7
7
|
class Runner
|
8
8
|
require_sub __FILE__
|
9
|
+
include ::EacRubyBase0::Runner
|
9
10
|
|
10
|
-
|
11
|
+
runner_definition do
|
11
12
|
desc 'Tools for EHB/RS.'
|
12
|
-
subcommands
|
13
|
-
alt do
|
14
|
-
bool_opt '-V', '--version', 'Show version.'
|
15
|
-
end
|
16
13
|
end
|
17
14
|
|
18
|
-
def
|
19
|
-
|
20
|
-
out(::Ehbrs::Tools::VERSION + "\n")
|
21
|
-
else
|
22
|
-
run_with_subcommand
|
23
|
-
end
|
15
|
+
def application
|
16
|
+
::Ehbrs::Tools.application
|
24
17
|
end
|
25
18
|
end
|
26
19
|
end
|
@@ -0,0 +1,30 @@
|
|
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
|
@@ -0,0 +1,50 @@
|
|
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
|
@@ -0,0 +1,63 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'eac_ruby_base0/patches'
|
4
|
+
require 'eac_ruby_utils/fs/clearable_directory'
|
5
|
+
require 'ehbrs/music/album'
|
6
|
+
|
7
|
+
module Ehbrs
|
8
|
+
class Runner
|
9
|
+
class Music
|
10
|
+
class Selected
|
11
|
+
DEFAULT_TRAVERSER_RECURSIVE = true
|
12
|
+
|
13
|
+
enable_jobs_runner
|
14
|
+
runner_with :help, :filesystem_traverser do
|
15
|
+
desc 'Seleciona álbuns de música.'
|
16
|
+
arg_opt '-b', '--build-dir', 'Constrói diretório de músicas selecionadas.'
|
17
|
+
end
|
18
|
+
|
19
|
+
def run
|
20
|
+
infov 'Recursive', traverser_recursive
|
21
|
+
run_jobs :show, :build
|
22
|
+
end
|
23
|
+
|
24
|
+
private
|
25
|
+
|
26
|
+
def build
|
27
|
+
infom 'Building...'
|
28
|
+
build_dir.clear
|
29
|
+
selected_albums.each do |album|
|
30
|
+
::EacRubyUtils::Envs.local.command('ln', '-s', album.path,
|
31
|
+
build_dir.join(album.id)).system!
|
32
|
+
end
|
33
|
+
end
|
34
|
+
|
35
|
+
def build_dir_uncached
|
36
|
+
parsed.build_dir.if_present { |v| ::EacRubyUtils::Fs::ClearableDirectory.new(v) }
|
37
|
+
end
|
38
|
+
|
39
|
+
def run_build?
|
40
|
+
build_dir.present?
|
41
|
+
end
|
42
|
+
|
43
|
+
def selected_albums_uncached
|
44
|
+
infom 'Searching selected albums...'
|
45
|
+
@selected = []
|
46
|
+
run_filesystem_traverser
|
47
|
+
@selected.sort
|
48
|
+
end
|
49
|
+
|
50
|
+
def show
|
51
|
+
infov 'Albums found', selected_albums.count
|
52
|
+
selected_albums.each do |album|
|
53
|
+
puts album.to_label
|
54
|
+
end
|
55
|
+
end
|
56
|
+
|
57
|
+
def traverser_check_directory(path)
|
58
|
+
@selected << ::Ehbrs::Music::Album.new(path) if path.join('.selected').exist?
|
59
|
+
end
|
60
|
+
end
|
61
|
+
end
|
62
|
+
end
|
63
|
+
end
|
@@ -0,0 +1,26 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'eac_cli/core_ext'
|
4
|
+
require 'ehbrs/tools/instance'
|
5
|
+
|
6
|
+
module Ehbrs
|
7
|
+
class Runner
|
8
|
+
class Telegram
|
9
|
+
require_sub __FILE__
|
10
|
+
|
11
|
+
runner_with :help, :subcommands do
|
12
|
+
desc 'Operações com Telegram.'
|
13
|
+
arg_opt '-b', '--bot-token', 'Token do bot Telegram.'
|
14
|
+
subcommands
|
15
|
+
end
|
16
|
+
|
17
|
+
def bot_token
|
18
|
+
parsed.bot_token || default_bot_token
|
19
|
+
end
|
20
|
+
|
21
|
+
def default_bot_token
|
22
|
+
::Ehbrs::Tools.instance.read_entry(:telegram_bot_token)
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end
|
@@ -0,0 +1,29 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'eac_cli/core_ext'
|
4
|
+
require 'ehbrs/telegram/message_sending'
|
5
|
+
|
6
|
+
module Ehbrs
|
7
|
+
class Runner
|
8
|
+
class Telegram
|
9
|
+
class SendMessage
|
10
|
+
runner_with :help do
|
11
|
+
desc 'Envia mensagens Telegram.'
|
12
|
+
pos_arg :message
|
13
|
+
pos_arg :recipients_ids, repeat: true
|
14
|
+
end
|
15
|
+
|
16
|
+
delegate :run, to: :message_sending
|
17
|
+
|
18
|
+
private
|
19
|
+
|
20
|
+
def message_sending_uncached
|
21
|
+
parsed.recipients_ids
|
22
|
+
.inject(::Ehbrs::Telegram::MessageSending.new) { |a, e| a.recipient_id(e) }
|
23
|
+
.bot_token(runner_context.call(:bot_token))
|
24
|
+
.message(parsed.message)
|
25
|
+
end
|
26
|
+
end
|
27
|
+
end
|
28
|
+
end
|
29
|
+
end
|
@@ -1,14 +1,14 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
require 'eac_cli/core_ext'
|
4
3
|
require 'ehbrs_ruby_utils/videos/container'
|
4
|
+
require 'eac_ruby_base0/core_ext'
|
5
5
|
require 'eac_ruby_utils/yaml'
|
6
6
|
|
7
7
|
module Ehbrs
|
8
8
|
class Runner
|
9
9
|
class Videos
|
10
10
|
class Probe
|
11
|
-
runner_with :help, :
|
11
|
+
runner_with :help, :output do
|
12
12
|
desc 'FFProbe em um arquivo de vídeo.'
|
13
13
|
pos_arg :file_path
|
14
14
|
end
|
@@ -42,7 +42,7 @@ module Ehbrs
|
|
42
42
|
def process_response(response)
|
43
43
|
infov 'Response status', response.status
|
44
44
|
if response.status == 200
|
45
|
-
pp ::JSON.parse(response.body)
|
45
|
+
pp ::JSON.parse(response.body)
|
46
46
|
else
|
47
47
|
error_file = '/tmp/ehbrsutils.html'
|
48
48
|
::File.write(error_file, response.body)
|
@@ -0,0 +1,32 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'eac_ruby_utils/core_ext'
|
4
|
+
require 'eac_ruby_utils/immutable'
|
5
|
+
require 'telegram/bot'
|
6
|
+
|
7
|
+
module Ehbrs
|
8
|
+
module Telegram
|
9
|
+
class MessageSending
|
10
|
+
include ::EacRubyUtils::Immutable
|
11
|
+
immutable_accessor :bot_token, :message
|
12
|
+
immutable_accessor :recipient_id, type: :array
|
13
|
+
|
14
|
+
def run
|
15
|
+
::Telegram::Bot::Client.run(prop(:bot_token)) do |bot|
|
16
|
+
prop(:recipient_ids).each do |recipient_id|
|
17
|
+
bot.api.sendMessage(chat_id: recipient_id, text: prop(:message))
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
21
|
+
|
22
|
+
private
|
23
|
+
|
24
|
+
def prop(attribute)
|
25
|
+
r = send(attribute)
|
26
|
+
return r if r.present?
|
27
|
+
|
28
|
+
raise "Attribute #{attribute} is blank"
|
29
|
+
end
|
30
|
+
end
|
31
|
+
end
|
32
|
+
end
|
@@ -0,0 +1,13 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'eac_ruby_base0/application'
|
4
|
+
|
5
|
+
module Ehbrs
|
6
|
+
module Tools
|
7
|
+
class << self
|
8
|
+
def application
|
9
|
+
@application ||= ::EacRubyBase0::Application.new(::File.expand_path('../../..', __dir__))
|
10
|
+
end
|
11
|
+
end
|
12
|
+
end
|
13
|
+
end
|
@@ -0,0 +1,16 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'avm/instances/base'
|
4
|
+
require 'eac_ruby_utils/core_ext'
|
5
|
+
|
6
|
+
module Ehbrs
|
7
|
+
module Tools
|
8
|
+
INSTANCE_ID = 'ehbrs-tools_0'
|
9
|
+
|
10
|
+
class << self
|
11
|
+
def instance
|
12
|
+
@instance ||= ::Avm::Instances::Base.by_id(INSTANCE_ID)
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
data/lib/ehbrs/tools/version.rb
CHANGED
@@ -1,5 +1,6 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
+
require 'eac_cli/speaker'
|
3
4
|
require 'ehbrs/videos/unsupported/check_result'
|
4
5
|
|
5
6
|
module Ehbrs
|
@@ -9,7 +10,7 @@ module Ehbrs
|
|
9
10
|
extend ::ActiveSupport::Concern
|
10
11
|
|
11
12
|
included do
|
12
|
-
include ::
|
13
|
+
include ::EacCli::Speaker
|
13
14
|
include ::EacRubyUtils::SimpleCache
|
14
15
|
end
|
15
16
|
|
@@ -26,7 +27,7 @@ module Ehbrs
|
|
26
27
|
|
27
28
|
def ffmpeg_fix_args
|
28
29
|
unpassed_checks.flat_map do |check|
|
29
|
-
check.check.fix.ffmpeg_args(self)
|
30
|
+
check.check.fix.if_present([]) { |v| v.ffmpeg_args(self) }
|
30
31
|
end
|
31
32
|
end
|
32
33
|
|