ehbrs-tools 0.21.0 → 0.24.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (213) hide show
  1. checksums.yaml +4 -4
  2. data/exe/ehbrs +2 -2
  3. data/lib/ehbrs/core_ext.rb +4 -0
  4. data/lib/ehbrs/music/album.rb +2 -0
  5. data/{vendor/eac_cli/lib/eac_cli/patches/module.rb → lib/ehbrs/patches.rb} +1 -1
  6. data/lib/ehbrs/tools/runner.rb +21 -0
  7. data/lib/ehbrs/tools/runner/cooking_book.rb +32 -0
  8. data/lib/ehbrs/tools/runner/cooking_book/build.rb +52 -0
  9. data/lib/ehbrs/{runner/videos/series.rb → tools/runner/finances.rb} +4 -4
  10. data/lib/ehbrs/tools/runner/finances/bb_browser.rb +66 -0
  11. data/lib/ehbrs/tools/runner/fs.rb +18 -0
  12. data/lib/ehbrs/tools/runner/fs/selected.rb +81 -0
  13. data/lib/ehbrs/tools/runner/fs/used_space.rb +161 -0
  14. data/lib/ehbrs/tools/runner/google.rb +18 -0
  15. data/lib/ehbrs/tools/runner/google/translate.rb +89 -0
  16. data/lib/ehbrs/tools/runner/music.rb +18 -0
  17. data/lib/ehbrs/tools/runner/music/selected.rb +28 -0
  18. data/lib/ehbrs/tools/runner/self.rb +18 -0
  19. data/lib/ehbrs/tools/runner/self/test.rb +27 -0
  20. data/lib/ehbrs/tools/runner/telegram.rb +28 -0
  21. data/lib/ehbrs/tools/runner/telegram/send_message.rb +31 -0
  22. data/lib/ehbrs/tools/runner/vg.rb +18 -0
  23. data/lib/ehbrs/tools/runner/vg/ips.rb +134 -0
  24. data/lib/ehbrs/tools/runner/vg/wii.rb +74 -0
  25. data/lib/ehbrs/{runner/web_utils → tools/runner}/videos.rb +3 -3
  26. data/lib/ehbrs/tools/runner/videos/extract.rb +70 -0
  27. data/lib/ehbrs/tools/runner/videos/probe.rb +34 -0
  28. data/lib/ehbrs/tools/runner/videos/series.rb +20 -0
  29. data/lib/ehbrs/tools/runner/videos/series/rename.rb +74 -0
  30. data/lib/ehbrs/tools/runner/videos/unsupported.rb +61 -0
  31. data/lib/ehbrs/tools/runner/web_utils.rb +26 -0
  32. data/lib/ehbrs/tools/runner/web_utils/videos.rb +20 -0
  33. data/lib/ehbrs/tools/runner/web_utils/videos/download.rb +65 -0
  34. data/lib/ehbrs/tools/runner/web_utils/videos/upload.rb +77 -0
  35. data/lib/ehbrs/tools/version.rb +1 -1
  36. data/lib/ehbrs/vg/wii/game_file.rb +10 -0
  37. data/lib/ehbrs/videos/unsupported/check_support.rb +12 -8
  38. data/vendor/aranha-parsers/aranha-parsers.gemspec +2 -2
  39. data/vendor/aranha-parsers/lib/aranha/parsers/rspec.rb +11 -0
  40. data/vendor/aranha-parsers/lib/aranha/parsers/rspec/setup_include.rb +17 -0
  41. data/vendor/aranha-parsers/lib/aranha/parsers/{spec → rspec}/source_target_fixtures_example.rb +0 -0
  42. data/vendor/aranha-parsers/lib/aranha/parsers/source_address.rb +10 -8
  43. data/vendor/aranha-parsers/lib/aranha/parsers/version.rb +1 -1
  44. data/vendor/aranha-parsers/spec/lib/rubocop_check_spec.rb +1 -5
  45. data/vendor/aranha-parsers/spec/spec_helper.rb +2 -6
  46. data/vendor/aranha-selenium/aranha-selenium.gemspec +2 -2
  47. data/vendor/aranha-selenium/lib/aranha/selenium/version.rb +1 -1
  48. data/vendor/aranha-selenium/spec/rubocop_check_spec.rb +1 -5
  49. data/vendor/aranha-selenium/spec/spec_helper.rb +2 -98
  50. data/vendor/eac_cli/eac_cli.gemspec +3 -4
  51. data/vendor/eac_cli/lib/eac_cli/config.rb +18 -0
  52. data/vendor/eac_cli/lib/eac_cli/config/entry.rb +46 -0
  53. data/vendor/eac_cli/lib/eac_cli/config/entry/options.rb +57 -0
  54. data/vendor/eac_cli/lib/eac_cli/config/entry/undefined.rb +26 -0
  55. data/vendor/eac_cli/lib/eac_cli/definition/help_formatter.rb +3 -2
  56. data/vendor/eac_cli/lib/eac_cli/definition/positional_argument.rb +6 -1
  57. data/vendor/eac_cli/lib/eac_cli/old_configs.rb +0 -1
  58. data/vendor/eac_cli/lib/eac_cli/old_configs/entry_reader.rb +2 -2
  59. data/vendor/eac_cli/lib/eac_cli/old_configs_bridge.rb +39 -0
  60. data/vendor/eac_cli/lib/eac_cli/runner.rb +0 -2
  61. data/vendor/eac_cli/lib/eac_cli/runner/after_class_methods.rb +20 -3
  62. data/vendor/eac_cli/lib/eac_cli/runner/instance_methods.rb +5 -1
  63. data/vendor/eac_cli/lib/eac_cli/runner_with/help.rb +9 -4
  64. data/vendor/eac_cli/lib/eac_cli/runner_with/help/builder.rb +73 -0
  65. data/vendor/eac_cli/lib/eac_cli/runner_with/help/builder/alternative.rb +56 -0
  66. data/vendor/eac_cli/lib/eac_cli/runner_with/subcommands.rb +6 -4
  67. data/vendor/eac_cli/lib/eac_cli/speaker.rb +15 -19
  68. data/vendor/eac_cli/lib/eac_cli/speaker/_constants.rb +1 -1
  69. data/vendor/eac_cli/lib/eac_cli/speaker/list.rb +1 -1
  70. data/vendor/eac_cli/lib/eac_cli/speaker/options.rb +38 -0
  71. data/vendor/eac_cli/lib/eac_cli/version.rb +1 -1
  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 +0 -1
  74. data/vendor/eac_cli/spec/lib/eac_cli/speaker_spec.rb +5 -9
  75. data/vendor/eac_cli/spec/rubocop_spec.rb +1 -1
  76. data/vendor/eac_cli/spec/spec_helper.rb +2 -101
  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_config/lib/eac_config/old_configs.rb +75 -0
  90. data/vendor/eac_config/lib/eac_config/old_configs/base.rb +43 -0
  91. data/vendor/eac_config/lib/eac_config/old_configs/file.rb +47 -0
  92. data/vendor/eac_config/lib/eac_config/paths_hash.rb +56 -0
  93. data/vendor/eac_config/lib/eac_config/paths_hash/entry_key_error.rb +8 -0
  94. data/vendor/eac_config/lib/eac_config/paths_hash/node.rb +67 -0
  95. data/vendor/eac_config/lib/eac_config/paths_hash/path_search.rb +39 -0
  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_config/spec/lib/eac_config/old_configs_spec.rb +46 -0
  103. data/vendor/eac_config/spec/lib/eac_config/paths_hash_spec.rb +88 -0
  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 +4 -0
  111. data/vendor/eac_docker/eac_docker.gemspec +2 -2
  112. data/vendor/eac_docker/lib/eac_docker/container.rb +7 -3
  113. data/vendor/eac_docker/lib/eac_docker/debug.rb +15 -0
  114. data/vendor/eac_docker/lib/eac_docker/images/coded.rb +4 -0
  115. data/vendor/eac_docker/lib/eac_docker/images/templatized.rb +16 -2
  116. data/vendor/eac_docker/lib/eac_docker/rspec.rb +2 -10
  117. data/vendor/eac_docker/lib/eac_docker/rspec/setup_include.rb +23 -0
  118. data/vendor/eac_docker/lib/eac_docker/version.rb +1 -1
  119. data/vendor/eac_docker/spec/rubocop_spec.rb +1 -1
  120. data/vendor/eac_docker/spec/spec_helper.rb +2 -104
  121. data/vendor/eac_ruby_base0/eac_ruby_base0.gemspec +4 -4
  122. data/vendor/eac_ruby_base0/lib/eac_ruby_base0/application.rb +23 -9
  123. data/vendor/eac_ruby_base0/lib/eac_ruby_base0/application_xdg.rb +34 -0
  124. data/vendor/eac_ruby_base0/lib/eac_ruby_base0/jobs_runner.rb +2 -2
  125. data/vendor/eac_ruby_base0/lib/eac_ruby_base0/runner.rb +19 -7
  126. data/vendor/eac_ruby_base0/lib/eac_ruby_base0/runner_with/confirmation.rb +8 -1
  127. data/vendor/eac_ruby_base0/lib/eac_ruby_base0/version.rb +1 -1
  128. data/vendor/eac_ruby_base0/spec/rubocop_spec.rb +1 -1
  129. data/vendor/eac_ruby_base0/spec/spec_helper.rb +2 -101
  130. data/vendor/eac_ruby_utils/eac_ruby_utils.gemspec +1 -1
  131. data/vendor/eac_ruby_utils/lib/eac_ruby_utils/boolean.rb +1 -1
  132. data/vendor/eac_ruby_utils/lib/eac_ruby_utils/context.rb +31 -0
  133. data/vendor/eac_ruby_utils/lib/eac_ruby_utils/contextualizable.rb +12 -7
  134. data/vendor/eac_ruby_utils/lib/eac_ruby_utils/envs/executable.rb +15 -3
  135. data/vendor/eac_ruby_utils/lib/eac_ruby_utils/gems_registry.rb +36 -0
  136. data/vendor/eac_ruby_utils/lib/eac_ruby_utils/gems_registry/gem.rb +39 -0
  137. data/vendor/eac_ruby_utils/lib/eac_ruby_utils/patches/module/context.rb +11 -0
  138. data/vendor/eac_ruby_utils/lib/eac_ruby_utils/patches/module/speaker.rb +9 -0
  139. data/vendor/eac_ruby_utils/lib/eac_ruby_utils/patches/pathname/parent_n.rb +11 -0
  140. data/vendor/eac_ruby_utils/lib/eac_ruby_utils/rspec/default_setup.rb +18 -0
  141. data/vendor/eac_ruby_utils/lib/eac_ruby_utils/rspec/setup.rb +45 -0
  142. data/vendor/eac_ruby_utils/lib/eac_ruby_utils/simple_cache.rb +10 -2
  143. data/vendor/eac_ruby_utils/lib/eac_ruby_utils/speaker.rb +16 -0
  144. data/vendor/eac_ruby_utils/lib/eac_ruby_utils/speaker/receiver.rb +57 -0
  145. data/vendor/eac_ruby_utils/lib/eac_ruby_utils/speaker/sender.rb +32 -0
  146. data/vendor/eac_ruby_utils/lib/eac_ruby_utils/version.rb +1 -1
  147. data/vendor/{eac_cli/spec/lib → eac_ruby_utils/spec/lib/eac_ruby_utils/patches}/module/speaker_spec.rb +2 -2
  148. data/vendor/eac_ruby_utils/spec/lib/eac_ruby_utils/patches/pathname/parent_n_spec.rb +33 -0
  149. data/vendor/eac_ruby_utils/spec/lib/eac_ruby_utils/simple_cache_spec.rb +18 -0
  150. data/vendor/eac_ruby_utils/spec/rubocop_check_spec.rb +1 -1
  151. data/vendor/eac_ruby_utils/spec/spec_helper.rb +6 -6
  152. data/vendor/ehbrs_ruby_utils/ehbrs_ruby_utils.gemspec +4 -2
  153. data/vendor/ehbrs_ruby_utils/lib/ehbrs_ruby_utils/finances/bb_browser/docker_image.rb +18 -0
  154. data/vendor/ehbrs_ruby_utils/lib/ehbrs_ruby_utils/patches/object/template.rb +6 -0
  155. data/vendor/ehbrs_ruby_utils/lib/ehbrs_ruby_utils/version.rb +1 -1
  156. data/vendor/ehbrs_ruby_utils/lib/ehbrs_ruby_utils/videos/stream.rb +11 -1
  157. data/vendor/ehbrs_ruby_utils/spec/lib/ehbrs_ruby_utils/videos/stream_spec.rb +13 -0
  158. data/vendor/ehbrs_ruby_utils/spec/lib/ehbrs_ruby_utils/videos/stream_spec_files/menina_ovo_attachment.source.yaml +28 -0
  159. data/vendor/ehbrs_ruby_utils/spec/lib/ehbrs_ruby_utils/videos/stream_spec_files/menina_ovo_attachment.target.yaml +7 -0
  160. data/vendor/ehbrs_ruby_utils/spec/lib/ehbrs_ruby_utils/videos/stream_spec_files/menina_ovo_audio.source.yaml +49 -0
  161. data/vendor/ehbrs_ruby_utils/spec/lib/ehbrs_ruby_utils/videos/stream_spec_files/menina_ovo_audio.target.yaml +7 -0
  162. data/vendor/ehbrs_ruby_utils/spec/lib/ehbrs_ruby_utils/videos/stream_spec_files/menina_ovo_subtitle.source.yaml +43 -0
  163. data/vendor/ehbrs_ruby_utils/spec/lib/ehbrs_ruby_utils/videos/stream_spec_files/menina_ovo_subtitle.target.yaml +7 -0
  164. data/vendor/ehbrs_ruby_utils/spec/lib/ehbrs_ruby_utils/videos/stream_spec_files/menina_ovo_video.source.yaml +59 -0
  165. data/vendor/ehbrs_ruby_utils/spec/lib/ehbrs_ruby_utils/videos/stream_spec_files/menina_ovo_video.target.yaml +7 -0
  166. data/vendor/ehbrs_ruby_utils/spec/rubocop_check_spec.rb +1 -5
  167. data/vendor/ehbrs_ruby_utils/spec/spec_helper.rb +2 -98
  168. data/vendor/ehbrs_ruby_utils/template/ehbrs_ruby_utils/finances/bb_browser/docker_image/Dockerfile +44 -0
  169. data/vendor/ehbrs_ruby_utils/template/ehbrs_ruby_utils/finances/bb_browser/docker_image/Makefile +35 -0
  170. data/vendor/ehbrs_ruby_utils/template/ehbrs_ruby_utils/finances/bb_browser/docker_image/README.md +16 -0
  171. data/vendor/ehbrs_ruby_utils/template/ehbrs_ruby_utils/finances/bb_browser/docker_image/context/firefox.service +8 -0
  172. data/vendor/ehbrs_ruby_utils/template/ehbrs_ruby_utils/finances/bb_browser/docker_image/context/startbrowser.sh +9 -0
  173. metadata +115 -52
  174. data/lib/ehbrs/runner.rb +0 -19
  175. data/lib/ehbrs/runner/cooking_book.rb +0 -30
  176. data/lib/ehbrs/runner/cooking_book/build.rb +0 -50
  177. data/lib/ehbrs/runner/finances.rb +0 -16
  178. data/lib/ehbrs/runner/finances/bb_browser.rb +0 -35
  179. data/lib/ehbrs/runner/fs.rb +0 -16
  180. data/lib/ehbrs/runner/fs/used_space.rb +0 -160
  181. data/lib/ehbrs/runner/google.rb +0 -16
  182. data/lib/ehbrs/runner/google/translate.rb +0 -87
  183. data/lib/ehbrs/runner/music.rb +0 -16
  184. data/lib/ehbrs/runner/music/selected.rb +0 -63
  185. data/lib/ehbrs/runner/self.rb +0 -16
  186. data/lib/ehbrs/runner/self/test.rb +0 -25
  187. data/lib/ehbrs/runner/telegram.rb +0 -26
  188. data/lib/ehbrs/runner/telegram/send_message.rb +0 -29
  189. data/lib/ehbrs/runner/vg.rb +0 -16
  190. data/lib/ehbrs/runner/vg/ips.rb +0 -132
  191. data/lib/ehbrs/runner/vg/wii.rb +0 -72
  192. data/lib/ehbrs/runner/videos.rb +0 -16
  193. data/lib/ehbrs/runner/videos/extract.rb +0 -68
  194. data/lib/ehbrs/runner/videos/probe.rb +0 -32
  195. data/lib/ehbrs/runner/videos/series/rename.rb +0 -72
  196. data/lib/ehbrs/runner/videos/unsupported.rb +0 -59
  197. data/lib/ehbrs/runner/web_utils.rb +0 -24
  198. data/lib/ehbrs/runner/web_utils/videos/download.rb +0 -63
  199. data/lib/ehbrs/runner/web_utils/videos/upload.rb +0 -75
  200. data/vendor/eac_cli/lib/eac_cli/docopt/doc_builder.rb +0 -71
  201. data/vendor/eac_cli/lib/eac_cli/docopt/doc_builder/alternative.rb +0 -50
  202. data/vendor/eac_cli/lib/eac_cli/docopt/runner_context_replacement.rb +0 -15
  203. data/vendor/eac_cli/lib/eac_cli/docopt/runner_extension.rb +0 -51
  204. data/vendor/eac_cli/lib/eac_cli/docopt_runner.rb +0 -43
  205. data/vendor/eac_cli/lib/eac_cli/docopt_runner/_class_methods.rb +0 -16
  206. data/vendor/eac_cli/lib/eac_cli/docopt_runner/_doc.rb +0 -23
  207. data/vendor/eac_cli/lib/eac_cli/docopt_runner/_settings.rb +0 -17
  208. data/vendor/eac_cli/lib/eac_cli/docopt_runner/_subcommands.rb +0 -152
  209. data/vendor/eac_cli/lib/eac_cli/patches/module/speaker.rb +0 -10
  210. data/vendor/eac_cli/lib/eac_cli/speaker/_class_methods.rb +0 -37
  211. data/vendor/eac_cli/lib/eac_cli/speaker/node.rb +0 -24
  212. data/vendor/eac_cli/spec/lib/eac_cli/docopt/runner_extension_spec.rb +0 -35
  213. data/vendor/eac_cli/spec/lib/eac_cli/docopt_runner_spec.rb +0 -136
