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.
Files changed (222) hide show
  1. checksums.yaml +4 -4
  2. data/lib/ehbrs/cooking_book.rb +9 -0
  3. data/lib/ehbrs/cooking_book/build.rb +45 -0
  4. data/lib/ehbrs/cooking_book/build/base_page.rb +43 -0
  5. data/lib/ehbrs/cooking_book/build/index_page.rb +26 -0
  6. data/lib/ehbrs/cooking_book/build/recipe_page.rb +27 -0
  7. data/lib/ehbrs/cooking_book/project.rb +31 -0
  8. data/lib/ehbrs/cooking_book/recipe.rb +37 -0
  9. data/lib/ehbrs/cooking_book/recipe/ingredient.rb +21 -0
  10. data/lib/ehbrs/cooking_book/recipe/measure.rb +60 -0
  11. data/lib/ehbrs/cooking_book/recipe/part.rb +32 -0
  12. data/lib/ehbrs/music.rb +9 -0
  13. data/lib/ehbrs/music/album.rb +42 -0
  14. data/lib/ehbrs/observers/base.rb +1 -1
  15. data/lib/ehbrs/observers/with_persistence.rb +1 -1
  16. data/lib/ehbrs/patches/module/erb_template.rb +11 -0
  17. data/lib/ehbrs/patches/object/erb_template.rb +9 -0
  18. data/lib/ehbrs/patches/object/template.rb +7 -0
  19. data/lib/ehbrs/runner.rb +6 -13
  20. data/lib/ehbrs/runner/cooking_book.rb +30 -0
  21. data/lib/ehbrs/runner/cooking_book/build.rb +50 -0
  22. data/lib/ehbrs/runner/fs/used_space.rb +1 -1
  23. data/lib/ehbrs/runner/music.rb +16 -0
  24. data/lib/ehbrs/runner/music/selected.rb +63 -0
  25. data/lib/ehbrs/runner/telegram.rb +26 -0
  26. data/lib/ehbrs/runner/telegram/send_message.rb +29 -0
  27. data/lib/ehbrs/runner/videos/probe.rb +2 -2
  28. data/lib/ehbrs/runner/videos/unsupported.rb +1 -1
  29. data/lib/ehbrs/runner/web_utils/videos/upload.rb +1 -1
  30. data/lib/ehbrs/telegram.rb +9 -0
  31. data/lib/ehbrs/telegram/message_sending.rb +32 -0
  32. data/lib/ehbrs/tools/application.rb +13 -0
  33. data/lib/ehbrs/tools/instance.rb +16 -0
  34. data/lib/ehbrs/tools/version.rb +1 -1
  35. data/lib/ehbrs/videos/convert_job.rb +1 -1
  36. data/lib/ehbrs/videos/series/rename/line_result.rb +1 -1
  37. data/lib/ehbrs/videos/unsupported/check_support.rb +3 -2
  38. data/lib/ehbrs/videos/unsupported/fixes/supported_codec.rb +1 -1
  39. data/lib/ehbrs/videos/unsupported/profiles/aoc.rb +27 -0
  40. data/lib/ehbrs/videos/unsupported/search.rb +1 -1
  41. data/lib/ehbrs/videos/unsupported/track.rb +1 -1
  42. data/template/ehbrs/cooking_book/build/base_page/layout.html.erb +20 -0
  43. data/template/ehbrs/cooking_book/build/index_page/inner.html.erb +6 -0
  44. data/template/ehbrs/cooking_book/build/recipe_page/inner.html.erb +6 -0
  45. data/template/ehbrs/cooking_book/build/recipe_page/part.html.erb +27 -0
  46. data/vendor/aranha-selenium/lib/aranha/selenium/driver_factory/base.rb +8 -0
  47. data/vendor/aranha-selenium/lib/aranha/selenium/driver_factory/chrome.rb +10 -5
  48. data/vendor/aranha-selenium/lib/aranha/selenium/driver_factory/firefox.rb +25 -11
  49. data/vendor/aranha-selenium/lib/aranha/selenium/version.rb +1 -1
  50. data/vendor/eac_cli/eac_cli.gemspec +5 -2
  51. data/vendor/eac_cli/lib/eac_cli/core_ext.rb +2 -0
  52. data/vendor/eac_cli/lib/eac_cli/default_runner.rb +1 -1
  53. data/vendor/eac_cli/lib/eac_cli/definition/alternative.rb +4 -7
  54. data/vendor/eac_cli/lib/eac_cli/definition/argument_option.rb +8 -0
  55. data/vendor/eac_cli/lib/eac_cli/definition/base_option.rb +26 -10
  56. data/vendor/eac_cli/lib/eac_cli/definition/base_option/initialize_args_parser.rb +47 -0
  57. data/vendor/eac_cli/lib/eac_cli/definition/boolean_option.rb +8 -0
  58. data/vendor/eac_cli/lib/eac_cli/definition/help_formatter.rb +2 -2
  59. data/vendor/eac_cli/lib/eac_cli/definition/positional_argument.rb +12 -0
  60. data/vendor/eac_cli/lib/eac_cli/docopt/doc_builder.rb +18 -2
  61. data/vendor/eac_cli/lib/eac_cli/docopt/doc_builder/alternative.rb +3 -3
  62. data/vendor/eac_cli/lib/eac_cli/docopt/runner_context_replacement.rb +15 -0
  63. data/vendor/eac_cli/lib/eac_cli/docopt/runner_extension.rb +7 -2
  64. data/vendor/eac_cli/lib/eac_cli/docopt_runner.rb +43 -0
  65. data/vendor/eac_cli/lib/eac_cli/docopt_runner/_class_methods.rb +16 -0
  66. data/vendor/eac_cli/lib/eac_cli/docopt_runner/_doc.rb +23 -0
  67. data/vendor/eac_cli/lib/eac_cli/docopt_runner/_settings.rb +17 -0
  68. data/vendor/eac_cli/lib/eac_cli/docopt_runner/_subcommands.rb +152 -0
  69. data/vendor/eac_cli/lib/eac_cli/old_configs.rb +36 -0
  70. data/vendor/eac_cli/lib/eac_cli/old_configs/entry_reader.rb +80 -0
  71. data/vendor/eac_cli/lib/eac_cli/old_configs/password_entry_reader.rb +16 -0
  72. data/vendor/eac_cli/lib/eac_cli/old_configs/read_entry_options.rb +44 -0
  73. data/vendor/eac_cli/lib/eac_cli/old_configs/store_passwords_entry_reader.rb +25 -0
  74. data/vendor/eac_cli/lib/eac_cli/parser/alternative.rb +4 -4
  75. data/vendor/eac_cli/lib/eac_cli/parser/alternative/long_options.rb +37 -0
  76. data/vendor/eac_cli/lib/eac_cli/parser/alternative/option_argument.rb +29 -0
  77. data/vendor/eac_cli/lib/eac_cli/parser/alternative/options.rb +7 -36
  78. data/vendor/eac_cli/lib/eac_cli/parser/alternative/short_options.rb +47 -0
  79. data/vendor/eac_cli/lib/eac_cli/parser/collector.rb +3 -17
  80. data/vendor/eac_cli/lib/eac_cli/patches/module.rb +4 -0
  81. data/vendor/eac_cli/lib/eac_cli/patches/module/speaker.rb +10 -0
  82. data/vendor/eac_cli/lib/eac_cli/patches/object/runner_with.rb +3 -2
  83. data/vendor/eac_cli/lib/eac_cli/runner.rb +0 -48
  84. data/vendor/eac_cli/lib/eac_cli/runner/after_class_methods.rb +29 -0
  85. data/vendor/eac_cli/lib/eac_cli/runner/context.rb +2 -1
  86. data/vendor/eac_cli/lib/eac_cli/runner/instance_methods.rb +38 -0
  87. data/vendor/eac_cli/lib/eac_cli/runner_with/subcommands.rb +19 -3
  88. data/vendor/eac_cli/lib/eac_cli/runner_with/subcommands/definition_concern.rb +10 -0
  89. data/vendor/eac_cli/lib/eac_cli/runner_with_set.rb +50 -0
  90. data/vendor/eac_cli/lib/eac_cli/speaker.rb +131 -0
  91. data/vendor/eac_cli/lib/eac_cli/speaker/_class_methods.rb +37 -0
  92. data/vendor/eac_cli/lib/eac_cli/speaker/_constants.rb +12 -0
  93. data/vendor/eac_cli/lib/eac_cli/speaker/list.rb +61 -0
  94. data/vendor/eac_cli/lib/eac_cli/speaker/node.rb +24 -0
  95. data/vendor/eac_cli/lib/eac_cli/version.rb +1 -1
  96. data/vendor/eac_cli/spec/lib/eac_cli/definition/alternative_spec.rb +4 -0
  97. data/vendor/eac_cli/spec/lib/eac_cli/docopt/runner_extension_spec.rb +1 -1
  98. data/vendor/{eac_ruby_utils/spec/lib/eac_ruby_utils/console → eac_cli/spec/lib/eac_cli}/docopt_runner_spec.rb +5 -5
  99. 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
  100. data/vendor/eac_cli/spec/lib/eac_cli/runner_spec.rb +44 -5
  101. data/vendor/{eac_ruby_utils/spec/lib/eac_ruby_utils/console → eac_cli/spec/lib/eac_cli}/speaker_spec.rb +2 -2
  102. data/vendor/eac_cli/spec/lib/module/speaker_spec.rb +13 -0
  103. data/vendor/eac_cli/spec/rubocop_spec.rb +1 -5
  104. data/vendor/eac_cli/spec/spec_helper.rb +3 -0
  105. data/vendor/eac_docker/eac_docker.gemspec +3 -2
  106. data/vendor/eac_docker/lib/eac_docker/images/templatized.rb +1 -0
  107. data/vendor/eac_docker/lib/eac_docker/version.rb +1 -1
  108. data/vendor/eac_docker/spec/lib/eac_docker/images/templatized_spec.rb +2 -1
  109. data/vendor/eac_docker/spec/rubocop_spec.rb +1 -5
  110. data/vendor/eac_docker/spec/spec_helper.rb +3 -0
  111. data/vendor/eac_ruby_base0/Gemfile +5 -0
  112. data/vendor/eac_ruby_base0/eac_ruby_base0.gemspec +20 -0
  113. data/vendor/eac_ruby_base0/lib/eac_ruby_base0.rb +7 -0
  114. data/vendor/eac_ruby_base0/lib/eac_ruby_base0/application.rb +69 -0
  115. data/vendor/eac_ruby_base0/lib/eac_ruby_base0/core_ext.rb +4 -0
  116. data/vendor/eac_ruby_base0/lib/eac_ruby_base0/jobs_runner.rb +31 -0
  117. data/vendor/eac_ruby_base0/lib/eac_ruby_base0/patches.rb +4 -0
  118. data/vendor/eac_ruby_base0/lib/eac_ruby_base0/patches/class.rb +4 -0
  119. data/vendor/eac_ruby_base0/lib/eac_ruby_base0/patches/class/jobs_runner.rb +10 -0
  120. data/vendor/eac_ruby_base0/lib/eac_ruby_base0/patches/object.rb +5 -0
  121. data/vendor/eac_ruby_base0/lib/eac_ruby_base0/patches/object/runner_with.rb +5 -0
  122. data/vendor/eac_ruby_base0/lib/eac_ruby_base0/runner.rb +52 -0
  123. data/vendor/eac_ruby_base0/lib/eac_ruby_base0/runner/test_all.rb +22 -0
  124. data/vendor/eac_ruby_base0/lib/eac_ruby_base0/runner_with.rb +9 -0
  125. data/vendor/eac_ruby_base0/lib/eac_ruby_base0/runner_with/confirmation.rb +36 -0
  126. data/vendor/eac_ruby_base0/lib/eac_ruby_base0/runner_with/filesystem_traverser.rb +52 -0
  127. data/vendor/eac_ruby_base0/lib/eac_ruby_base0/runner_with/input.rb +36 -0
  128. data/vendor/eac_ruby_base0/lib/eac_ruby_base0/runner_with/output.rb +58 -0
  129. data/vendor/eac_ruby_base0/lib/eac_ruby_base0/version.rb +5 -0
  130. data/vendor/eac_ruby_base0/spec/lib/eac_ruby_base0/runner_with/confirmation_spec.rb +42 -0
  131. data/vendor/eac_ruby_base0/spec/lib/eac_ruby_base0/runner_with/output_spec.rb +81 -0
  132. data/vendor/eac_ruby_base0/spec/rubocop_spec.rb +3 -0
  133. data/vendor/eac_ruby_base0/spec/spec_helper.rb +103 -0
  134. data/vendor/eac_ruby_utils/eac_ruby_utils.gemspec +2 -3
  135. data/vendor/eac_ruby_utils/lib/eac_ruby_utils/common_concern/module_setup.rb +16 -6
  136. data/vendor/eac_ruby_utils/lib/eac_ruby_utils/common_constructor.rb +2 -99
  137. data/vendor/eac_ruby_utils/lib/eac_ruby_utils/common_constructor/class_initialize.rb +29 -0
  138. data/vendor/eac_ruby_utils/lib/eac_ruby_utils/common_constructor/instance_initialize.rb +53 -0
  139. data/vendor/eac_ruby_utils/lib/eac_ruby_utils/common_constructor/super_args.rb +54 -0
  140. data/vendor/eac_ruby_utils/lib/eac_ruby_utils/envs/command.rb +10 -5
  141. data/vendor/eac_ruby_utils/lib/eac_ruby_utils/filesystem_cache.rb +6 -0
  142. data/vendor/eac_ruby_utils/lib/eac_ruby_utils/fs/logs.rb +63 -0
  143. data/vendor/eac_ruby_utils/lib/eac_ruby_utils/fs/traverser.rb +0 -2
  144. data/vendor/eac_ruby_utils/lib/eac_ruby_utils/inflector.rb +13 -2
  145. data/vendor/eac_ruby_utils/lib/eac_ruby_utils/listable/list.rb +3 -2
  146. data/vendor/eac_ruby_utils/lib/eac_ruby_utils/local_time_zone.rb +48 -0
  147. data/vendor/eac_ruby_utils/lib/eac_ruby_utils/patches/class/settings_provider.rb +10 -0
  148. data/vendor/eac_ruby_utils/lib/eac_ruby_utils/patches/kernel.rb +4 -0
  149. data/vendor/eac_ruby_utils/lib/eac_ruby_utils/patches/kernel/nyi.rb +10 -0
  150. data/vendor/eac_ruby_utils/lib/eac_ruby_utils/patches/module/common_concern.rb +0 -1
  151. data/vendor/eac_ruby_utils/lib/eac_ruby_utils/patches/object/if_nil.rb +17 -0
  152. data/vendor/eac_ruby_utils/lib/eac_ruby_utils/patches/regexp/to_parser.rb +10 -0
  153. data/vendor/eac_ruby_utils/lib/eac_ruby_utils/patches/string/inflector.rb +4 -2
  154. data/vendor/eac_ruby_utils/lib/eac_ruby_utils/patches/time/required_zone.rb +11 -0
  155. data/vendor/eac_ruby_utils/lib/eac_ruby_utils/regexp_parser.rb +34 -0
  156. data/vendor/eac_ruby_utils/lib/eac_ruby_utils/rspec/conditional.rb +1 -4
  157. data/vendor/eac_ruby_utils/lib/eac_ruby_utils/settings_provider.rb +10 -29
  158. data/vendor/eac_ruby_utils/lib/eac_ruby_utils/settings_provider/setting_value.rb +69 -0
  159. data/vendor/eac_ruby_utils/lib/eac_ruby_utils/simple_cache.rb +18 -5
  160. data/vendor/eac_ruby_utils/lib/eac_ruby_utils/version.rb +1 -1
  161. data/vendor/eac_ruby_utils/lib/eac_ruby_utils/yaml.rb +8 -0
  162. data/vendor/eac_ruby_utils/spec/lib/eac_ruby_utils/common_concern_spec.rb +14 -4
  163. data/vendor/eac_ruby_utils/spec/lib/eac_ruby_utils/common_constructor_spec.rb +30 -0
  164. data/vendor/eac_ruby_utils/spec/lib/eac_ruby_utils/inflector_spec.rb +2 -1
  165. data/vendor/eac_ruby_utils/spec/lib/eac_ruby_utils/local_time_zone_spec.rb +17 -0
  166. data/vendor/eac_ruby_utils/spec/lib/eac_ruby_utils/settings_provider_spec.rb +8 -0
  167. data/vendor/eac_ruby_utils/spec/lib/eac_ruby_utils/simple_cache_spec.rb +9 -0
  168. data/vendor/eac_ruby_utils/spec/rubocop_check_spec.rb +1 -5
  169. data/vendor/eac_ruby_utils/spec/spec_helper.rb +3 -0
  170. data/vendor/ehbrs_ruby_utils/lib/ehbrs_ruby_utils/videos/convert_job.rb +1 -1
  171. data/vendor/ehbrs_ruby_utils/lib/ehbrs_ruby_utils/web_utils/videos/files_list.rb +1 -1
  172. metadata +134 -62
  173. data/vendor/eac_cli/lib/eac_cli/runner_with/output_file.rb +0 -30
  174. data/vendor/eac_cli/spec/lib/eac_cli/runner_with/output_file_spec.rb +0 -53
  175. data/vendor/eac_ruby_utils/lib/eac_ruby_utils/configs.rb +0 -74
  176. data/vendor/eac_ruby_utils/lib/eac_ruby_utils/configs/base.rb +0 -43
  177. data/vendor/eac_ruby_utils/lib/eac_ruby_utils/configs/file.rb +0 -47
  178. data/vendor/eac_ruby_utils/lib/eac_ruby_utils/console.rb +0 -5
  179. data/vendor/eac_ruby_utils/lib/eac_ruby_utils/console/configs.rb +0 -38
  180. data/vendor/eac_ruby_utils/lib/eac_ruby_utils/console/configs/entry_reader.rb +0 -81
  181. data/vendor/eac_ruby_utils/lib/eac_ruby_utils/console/configs/password_entry_reader.rb +0 -18
  182. data/vendor/eac_ruby_utils/lib/eac_ruby_utils/console/configs/read_entry_options.rb +0 -46
  183. data/vendor/eac_ruby_utils/lib/eac_ruby_utils/console/configs/store_passwords_entry_reader.rb +0 -27
  184. data/vendor/eac_ruby_utils/lib/eac_ruby_utils/console/docopt_runner.rb +0 -45
  185. data/vendor/eac_ruby_utils/lib/eac_ruby_utils/console/docopt_runner/_class_methods.rb +0 -18
  186. data/vendor/eac_ruby_utils/lib/eac_ruby_utils/console/docopt_runner/_doc.rb +0 -25
  187. data/vendor/eac_ruby_utils/lib/eac_ruby_utils/console/docopt_runner/_settings.rb +0 -19
  188. data/vendor/eac_ruby_utils/lib/eac_ruby_utils/console/docopt_runner/_subcommands.rb +0 -145
  189. data/vendor/eac_ruby_utils/lib/eac_ruby_utils/console/speaker.rb +0 -133
  190. data/vendor/eac_ruby_utils/lib/eac_ruby_utils/console/speaker/_class_methods.rb +0 -39
  191. data/vendor/eac_ruby_utils/lib/eac_ruby_utils/console/speaker/_constants.rb +0 -14
  192. data/vendor/eac_ruby_utils/lib/eac_ruby_utils/console/speaker/list.rb +0 -63
  193. data/vendor/eac_ruby_utils/lib/eac_ruby_utils/console/speaker/node.rb +0 -26
  194. data/vendor/eac_ruby_utils/lib/eac_ruby_utils/patches/module/console_speaker.rb +0 -10
  195. data/vendor/eac_ruby_utils/lib/eac_ruby_utils/patches/object/template.rb +0 -16
  196. data/vendor/eac_ruby_utils/lib/eac_ruby_utils/patches/time/default_time_zone_set.rb +0 -5
  197. data/vendor/eac_ruby_utils/lib/eac_ruby_utils/patches/time/local_time_zone.rb +0 -25
  198. data/vendor/eac_ruby_utils/lib/eac_ruby_utils/paths_hash.rb +0 -56
  199. data/vendor/eac_ruby_utils/lib/eac_ruby_utils/paths_hash/entry_key_error.rb +0 -8
  200. data/vendor/eac_ruby_utils/lib/eac_ruby_utils/paths_hash/node.rb +0 -67
  201. data/vendor/eac_ruby_utils/lib/eac_ruby_utils/paths_hash/path_search.rb +0 -39
  202. data/vendor/eac_ruby_utils/lib/eac_ruby_utils/templates.rb +0 -9
  203. data/vendor/eac_ruby_utils/lib/eac_ruby_utils/templates/directory.rb +0 -110
  204. data/vendor/eac_ruby_utils/lib/eac_ruby_utils/templates/file.rb +0 -50
  205. data/vendor/eac_ruby_utils/lib/eac_ruby_utils/templates/searcher.rb +0 -55
  206. data/vendor/eac_ruby_utils/lib/eac_ruby_utils/templates/variable_not_found_error.rb +0 -7
  207. data/vendor/eac_ruby_utils/lib/eac_ruby_utils/templates/variable_providers.rb +0 -25
  208. data/vendor/eac_ruby_utils/lib/eac_ruby_utils/templates/variable_providers/base.rb +0 -23
  209. data/vendor/eac_ruby_utils/lib/eac_ruby_utils/templates/variable_providers/entries_reader.rb +0 -25
  210. data/vendor/eac_ruby_utils/lib/eac_ruby_utils/templates/variable_providers/generic.rb +0 -25
  211. data/vendor/eac_ruby_utils/lib/eac_ruby_utils/templates/variable_providers/hash.rb +0 -29
  212. data/vendor/eac_ruby_utils/spec/lib/eac_ruby_utils/configs_spec.rb +0 -46
  213. data/vendor/eac_ruby_utils/spec/lib/eac_ruby_utils/patches/module/console_speaker_spec.rb +0 -13
  214. data/vendor/eac_ruby_utils/spec/lib/eac_ruby_utils/patches/object/template_spec.rb +0 -23
  215. data/vendor/eac_ruby_utils/spec/lib/eac_ruby_utils/paths_hash_spec.rb +0 -88
  216. data/vendor/eac_ruby_utils/spec/lib/eac_ruby_utils/templates/file_spec.rb +0 -35
  217. data/vendor/eac_ruby_utils/spec/lib/eac_ruby_utils/templates/file_spec_files/expected_content +0 -2
  218. data/vendor/eac_ruby_utils/spec/lib/eac_ruby_utils/templates/file_spec_files/source.template +0 -2
  219. data/vendor/eac_ruby_utils/spec/lib/eac_ruby_utils/templates/searcher_spec.rb +0 -30
  220. data/vendor/eac_ruby_utils/spec/lib/eac_ruby_utils/templates/searcher_spec_files/path1/subdir1/file1.template +0 -1
  221. data/vendor/eac_ruby_utils/spec/lib/eac_ruby_utils/templates/searcher_spec_files/path1/subdir1/file2 +0 -1
  222. data/vendor/eac_ruby_utils/spec/lib/eac_ruby_utils/templates/searcher_spec_files/path2/subdir1/file3.template +0 -1
