ehbrs-tools 0.19.0 → 0.23.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (220) hide show
  1. checksums.yaml +4 -4
  2. data/lib/ehbrs/cooking_book/project.rb +8 -2
  3. data/lib/ehbrs/core_ext.rb +4 -0
  4. data/lib/ehbrs/music.rb +9 -0
  5. data/lib/ehbrs/music/album.rb +44 -0
  6. data/lib/ehbrs/observers/base.rb +1 -1
  7. data/lib/ehbrs/observers/with_persistence.rb +1 -1
  8. data/lib/ehbrs/patches.rb +4 -0
  9. data/lib/ehbrs/patches/object/template.rb +2 -2
  10. data/lib/ehbrs/runner/cooking_book/build.rb +20 -2
  11. data/lib/ehbrs/runner/fs/selected.rb +79 -0
  12. data/lib/ehbrs/runner/fs/used_space.rb +2 -3
  13. data/lib/ehbrs/runner/music.rb +16 -0
  14. data/lib/ehbrs/runner/music/selected.rb +26 -0
  15. data/lib/ehbrs/runner/videos/probe.rb +2 -2
  16. data/lib/ehbrs/runner/web_utils/videos/upload.rb +1 -1
  17. data/lib/ehbrs/tools/version.rb +1 -1
  18. data/lib/ehbrs/vg/wii/game_file.rb +10 -0
  19. data/lib/ehbrs/videos/convert_job.rb +1 -1
  20. data/lib/ehbrs/videos/series/rename/line_result.rb +1 -1
  21. data/lib/ehbrs/videos/unsupported/check_support.rb +12 -7
  22. data/lib/ehbrs/videos/unsupported/search.rb +1 -1
  23. data/lib/ehbrs/videos/unsupported/track.rb +1 -1
  24. data/vendor/aranha-parsers/aranha-parsers.gemspec +1 -1
  25. data/vendor/aranha-parsers/lib/aranha/parsers/version.rb +1 -1
  26. data/vendor/aranha-parsers/spec/lib/rubocop_check_spec.rb +1 -5
  27. data/vendor/aranha-parsers/spec/spec_helper.rb +3 -0
  28. data/vendor/aranha-selenium/lib/aranha/selenium/driver_factory/base.rb +8 -0
  29. data/vendor/aranha-selenium/lib/aranha/selenium/driver_factory/chrome.rb +10 -5
  30. data/vendor/aranha-selenium/lib/aranha/selenium/driver_factory/firefox.rb +25 -11
  31. data/vendor/aranha-selenium/lib/aranha/selenium/version.rb +1 -1
  32. data/vendor/eac_cli/eac_cli.gemspec +4 -2
  33. data/vendor/eac_cli/lib/eac_cli/config.rb +18 -0
  34. data/vendor/eac_cli/lib/eac_cli/config/entry.rb +48 -0
  35. data/vendor/{eac_ruby_utils/lib/eac_ruby_utils/console/configs/read_entry_options.rb → eac_cli/lib/eac_cli/config/entry/options.rb} +20 -9
  36. data/vendor/eac_cli/lib/eac_cli/config/entry/undefined.rb +26 -0
  37. data/vendor/eac_cli/lib/eac_cli/core_ext.rb +2 -0
  38. data/vendor/eac_cli/lib/eac_cli/default_runner.rb +1 -1
  39. data/vendor/eac_cli/lib/eac_cli/definition/alternative.rb +4 -7
  40. data/vendor/eac_cli/lib/eac_cli/definition/argument_option.rb +8 -0
  41. data/vendor/eac_cli/lib/eac_cli/definition/base_option.rb +26 -10
  42. data/vendor/eac_cli/lib/eac_cli/definition/base_option/initialize_args_parser.rb +47 -0
  43. data/vendor/eac_cli/lib/eac_cli/definition/boolean_option.rb +8 -0
  44. data/vendor/eac_cli/lib/eac_cli/definition/help_formatter.rb +3 -2
  45. data/vendor/eac_cli/lib/eac_cli/definition/positional_argument.rb +18 -1
  46. data/vendor/eac_cli/lib/eac_cli/old_configs.rb +35 -0
  47. data/vendor/eac_cli/lib/eac_cli/old_configs/entry_reader.rb +80 -0
  48. data/vendor/eac_cli/lib/eac_cli/old_configs/password_entry_reader.rb +16 -0
  49. data/vendor/eac_cli/lib/eac_cli/old_configs/read_entry_options.rb +44 -0
  50. data/vendor/eac_cli/lib/eac_cli/old_configs/store_passwords_entry_reader.rb +25 -0
  51. data/vendor/eac_cli/lib/eac_cli/old_configs_bridge.rb +39 -0
  52. data/vendor/eac_cli/lib/eac_cli/parser/alternative/short_options.rb +4 -2
  53. data/vendor/eac_cli/lib/eac_cli/parser/collector.rb +3 -17
  54. data/vendor/eac_cli/lib/eac_cli/patches/object/runner_with.rb +3 -2
  55. data/vendor/eac_cli/lib/eac_cli/runner.rb +0 -50
  56. data/vendor/eac_cli/lib/eac_cli/runner/after_class_methods.rb +46 -0
  57. data/vendor/eac_cli/lib/eac_cli/runner/context.rb +2 -1
  58. data/vendor/eac_cli/lib/eac_cli/runner/instance_methods.rb +42 -0
  59. data/vendor/eac_cli/lib/eac_cli/runner_with/help.rb +9 -4
  60. data/vendor/eac_cli/lib/eac_cli/runner_with/help/builder.rb +73 -0
  61. data/vendor/eac_cli/lib/eac_cli/runner_with/help/builder/alternative.rb +56 -0
  62. data/vendor/eac_cli/lib/eac_cli/runner_with/subcommands.rb +11 -5
  63. data/vendor/eac_cli/lib/eac_cli/runner_with/subcommands/definition_concern.rb +10 -0
  64. data/vendor/eac_cli/lib/eac_cli/runner_with_set.rb +50 -0
  65. data/vendor/eac_cli/lib/eac_cli/speaker.rb +127 -0
  66. data/vendor/eac_cli/lib/eac_cli/speaker/_constants.rb +12 -0
  67. data/vendor/eac_cli/lib/eac_cli/speaker/list.rb +61 -0
  68. data/vendor/eac_cli/lib/eac_cli/speaker/options.rb +38 -0
  69. data/vendor/eac_cli/lib/eac_cli/version.rb +1 -1
  70. data/vendor/eac_cli/spec/lib/eac_cli/definition/alternative_spec.rb +4 -0
  71. 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
  72. data/vendor/eac_cli/spec/lib/eac_cli/parser/alternative_spec.rb +1 -1
  73. data/vendor/eac_cli/spec/lib/eac_cli/runner_spec.rb +21 -4
  74. data/vendor/{eac_ruby_utils/spec/lib/eac_ruby_utils/console → eac_cli/spec/lib/eac_cli}/speaker_spec.rb +7 -11
  75. data/vendor/eac_cli/spec/rubocop_spec.rb +1 -5
  76. data/vendor/eac_cli/spec/spec_helper.rb +3 -0
  77. data/vendor/eac_config/Gemfile +5 -0
  78. data/vendor/eac_config/eac_config.gemspec +19 -0
  79. data/vendor/eac_config/lib/eac_config.rb +7 -0
  80. data/vendor/eac_config/lib/eac_config/entry.rb +49 -0
  81. data/vendor/eac_config/lib/eac_config/entry_path.rb +41 -0
  82. data/vendor/eac_config/lib/eac_config/envvars_node.rb +25 -0
  83. data/vendor/eac_config/lib/eac_config/envvars_node/entry.rb +54 -0
  84. data/vendor/eac_config/lib/eac_config/load_nodes_search.rb +39 -0
  85. data/vendor/eac_config/lib/eac_config/load_path.rb +28 -0
  86. data/vendor/eac_config/lib/eac_config/node.rb +67 -0
  87. data/vendor/eac_config/lib/eac_config/node_entry.rb +18 -0
  88. data/vendor/eac_config/lib/eac_config/node_uri.rb +38 -0
  89. data/vendor/{eac_ruby_utils/lib/eac_ruby_utils/configs.rb → eac_config/lib/eac_config/old_configs.rb} +6 -5
  90. data/vendor/{eac_ruby_utils/lib/eac_ruby_utils/configs → eac_config/lib/eac_config/old_configs}/base.rb +5 -5
  91. data/vendor/{eac_ruby_utils/lib/eac_ruby_utils/configs → eac_config/lib/eac_config/old_configs}/file.rb +4 -4
  92. data/vendor/{eac_ruby_utils/lib/eac_ruby_utils → eac_config/lib/eac_config}/paths_hash.rb +8 -8
  93. data/vendor/{eac_ruby_utils/lib/eac_ruby_utils → eac_config/lib/eac_config}/paths_hash/entry_key_error.rb +1 -1
  94. data/vendor/{eac_ruby_utils/lib/eac_ruby_utils → eac_config/lib/eac_config}/paths_hash/node.rb +2 -2
  95. data/vendor/{eac_ruby_utils/lib/eac_ruby_utils → eac_config/lib/eac_config}/paths_hash/path_search.rb +4 -4
  96. data/vendor/eac_config/lib/eac_config/version.rb +5 -0
  97. data/vendor/eac_config/lib/eac_config/yaml_file_node.rb +48 -0
  98. data/vendor/eac_config/lib/eac_config/yaml_file_node/entry.rb +37 -0
  99. data/vendor/eac_config/spec/lib/eac_config/entry_path_spec.rb +30 -0
  100. data/vendor/eac_config/spec/lib/eac_config/envvars_node/entry_spec.rb +14 -0
  101. data/vendor/eac_config/spec/lib/eac_config/envvars_node_spec.rb +40 -0
  102. data/vendor/{eac_ruby_utils/spec/lib/eac_ruby_utils/configs_spec.rb → eac_config/spec/lib/eac_config/old_configs_spec.rb} +2 -2
  103. data/vendor/{eac_ruby_utils/spec/lib/eac_ruby_utils → eac_config/spec/lib/eac_config}/paths_hash_spec.rb +6 -6
  104. data/vendor/eac_config/spec/lib/eac_config/yaml_file_node_spec.rb +52 -0
  105. data/vendor/eac_config/spec/lib/eac_config/yaml_file_node_spec_files/storage1.yaml +6 -0
  106. data/vendor/eac_config/spec/lib/eac_config/yaml_file_node_spec_files/storage1_1.yaml +2 -0
  107. data/vendor/eac_config/spec/lib/eac_config/yaml_file_node_spec_files/storage1_2.yaml +4 -0
  108. data/vendor/eac_config/spec/lib/eac_config/yaml_file_node_spec_files/storage1_2/storage1_2_1.yaml +2 -0
  109. data/vendor/eac_config/spec/rubocop_spec.rb +3 -0
  110. data/vendor/eac_config/spec/spec_helper.rb +17 -0
  111. data/vendor/eac_docker/eac_docker.gemspec +3 -2
  112. data/vendor/eac_docker/lib/eac_docker/images/templatized.rb +1 -0
  113. data/vendor/eac_docker/lib/eac_docker/version.rb +1 -1
  114. data/vendor/eac_docker/spec/lib/eac_docker/images/templatized_spec.rb +2 -1
  115. data/vendor/eac_docker/spec/rubocop_spec.rb +1 -5
  116. data/vendor/eac_docker/spec/spec_helper.rb +3 -0
  117. data/vendor/eac_ruby_base0/eac_ruby_base0.gemspec +4 -4
  118. data/vendor/eac_ruby_base0/lib/eac_ruby_base0/application.rb +23 -9
  119. data/vendor/eac_ruby_base0/lib/eac_ruby_base0/application_xdg.rb +34 -0
  120. data/vendor/eac_ruby_base0/lib/eac_ruby_base0/core_ext.rb +4 -0
  121. data/vendor/eac_ruby_base0/lib/eac_ruby_base0/jobs_runner.rb +31 -0
  122. data/vendor/eac_ruby_base0/lib/eac_ruby_base0/patches.rb +4 -0
  123. data/vendor/eac_ruby_base0/lib/eac_ruby_base0/patches/class.rb +4 -0
  124. data/vendor/eac_ruby_base0/lib/eac_ruby_base0/patches/class/jobs_runner.rb +10 -0
  125. data/vendor/eac_ruby_base0/lib/eac_ruby_base0/patches/object.rb +5 -0
  126. data/vendor/eac_ruby_base0/lib/eac_ruby_base0/patches/object/runner_with.rb +5 -0
  127. data/vendor/eac_ruby_base0/lib/eac_ruby_base0/runner.rb +22 -12
  128. data/vendor/eac_ruby_base0/lib/eac_ruby_base0/runner_with.rb +9 -0
  129. data/vendor/eac_ruby_base0/lib/eac_ruby_base0/runner_with/confirmation.rb +43 -0
  130. data/vendor/eac_ruby_base0/lib/eac_ruby_base0/runner_with/filesystem_traverser.rb +52 -0
  131. data/vendor/eac_ruby_base0/lib/eac_ruby_base0/runner_with/input.rb +36 -0
  132. data/vendor/eac_ruby_base0/lib/eac_ruby_base0/runner_with/output.rb +58 -0
  133. data/vendor/eac_ruby_base0/lib/eac_ruby_base0/version.rb +1 -1
  134. data/vendor/eac_ruby_base0/spec/lib/eac_ruby_base0/runner_with/confirmation_spec.rb +42 -0
  135. data/vendor/eac_ruby_base0/spec/lib/eac_ruby_base0/runner_with/output_spec.rb +81 -0
  136. data/vendor/eac_ruby_base0/spec/rubocop_spec.rb +1 -5
  137. data/vendor/eac_ruby_base0/spec/spec_helper.rb +3 -0
  138. data/vendor/eac_ruby_utils/eac_ruby_utils.gemspec +2 -3
  139. data/vendor/eac_ruby_utils/lib/eac_ruby_utils/context.rb +31 -0
  140. data/vendor/eac_ruby_utils/lib/eac_ruby_utils/contextualizable.rb +12 -7
  141. data/vendor/eac_ruby_utils/lib/eac_ruby_utils/envs/command.rb +10 -5
  142. data/vendor/eac_ruby_utils/lib/eac_ruby_utils/filesystem_cache.rb +6 -0
  143. data/vendor/eac_ruby_utils/lib/eac_ruby_utils/fs/logs.rb +63 -0
  144. data/vendor/eac_ruby_utils/lib/eac_ruby_utils/inflector.rb +9 -1
  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 +12 -2
  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/nyi.rb +4 -2
  149. data/vendor/eac_ruby_utils/lib/eac_ruby_utils/patches/module/common_concern.rb +0 -1
  150. data/vendor/eac_ruby_utils/lib/eac_ruby_utils/patches/module/context.rb +11 -0
  151. data/vendor/eac_ruby_utils/lib/eac_ruby_utils/patches/module/speaker.rb +9 -0
  152. data/vendor/eac_ruby_utils/lib/eac_ruby_utils/patches/object/if_nil.rb +17 -0
  153. data/vendor/eac_ruby_utils/lib/eac_ruby_utils/patches/pathname/parent_n.rb +11 -0
  154. data/vendor/eac_ruby_utils/lib/eac_ruby_utils/patches/regexp/to_parser.rb +10 -0
  155. data/vendor/eac_ruby_utils/lib/eac_ruby_utils/patches/string/inflector.rb +4 -2
  156. data/vendor/eac_ruby_utils/lib/eac_ruby_utils/patches/time/required_zone.rb +11 -0
  157. data/vendor/eac_ruby_utils/lib/eac_ruby_utils/regexp_parser.rb +34 -0
  158. data/vendor/eac_ruby_utils/lib/eac_ruby_utils/rspec/conditional.rb +1 -4
  159. data/vendor/eac_ruby_utils/lib/eac_ruby_utils/settings_provider.rb +10 -29
  160. data/vendor/eac_ruby_utils/lib/eac_ruby_utils/settings_provider/setting_value.rb +69 -0
  161. data/vendor/eac_ruby_utils/lib/eac_ruby_utils/simple_cache.rb +26 -5
  162. data/vendor/eac_ruby_utils/lib/eac_ruby_utils/speaker.rb +16 -0
  163. data/vendor/eac_ruby_utils/lib/eac_ruby_utils/speaker/receiver.rb +57 -0
  164. data/vendor/eac_ruby_utils/lib/eac_ruby_utils/speaker/sender.rb +32 -0
  165. data/vendor/eac_ruby_utils/lib/eac_ruby_utils/version.rb +1 -1
  166. data/vendor/eac_ruby_utils/spec/lib/eac_ruby_utils/patches/module/speaker_spec.rb +13 -0
  167. data/vendor/eac_ruby_utils/spec/lib/eac_ruby_utils/patches/pathname/parent_n_spec.rb +33 -0
  168. data/vendor/eac_ruby_utils/spec/lib/eac_ruby_utils/settings_provider_spec.rb +8 -0
  169. data/vendor/eac_ruby_utils/spec/lib/eac_ruby_utils/simple_cache_spec.rb +27 -0
  170. data/vendor/eac_ruby_utils/spec/rubocop_check_spec.rb +1 -5
  171. data/vendor/eac_ruby_utils/spec/spec_helper.rb +3 -0
  172. data/vendor/ehbrs_ruby_utils/lib/ehbrs_ruby_utils/videos/convert_job.rb +1 -1
  173. data/vendor/ehbrs_ruby_utils/lib/ehbrs_ruby_utils/web_utils/videos/files_list.rb +1 -1
  174. metadata +118 -67
  175. data/vendor/eac_cli/lib/eac_cli/docopt/doc_builder.rb +0 -55
  176. data/vendor/eac_cli/lib/eac_cli/docopt/doc_builder/alternative.rb +0 -50
  177. data/vendor/eac_cli/lib/eac_cli/docopt/runner_context_replacement.rb +0 -15
  178. data/vendor/eac_cli/lib/eac_cli/docopt/runner_extension.rb +0 -51
  179. data/vendor/eac_cli/lib/eac_cli/runner_with/output_file.rb +0 -30
  180. data/vendor/eac_cli/spec/lib/eac_cli/docopt/runner_extension_spec.rb +0 -35
  181. data/vendor/eac_cli/spec/lib/eac_cli/runner_with/output_file_spec.rb +0 -53
  182. data/vendor/eac_ruby_utils/lib/eac_ruby_utils/console.rb +0 -5
  183. data/vendor/eac_ruby_utils/lib/eac_ruby_utils/console/configs.rb +0 -38
  184. data/vendor/eac_ruby_utils/lib/eac_ruby_utils/console/configs/entry_reader.rb +0 -81
  185. data/vendor/eac_ruby_utils/lib/eac_ruby_utils/console/configs/password_entry_reader.rb +0 -18
  186. data/vendor/eac_ruby_utils/lib/eac_ruby_utils/console/configs/store_passwords_entry_reader.rb +0 -27
  187. data/vendor/eac_ruby_utils/lib/eac_ruby_utils/console/docopt_runner.rb +0 -45
  188. data/vendor/eac_ruby_utils/lib/eac_ruby_utils/console/docopt_runner/_class_methods.rb +0 -18
  189. data/vendor/eac_ruby_utils/lib/eac_ruby_utils/console/docopt_runner/_doc.rb +0 -25
  190. data/vendor/eac_ruby_utils/lib/eac_ruby_utils/console/docopt_runner/_settings.rb +0 -19
  191. data/vendor/eac_ruby_utils/lib/eac_ruby_utils/console/docopt_runner/_subcommands.rb +0 -154
  192. data/vendor/eac_ruby_utils/lib/eac_ruby_utils/console/speaker.rb +0 -133
  193. data/vendor/eac_ruby_utils/lib/eac_ruby_utils/console/speaker/_class_methods.rb +0 -39
  194. data/vendor/eac_ruby_utils/lib/eac_ruby_utils/console/speaker/_constants.rb +0 -14
  195. data/vendor/eac_ruby_utils/lib/eac_ruby_utils/console/speaker/list.rb +0 -63
  196. data/vendor/eac_ruby_utils/lib/eac_ruby_utils/console/speaker/node.rb +0 -26
  197. data/vendor/eac_ruby_utils/lib/eac_ruby_utils/patches/module/console_speaker.rb +0 -10
  198. data/vendor/eac_ruby_utils/lib/eac_ruby_utils/patches/module/template.rb +0 -10
  199. data/vendor/eac_ruby_utils/lib/eac_ruby_utils/patches/object/template.rb +0 -9
  200. data/vendor/eac_ruby_utils/lib/eac_ruby_utils/patches/time/default_time_zone_set.rb +0 -6
  201. data/vendor/eac_ruby_utils/lib/eac_ruby_utils/templates.rb +0 -9
  202. data/vendor/eac_ruby_utils/lib/eac_ruby_utils/templates/directory.rb +0 -110
  203. data/vendor/eac_ruby_utils/lib/eac_ruby_utils/templates/file.rb +0 -50
  204. data/vendor/eac_ruby_utils/lib/eac_ruby_utils/templates/searcher.rb +0 -55
  205. data/vendor/eac_ruby_utils/lib/eac_ruby_utils/templates/variable_not_found_error.rb +0 -7
  206. data/vendor/eac_ruby_utils/lib/eac_ruby_utils/templates/variable_providers.rb +0 -25
  207. data/vendor/eac_ruby_utils/lib/eac_ruby_utils/templates/variable_providers/base.rb +0 -23
  208. data/vendor/eac_ruby_utils/lib/eac_ruby_utils/templates/variable_providers/entries_reader.rb +0 -25
  209. data/vendor/eac_ruby_utils/lib/eac_ruby_utils/templates/variable_providers/generic.rb +0 -25
  210. data/vendor/eac_ruby_utils/lib/eac_ruby_utils/templates/variable_providers/hash.rb +0 -29
  211. data/vendor/eac_ruby_utils/spec/lib/eac_ruby_utils/console/docopt_runner_spec.rb +0 -136
  212. data/vendor/eac_ruby_utils/spec/lib/eac_ruby_utils/patches/module/console_speaker_spec.rb +0 -13
  213. data/vendor/eac_ruby_utils/spec/lib/eac_ruby_utils/patches/object/template_spec.rb +0 -23
  214. data/vendor/eac_ruby_utils/spec/lib/eac_ruby_utils/templates/file_spec.rb +0 -35
  215. data/vendor/eac_ruby_utils/spec/lib/eac_ruby_utils/templates/file_spec_files/expected_content +0 -2
  216. data/vendor/eac_ruby_utils/spec/lib/eac_ruby_utils/templates/file_spec_files/source.template +0 -2
  217. data/vendor/eac_ruby_utils/spec/lib/eac_ruby_utils/templates/searcher_spec.rb +0 -30
  218. data/vendor/eac_ruby_utils/spec/lib/eac_ruby_utils/templates/searcher_spec_files/path1/subdir1/file1.template +0 -1
  219. data/vendor/eac_ruby_utils/spec/lib/eac_ruby_utils/templates/searcher_spec_files/path1/subdir1/file2 +0 -1
  220. data/vendor/eac_ruby_utils/spec/lib/eac_ruby_utils/templates/searcher_spec_files/path2/subdir1/file3.template +0 -1