@@ -3,11 +3,19 @@
3
3
  module EacRubyUtils
4
4
  module SimpleCache
5
5
  UNCACHED_METHOD_NAME_SUFFIX = '_uncached'
6
- UNCACHED_METHOD_PATTERN = /\A(\s+)_#{::Regexp.quote(UNCACHED_METHOD_NAME_SUFFIX)}\z/.freeze
6
+ UNCACHED_METHOD_PATTERN = /
7
+ \A(\s+)_#{::Regexp.quote(UNCACHED_METHOD_NAME_SUFFIX)}([\!\?]?)\z
8
+ /x.freeze
7
9
 
8
10
  class << self
9
11
  def uncached_method_name(method_name)
10
- "#{method_name}#{UNCACHED_METHOD_NAME_SUFFIX}"
12
+ method_name = method_name.to_s
13
+ end_mark = nil
14
+ if %w[! ?].any? { |mark| method_name.end_with?(mark) }
15
+ end_mark = method_name[-1]
16
+ method_name = method_name[0..-2]
17
+ end
18
+ "#{method_name}#{UNCACHED_METHOD_NAME_SUFFIX}#{end_mark}"
11
19
  end
12
20
  end
13
21
 
@@ -0,0 +1,16 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'eac_ruby_utils/contextualizable'
4
+
5
+ module EacRubyUtils
6
+ module Speaker
7
+ include ::EacRubyUtils::Contextualizable
8
+
9
+ class << self
10
+ # @return [EacRubyUtils::Speaker::Receiver]
11
+ def current_receiver
12
+ context.current
13
+ end
14
+ end
15
+ end
16
+ end
@@ -0,0 +1,57 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'eac_ruby_utils/abstract_methods'
4
+
5
+ module EacRubyUtils
6
+ module Speaker
7
+ module Receiver
8
+ extend ::EacRubyUtils::AbstractMethods
9
+
10
+ def error(_string)
11
+ raise_abstract_method(__FILE__)
12
+ end
13
+
14
+ def fatal_error(string)
15
+ error(string)
16
+ ::Kernel.exit 1 # rubocop:disable Rails/Exit
17
+ end
18
+
19
+ # @see EacRubyUtils::Speaker::Sender.input
20
+ def input(_question, _options = {})
21
+ raise_abstract_method(__FILE__)
22
+ end
23
+
24
+ def info(_string)
25
+ raise_abstract_method(__FILE__)
26
+ end
27
+
28
+ def infom(_string)
29
+ raise_abstract_method(__FILE__)
30
+ end
31
+
32
+ def infov(*_args)
33
+ raise_abstract_method(__FILE__)
34
+ end
35
+
36
+ def out(_string = '')
37
+ raise_abstract_method(__FILE__)
38
+ end
39
+
40
+ def puts(_string = '')
41
+ raise_abstract_method(__FILE__)
42
+ end
43
+
44
+ def success(_string)
45
+ raise_abstract_method(__FILE__)
46
+ end
47
+
48
+ def title(_string)
49
+ raise_abstract_method(__FILE__)
50
+ end
51
+
52
+ def warn(_string)
53
+ raise_abstract_method(__FILE__)
54
+ end
55
+ end
56
+ end
57
+ end
@@ -0,0 +1,32 @@
1
+ # frozen_string_literal: true
2
+
3
+ module EacRubyUtils
4
+ module Speaker
5
+ module Sender
6
+ delegate :error, :fatal_error, :info, :infom, :title, :success, :warn, to: :speaker_receiver
7
+
8
+ def infov(*args)
9
+ speaker_receiver.infov(*args)
10
+ end
11
+
12
+ delegate :out, to: :speaker_receiver
13
+
14
+ delegate :puts, to: :speaker_receiver
15
+
16
+ # Shortcut to [EacRubyUtils::Speaker.current_receiver].
17
+ #
18
+ # @return [EacRubyUtils::Speaker::Receiver]
19
+ def speaker_receiver
20
+ ::EacRubyUtils::Speaker.current_receiver
21
+ end
22
+
23
+ # Options:
24
+ # +bool+ ([Boolean], default: +false+): requires a answer "yes" or "no".
25
+ # +list+ ([Hash] or [Array], default: +nil+): requires a answer from a list.
26
+ # +noecho+ ([Boolean], default: +false+): does not output answer.
27
+ def input(question, options = {})
28
+ speaker_receiver.input(question, options)
29
+ end
30
+ end
31
+ end
32
+ end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module EacRubyUtils
4
- VERSION = '0.64.0'
4
+ VERSION = '0.71.0'
5
5
  end
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require 'eac_cli/patches/module/speaker'
3
+ require 'eac_ruby_utils/patches/module/speaker'
4
4
 