@@ -12,7 +12,7 @@ module Ehbrs
12
12
  }.freeze
13
13
 
14
14
  TRACK_TYPE_FIX_CODECS = {
15
- audio: 'libvorbis',
15
+ audio: 'aac',
16
16
  video: 'libx264',
17
17
  subtitle: 'ass'
18
18
  }.freeze
@@ -0,0 +1,27 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'ehbrs/videos/unsupported/profiles/base'
4
+
5
+ module Ehbrs
6
+ module Videos
7
+ module Unsupported
8
+ module Profiles
9
+ class Aoc < ::Ehbrs::Videos::Unsupported::Profiles::Base
10
+ AUDIO_SUPPORTED_CODECS = %w[aac ac3 mp2 mp3].freeze
11
+ AUDIO_UNSUPPORTED_CODECS = %w[eac3 vorbis].freeze
12
+
13
+ VIDEO_SUPPORTED_CODECS = %w[h264 mpeg4].freeze
14
+ VIDEO_UNSUPPORTED_CODECS = %w[hevc].freeze
15
+
16
+ SUBTITLE_SUPPORTED_CODECS = %w[ass dvd_subtitle hdmv_pgs_subtitle subrip].freeze
17
+ SUBTITLE_UNSUPPORTED_CODECS = %w[mov_text].freeze
18
+
19
+ OTHER_SUPPORTED_CODECS = %w[].freeze
20
+
21
+ MPEG4_EXTRA_SUPPORTED = %w[xvid].freeze
22
+ MPEG4_EXTRA_UNSUPPORTED = %w[].freeze
23
+ end
24
+ end
25
+ end
26
+ end
27
+ end
@@ -9,7 +9,7 @@ module Ehbrs
9
9
  module Unsupported