@@ -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
 
@@ -19,5 +19,5 @@ Gem::Specification.new do |s|
19
19
  s.add_dependency 'httpclient', '~> 2.8', '>= 2.8.3'
20
20
  s.add_dependency 'ofx-parser', '~> 1.1.0'
21
21
 
22
- s.add_development_dependency 'eac_ruby_gem_support', '~> 0.1'
22
+ s.add_development_dependency 'eac_ruby_gem_support', '~> 0.2'
23
23
  end
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Aranha
4
4
  module Parsers
5
- VERSION = '0.7.0'
5
+ VERSION = '0.7.1'
6
6
  end
7
7
  end
@@ -1,7 +1,3 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require 'eac_ruby_gem_support/spec/examples/rubocop_check'
4
-
5
- RSpec.describe ::RuboCop do
6
- include_examples 'rubocop_check', ::File.expand_path('../..', __dir__)
7
- end
3
+ ::EacRubyGemSupport::Rspec.default.describe_rubocop
@@ -5,4 +5,7 @@ require 'tmpdir'
5
5
 
6
6
  RSpec.configure do |config|
7
7
  config.example_status_persistence_file_path = ::File.join(::Dir.tmpdir, 'aranha-parsers_rspec')
8
+
9
+ require 'eac_ruby_gem_support/rspec'
10
+ ::EacRubyGemSupport::Rspec.setup(::File.expand_path('..', __dir__), config)
8
11
  end