5
5
  RSpec.describe ::Module do
6
6
  class StubClass # rubocop:disable RSpec/LeakyConstantDeclaration
@@ -8,6 +8,6 @@ RSpec.describe ::Module do
8
8
  end
9
9
 
10
10
  describe '#enable_speaker' do
11
- it { expect(StubClass.included_modules).to include(::EacCli::Speaker) }
11
+ it { expect(StubClass.included_modules).to include(::EacRubyUtils::Speaker::Sender) }
12
12
  end
13
13
  end
@@ -0,0 +1,33 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'eac_ruby_utils/patches/pathname/parent_n'
4
+
5
+ RSpec.describe ::Pathname do
6
+ [
7
+ ['/absolute/path/to/file', 0, '/absolute/path/to/file'],
8
+ ['/absolute/path/to/file', 1, '/absolute/path/to'],
9
+ ['/absolute/path/to/file', 2, '/absolute/path'],
10
+ ['/absolute/path/to/file', 3, '/absolute'],
11
+ ['/absolute/path/to/file', 4, '/'],
12
+ ['/absolute/path/to/file', 5, '/'],
13
+ ['relative/path/to/file', 0, 'relative/path/to/file'],
14
+ ['relative/path/to/file', 1, 'relative/path/to'],
15
+ ['relative/path/to/file', 2, 'relative/path'],
16
+ ['relative/path/to/file', 3, 'relative'],
17
+ ['relative/path/to/file', 4, '.'],
18
+ ['relative/path/to/file', 5, '..'],
19
+ ['relative/path/to/file', 6, '../..']
20
+ ].each do |test_data|
21
+ input_path = test_data[0]
22
+ context "when path is \"#{input_path}\"" do
23
+ let(:n) { test_data[1] }
24
+ let(:expected_path) { test_data[2] }
25
+
26
+ it do
27
+ expect(described_class.new(input_path).parent_n(n)).to(
28
+ eq(described_class.new(expected_path))
29
+ )
30
+ end
31
+ end
32
+ end
33
+ end
@@ -10,6 +10,14 @@ class CacheableObject
10
10
  @counter += 1
