ehbrs-tools 0.23.1 → 0.26.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (174) hide show
  1. checksums.yaml +4 -4
  2. data/.avm.yml +4 -0
  3. data/.rspec +1 -0
  4. data/.rubocop.yml +39 -0
  5. data/Gemfile.lock +285 -0
  6. data/lib/ehbrs/{core_ext.rb → tools/core_ext.rb} +0 -0
  7. data/lib/ehbrs/tools/runner/finances/bb_browser.rb +38 -9
  8. data/lib/ehbrs/tools/runner/fs/selected.rb +1 -1
  9. data/lib/ehbrs/tools/runner/music/lyrics.rb +69 -0
  10. data/lib/ehbrs/tools/runner/web_utils/videos/download.rb +20 -10
  11. data/lib/ehbrs/tools/runner/web_utils/videos/upload.rb +1 -1
  12. data/lib/ehbrs/tools/version.rb +1 -1
  13. data/spec/code/rubocop_spec.rb +3 -0
  14. data/spec/lib/ehbrs/cooking_book/recipe/measure_spec.rb +21 -0
  15. data/spec/lib/ehbrs/observers/base_spec.rb +93 -0
  16. data/spec/lib/ehbrs/tools/runner/fs/used_space_spec.rb +61 -0
  17. data/spec/lib/ehbrs/tools/runner/vg/ips_spec.rb +31 -0
  18. data/spec/lib/ehbrs/tools/runner/vg/ips_spec_files/expected.rom +0 -0
  19. data/spec/lib/ehbrs/tools/runner/vg/ips_spec_files/patch_0.ips +0 -0
  20. data/spec/lib/ehbrs/tools/runner/vg/ips_spec_files/patch_1.ips +0 -0
  21. data/spec/lib/ehbrs/tools/runner/vg/ips_spec_files/source.rom +0 -0
  22. data/spec/lib/ehbrs/tools/runner/videos/probe_spec.rb +19 -0
  23. data/spec/lib/ehbrs/tools/runner/videos/probe_spec_files/fixed.target.yaml +105 -0
  24. data/spec/lib/ehbrs/tools/runner/videos/unsupported_spec.rb +75 -0
  25. data/spec/lib/ehbrs/tools/runner/videos/unsupported_spec_files/dts_audio.probe.yaml +90 -0
  26. data/spec/lib/ehbrs/tools/runner_spec.rb +16 -0
  27. data/spec/lib/ehbrs/vg/wii/game_file_spec.rb +21 -0
  28. data/spec/lib/ehbrs/vg/wii/wit/parsers/dump_spec.rb +11 -0
  29. data/spec/lib/ehbrs/vg/wii/wit/parsers/dump_spec_files/pikmin2_R92P01_wia.source.witdump +27 -0
  30. data/spec/lib/ehbrs/vg/wii/wit/parsers/dump_spec_files/pikmin2_R92P01_wia.target.yaml +22 -0
  31. data/spec/lib/ehbrs/vg/wii/wit/parsers/dump_spec_files/pikmin2_pal_iso.source.witdump +28 -0
  32. data/spec/lib/ehbrs/vg/wii/wit/parsers/dump_spec_files/pikmin2_pal_iso.target.yaml +21 -0
  33. data/spec/lib/ehbrs/vg/wii/wit/parsers/dump_spec_files/resident_evil_code_veronica_disc2_iso.source.witdump +16 -0
  34. data/spec/lib/ehbrs/vg/wii/wit/parsers/dump_spec_files/resident_evil_code_veronica_disc2_iso.target.yaml +19 -0
  35. data/spec/lib/ehbrs/vg/wii/wit/parsers/dump_spec_files/super_mario_galaxy_wbfs.source.witdump +28 -0
  36. data/spec/lib/ehbrs/vg/wii/wit/parsers/dump_spec_files/super_mario_galaxy_wbfs.target.yaml +23 -0
  37. data/spec/lib/ehbrs/vg/wii/wit/path_spec.rb +33 -0
  38. data/spec/spec_helper/videos.rb +30 -0
  39. data/spec/spec_helper/videos_files/stub_source.mp4 +0 -0
  40. data/spec/spec_helper.rb +7 -0
  41. data/vendor/aranha-parsers/aranha-parsers.gemspec +3 -2
  42. data/vendor/aranha-parsers/lib/aranha/parsers/rspec/setup.rb +15 -0
  43. data/vendor/aranha-parsers/lib/aranha/parsers/{spec/source_target_fixtures_example.rb → rspec/shared_examples/source_target_fixtures.rb} +0 -0
  44. data/vendor/aranha-parsers/lib/aranha/parsers/rspec.rb +11 -0
  45. data/vendor/aranha-parsers/lib/aranha/parsers/source_address/fetch_content_error.rb +10 -0
  46. data/vendor/aranha-parsers/lib/aranha/parsers/source_address/http_get.rb +15 -2
  47. data/vendor/aranha-parsers/lib/aranha/parsers/version.rb +1 -1
  48. data/vendor/aranha-parsers/spec/lib/rubocop_check_spec.rb +1 -1
  49. data/vendor/aranha-parsers/spec/spec_helper.rb +2 -9
  50. data/vendor/aranha-selenium/aranha-selenium.gemspec +2 -2
  51. data/vendor/aranha-selenium/lib/aranha/selenium/version.rb +1 -1
  52. data/vendor/aranha-selenium/spec/rubocop_check_spec.rb +1 -5
  53. data/vendor/aranha-selenium/spec/spec_helper.rb +2 -98
  54. data/vendor/eac_cli/eac_cli.gemspec +3 -3
  55. data/vendor/eac_cli/lib/eac_cli/config/entry.rb +0 -2
  56. data/vendor/eac_cli/lib/eac_cli/version.rb +1 -1
  57. data/vendor/eac_cli/spec/rubocop_spec.rb +1 -1
  58. data/vendor/eac_cli/spec/spec_helper.rb +2 -101
  59. data/vendor/eac_config/eac_config.gemspec +2 -2
  60. data/vendor/eac_config/lib/eac_config/version.rb +1 -1
  61. data/vendor/eac_config/spec/rubocop_spec.rb +1 -1
  62. data/vendor/eac_config/spec/spec_helper.rb +2 -15
  63. data/vendor/eac_docker/eac_docker.gemspec +2 -2
  64. data/vendor/eac_docker/lib/eac_docker/container.rb +7 -3
  65. data/vendor/eac_docker/lib/eac_docker/images/templatized.rb +4 -0
  66. data/vendor/eac_docker/lib/eac_docker/rspec/setup.rb +17 -0
  67. data/vendor/eac_docker/lib/eac_docker/rspec.rb +2 -10
  68. data/vendor/eac_docker/lib/eac_docker/version.rb +1 -1
  69. data/vendor/eac_docker/spec/rubocop_spec.rb +1 -1
  70. data/vendor/eac_docker/spec/spec_helper.rb +2 -104
  71. data/vendor/eac_ruby_base0/eac_ruby_base0.gemspec +4 -4
  72. data/vendor/eac_ruby_base0/lib/eac_ruby_base0/version.rb +1 -1
  73. data/vendor/eac_ruby_base0/spec/rubocop_spec.rb +1 -1
  74. data/vendor/eac_ruby_base0/spec/spec_helper.rb +2 -101
  75. data/vendor/eac_ruby_utils/eac_ruby_utils.gemspec +1 -1
  76. data/vendor/eac_ruby_utils/lib/eac_ruby_utils/compact.rb +22 -0
  77. data/vendor/eac_ruby_utils/lib/eac_ruby_utils/envs/executable.rb +15 -3
  78. data/vendor/eac_ruby_utils/lib/eac_ruby_utils/fs_cache.rb +1 -1
  79. data/vendor/eac_ruby_utils/lib/eac_ruby_utils/gems_registry/gem.rb +75 -0
  80. data/vendor/eac_ruby_utils/lib/eac_ruby_utils/gems_registry.rb +35 -0
  81. data/vendor/eac_ruby_utils/lib/eac_ruby_utils/patches/object/compact.rb +20 -0
  82. data/vendor/eac_ruby_utils/lib/eac_ruby_utils/patches/string/delimited.rb +16 -0
  83. data/vendor/eac_ruby_utils/lib/eac_ruby_utils/recursive_builder.rb +51 -0
  84. data/vendor/eac_ruby_utils/lib/eac_ruby_utils/rspec/default_setup.rb +20 -0
  85. data/vendor/eac_ruby_utils/lib/eac_ruby_utils/rspec/setup/conditionals.rb +17 -0
  86. data/vendor/eac_ruby_utils/lib/eac_ruby_utils/rspec/setup.rb +12 -0
  87. data/vendor/eac_ruby_utils/lib/eac_ruby_utils/rspec/setup_manager.rb +49 -0
  88. data/vendor/eac_ruby_utils/lib/eac_ruby_utils/string_delimited.rb +70 -0
  89. data/vendor/eac_ruby_utils/lib/eac_ruby_utils/version.rb +1 -1
  90. data/vendor/eac_ruby_utils/spec/lib/eac_ruby_utils/compact_spec.rb +20 -0
  91. data/vendor/eac_ruby_utils/spec/lib/eac_ruby_utils/patches/object/compact_spec.rb +20 -0
  92. data/vendor/eac_ruby_utils/spec/lib/eac_ruby_utils/patches/string/delimited_spec.rb +34 -0
  93. data/vendor/eac_ruby_utils/spec/lib/eac_ruby_utils/recursive_builder_spec.rb +65 -0
  94. data/vendor/eac_ruby_utils/spec/rubocop_check_spec.rb +1 -1
  95. data/vendor/eac_ruby_utils/spec/spec_helper.rb +6 -6
  96. data/vendor/ehbrs_ruby_utils/ehbrs_ruby_utils.gemspec +9 -4
  97. data/vendor/ehbrs_ruby_utils/lib/ehbrs_ruby_utils/finances/bb_browser/docker_image.rb +18 -0
  98. data/vendor/ehbrs_ruby_utils/lib/ehbrs_ruby_utils/music.rb +9 -0
  99. data/vendor/ehbrs_ruby_utils/lib/ehbrs_ruby_utils/patches/object/template.rb +6 -0
  100. data/vendor/ehbrs_ruby_utils/lib/ehbrs_ruby_utils/version.rb +1 -1
  101. data/vendor/ehbrs_ruby_utils/lib/ehbrs_ruby_utils/videos/container.rb +31 -0
  102. data/vendor/ehbrs_ruby_utils/lib/ehbrs_ruby_utils/videos/stream.rb +1 -1
  103. data/vendor/ehbrs_ruby_utils/lib/ehbrs_ruby_utils/web_utils/videos/file/rename.rb +28 -0
  104. data/vendor/ehbrs_ruby_utils/lib/ehbrs_ruby_utils/web_utils/videos/file.rb +11 -8
  105. data/vendor/ehbrs_ruby_utils/spec/lib/ehbrs_ruby_utils/videos/stream_spec.rb +0 -1
  106. data/vendor/ehbrs_ruby_utils/spec/rubocop_check_spec.rb +1 -1
  107. data/vendor/ehbrs_ruby_utils/spec/spec_helper.rb +2 -101
  108. data/vendor/ehbrs_ruby_utils/template/ehbrs_ruby_utils/finances/bb_browser/docker_image/Dockerfile +44 -0
  109. data/vendor/ehbrs_ruby_utils/template/ehbrs_ruby_utils/finances/bb_browser/docker_image/Makefile +35 -0
  110. data/vendor/ehbrs_ruby_utils/template/ehbrs_ruby_utils/finances/bb_browser/docker_image/README.md +16 -0
  111. data/vendor/ehbrs_ruby_utils/template/ehbrs_ruby_utils/finances/bb_browser/docker_image/context/firefox.service +8 -0
  112. data/vendor/ehbrs_ruby_utils/template/ehbrs_ruby_utils/finances/bb_browser/docker_image/context/startbrowser.sh +9 -0
  113. data/vendor/ultimate_lyrics/Gemfile +5 -0
  114. data/vendor/ultimate_lyrics/bin/download_parser_spec_files.rb +94 -0
  115. data/vendor/ultimate_lyrics/lib/ultimate_lyrics/field.rb +83 -0
  116. data/vendor/ultimate_lyrics/lib/ultimate_lyrics/lyrics.rb +13 -0
  117. data/vendor/ultimate_lyrics/lib/ultimate_lyrics/parser.rb +28 -0
  118. data/vendor/ultimate_lyrics/lib/ultimate_lyrics/provider/exclude_item.rb +17 -0
  119. data/vendor/ultimate_lyrics/lib/ultimate_lyrics/provider/extract_item.rb +21 -0
  120. data/vendor/ultimate_lyrics/lib/ultimate_lyrics/provider/item.rb +48 -0
  121. data/vendor/ultimate_lyrics/lib/ultimate_lyrics/provider/replace_fields.rb +13 -0
  122. data/vendor/ultimate_lyrics/lib/ultimate_lyrics/provider/rule.rb +52 -0
  123. data/vendor/ultimate_lyrics/lib/ultimate_lyrics/provider/url_format.rb +21 -0
  124. data/vendor/ultimate_lyrics/lib/ultimate_lyrics/provider.rb +92 -0
  125. data/vendor/ultimate_lyrics/lib/ultimate_lyrics/provider_search.rb +43 -0
  126. data/vendor/ultimate_lyrics/lib/ultimate_lyrics/providers_data.xml +355 -0
  127. data/vendor/ultimate_lyrics/lib/ultimate_lyrics/song_metadata/field.rb +24 -0
  128. data/vendor/ultimate_lyrics/lib/ultimate_lyrics/song_metadata.rb +28 -0
  129. data/vendor/ultimate_lyrics/lib/ultimate_lyrics/version.rb +5 -0
  130. data/vendor/ultimate_lyrics/lib/ultimate_lyrics.rb +7 -0
  131. data/vendor/ultimate_lyrics/spec/lib/ultimate_lyrics/parser_spec.rb +20 -0
  132. data/vendor/ultimate_lyrics/spec/lib/ultimate_lyrics/parser_spec_files/encyclopaedia_metallum__michael_jackson_thriller.source.html +8 -0
  133. data/vendor/ultimate_lyrics/spec/lib/ultimate_lyrics/parser_spec_files/encyclopaedia_metallum__michael_jackson_thriller.target.yaml +3 -0
  134. data/vendor/ultimate_lyrics/spec/lib/ultimate_lyrics/parser_spec_files/encyclopaedia_metallum__michael_jackson_thriller.url +1 -0
  135. data/vendor/ultimate_lyrics/spec/lib/ultimate_lyrics/parser_spec_files/encyclopaedia_metallum__milton_nascimento_rouxinol.source.html +8 -0
  136. data/vendor/ultimate_lyrics/spec/lib/ultimate_lyrics/parser_spec_files/encyclopaedia_metallum__milton_nascimento_rouxinol.target.yaml +3 -0
  137. data/vendor/ultimate_lyrics/spec/lib/ultimate_lyrics/parser_spec_files/encyclopaedia_metallum__milton_nascimento_rouxinol.url +1 -0
  138. data/vendor/ultimate_lyrics/spec/lib/ultimate_lyrics/parser_spec_files/hindilyrics_net_bollywood_songs__michael_jackson_thriller.source.html +193 -0
  139. data/vendor/ultimate_lyrics/spec/lib/ultimate_lyrics/parser_spec_files/hindilyrics_net_bollywood_songs__michael_jackson_thriller.target.yaml +3 -0
  140. data/vendor/ultimate_lyrics/spec/lib/ultimate_lyrics/parser_spec_files/hindilyrics_net_bollywood_songs__michael_jackson_thriller.url +1 -0
  141. data/vendor/ultimate_lyrics/spec/lib/ultimate_lyrics/parser_spec_files/hindilyrics_net_bollywood_songs__milton_nascimento_rouxinol.source.html +193 -0
  142. data/vendor/ultimate_lyrics/spec/lib/ultimate_lyrics/parser_spec_files/hindilyrics_net_bollywood_songs__milton_nascimento_rouxinol.target.yaml +3 -0
  143. data/vendor/ultimate_lyrics/spec/lib/ultimate_lyrics/parser_spec_files/hindilyrics_net_bollywood_songs__milton_nascimento_rouxinol.url +1 -0
  144. data/vendor/ultimate_lyrics/spec/lib/ultimate_lyrics/parser_spec_files/lyrics_com__michael_jackson_thriller.source.html +87 -0
  145. data/vendor/ultimate_lyrics/spec/lib/ultimate_lyrics/parser_spec_files/lyrics_com__michael_jackson_thriller.target.yaml +36 -0
  146. data/vendor/ultimate_lyrics/spec/lib/ultimate_lyrics/parser_spec_files/lyrics_com__michael_jackson_thriller.url +1 -0
  147. data/vendor/ultimate_lyrics/spec/lib/ultimate_lyrics/parser_spec_files/lyrics_com__milton_nascimento_rouxinol.source.html +4 -0
  148. data/vendor/ultimate_lyrics/spec/lib/ultimate_lyrics/parser_spec_files/lyrics_com__milton_nascimento_rouxinol.target.yaml +5 -0
  149. data/vendor/ultimate_lyrics/spec/lib/ultimate_lyrics/parser_spec_files/lyrics_com__milton_nascimento_rouxinol.url +1 -0
  150. data/vendor/ultimate_lyrics/spec/lib/ultimate_lyrics/parser_spec_files/lyricsplugin_com__michael_jackson_thriller.source.html +2 -0
  151. data/vendor/ultimate_lyrics/spec/lib/ultimate_lyrics/parser_spec_files/lyricsplugin_com__michael_jackson_thriller.target.yaml +3 -0
  152. data/vendor/ultimate_lyrics/spec/lib/ultimate_lyrics/parser_spec_files/lyricsplugin_com__michael_jackson_thriller.url +1 -0
  153. data/vendor/ultimate_lyrics/spec/lib/ultimate_lyrics/parser_spec_files/lyricsplugin_com__milton_nascimento_rouxinol.source.html +2 -0
  154. data/vendor/ultimate_lyrics/spec/lib/ultimate_lyrics/parser_spec_files/lyricsplugin_com__milton_nascimento_rouxinol.target.yaml +3 -0
  155. data/vendor/ultimate_lyrics/spec/lib/ultimate_lyrics/parser_spec_files/lyricsplugin_com__milton_nascimento_rouxinol.url +1 -0
  156. data/vendor/ultimate_lyrics/spec/lib/ultimate_lyrics/parser_spec_files/lyricsreg_com__milton_nascimento_rouxinol.source.html +101 -0
  157. data/vendor/ultimate_lyrics/spec/lib/ultimate_lyrics/parser_spec_files/lyricsreg_com__milton_nascimento_rouxinol.target.yaml +3 -0
  158. data/vendor/ultimate_lyrics/spec/lib/ultimate_lyrics/parser_spec_files/lyricsreg_com__milton_nascimento_rouxinol.url +1 -0
  159. data/vendor/ultimate_lyrics/spec/lib/ultimate_lyrics/parser_spec_files/mp3lyrics_org__michael_jackson_thriller.source.html +29 -0
  160. data/vendor/ultimate_lyrics/spec/lib/ultimate_lyrics/parser_spec_files/mp3lyrics_org__michael_jackson_thriller.target.yaml +3 -0
  161. data/vendor/ultimate_lyrics/spec/lib/ultimate_lyrics/parser_spec_files/mp3lyrics_org__michael_jackson_thriller.url +1 -0
  162. data/vendor/ultimate_lyrics/spec/lib/ultimate_lyrics/parser_spec_files/mp3lyrics_org__milton_nascimento_rouxinol.source.html +29 -0
  163. data/vendor/ultimate_lyrics/spec/lib/ultimate_lyrics/parser_spec_files/mp3lyrics_org__milton_nascimento_rouxinol.target.yaml +3 -0
  164. data/vendor/ultimate_lyrics/spec/lib/ultimate_lyrics/parser_spec_files/mp3lyrics_org__milton_nascimento_rouxinol.url +1 -0
  165. data/vendor/ultimate_lyrics/spec/lib/ultimate_lyrics/parser_spec_files/songlyrics_com__michael_jackson_thriller.source.html +1298 -0
  166. data/vendor/ultimate_lyrics/spec/lib/ultimate_lyrics/parser_spec_files/songlyrics_com__michael_jackson_thriller.target.yaml +3 -0
  167. data/vendor/ultimate_lyrics/spec/lib/ultimate_lyrics/parser_spec_files/songlyrics_com__michael_jackson_thriller.url +1 -0
  168. data/vendor/ultimate_lyrics/spec/lib/ultimate_lyrics/provider_search_spec.rb +72 -0
  169. data/vendor/ultimate_lyrics/spec/rubocop_spec.rb +3 -0
  170. data/vendor/ultimate_lyrics/spec/spec_helper.rb +4 -0
  171. data/vendor/ultimate_lyrics/ultimate_lyrics.gemspec +19 -0
  172. metadata +179 -11
  173. data/vendor/eac_ruby_utils/lib/eac_ruby_utils/rspec/conditional.rb +0 -35
  174. data/vendor/eac_ruby_utils/lib/eac_ruby_utils/rspec/stubbed_ssh.rb +0 -44
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 429a63c4ba2d38ccc0c997ca4abd9a224fe7cb37de219390f9bbbab15adc9698
4
- data.tar.gz: 6b23e3bab5b16c34fa33f78d0f1c2ad122826d83cc60c92890d815a187738b1f
3
+ metadata.gz: ed1aa5f7815ed7b0d48dafd1adbe15fefc1d9b65c1f88b573b11c4f0f83dcb9a
4
+ data.tar.gz: 1410d0c2c225cb81a266c96c6e835169db6f05407f474fad319e23a2ac0be0cf
5
5
  SHA512:
6
- metadata.gz: d12489f3f71db60bf4c39b6e4d705165e5b89d2b0a1bf17f13c2a20b9580c4e994f3eaba68bb736ace35d141632d7d8acf2700020b8d04cf9d34f3293fa2eb4d
7
- data.tar.gz: 74b605f93c3f8832aea0ba7871ff580a83955cf385d9cb3aed6c90a3d96b6745fefc3a7b02dc1850c3599bd8ae263c3b324c9c7caf68b25d9c646168e40f3f2a
6
+ metadata.gz: d5a5e0d55099bad71f3100b9ce17cc0fff3d6962543da41e43919536ded40e9a6d01ab1cb85514c1e73660e78065fc9f02cf7d0bafc0959f204b7fda1ba45ede
7
+ data.tar.gz: 8c37bccb70f1f5e2190b4102914b28fac6658f96ec7cbb56e2db606e3675bddddb149986eb300703539e754dbbe5d85be08f94723066799efad4a418f4ca5bd2
data/.avm.yml ADDED
@@ -0,0 +1,4 @@
1
+ ---
2
+ locale: pt-BR
3
+ test:
4
+ bundle_command: exec ehbrs self test
data/.rspec ADDED
@@ -0,0 +1 @@
1
+ --require spec/spec_helper --color --format doc --default-path . --pattern 'spec/**/*_spec.rb'
data/.rubocop.yml ADDED
@@ -0,0 +1,39 @@
1
+ require:
2
+ - rubocop-rails
3
+ - rubocop-rspec
4
+
5
+ AllCops:
6
+ Exclude:
7
+ - vendor/**/*
8
+
9
+ Layout/LineLength:
10
+ Max: 100
11
+
12
+ Metrics/BlockLength:
13
+ Exclude:
14
+ - spec/**/*_spec.rb
15
+
16
+ Rails/Output:
17
+ Enabled: false
18
+
19
+ Rails/TimeZone:
20
+ Enabled: false
21
+
22
+ RSpec/NestedGroups:
23
+ Exclude:
24
+ - spec/**/*_spec.rb
25
+
26
+ Style/AsciiComments:
27
+ Enabled: false
28
+
29
+ Style/Documentation:
30
+ Enabled: false
31
+
32
+ Style/HashEachMethods:
33
+ Enabled: true
34
+
35
+ Style/HashTransformKeys:
36
+ Enabled: true
37
+
38
+ Style/HashTransformValues:
39
+ Enabled: true
data/Gemfile.lock ADDED
@@ -0,0 +1,285 @@
1
+ PATH
2
+ remote: .
3
+ specs:
4
+ ehbrs-tools (0.26.0)
5
+ avm-tools (~> 0.82, >= 0.82.1)
6
+ eac_cli (~> 0.12, >= 0.12.5)
7
+ eac_ruby_utils (~> 0.71)
8
+ ehbrs_ruby_utils (~> 0.8, >= 0.8.1)
9
+ filesize
10
+ inifile (~> 3.0)
11
+ os
12
+ telegram-bot-ruby
13
+
14
+ PATH
15
+ remote: vendor/aranha-parsers
16
+ specs:
17
+ aranha-parsers (0.8.5)
18
+ activesupport (>= 4.0.0)
19
+ addressable (~> 2.7)
20
+ curb (~> 0.9.10)
21
+ eac_ruby_utils (~> 0.74)
22
+ httpclient (~> 2.8, >= 2.8.3)
23
+ nokogiri (~> 1.12, >= 1.12.4)
24
+ ofx-parser (~> 1.1.0)
25
+
26
+ PATH
27
+ remote: vendor/aranha-selenium
28
+ specs:
29
+ aranha-selenium (0.2.2)
30
+ eac_ruby_utils (~> 0.70)
31
+ selenium-webdriver (~> 3.142, >= 3.142.3)
32
+
33
+ PATH
34
+ remote: vendor/eac_cli
35
+ specs:
36
+ eac_cli (0.22.2)
37
+ colorize (~> 0.8.1)
38
+ eac_config (~> 0.5, >= 0.5.1)
39
+ eac_ruby_utils (~> 0.70)
40
+
41
+ PATH
42
+ remote: vendor/eac_config
43
+ specs:
44
+ eac_config (0.5.1)
45
+ addressable
46
+ eac_ruby_utils (~> 0.70)
47
+
48
+ PATH
49
+ remote: vendor/eac_docker
50
+ specs:
51
+ eac_docker (0.4.1)
52
+ eac_ruby_utils (~> 0.74)
53
+ eac_templates (~> 0.1)
54
+
55
+ PATH
56
+ remote: vendor/eac_ruby_base0
57
+ specs:
58
+ eac_ruby_base0 (0.10.1)
59
+ eac_cli (~> 0.22, >= 0.22.2)
60
+ eac_ruby_gems_utils (~> 0.9.5, ~> 0.9)
61
+ eac_ruby_utils (~> 0.70)
62
+
63
+ PATH
64
+ remote: vendor/eac_ruby_utils
65
+ specs:
66
+ eac_ruby_utils (0.75.0)
67
+ activesupport (>= 4.0)
68
+ addressable (~> 2.6)
69
+ filesize
70
+ net-ssh (~> 4.2)
71
+
72
+ PATH
73
+ remote: vendor/ehbrs_ruby_utils
74
+ specs:
75
+ ehbrs_ruby_utils (0.10.0)
76
+ aranha-parsers (~> 0.8, >= 0.8.5)
77
+ eac_ruby_utils (~> 0.70)
78
+ eac_templates (~> 0.1, >= 0.1.1)
79
+ taglib-ruby (~> 1.1)
80
+ ultimate_lyrics (~> 0.1)
81
+
82
+ PATH
83
+ remote: vendor/ultimate_lyrics
84
+ specs:
85
+ ultimate_lyrics (0.1.0)
86
+ aranha-parsers (~> 0.8, >= 0.8.5)
87
+ eac_ruby_utils (~> 0.74)
88
+
89
+ GEM
90
+ remote: https://rubygems.org/
91
+ specs:
92
+ activesupport (6.1.4.1)
93
+ concurrent-ruby (~> 1.0, >= 1.0.2)
94
+ i18n (>= 1.6, < 2)
95
+ minitest (>= 5.1)
96
+ tzinfo (~> 2.0)
97
+ zeitwerk (~> 2.3)
98
+ addressable (2.8.0)
99
+ public_suffix (>= 2.0.2, < 5.0)
100
+ asciidoctor (2.0.16)
101
+ ast (2.4.2)
102
+ avm (0.3.2)
103
+ eac_docker (~> 0.3)
104
+ eac_git (~> 0.6)
105
+ eac_ruby_utils (~> 0.68)
106
+ eac_templates (~> 0.1, >= 0.1.1)
107
+ avm-apps (0.4.1)
108
+ eac_ruby_utils (~> 0.67)
109
+ avm-eac_asciidoctor_base0 (0.3.1)
110
+ asciidoctor (~> 2.0, >= 2.0.12)
111
+ avm-eac_webapp_base0 (~> 0.1)
112
+ eac_ruby_utils (~> 0.63)
113
+ os
114
+ rouge (~> 3.26)
115
+ avm-eac_webapp_base0 (0.1.1)
116
+ avm (~> 0.1)
117
+ eac_ruby_utils (~> 0.68)
118
+ avm-tools (0.105.0)
119
+ aranha-parsers (~> 0.4)
120
+ asciidoctor (~> 2.0, >= 2.0.12)
121
+ avm (~> 0.1)
122
+ avm-apps (~> 0.2)
123
+ avm-eac_asciidoctor_base0
124
+ clipboard (~> 1.3, >= 1.3.3)
125
+ content-type (~> 0.0.1)
126
+ curb (~> 0.9.10)
127
+ eac_docker (~> 0.2)
128
+ eac_git (~> 0.2)
129
+ eac_ruby_base0 (~> 0.7, >= 0.7.2)
130
+ eac_ruby_gems_utils (~> 0.6, >= 0.6.1)
131
+ eac_templates (~> 0.1)
132
+ filesize
133
+ git (~> 1.7)
134
+ htmlbeautifier (~> 1.3, >= 1.3.1)
135
+ minitar
136
+ os
137
+ ruby-progressbar (~> 1.10, >= 1.10.1)
138
+ axiom-types (0.1.1)
139
+ descendants_tracker (~> 0.0.4)
140
+ ice_nine (~> 0.11.0)
141
+ thread_safe (~> 0.3, >= 0.3.1)
142
+ childprocess (3.0.0)
143
+ clipboard (1.3.6)
144
+ coercible (1.0.0)
145
+ descendants_tracker (~> 0.0.1)
146
+ colorize (0.8.1)
147
+ concurrent-ruby (1.1.9)
148
+ content-type (0.0.1)
149
+ parslet (~> 1.5)
150
+ curb (0.9.11)
151
+ descendants_tracker (0.0.4)
152
+ thread_safe (~> 0.3, >= 0.3.1)
153
+ diff-lcs (1.4.4)
154
+ dry-inflector (0.2.1)
155
+ eac_git (0.7.3)
156
+ eac_ruby_utils (~> 0.74)
157
+ parseconfig (~> 1.0, >= 1.0.8)
158
+ eac_ruby_gem_support (0.4.0)
159
+ eac_ruby_utils (~> 0.74)
160
+ rspec (~> 3.9)
161
+ rubocop (~> 0.80.1)
162
+ rubocop-rails (~> 2.4.2)
163
+ rubocop-rspec (~> 1.38.1)
164
+ eac_ruby_gems_utils (0.9.5)
165
+ bundler (~> 2.2, >= 2.2.17)
166
+ eac_ruby_utils (~> 0.70)
167
+ eac_templates (0.1.2)
168
+ eac_config (~> 0.5)
169
+ eac_ruby_utils (~> 0.64)
170
+ faraday (1.8.0)
171
+ faraday-em_http (~> 1.0)
172
+ faraday-em_synchrony (~> 1.0)
173
+ faraday-excon (~> 1.1)
174
+ faraday-httpclient (~> 1.0.1)
175
+ faraday-net_http (~> 1.0)
176
+ faraday-net_http_persistent (~> 1.1)
177
+ faraday-patron (~> 1.0)
178
+ faraday-rack (~> 1.0)
179
+ multipart-post (>= 1.2, < 3)
180
+ ruby2_keywords (>= 0.0.4)
181
+ faraday-em_http (1.0.0)
182
+ faraday-em_synchrony (1.0.0)
183
+ faraday-excon (1.1.0)
184
+ faraday-httpclient (1.0.1)
185
+ faraday-net_http (1.0.1)
186
+ faraday-net_http_persistent (1.2.0)
187
+ faraday-patron (1.0.0)
188
+ faraday-rack (1.0.0)
189
+ filesize (0.2.0)
190
+ git (1.9.1)
191
+ rchardet (~> 1.8)
192
+ hpricot (0.8.6)
193
+ htmlbeautifier (1.3.1)
194
+ httpclient (2.8.3)
195
+ i18n (1.8.10)
196
+ concurrent-ruby (~> 1.0)
197
+ ice_nine (0.11.2)
198
+ inifile (3.0.0)
199
+ jaro_winkler (1.5.4)
200
+ minitar (0.9)
201
+ minitest (5.14.4)
202
+ multipart-post (2.1.1)
203
+ net-ssh (4.2.0)
204
+ nokogiri (1.12.4-x86_64-linux)
205
+ racc (~> 1.4)
206
+ ofx-parser (1.1.0)
207
+ hpricot (>= 0.6)
208
+ os (1.1.1)
209
+ parallel (1.21.0)
210
+ parseconfig (1.1.0)
211
+ parser (3.0.2.0)
212
+ ast (~> 2.4.1)
213
+ parslet (1.8.2)
214
+ public_suffix (4.0.6)
215
+ racc (1.5.2)
216
+ rack (2.2.3)
217
+ rainbow (3.0.0)
218
+ rchardet (1.8.0)
219
+ rexml (3.2.5)
220
+ rouge (3.26.1)
221
+ rspec (3.10.0)
222
+ rspec-core (~> 3.10.0)
223
+ rspec-expectations (~> 3.10.0)
224
+ rspec-mocks (~> 3.10.0)
225
+ rspec-core (3.10.1)
226
+ rspec-support (~> 3.10.0)
227
+ rspec-expectations (3.10.1)
228
+ diff-lcs (>= 1.2.0, < 2.0)
229
+ rspec-support (~> 3.10.0)
230
+ rspec-mocks (3.10.2)
231
+ diff-lcs (>= 1.2.0, < 2.0)
232
+ rspec-support (~> 3.10.0)
233
+ rspec-support (3.10.2)
234
+ rubocop (0.80.1)
235
+ jaro_winkler (~> 1.5.1)
236
+ parallel (~> 1.10)
237
+ parser (>= 2.7.0.1)
238
+ rainbow (>= 2.2.2, < 4.0)
239
+ rexml
240
+ ruby-progressbar (~> 1.7)
241
+ unicode-display_width (>= 1.4.0, < 1.7)
242
+ rubocop-rails (2.4.2)
243
+ rack (>= 1.1)
244
+ rubocop (>= 0.72.0)
245
+ rubocop-rspec (1.38.1)
246
+ rubocop (>= 0.68.1)
247
+ ruby-progressbar (1.11.0)
248
+ ruby2_keywords (0.0.5)
249
+ rubyzip (2.3.2)
250
+ selenium-webdriver (3.142.7)
251
+ childprocess (>= 0.5, < 4.0)
252
+ rubyzip (>= 1.2.2)
253
+ taglib-ruby (1.1.0)
254
+ telegram-bot-ruby (0.16.0)
255
+ dry-inflector
256
+ faraday
257
+ virtus (~> 2.0)
258
+ thread_safe (0.3.6)
259
+ tzinfo (2.0.4)
260
+ concurrent-ruby (~> 1.0)
261
+ unicode-display_width (1.6.1)
262
+ virtus (2.0.0)
263
+ axiom-types (~> 0.1)
264
+ coercible (~> 1.0)
265
+ descendants_tracker (~> 0.0, >= 0.0.3)
266
+ zeitwerk (2.4.2)
267
+
268
+ PLATFORMS
269
+ x86_64-linux
270
+
271
+ DEPENDENCIES
272
+ aranha-parsers!
273
+ aranha-selenium!
274
+ eac_cli!
275
+ eac_config!
276
+ eac_docker!
277
+ eac_ruby_base0!
278
+ eac_ruby_gem_support (~> 0.3)
279
+ eac_ruby_utils!
280
+ ehbrs-tools!
281
+ ehbrs_ruby_utils!
282
+ ultimate_lyrics!
283
+
284
+ BUNDLED WITH
285
+ 2.2.25
File without changes
@@ -1,8 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require 'eac_cli/core_ext'
4
- require 'ehbrs/videos/extract/package'
5
- require 'eac_docker/images/named'
3
+ require 'ehbrs/tools/core_ext'
4
+ require 'ehbrs_ruby_utils/finances/bb_browser/docker_image'
6
5
 