10
10
  class Search
11
11
  include ::EacRubyUtils::Fs::Traversable
12
- enable_console_speaker
12
+ enable_speaker
13
13
  enable_simple_cache
14
14
 
15
15
  VALID_EXTENSIONS = %w[.avi .mp4 .mkv .m4v].freeze
@@ -8,7 +8,7 @@ module Ehbrs
8
8
  class Track < ::SimpleDelegator
9
9
  include ::Ehbrs::Videos::Unsupported::CheckSupport
10
10
 
11
- enable_console_speaker
11
+ enable_speaker
12
12
  enable_simple_cache
13
13
  attr_reader :video
14
14
 
@@ -0,0 +1,20 @@
1
+ <!doctype html>
2
+ <html>
3
+ <head>
4
+ <title><%= title %></title>
5
+ <meta charset="utf-8">
6
+ <meta name="viewport" content="width=device-width, initial-scale=1">
7
+ <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.0.0-beta1/dist/css/bootstrap.min.css"
8
+ rel="stylesheet"
9
+ integrity="sha384-giJF6kkoqNQ00vy+HMDP7azOuL0xtbfIcaT9wjKHr8RbDVddVHyTfAAsrekwKmP1"
10
+ crossorigin="anonymous">
11
+ <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.0.0-beta1/dist/js/bootstrap.bundle.min.js"
12
+ integrity="sha384-ygbV9kiqUc6oa4msXn9868pTtWMgiQaeYH7/t7LECLbyPA2x65Kgf80OJFdroafW"
13
+ crossorigin="anonymous"
14
+ ></script>
15
+ </head>
16
+ <body>
17
+ <h1><%= title %></h1>
18
+ <%= inner_content %>
19
+ </body>
20
+ </html>
@@ -0,0 +1,6 @@
1
+ <h2>Receitas</h2>
2
+ <ul>
3
+ <% parent.recipes_pages.each do |rp| %>
4
+ <li><a href="<%= rp.href %>" ><%= rp.title %></a></li>
5
+ <% end %>
6
+ </ul>
@@ -0,0 +1,6 @@
1
+ <% if notes.present? %>
2
+ <p><%= notes %></p>
3
+ <% end %>
4
+ <% parts.each do |part| %>
5
+ <%= part.content %>
6
+ <% end %>
@@ -0,0 +1,27 @@
1
+ <h2><%= title %></h2>
2
+ <h3>Ingredientes</h3>
3
+ <% if notes.present? %>
4
+ <%= notes %>
5
+ <% end %>
6
+ <table class="table">
7
+ <thead>
8
+ <tr>
9
+ <th scope="col">Ingrediente</th>
10
+ <th scope="col">Medida</th>
11
+ </tr>
12
+ </thead>
13
+ <tbody>
14
+ <% ingredients.each do |ingredient| %>
15
+ <tr>
16
+ <th scope="row"><%= ingredient.name %></th>
17
+ <td><%= ingredient.measure %></td>
18
+ </tr>
19
+ <% end %>
20
+ </tbody>
21
+ </table>
22
+ <h3>Preparo</h3>
23
+ <ol>
24
+ <% steps.each do |step| %>
25
+ <li><%= step %></li>
26
+ <% end %>
27
+ </ol>
@@ -57,6 +57,14 @@ module Aranha
57
57
  option_value(:headless)