11
11
  end
12
12
 
13
+ def method_with_question_uncached?
14
+ 'question'
15
+ end
16
+
17
+ def method_with_exclamation_uncached!
18
+ 'exclamation'
19
+ end
20
+
13
21
  def method_with_args_uncached(arg1)
14
22
  @counter2 ||= 0
15
23
  @counter2 += 1
@@ -74,6 +82,16 @@ RSpec.describe ::EacRubyUtils::SimpleCache do
74
82
  end
75
83
  end
76
84
 
85
+ describe 'method with marks' do
86
+ it 'found uncached method with exclamation mark' do
87
+ expect(instance.method_with_exclamation!).to eq('exclamation')
88
+ end
89
+
90
+ it 'found uncached method with question mark' do
91
+ expect(instance.method_with_question?).to eq('question')
92
+ end
93
+ end
94
+
77
95
  describe '#respond_to?' do
78
96
  it 'responds to cached method without args' do
79
97
  expect(instance.respond_to?(:my_method)).to be(true)
@@ -1,3 +1,3 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- ::EacRubyGemSupport::Rspec.default.describe_rubocop
3
+ ::EacRubyUtils::Rspec.default_setup.describe_rubocop
@@ -3,13 +3,13 @@
3
3
  $LOAD_PATH.push File.expand_path('../lib', __dir__)