7
6
  module Ehbrs
8
7
  module Tools
@@ -14,21 +13,51 @@ module Ehbrs
14
13
  end
15
14
 
16
15
  def run
17
- infov 'Docker run arguments', docker_container.run_command_args
16
+ infov 'Docker run arguments', ::Shellwords.join(docker_container.run_command_args)
18
17
  infov 'System result', docker_container.run_command.system
19
18
  end
20
19
 
21
20
  private
22
21
 
23
22
  def docker_image_uncached
24
- ::EacDocker::Images::Named.new('lichti/warsaw-browser')
23
+ ::EhbrsRubyUtils::Finances::BbBrowser::DockerImage.create
25
24
  end
26
25
 
27
26
  def docker_container_uncached
28
- docker_image.container.env('DISPLAY', "unix#{ENV.fetch('DISPLAY')}")
29
- .volume(::File.join(ENV['HOME'], 'Downloads'), '/home/bank/Downloads')
30
- .volume('/tmp/.X11-unix', '/tmp/.X11-unix').command_arg('bb')
31
- .temporary(true).interactive(true).tty(true)
27
+ r = docker_image.container
28
+ .temporary(true).interactive(true).tty(true)
29
+ .command_arg('seg.bb.com.br')
30
+ %w[capabilities environment_variables volumes].inject(r) do |a, e|
31
+ send("docker_container_#{e}", a)
32
+ end
33
+ end
34
+
35
+ def docker_container_capabilities(container)
36
+ %w[CAP_AUDIT_WRITE CAP_SYS_PTRACE].inject(container) { |a, e| a.capability(e) }
37
+ end
38
+
39
+ def docker_container_environment_variables(container)
40
+ {
41
+ 'USER_UID' => user_id,
42
+ 'USER_GID' => group_id
43
+ }.inject(container) { |a, e| a.env(e[0], e[1]) }
44
+ end
45
+
46
+ def docker_container_volumes(container)
47
+ {
48
+ ::File.join(ENV.fetch('HOME'), 'Downloads') => '/home/user/Downloads',
49
+ ::File.join(ENV.fetch('HOME'), '.Xauthority') => '/home/user/.Xauthority:ro',
50
+ '/tmp/.X11-unix' => '/tmp/.X11-unix:ro',
51
+ '/etc/machine-id' => '/etc/machine-id:ro'
52
+ }.inject(container) { |a, e| a.volume(e[0], e[1]) }
53
+ end
54
+
55
+ def user_id
56
+ ::EacRubyUtils::Envs.local.command('id', '-u').execute!.strip
57
+ end
58
+
59
+ def group_id
60
+ ::EacRubyUtils::Envs.local.command('id', '-g').execute!.strip
32
61
  end