58
58
  end
59
59
 
60
+ def profile_dir
61
+ options[:profile_dir].to_s
62
+ end
63
+
64
+ def profile_name
65
+ options[:profile_name]
66
+ end
67
+
60
68
  def user_agent
61
69
  option_value(:user_agent)
62
70
  end
@@ -14,14 +14,19 @@ module Aranha
14
14
 
15
15
  def chrome_options
16
16
  r = ::Selenium::WebDriver::Chrome::Options.new
17
- r.add_argument('--ignore-certificate-errors') if accept_insecure_certs?
18
- r.add_argument('--headless') if headless?
19
- r.add_argument('--disable-popup-blocking')
20
- r.add_argument('--disable-translate')
21
- r.add_argument("user-agent=#{user_agent}") if user_agent.present?
17
+ chrome_arguments.each { |arg| r.add_argument(arg) }
22
18
  r.add_preference(:download, prompt_for_download: false, default_directory: downloads_dir)
23
19
  r
24
20
  end
21
+
22
+ def chrome_arguments
23
+ r = %w[--disable-popup-blocking --disable-translate]
24
+ r << '--ignore-certificate-errors' if accept_insecure_certs?
25
+ r << '--headless' if headless?
26
+ r << "--user-agent=#{user_agent}" if user_agent.present?
27
+ r << "--user-data-dir=#{profile_dir}" if profile_dir.present?
28
+ r
29
+ end
25
30
  end