4
4
  require 'tmpdir'
5
5
 
6
+ require 'i18n'
7
+ ::I18n.load_path << ::File.join(__dir__, 'locales/pt-BR.yml')
8
+ ::I18n.locale = 'pt-BR'
9
+
6
10
  RSpec.configure do |config|
7
11
  config.example_status_persistence_file_path = ::File.join(::Dir.tmpdir, 'eac_ruby_utils_rspec')
8
12
 
9
- require 'eac_ruby_gem_support/rspec'
10
- ::EacRubyGemSupport::Rspec.setup(::File.expand_path('..', __dir__), config)
13
+ require 'eac_ruby_utils/rspec/default_setup'
14
+ ::EacRubyUtils::Rspec.default_setup_create(::File.expand_path('..', __dir__), config)
11
15
  end
12
-
13
- require 'i18n'
14
- ::I18n.load_path << ::File.join(__dir__, 'locales/pt-BR.yml')
15
- ::I18n.locale = 'pt-BR'
@@ -14,7 +14,9 @@ Gem::Specification.new do |s|
14
14
 
15
15
  s.files = Dir['{lib}/**/*']
16
16
 
17
- s.add_dependency 'eac_ruby_utils', '~> 0.36'
17
+ s.add_dependency 'eac_ruby_utils', '~> 0.70'
18
+ s.add_dependency 'eac_templates', '~> 0.1', '>= 0.1.1'
18
19
 