@@ -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,9 @@ 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 'eac_config', '~> 0.3'
17
+ s.add_dependency 'eac_ruby_utils', '~> 0.67'
16
18
 
17
- s.add_development_dependency 'eac_ruby_gem_support', '~> 0.1', '>= 0.1.2'
19
+ s.add_development_dependency 'eac_ruby_gem_support', '~> 0.2'
18
20
  end
@@ -0,0 +1,18 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'eac_ruby_utils/core_ext'
4
+
5
+ module EacCli
6
+ class Config
7
+ require_sub __FILE__
8
+ attr_reader :sub
9
+
10
+ def initialize(sub_node)
11
+ @sub = sub_node
12
+ end
13
+
14
+ def entry(path, options = {})
15
+ ::EacCli::Config::Entry.new(self, path, options)
16
+ end
17
+ end
18
+ end
@@ -0,0 +1,48 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'eac_cli/speaker'
4
+ require 'eac_config/entry_path'
5
+ require 'eac_ruby_utils/core_ext'
6
+
7
+ module EacCli
8
+ class Config
9
+ class Entry
10
+ require_sub __FILE__, include_modules: true
11
+ enable_listable
12
+ enable_simple_cache
13
+ enable_speaker
14
+
15
+ common_constructor :config, :path, :options do
16
+ self.path = ::EacConfig::EntryPath.assert(path)
17
+ self.options = ::EacCli::Config::Entry::Options.new(options)
18
+ end
19
+
20
+ def value
21
+ return sub_value_to_return if sub_entry.found?
22
+ return nil unless options.required?
23
+
24
+ puts "|#{sub_entry.path}|"
25
+
26
+ input_value
27
+ end
28
+
29
+ delegate :found?, :value=, to: :sub_entry
30
+
31
+ private
32
+
33
+ def sub_value_to_return
34
+ sub_entry.value.presence || ::EacRubyUtils::BlankNotBlank.instance
35
+ end
36
+
37
+ def sub_entry_uncached
38
+ config.sub.entry(path)
39
+ end
40
+
41
+ def input_value_uncached
42
+ r = send("#{options.type}_value")
43
+ sub_entry.value = r if options.store?
44
+ r
45
+ end
46
+ end
47
+ end
48
+ end
@@ -2,21 +2,26 @@
2
2
 
