ehbrs-tools 0.16.1 → 0.17.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 +25 -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/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 +32 -0
- data/lib/ehbrs/runner/videos/probe.rb +3 -3
- data/lib/ehbrs/tools/application.rb +13 -0
- data/lib/ehbrs/tools/version.rb +1 -1
- data/lib/ehbrs/videos/file.rb +4 -8
- data/lib/ehbrs/videos/track.rb +5 -13
- data/lib/ehbrs/videos/unsupported/checks/codec_extra_unlisted.rb +3 -1
- data/lib/ehbrs/videos/unsupported/checks/codec_extra_unsupported.rb +3 -1
- data/lib/ehbrs/videos/unsupported/checks/codec_unlisted.rb +4 -2
- data/lib/ehbrs/videos/unsupported/checks/codec_unsupported.rb +3 -1
- data/lib/ehbrs/videos/unsupported/checks/invalid_extension.rb +2 -0
- data/lib/ehbrs/videos/unsupported/fix_profile.rb +0 -13
- data/lib/ehbrs/videos/unsupported/fixes/supported_codec.rb +10 -10
- data/lib/ehbrs/videos/unsupported/profiles/base.rb +17 -3
- data/lib/ehbrs/videos/unsupported/profiles/philco.rb +5 -4
- 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-parsers/lib/aranha/parsers/spec/source_target_fixtures_example.rb +10 -2
- data/vendor/aranha-parsers/lib/aranha/parsers/version.rb +1 -1
- data/vendor/eac_cli/eac_cli.gemspec +1 -1
- data/vendor/eac_cli/lib/eac_cli/definition.rb +34 -39
- data/vendor/eac_cli/lib/eac_cli/definition/alternative.rb +83 -0
- data/vendor/eac_cli/lib/eac_cli/docopt/doc_builder.rb +18 -40
- data/vendor/eac_cli/lib/eac_cli/docopt/doc_builder/alternative.rb +50 -0
- data/vendor/eac_cli/lib/eac_cli/parser.rb +23 -3
- data/vendor/eac_cli/lib/eac_cli/parser/alternative.rb +92 -0
- data/vendor/eac_cli/lib/eac_cli/parser/alternative/argv.rb +17 -0
- data/vendor/eac_cli/lib/eac_cli/parser/alternative/double_dash.rb +24 -0
- data/vendor/eac_cli/lib/eac_cli/parser/alternative/options.rb +58 -0
- data/vendor/eac_cli/lib/eac_cli/parser/alternative/positionals.rb +30 -0
- data/vendor/eac_cli/lib/eac_cli/runner.rb +12 -4
- data/vendor/eac_cli/lib/eac_cli/runner/exit.rb +13 -0
- data/vendor/eac_cli/lib/eac_cli/runner_with/help.rb +18 -1
- data/vendor/eac_cli/lib/eac_cli/runner_with/output_file.rb +5 -1
- data/vendor/eac_cli/lib/eac_cli/runner_with/subcommands.rb +6 -1
- data/vendor/eac_cli/lib/eac_cli/version.rb +1 -1
- data/vendor/eac_cli/spec/lib/eac_cli/definition/alternative_spec.rb +14 -0
- data/vendor/eac_cli/spec/lib/eac_cli/docopt/runner_extension_spec.rb +10 -0
- data/vendor/eac_cli/spec/lib/eac_cli/parser/alternative_spec.rb +140 -0
- data/vendor/eac_cli/spec/lib/eac_cli/runner_spec.rb +17 -5
- data/vendor/eac_cli/spec/lib/eac_cli/runner_with/help_spec.rb +42 -0
- data/vendor/eac_cli/spec/lib/eac_cli/runner_with/output_file_spec.rb +53 -0
- data/vendor/eac_cli/spec/lib/eac_cli/runner_with/subcommands_spec.rb +29 -1
- data/vendor/eac_docker/lib/eac_docker/container.rb +24 -0
- data/vendor/eac_docker/lib/eac_docker/images/coded.rb +39 -0
- data/vendor/eac_docker/lib/eac_docker/images/templatized.rb +26 -0
- data/vendor/eac_docker/lib/eac_docker/registry.rb +17 -0
- data/vendor/eac_docker/lib/eac_docker/version.rb +1 -1
- data/vendor/eac_docker/spec/lib/eac_docker/images/coded_spec.rb +12 -0
- data/vendor/eac_docker/spec/lib/eac_docker/images/coded_spec_files/image1/Dockerfile +1 -0
- data/vendor/eac_docker/spec/lib/eac_docker/images/templatized_spec.rb +17 -0
- data/vendor/eac_docker/spec/lib/eac_docker/images/templatized_spec_files/stub_docker_image/Dockerfile +1 -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/runner.rb +54 -0
- data/vendor/eac_ruby_base0/lib/eac_ruby_base0/runner/test_all.rb +27 -0
- data/vendor/eac_ruby_base0/lib/eac_ruby_base0/version.rb +5 -0
- data/vendor/eac_ruby_base0/spec/rubocop_spec.rb +7 -0
- data/vendor/eac_ruby_base0/spec/spec_helper.rb +100 -0
- data/vendor/eac_ruby_utils/lib/eac_ruby_utils/abstract_methods.rb +60 -0
- data/vendor/eac_ruby_utils/lib/eac_ruby_utils/common_concern.rb +2 -50
- data/vendor/eac_ruby_utils/lib/eac_ruby_utils/common_concern/class_setup.rb +52 -0
- data/vendor/eac_ruby_utils/lib/eac_ruby_utils/common_concern/module_setup.rb +41 -0
- data/vendor/eac_ruby_utils/lib/eac_ruby_utils/common_constructor.rb +6 -50
- 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/console/docopt_runner/_subcommands.rb +10 -1
- data/vendor/eac_ruby_utils/lib/eac_ruby_utils/envs/command.rb +4 -6
- data/vendor/eac_ruby_utils/lib/eac_ruby_utils/envs/command/concat.rb +33 -0
- data/vendor/eac_ruby_utils/lib/eac_ruby_utils/envs/command/envvars.rb +24 -0
- data/vendor/eac_ruby_utils/lib/eac_ruby_utils/envs/command/extra_options.rb +0 -21
- data/vendor/eac_ruby_utils/lib/eac_ruby_utils/patches/module/abstract_methods.rb +10 -0
- data/vendor/eac_ruby_utils/lib/eac_ruby_utils/patches/module/template.rb +10 -0
- data/vendor/eac_ruby_utils/lib/eac_ruby_utils/patches/object/template.rb +1 -8
- data/vendor/eac_ruby_utils/lib/eac_ruby_utils/patches/pathname/basename_sub.rb +2 -2
- data/vendor/eac_ruby_utils/lib/eac_ruby_utils/struct.rb +7 -1
- data/vendor/eac_ruby_utils/lib/eac_ruby_utils/version.rb +1 -1
- data/vendor/eac_ruby_utils/lib/eac_ruby_utils/yaml.rb +11 -2
- data/vendor/eac_ruby_utils/spec/lib/eac_ruby_utils/abstract_methods_spec.rb +28 -0
- data/vendor/eac_ruby_utils/spec/lib/eac_ruby_utils/common_concern_spec.rb +40 -17
- data/vendor/eac_ruby_utils/spec/lib/eac_ruby_utils/common_constructor_spec.rb +96 -8
- data/vendor/eac_ruby_utils/spec/lib/eac_ruby_utils/struct_spec.rb +12 -1
- data/vendor/ehbrs_ruby_utils/lib/ehbrs_ruby_utils/version.rb +1 -1
- data/vendor/ehbrs_ruby_utils/lib/ehbrs_ruby_utils/videos/container.rb +30 -2
- data/vendor/ehbrs_ruby_utils/lib/ehbrs_ruby_utils/videos/convert_job.rb +91 -0
- data/vendor/ehbrs_ruby_utils/lib/ehbrs_ruby_utils/videos/stream.rb +51 -0
- metadata +89 -13
- data/vendor/eac_cli/lib/eac_cli/parser/options_collection.rb +0 -68
- data/vendor/eac_cli/lib/eac_cli/parser/parse_result.rb +0 -38
- data/vendor/eac_cli/lib/eac_cli/parser/positional_collection.rb +0 -77
- data/vendor/ehbrs_ruby_utils/lib/ehbrs_ruby_utils/videos/container/file.rb +0 -31
- data/vendor/ehbrs_ruby_utils/lib/ehbrs_ruby_utils/videos/container/info.rb +0 -21
@@ -1,68 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
require 'eac_ruby_utils/core_ext'
|
4
|
-
require 'optparse'
|
5
|
-
|
6
|
-
module EacCli
|
7
|
-
class Parser
|
8
|
-
class OptionsCollection
|
9
|
-
enable_simple_cache
|
10
|
-
common_constructor(:definition, :argv, :collector) { collect }
|
11
|
-
attr_reader :arguments
|
12
|
-
|
13
|
-
def options_first?
|
14
|
-
definition.options_first? || definition.subcommands?
|
15
|
-
end
|
16
|
-
|
17
|
-
private
|
18
|
-
|
19
|
-
def check_required_options
|
20
|
-
definition.options.each do |option|
|
21
|
-
next unless option.required?
|
22
|
-
next if collector.supplied?(option)
|
23
|
-
|
24
|
-
raise ::EacCli::Parser::Error.new(
|
25
|
-
definition, argv, "Option \"#{option}\" is required and a value was not supplied"
|
26
|
-
)
|
27
|
-
end
|
28
|
-
end
|
29
|
-
|
30
|
-
def collect
|
31
|
-
build_banner
|
32
|
-
build_options
|
33
|
-
parse_argv
|
34
|
-
check_required_options
|
35
|
-
end
|
36
|
-
|
37
|
-
def option_parser_uncached
|
38
|
-
::OptionParser.new
|
39
|
-
end
|
40
|
-
|
41
|
-
def parse_argv
|
42
|
-
@arguments = options_first? ? option_parser.order(argv) : option_parser.parse(argv)
|
43
|
-
rescue ::OptionParser::InvalidOption => e
|
44
|
-
raise ::EacCli::Parser::Error.new(definition, argv, e.message)
|
45
|
-
end
|
46
|
-
|
47
|
-
def build_banner
|
48
|
-
option_parser.banner = definition.help_formatter.to_banner
|
49
|
-
end
|
50
|
-
|
51
|
-
def build_options
|
52
|
-
definition.options.each do |option|
|
53
|
-
build_option(option)
|
54
|
-
end
|
55
|
-
end
|
56
|
-
|
57
|
-
def build_option(option)
|
58
|
-
option_parser.on(
|
59
|
-
*[::EacCli::Definition::HelpFormatter.option_short(option),
|
60
|
-
::EacCli::Definition::HelpFormatter.option_long(option),
|
61
|
-
option.description].reject(&:blank?)
|
62
|
-
) do |value|
|
63
|
-
collector.collect(option, value)
|
64
|
-
end
|
65
|
-
end
|
66
|
-
end
|
67
|
-
end
|
68
|
-
end
|
@@ -1,38 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
require 'eac_cli/parser/error'
|
4
|
-
require 'eac_ruby_utils/core_ext'
|
5
|
-
|
6
|
-
module EacCli
|
7
|
-
class Parser
|
8
|
-
class ParseResult
|
9
|
-
common_constructor :definition, :argv
|
10
|
-
|
11
|
-
def result
|
12
|
-
result_or_error = parse(definition)
|
13
|
-
return result_or_error unless result_or_error.is_a?(::Exception)
|
14
|
-
|
15
|
-
definition.alternatives.each do |alternative|
|
16
|
-
alt_result_or_error = parse(alternative)
|
17
|
-
return alt_result_or_error unless alt_result_or_error.is_a?(::Exception)
|
18
|
-
end
|
19
|
-
|
20
|
-
raise result_or_error
|
21
|
-
end
|
22
|
-
|
23
|
-
private
|
24
|
-
|
25
|
-
def parse(definition)
|
26
|
-
::EacCli::Parser::Collector.to_data(definition) do |collector|
|
27
|
-
::EacCli::Parser::PositionalCollection.new(
|
28
|
-
definition,
|
29
|
-
::EacCli::Parser::OptionsCollection.new(definition, argv, collector).arguments,
|
30
|
-
collector
|
31
|
-
)
|
32
|
-
end
|
33
|
-
rescue ::EacCli::Parser::Error => e
|
34
|
-
e
|
35
|
-
end
|
36
|
-
end
|
37
|
-
end
|
38
|
-
end
|
@@ -1,77 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
require 'eac_ruby_utils/core_ext'
|
4
|
-
require 'eac_cli/parser/error'
|
5
|
-
|
6
|
-
module EacCli
|
7
|
-
class Parser
|
8
|
-
class PositionalCollection
|
9
|
-
common_constructor(:definition, :argv, :collector) { collect }
|
10
|
-
|
11
|
-
private
|
12
|
-
|
13
|
-
def argv_enum
|
14
|
-
@argv_enum ||= argv.each
|
15
|
-
end
|
16
|
-
|
17
|
-
def argv_pending?
|
18
|
-
argv_enum.ongoing?
|
19
|
-
end
|
20
|
-
|
21
|
-
def argv_pending_check
|
22
|
-
return unless argv_pending?
|
23
|
-
return unless positional_enum.stopped?
|
24
|
-
|
25
|
-
raise ::EacCli::Parser::Error.new(
|
26
|
-
definition, argv, "No positional left for argv \"#{argv_enum.current}\""
|
27
|
-
)
|
28
|
-
end
|
29
|
-
|
30
|
-
def collected
|
31
|
-
@collected ||= ::Set.new
|
32
|
-
end
|
33
|
-
|
34
|
-
def collect
|
35
|
-
loop do
|
36
|
-
break unless enums('pending?').any?
|
37
|
-
|
38
|
-
enums('pending_check')
|
39
|
-
collect_argv_value
|
40
|
-
end
|
41
|
-
end
|
42
|
-
|
43
|
-
def collect_argv_value
|
44
|
-
collector.collect(*enums('enum', &:peek))
|
45
|
-
collected << positional_enum.peek
|
46
|
-
positional_enum.next unless positional_enum.peek.repeat?
|
47
|
-
argv_enum.next
|
48
|
-
end
|
49
|
-
|
50
|
-
def enums(method_suffix, &block)
|
51
|
-
%w[positional argv].map do |method_prefix|
|
52
|
-
v = send("#{method_prefix}_#{method_suffix}")
|
53
|
-
block ? block.call(v) : v
|
54
|
-
end
|
55
|
-
end
|
56
|
-
|
57
|
-
def positional_enum
|
58
|
-
@positional_enum ||= definition.positional.each
|
59
|
-
end
|
60
|
-
|
61
|
-
def positional_pending?
|
62
|
-
!(positional_enum.stopped? || positional_enum.current.optional? ||
|
63
|
-
collected.include?(positional_enum.current))
|
64
|
-
end
|
65
|
-
|
66
|
-
def positional_pending_check
|
67
|
-
return unless positional_pending?
|
68
|
-
return unless argv_enum.stopped?
|
69
|
-
|
70
|
-
raise ::EacCli::Parser::Error.new(
|
71
|
-
definition, argv, 'No value for required positional ' \
|
72
|
-
"\"#{positional_enum.current.identifier}\""
|
73
|
-
)
|
74
|
-
end
|
75
|
-
end
|
76
|
-
end
|
77
|
-
end
|
@@ -1,31 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
require 'json'
|
4
|
-
require 'eac_ruby_utils/core_ext'
|
5
|
-
require 'ehbrs_ruby_utils/executables'
|
6
|
-
require 'ehbrs_ruby_utils/videos/container/info'
|
7
|
-
|
8
|
-
module EhbrsRubyUtils
|
9
|
-
module Videos
|
10
|
-
module Container
|
11
|
-
class File
|
12
|
-
enable_simple_cache
|
13
|
-
common_constructor :path do
|
14
|
-
self.path = path.to_pathname
|
15
|
-
end
|
16
|
-
|
17
|
-
private
|
18
|
-
|
19
|
-
def info_uncached
|
20
|
-
::EhbrsRubyUtils::Videos::Container::Info.new(
|
21
|
-
::JSON.parse(
|
22
|
-
::EhbrsRubyUtils::Executables.ffprobe.command(
|
23
|
-
'-hide_banner', '-print_format', 'json', '-show_format', '-show_streams', path
|
24
|
-
).execute!
|
25
|
-
)
|
26
|
-
)
|
27
|
-
end
|
28
|
-
end
|
29
|
-
end
|
30
|
-
end
|
31
|
-
end
|
@@ -1,21 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
require 'eac_ruby_utils/core_ext'
|
4
|
-
require 'ehbrs_ruby_utils/videos/container/info'
|
5
|
-
|
6
|
-
module EhbrsRubyUtils
|
7
|
-
module Videos
|
8
|
-
module Container
|
9
|
-
class Info
|
10
|
-
enable_simple_cache
|
11
|
-
common_constructor :ffprobe_data do
|
12
|
-
self.ffprobe_data = ffprobe_data.with_indifferent_access.freeze
|
13
|
-
end
|
14
|
-
|
15
|
-
def to_h
|
16
|
-
ffprobe_data
|
17
|
-
end
|
18
|
-
end
|
19
|
-
end
|
20
|
-
end
|
21
|
-
end
|