19
- s.add_development_dependency 'eac_ruby_gem_support', '~> 0.1', '>= 0.1.1'
20
+ s.add_development_dependency 'aranha-parsers', '~> 0.8'
21
+ s.add_development_dependency 'eac_ruby_gem_support', '~> 0.3'
20
22
  end
@@ -0,0 +1,18 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'eac_docker/images/templatized'
4
+ require 'ehbrs_ruby_utils/patches/object/template'
5
+
6
+ module EhbrsRubyUtils
7
+ module Finances
8
+ module BbBrowser
9
+ class DockerImage < ::EacDocker::Images::Templatized
10
+ class << self
11
+ def create
12
+ new.tag(name.variableize)
13
+ end
14
+ end
15
+ end
16
+ end
17
+ end
18
+ end
@@ -0,0 +1,6 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'eac_templates/patches/object/template'
4
+
5
+ ::EacTemplates::Searcher.default.included_paths <<
6
+ ::File.expand_path('../../../../template', __dir__)
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module EhbrsRubyUtils
4
- VERSION = '0.5.1'
4
+ VERSION = '0.7.0'
5
5
  end
@@ -29,12 +29,18 @@ module EhbrsRubyUtils
29
29
  ffprobe_data
30
30
  end
31
31
 
32
- %i[index codec_name codec_long_name].each do |method_name|
32
+ %i[index].each do |method_name|
33
33
  define_method method_name do