3
3
  require 'eac_ruby_utils/core_ext'
4
4
 
5
- module EacRubyUtils
6
- module Console
7
- class Configs
8
- class ReadEntryOptions
5
+ module EacCli
6
+ class Config
7
+ class Entry
8
+ class Options
9
9
  enable_simple_cache
10
- common_constructor :options do
11
- self.options = options.to_h.symbolize_keys
12
- .assert_valid_keys(DEFAULT_VALUES.keys).freeze
13
- end
10
+ enable_listable
11
+
12
+ lists.add_symbol :type, :undefined
14
13
 
15
14
  DEFAULT_VALUES = {
16
15
  before_input: nil, bool: false, list: false, noecho: false, noenv: false, noinput: false,
17
- required: true, store: true, validator: nil
16
+ required: true, store: true, type: TYPE_UNDEFINED, validator: nil
18
17
  }.freeze
19
18
 
19
+ lists.add_symbol :option, *DEFAULT_VALUES.keys
20
+
21
+ common_constructor :options do
22
+ self.options = self.class.lists.option.hash_keys_validate!(options)
23
+ end
24
+
20
25
  delegate :to_h, to: :options
21
26
 
22
27
  def [](key)
@@ -27,6 +32,12 @@ module EacRubyUtils
27
32
  values.slice(:bool, :list, :noecho)
28
33
  end
29
34
 
35
+ DEFAULT_VALUES.each do |attr, default_value|
36
+ define_method(attr.to_s + ([true, false].include?(default_value) ? '?' : '')) do
37
+ self[attr]
38
+ end
39
+ end
40
+
30
41
  private
31
42
 
32
43
  def values_uncached
@@ -0,0 +1,26 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'eac_ruby_utils/core_ext'
4
+
5
+ module EacCli
6
+ class Config
7
+ class Entry
8
+ module Undefined
9
+ private
10
+
11
+ def undefined_value
12
+ loop do
13
+ entry_value = undefined_value_no_loop
14
+ next unless options[:validator].if_present(true) { |v| v.call(entry_value) }
15
+
16
+ return entry_value
17
+ end
18
+ end
19
+
20
+ def undefined_value_no_loop
21
+ input("Value for entry \"#{path}\"", options.request_input_options)
22
+ end
23
+ end
24
+ end
25
+ end
26
+ 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