26
31
  end
27
32
  end
@@ -9,10 +9,7 @@ module Aranha
9
9
  def build
10
10
  ::Selenium::WebDriver.for(
11
11
  :firefox,
12
- options: ::Selenium::WebDriver::Firefox::Options.new(
13
- profile: build_profile,
14
- args: build_args
15
- ),
12
+ options: build_options,
16
13
  desired_capabilities: build_capabilities
17
14
  )
18
15
  end
@@ -21,7 +18,7 @@ module Aranha
21
18
 
22
19
  def build_args
23
20
  r = []
24
- r << '-headless' if headless?
21
+ r << '--headless' if headless?
25
22
  r
26
23
  end
27
24
 
@@ -33,16 +30,33 @@ module Aranha
33
30
  end
34
31
  end
35
32
 
36
- def build_profile
37
- r = ::Selenium::WebDriver::Firefox::Profile.new
38
- r['browser.download.dir'] = downloads_dir
39
- r['browser.download.folderList'] = 2
40
- r['browser.helperApps.neverAsk.saveToDisk'] = auto_download_mime_types.join(';')
41
- r['pdfjs.disabled'] = true
33
+ def build_options
34
+ r = ::Selenium::WebDriver::Firefox::Options.new(args: build_args,
35
+ prefs: build_preferences)
36
+ build_profile.if_present { |v| r.profile = v }
37
+ r
38
+ end
39
+
40
+ def build_preferences
41
+ r = {
42
+ 'browser.download.dir' => downloads_dir,
43
+ 'browser.download.folderList' => 2,
44
+ 'browser.helperApps.neverAsk.saveToDisk' => auto_download_mime_types.join(';'),
45
+ 'pdfjs.disabled' => true
46
+ }
42
47
  r['general.useragent.override'] = user_agent if user_agent.present?