33
62
  end
34
63
  end
@@ -2,7 +2,7 @@
2
2
 
3
3
  require 'eac_ruby_utils/envs'
4
4
  require 'eac_ruby_utils/fs/clearable_directory'
5
- require 'ehbrs/core_ext'
5
+ require 'ehbrs/tools/core_ext'
6
6
 
7
7
  module Ehbrs
8
8
  module Tools
@@ -0,0 +1,69 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'eac_ruby_utils/fs_cache'
4
+ require 'ehbrs/tools/core_ext'
5
+ require 'ehbrs_ruby_utils/videos/container'
6
+ require 'ultimate_lyrics/provider'
7
+
8
+ module Ehbrs
9
+ module Tools
10
+ class Runner
11
+ class Music
12
+ class Lyrics
13
+ DEFAULT_PROVIDER = 'lyrics.com'
14
+
15
+ runner_with :help, :output do
16
+ arg_opt '-p', '--provider', "Nome do provedor [Nome do #{DEFAULT_PROVIDER}]"
17
+ pos_arg :file
18
+ end
19
+
20
+ def run
21
+ start_banner
22
+ show_results
23
+ end
24
+
25
+ def show_results
26
+ if lyrics.found?
27
+ success 'Lyrics found'
28
+ run_output
29
+ else
30
+ fatal_error 'No lyric found'
31
+ end
32
+ end
33
+
34
+ def start_banner
35
+ infov 'File', file
36
+ %w[artist album track title].each do |attr|
37
+ infov attr.humanize, container.tag_file.tag.send(attr)
38
+ end
39
+ infov 'Selected provider', provider
40
+ end
41
+
42
+ def container_uncached
43
+ ::EhbrsRubyUtils::Videos::Container.from_file(file)
44
+ end
45
+
46
+ def file
47
+ parsed.file.to_pathname
48
+ end
49
+
50
+ def lyrics_uncached
51
+ container.lyrics_by_provider(provider)
52
+ end
53
+
54
+ def output_content
55
+ lyrics.text
56
+ end
57
+
58
+ def provider_uncached
59
+ ::UltimateLyrics::Provider.by_name(provider_name)
60
+ end
61
+
62
+ def provider_name
63
+ parsed.provider.if_present(DEFAULT_PROVIDER)
64
+ end
65
+ end
66
+ end
67
+ end
68
+ end
69
+ end
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require 'eac_cli/core_ext'
3
+ require 'eac_ruby_base0/core_ext'
4
4
  require 'ehbrs_ruby_utils/web_utils/videos/file'