34
34
  ffprobe_data.fetch(method_name)
35
35
  end
36
36
  end
37
37
 
38
+ %i[codec_name codec_long_name].each do |method_name|
39
+ define_method method_name do
40
+ ffprobe_data[method_name]
41
+ end
42
+ end
43
+
38
44
  def codec_type
39
45
  ffprobe_data.fetch(:codec_type).to_sym
40
46
  end
@@ -46,6 +52,10 @@ module EhbrsRubyUtils
46
52
  def language
47
53
  tags[:language]
48
54
  end
55
+
56
+ def title
57
+ tags[:title]
58
+ end
49
59
  end
50
60
  end
51
61
  end
@@ -0,0 +1,13 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'ehbrs_ruby_utils/videos/stream'
4
+
5
+ RSpec.describe ::EhbrsRubyUtils::Videos::Stream do
6
+ include_examples 'source_target_fixtures', __FILE__
7
+
8
+ def source_data(source_file)
9
+ instance = described_class.new(::YAML.load_file(source_file))
10
+ %w[codec_name codec_long_name codec_type index language title]
11
+ .map { |k| [k.to_sym, instance.send(k)] }.sort.to_h
12
+ end
13
+ end
@@ -0,0 +1,28 @@
1
+ ---
2
+ :index: 19
3
+ :codec_type: attachment
4
+ :codec_tag_string: "[0][0][0][0]"
5
+ :codec_tag: '0x0000'
6
+ :r_frame_rate: 0/0
7
+ :avg_frame_rate: 0/0
8
+ :time_base: 1/90000
9
+ :start_pts: 0
10
+ :start_time: '0.000000'
11
+ :duration_ts: 383973120
12
+ :duration: '4266.368000'
13
+ :disposition:
14
+ :default: 0
15
+ :dub: 0
16
+ :original: 0
17
+ :comment: 0
18
+ :lyrics: 0
19
+ :karaoke: 0
20
+ :forced: 0
21
+ :hearing_impaired: 0
22
+ :visual_impaired: 0
23
+ :clean_effects: 0
24
+ :attached_pic: 0
25
+ :timed_thumbnails: 0
26
+ :tags:
27
+ :filename: encoding-source-code.7z
28
+ :mimetype: application/octet-stream
@@ -0,0 +1,7 @@
1
+ ---
2
+ :codec_long_name:
3
+ :codec_name:
4
+ :codec_type: :attachment
5
+ :index: 19
6
+ :language:
7
+ :title:
@@ -0,0 +1,49 @@
1
+ ---
2
+ :index: 18
3
+ :codec_name: aac
4
+ :codec_long_name: AAC (Advanced Audio Coding)
5
+ :profile: LC
6
+ :codec_type: audio
7
+ :codec_time_base: 1/48000
8
+ :codec_tag_string: "[0][0][0][0]"
9
+ :codec_tag: '0x0000'
10
+ :sample_fmt: fltp
11
+ :sample_rate: '48000'
12
+ :channels: 2
13
+ :channel_layout: stereo
14
+ :bits_per_sample: 0
15
+ :r_frame_rate: 0/0
16
+ :avg_frame_rate: 0/0
17
+ :time_base: 1/1000
18
+ :start_pts: 0
19
+ :start_time: '0.000000'
20
+ :disposition:
21
+ :default: 1
22
+ :dub: 0
23
+ :original: 0
24
+ :comment: 0
25
+ :lyrics: 0
26
+ :karaoke: 0
27
+ :forced: 0
28
+ :hearing_impaired: 0
29
+ :visual_impaired: 0
30
+ :clean_effects: 0
31
+ :attached_pic: 0
32
+ :timed_thumbnails: 0
33
+ :tags:
34
+ :language: jpn
35
+ :title: "[AnimeRG] Tenshi No Tamago [1080p] [ScavvyKiD]"
36
+ :BPS: '125375'
37
+ :BPS-eng: '125375'
38
+ :DURATION: '01:11:06.368000000'
39
+ :DURATION-eng: '01:11:06.368000000'
40
+ :NUMBER_OF_FRAMES: '199986'
41
+ :NUMBER_OF_FRAMES-eng: '199986'
42
+ :NUMBER_OF_BYTES: '66861986'
43
+ :NUMBER_OF_BYTES-eng: '66861986'
44
+ :_STATISTICS_WRITING_APP: mkvmerge v8.3.0 ('Over the Horizon') 32bit
45
+ :_STATISTICS_WRITING_APP-eng: mkvmerge v8.3.0 ('Over the Horizon') 32bit
46
+ :_STATISTICS_WRITING_DATE_UTC: '2015-12-04 08:47:49'
47
+ :_STATISTICS_WRITING_DATE_UTC-eng: '2015-12-04 08:47:49'
48
+ :_STATISTICS_TAGS: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES
49
+ :_STATISTICS_TAGS-eng: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES
@@ -0,0 +1,7 @@
1
+ ---
2
+ :codec_long_name: AAC (Advanced Audio Coding)
3
+ :codec_name: aac
4
+ :codec_type: :audio
5
+ :index: 18
6
+ :language: jpn
7
+ :title: "[AnimeRG] Tenshi No Tamago [1080p] [ScavvyKiD]"