43
48
  r
44
49
  end
45
50
 
51
+ def build_profile
52
+ if profile_name.present?
53
+ ::Selenium::WebDriver::Firefox::Profile.from_name(v)
54
+ elsif profile_dir.present?
55
+ ::FileUtils.mkdir_p(profile_dir)
56
+ ::Selenium::WebDriver::Firefox::Profile.new(profile_dir)
57
+ end
58
+ end
59
+
46
60
  def auto_download_mime_types
47
61
  ::File.read(
48
62
  ::File.join(__dir__, 'firefox_auto_download_mime_types')
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Aranha
4
4
  module Selenium
5
- VERSION = '0.1.3'
5
+ VERSION = '0.2.0'
6
6
  end
7
7
  end
@@ -12,7 +12,10 @@ Gem::Specification.new do |s|
12
12
 
13
13
  s.files = Dir['{lib}/**/*', 'Gemfile']
14
14
 
15
- s.add_dependency 'eac_ruby_utils', '~> 0.55'
15
+ s.add_dependency 'colorize', '~> 0.8.1'
16
+ s.add_dependency 'docopt', '~> 0.6.1'
17
+ s.add_dependency 'eac_config', '~> 0.3'
18
+ s.add_dependency 'eac_ruby_utils', '~> 0.64'
16
19
 
17
- s.add_development_dependency 'eac_ruby_gem_support', '~> 0.1', '>= 0.1.2'
20
+ s.add_development_dependency 'eac_ruby_gem_support', '~> 0.2'
18
21
  end
@@ -2,3 +2,5 @@
2
2
 
3
3
  require 'eac_ruby_utils/core_ext'
4
4
  require 'eac_cli/patches'
5
+
6
+ ::EacCli::RunnerWithSet.default.add_namespace(::EacCli::RunnerWith)
@@ -7,7 +7,7 @@ module EacCli
7
7
  module DefaultRunner
8
8
  common_concern do
9
9
  include ::EacCli::RunnerWith::Help
10
- enable_console_speaker
10
+ enable_speaker
11
11
  enable_simple_cache
12
12
  end
13
13
  end
@@ -10,15 +10,12 @@ module EacCli
10
10
  SUBCOMMAND_NAME_ARG = :subcommand
11
11
  SUBCOMMAND_ARGS_ARG = :subcommand_args
12
12
 
13
- def arg_opt(short, long, description, option_options = {})
14
- options_set << ::EacCli::Definition::ArgumentOption.new(
15
- short, long, description, option_options
16
- )
13
+ def arg_opt(*args)
14
+ options_set << ::EacCli::Definition::ArgumentOption.from_args(args)
17
15
  end
18
16
 
19
- def bool_opt(short, long, description, option_options = {})
20
- options_set << ::EacCli::Definition::BooleanOption.new(short, long, description,
21
- option_options)
17
+ def bool_opt(*args)
18
+ options_set << ::EacCli::Definition::BooleanOption.from_args(args)
22
19
  end
23
20
 
24
21
  def options
@@ -8,6 +8,14 @@ module EacCli
8
8
  def argument?
9
9
  true
10
10
  end
11
+
12
+ def build_value(new_value, previous_value)
13
+ repeat? ? previous_value + [new_value] : new_value
14
+ end
15
+
16
+ def default_value
17
+ repeat? ? [] : nil
18
+ end
11
19
  end
12
20
  end
13
21
  end
@@ -5,22 +5,38 @@ require 'eac_ruby_utils/core_ext'
5
5
  module EacCli
6
6
  class Definition
7
7
  class BaseOption
8
+ require_sub __FILE__
9
+
10
+ class << self
11
+ def from_args(args)
12
+ p = ::EacCli::Definition::BaseOption::InitializeArgsParser.new(args)
13
+ new(p.short, p.long, p.description, p.options)
14
+ end
15
+ end
16
+
8
17
  DEFAULT_REQUIRED = false
9
18
 
10
19
  enable_listable
11
- lists.add_symbol :option, :optional, :usage, :required
12
- attr_reader :short, :long, :description, :options
13
-
14
- def initialize(short, long, description, options = {})
15
- @short = short
16
- @long = long
17
- @description = description
18
- @options = options.symbolize_keys
19
- @options.assert_valid_keys(::EacCli::Definition::BaseOption.lists.option.values)
20
+ enable_abstract_methods :build_value, :default_value
21
+ lists.add_symbol :option, :optional, :usage, :repeat, :required
22
+ common_constructor :short, :long, :description, :options, default: [{}] do
23
+ raise 'Nor short neither long selector was set' if short.blank? && long.blank?
24
+
25
+ self.options = ::EacCli::Definition::BaseOption.lists.option.hash_keys_validate!(
26
+ options.symbolize_keys
27
+ )
20
28
  end
21
29
 
22
30
  def identifier
23
- long.to_s.variableize.to_sym
31
+ [long, short].each do |v|
32
+ v.to_s.if_present { |vv| return vv.variableize.to_sym }
33
+ end
34
+
35
+ raise 'No short or long option to build identifier'
36
+ end
37
+
38
+ def repeat?
39
+ options[OPTION_REPEAT]
24
40
  end
25
41
 
26
42
  def required?
@@ -0,0 +1,47 @@
1
+ # frozen_string_literal: true
2
+
3
+ module EacCli
4
+ class Definition
5
+ class BaseOption
6
+ class InitializeArgsParser
7
+ PROPERTIES = %i[short long description options].freeze
8
+ attr_reader(*PROPERTIES)
9
+
10
+ def initialize(args)
11
+ self.options = args.extract_options!.freeze
12
+ args.each { |arg| absorb_arg(arg) }
13
+ end
14
+
15
+ private
16
+
17
+ attr_writer(*PROPERTIES)
18
+
19
+ def absorb_arg(arg)
20
+ arg_ext = ArgumentParser.new(arg)
21
+ send("#{arg_ext.type}=", arg_ext.value)
22
+ end
23
+
24
+ class ArgumentParser
25
+ TYPES = %i[short long description].freeze
26
+ common_constructor :value
27
+
28
+ def type
29
+ TYPES.find { |type| send("#{type}?") } || raise("Unknown type for \"#{value}\"")
30
+ end
31
+
32
+ def short?
33
+ value.start_with?('-') && !long?
34
+ end
35
+
36
+ def long?
37
+ value.start_with?('--')
38
+ end
39
+
40
+ def description?
41
+ !short? || !long?
42
+ end
43
+ end
44
+ end
45
+ end
46
+ end
47
+ end
@@ -8,6 +8,14 @@ module EacCli
8
8
  def argument?
9
9
  false
10
10
  end
11
+
12
+ def build_value(_new_value, previous_value)
13
+ repeat? ? previous_value + 1 : true
14
+ end
15
+
16
+ def default_value
17
+ repeat? ? 0 : false
18
+ end
11
19
  end
12
20
  end
13
21
  end
@@ -27,7 +27,7 @@ module EacCli
27
27
 
28
28
  def positional_argument(positional)
29
29
  if positional.subcommand?
30
- ::EacRubyUtils::Console::DocoptRunner::SUBCOMMANDS_MACRO
30
+ ::EacCli::DocoptRunner::SUBCOMMANDS_MACRO
31
31
  else
32
32
  r = "<#{positional.name}>"
33
33
  r += '...' if positional.repeat?
@@ -52,7 +52,7 @@ module EacCli
52
52
  end
53
53
 
54
54
  def self_usage_arguments
55
- [::EacRubyUtils::Console::DocoptRunner::PROGRAM_MACRO] +
55
+ [::EacCli::DocoptRunner::PROGRAM_MACRO] +
56
56
  definition.options_argument.if_present([]) { |_v| ['[options]'] } +
57
57
  self_usage_arguments_options +
58
58
  self_usage_arguments_positional
@@ -13,6 +13,18 @@ module EacCli
13
13
  options.assert_valid_keys(self.class.lists.option.values)
14
14
  end
15
15
 
16
+ def build_value(new_value, previous_value)
17
+ if previous_value.is_a?(::Array)
18
+ previous_value + [new_value]
19
+ else
20
+ new_value
21
+ end
22
+ end
23
+
24
+ def default_value
25
+ repeat? ? [] : nil
26
+ end
27
+
16
28
  def identifier
17
29
  name.to_s.variableize.to_sym
18
30
  end