5
5
 
6
6
  module Ehbrs
@@ -9,33 +9,43 @@ module Ehbrs
9
9
  class WebUtils
10
10
  class Videos
11
11
  class Download
12
- runner_with :help do
12
+ runner_with :confirmation, :help do
13
13
  desc 'Importa informações de arquivos de vídeo de uma instância EHB/RS Utils.'
14
- bool_opt '-c', '--confirm', 'Confirma as mudanças'
14
+ bool_opt '-d', '--delete', 'Remove vídeos indesejados.'
15
+ arg_opt '-m', '--move', 'Move vídeos indesejados para o diretório indicado.'
15
16
  end
16
17
 
17
18
  def run
18
19
  start_banner
19
20
  to_rename.each { |file| process_rename_file(file) }
20
- to_delete.each { |file| process_delete_file(file) }
21
+ unwanted.each { |file| process_unwanted_file(file) }
21
22
  end
22
23
 
23
24
  private
24
25
 
26
+ def delete?
27
+ parsed.delete? && !move?
28
+ end
29
+
30
+ def move?
31
+ parsed.move.present?
32
+ end
33
+
25
34
  def start_banner
26
35
  infov 'Files downloaded', files.count
27
36
  infov 'To rename', to_rename.count
28
- infov 'To delete', to_delete.count
37
+ infov 'Unwanted', unwanted.count
29
38
  end
30
39
 
31
40
  def process_rename_file(file)
32
41
  infov " * #{file.new_path}", file.original_path
33
- file.rename if parsed.confirm?
42
+ file.rename if confirm?
34
43
  end
35
44
 
36
- def process_delete_file(file)
37
- infov " * #{file.new_path}", 'REMOVE'
38
- file.remove if parsed.confirm?
45
+ def process_unwanted_file(file)
46
+ infov " * #{file.new_path}", 'UNWANTED'
47
+ file.remove if delete? && confirm?
48
+ file.move(parsed.move) if move? && confirm?
39
49
  end
40
50
 
41
51
  def files_uncached
@@ -46,7 +56,7 @@ module Ehbrs
46
56
  files.select(&:path_changed?)
47
57
  end
48
58
 
49
- def to_delete_uncached
59
+ def unwanted_uncached
50
60
  files.reject { |f| f.type == 'Videos::SeriesDirectory' }.select(&:unwanted)
51
61
  end
52
62
 
@@ -32,7 +32,7 @@ module Ehbrs
32
32
  '/videos/files/import',
33
33
  method: :put,
34
34
  body: {
35
- 'videos_tableless_local_import_list[list_file]' => ::File.new(files_list_path)
35
+ 'videos_local_files_import_list[list_file]' => ::File.new(files_list_path)
36
36
  },
37
37
  header: {
38
38
  'Accept' => 'application/json'
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Ehbrs
4
4
  module Tools
5
- VERSION = '0.23.1'
5
+ VERSION = '0.26.0'
6
6
  end
7
7
  end
@@ -0,0 +1,3 @@
1
+ # frozen_string_literal: true
2
+
3
+ ::EacRubyUtils::Rspec.default_setup.describe_rubocop
@@ -0,0 +1,21 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'ehbrs/cooking_book/recipe/measure'
4
+
5
+ RSpec.describe ::Ehbrs::CookingBook::Recipe::Measure do
6
+ describe '#build'
7
+ {
8
+ '1.5 cup' => [1.5, nil, 'cup'],
9
+ '~' => [nil, nil, nil],
10
+ '2/ 3 u' => [2, 3, 'u'],
11
+ '4.5/7.8' => [4.5, 7.8, nil]
12
+ }.each do |source, expected|
13
+ context "when source is \"#{source}\"" do
14
+ let(:instance) { described_class.build(source) }
15
+
16
+ it { expect(instance.numerator).to eq(expected[0]) }
17
+ it { expect(instance.denominator).to eq(expected[1]) }
18
+ it { expect(instance.unit).to eq(expected[2]) }
19
+ end
20
+ end
21
+ end