ehbrs-tools 0.25.0 → 0.28.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.avm.yml +4 -0
- data/.rspec +1 -0
- data/.rubocop.yml +39 -0
- data/Gemfile.lock +307 -0
- data/lib/ehbrs/{core_ext.rb → tools/core_ext.rb} +0 -0
- data/lib/ehbrs/tools/runner/finances/bb_browser.rb +1 -1
- data/lib/ehbrs/tools/runner/fs/selected.rb +19 -26
- data/lib/ehbrs/tools/runner/music/lyrics.rb +68 -0
- data/lib/ehbrs/tools/runner/music/lyrics_book.rb +41 -0
- data/lib/ehbrs/tools/runner/music/selected.rb +6 -6
- data/lib/ehbrs/tools/runner/web_utils/videos/upload.rb +1 -1
- data/lib/ehbrs/tools/version.rb +1 -1
- data/lib/ehbrs/user_dirs.rb +2 -2
- data/lib/ehbrs/videos/extract/package.rb +2 -2
- data/lib/ehbrs/videos/extract/package_file.rb +0 -1
- data/spec/code/rubocop_spec.rb +3 -0
- data/spec/lib/ehbrs/cooking_book/recipe/measure_spec.rb +21 -0
- data/spec/lib/ehbrs/observers/base_spec.rb +93 -0
- data/spec/lib/ehbrs/tools/runner/fs/used_space_spec.rb +62 -0
- data/spec/lib/ehbrs/tools/runner/vg/ips_spec.rb +31 -0
- data/spec/lib/ehbrs/tools/runner/vg/ips_spec_files/expected.rom +0 -0
- data/spec/lib/ehbrs/tools/runner/vg/ips_spec_files/patch_0.ips +0 -0
- data/spec/lib/ehbrs/tools/runner/vg/ips_spec_files/patch_1.ips +0 -0
- data/spec/lib/ehbrs/tools/runner/vg/ips_spec_files/source.rom +0 -0
- data/spec/lib/ehbrs/tools/runner/videos/probe_spec.rb +19 -0
- data/spec/lib/ehbrs/tools/runner/videos/probe_spec_files/fixed.target.yaml +105 -0
- data/spec/lib/ehbrs/tools/runner/videos/unsupported_spec.rb +75 -0
- data/spec/lib/ehbrs/tools/runner/videos/unsupported_spec_files/dts_audio.probe.yaml +90 -0
- data/spec/lib/ehbrs/tools/runner_spec.rb +16 -0
- data/spec/lib/ehbrs/vg/wii/game_file_spec.rb +21 -0
- data/spec/lib/ehbrs/vg/wii/wit/parsers/dump_spec.rb +11 -0
- data/spec/lib/ehbrs/vg/wii/wit/parsers/dump_spec_files/pikmin2_R92P01_wia.source.witdump +27 -0
- data/spec/lib/ehbrs/vg/wii/wit/parsers/dump_spec_files/pikmin2_R92P01_wia.target.yaml +22 -0
- data/spec/lib/ehbrs/vg/wii/wit/parsers/dump_spec_files/pikmin2_pal_iso.source.witdump +28 -0
- data/spec/lib/ehbrs/vg/wii/wit/parsers/dump_spec_files/pikmin2_pal_iso.target.yaml +21 -0
- data/spec/lib/ehbrs/vg/wii/wit/parsers/dump_spec_files/resident_evil_code_veronica_disc2_iso.source.witdump +16 -0
- data/spec/lib/ehbrs/vg/wii/wit/parsers/dump_spec_files/resident_evil_code_veronica_disc2_iso.target.yaml +19 -0
- data/spec/lib/ehbrs/vg/wii/wit/parsers/dump_spec_files/super_mario_galaxy_wbfs.source.witdump +28 -0
- data/spec/lib/ehbrs/vg/wii/wit/parsers/dump_spec_files/super_mario_galaxy_wbfs.target.yaml +23 -0
- data/spec/lib/ehbrs/vg/wii/wit/path_spec.rb +33 -0
- data/spec/spec_helper/videos.rb +30 -0
- data/spec/spec_helper/videos_files/stub_source.mp4 +0 -0
- data/spec/spec_helper.rb +7 -0
- data/vendor/aranha-parsers/aranha-parsers.gemspec +1 -0
- data/vendor/aranha-parsers/lib/aranha/parsers/rspec/setup.rb +1 -1
- data/vendor/aranha-parsers/lib/aranha/parsers/rspec/{source_target_fixtures_example.rb → shared_examples/source_target_fixtures.rb} +0 -0
- data/vendor/aranha-parsers/lib/aranha/parsers/source_address/fetch_content_error.rb +10 -0
- data/vendor/aranha-parsers/lib/aranha/parsers/source_address/http_get.rb +15 -2
- data/vendor/aranha-parsers/lib/aranha/parsers/version.rb +1 -1
- data/vendor/eac_cli/lib/eac_cli/definition/argument_option.rb +1 -1
- data/vendor/eac_cli/lib/eac_cli/definition/base_option.rb +9 -1
- data/vendor/eac_cli/lib/eac_cli/definition/boolean_option.rb +6 -0
- data/vendor/eac_cli/lib/eac_cli/runner_with/help/builder.rb +3 -3
- data/vendor/eac_cli/lib/eac_cli/version.rb +1 -1
- data/vendor/eac_cli/spec/lib/eac_cli/runner_spec.rb +6 -5
- data/vendor/eac_fs/Gemfile +5 -0
- data/vendor/eac_fs/eac_fs.gemspec +20 -0
- data/vendor/{eac_ruby_utils/lib/eac_ruby_utils/filesystem_cache.rb → eac_fs/lib/eac_fs/cache.rb} +7 -2
- data/vendor/eac_fs/lib/eac_fs/file_info.rb +24 -0
- data/vendor/eac_fs/lib/eac_fs/patches/module/fs_cache.rb +10 -0
- data/vendor/eac_fs/lib/eac_fs/patches/module.rb +4 -0
- data/vendor/eac_fs/lib/eac_fs/patches/object/fs_cache.rb +10 -0
- data/vendor/eac_fs/lib/eac_fs/patches/object.rb +4 -0
- data/vendor/eac_fs/lib/eac_fs/patches/pathname/info.rb +12 -0
- data/vendor/eac_fs/lib/eac_fs/patches/pathname.rb +4 -0
- data/vendor/eac_fs/lib/eac_fs/patches.rb +4 -0
- data/vendor/eac_fs/lib/eac_fs/version.rb +5 -0
- data/vendor/eac_fs/lib/eac_fs.rb +7 -0
- data/vendor/{eac_ruby_utils/spec/lib/eac_ruby_utils/filesystem_cache_spec.rb → eac_fs/spec/lib/eac_fs/cache_spec.rb} +2 -2
- data/vendor/eac_fs/spec/rubocop_spec.rb +3 -0
- data/vendor/eac_fs/spec/spec_helper.rb +4 -0
- data/vendor/eac_ruby_base0/eac_ruby_base0.gemspec +2 -1
- data/vendor/eac_ruby_base0/lib/eac_ruby_base0/application.rb +3 -3
- data/vendor/eac_ruby_base0/lib/eac_ruby_base0/core_ext.rb +1 -0
- data/vendor/eac_ruby_base0/lib/eac_ruby_base0/runner.rb +16 -7
- data/vendor/eac_ruby_base0/lib/eac_ruby_base0/version.rb +1 -1
- data/vendor/eac_ruby_gems_utils/Gemfile +5 -0
- data/vendor/eac_ruby_gems_utils/LICENCE +16 -0
- data/vendor/eac_ruby_gems_utils/README.rdoc +3 -0
- data/vendor/eac_ruby_gems_utils/eac_ruby_gems_utils.gemspec +30 -0
- data/vendor/eac_ruby_gems_utils/lib/eac_ruby_gems_utils/gem/command.rb +33 -0
- data/vendor/eac_ruby_gems_utils/lib/eac_ruby_gems_utils/gem/version_file.rb +41 -0
- data/vendor/eac_ruby_gems_utils/lib/eac_ruby_gems_utils/gem.rb +97 -0
- data/vendor/eac_ruby_gems_utils/lib/eac_ruby_gems_utils/tests/base.rb +58 -0
- data/vendor/eac_ruby_gems_utils/lib/eac_ruby_gems_utils/tests/minitest.rb +25 -0
- data/vendor/eac_ruby_gems_utils/lib/eac_ruby_gems_utils/tests/multiple/decorated_gem.rb +48 -0
- data/vendor/eac_ruby_gems_utils/lib/eac_ruby_gems_utils/tests/multiple/result.rb +25 -0
- data/vendor/eac_ruby_gems_utils/lib/eac_ruby_gems_utils/tests/multiple.rb +84 -0
- data/vendor/eac_ruby_gems_utils/lib/eac_ruby_gems_utils/tests/rspec.rb +21 -0
- data/vendor/eac_ruby_gems_utils/lib/eac_ruby_gems_utils/tests.rb +9 -0
- data/vendor/eac_ruby_gems_utils/lib/eac_ruby_gems_utils/version.rb +5 -0
- data/vendor/eac_ruby_gems_utils/lib/eac_ruby_gems_utils.rb +7 -0
- data/vendor/eac_ruby_gems_utils/spec/code/rubocop_check_spec.rb +3 -0
- data/vendor/eac_ruby_gems_utils/spec/lib/eac_ruby_gems_utils/gem/version_file_spec.rb +14 -0
- data/vendor/eac_ruby_gems_utils/spec/lib/eac_ruby_gems_utils/gem/version_file_spec_files/a_version_file.rb +7 -0
- data/vendor/eac_ruby_gems_utils/spec/lib/eac_ruby_gems_utils/gem_spec.rb +20 -0
- data/vendor/eac_ruby_gems_utils/spec/spec_helper.rb +4 -0
- data/vendor/eac_ruby_gems_utils/spec/support/mygem/Gemfile +5 -0
- data/vendor/eac_ruby_gems_utils/spec/support/mygem/Gemfile.lock +19 -0
- data/vendor/eac_ruby_gems_utils/spec/support/mygem/Rakefile +14 -0
- data/vendor/eac_ruby_gems_utils/spec/support/mygem/exe/myrunner +5 -0
- data/vendor/eac_ruby_gems_utils/spec/support/mygem/lib/mygem/version.rb +5 -0
- data/vendor/eac_ruby_gems_utils/spec/support/mygem/lib/mygem.rb +5 -0
- data/vendor/eac_ruby_gems_utils/spec/support/mygem/mygem.gemspec +16 -0
- data/vendor/eac_ruby_utils/lib/eac_ruby_utils/compact.rb +22 -0
- data/vendor/eac_ruby_utils/lib/eac_ruby_utils/patches/object/compact.rb +20 -0
- data/vendor/eac_ruby_utils/lib/eac_ruby_utils/patches/string/delimited.rb +16 -0
- data/vendor/eac_ruby_utils/lib/eac_ruby_utils/string_delimited.rb +70 -0
- data/vendor/eac_ruby_utils/lib/eac_ruby_utils/version.rb +1 -1
- data/vendor/eac_ruby_utils/spec/lib/eac_ruby_utils/compact_spec.rb +20 -0
- data/vendor/eac_ruby_utils/spec/lib/eac_ruby_utils/patches/object/compact_spec.rb +20 -0
- data/vendor/eac_ruby_utils/spec/lib/eac_ruby_utils/patches/string/delimited_spec.rb +34 -0
- data/vendor/eac_templates/Gemfile +5 -0
- data/vendor/eac_templates/eac_templates.gemspec +19 -0
- data/vendor/eac_templates/lib/eac_templates/directory.rb +108 -0
- data/vendor/eac_templates/lib/eac_templates/file.rb +48 -0
- data/vendor/eac_templates/lib/eac_templates/patches/module/erb_template.rb +9 -0
- data/vendor/eac_templates/lib/eac_templates/patches/module/template.rb +10 -0
- data/vendor/eac_templates/lib/eac_templates/patches/module.rb +4 -0
- data/vendor/eac_templates/lib/eac_templates/patches/object/erb_template.rb +9 -0
- data/vendor/eac_templates/lib/eac_templates/patches/object/template.rb +9 -0
- data/vendor/eac_templates/lib/eac_templates/patches/object.rb +4 -0
- data/vendor/eac_templates/lib/eac_templates/patches.rb +4 -0
- data/vendor/eac_templates/lib/eac_templates/searcher.rb +53 -0
- data/vendor/eac_templates/lib/eac_templates/variable_not_found_error.rb +5 -0
- data/vendor/eac_templates/lib/eac_templates/variable_providers/base.rb +21 -0
- data/vendor/eac_templates/lib/eac_templates/variable_providers/config_reader.rb +27 -0
- data/vendor/eac_templates/lib/eac_templates/variable_providers/entries_reader.rb +23 -0
- data/vendor/eac_templates/lib/eac_templates/variable_providers/generic.rb +23 -0
- data/vendor/eac_templates/lib/eac_templates/variable_providers/hash.rb +27 -0
- data/vendor/eac_templates/lib/eac_templates/variable_providers.rb +23 -0
- data/vendor/eac_templates/lib/eac_templates/version.rb +5 -0
- data/vendor/eac_templates/lib/eac_templates.rb +7 -0
- data/vendor/eac_templates/spec/lib/eac_templates/file_spec.rb +35 -0
- data/vendor/eac_templates/spec/lib/eac_templates/file_spec_files/expected_content +2 -0
- data/vendor/eac_templates/spec/lib/eac_templates/file_spec_files/source.template +2 -0
- data/vendor/eac_templates/spec/lib/eac_templates/searcher_spec.rb +30 -0
- data/vendor/eac_templates/spec/lib/eac_templates/searcher_spec_files/path1/subdir1/file1.template +1 -0
- data/vendor/eac_templates/spec/lib/eac_templates/searcher_spec_files/path1/subdir1/file2 +1 -0
- data/vendor/eac_templates/spec/lib/eac_templates/searcher_spec_files/path2/subdir1/file3.template +1 -0
- data/vendor/eac_templates/spec/lib/object/template_spec.rb +23 -0
- data/vendor/eac_templates/spec/lib/object/template_spec_files/path/my_stub_with_template +1 -0
- data/vendor/eac_templates/spec/rubocop_spec.rb +3 -0
- data/vendor/eac_templates/spec/spec_helper.rb +4 -0
- data/vendor/ehbrs_ruby_utils/ehbrs_ruby_utils.gemspec +6 -1
- data/vendor/ehbrs_ruby_utils/lib/ehbrs_ruby_utils/core_ext.rb +5 -0
- data/{lib/ehbrs → vendor/ehbrs_ruby_utils/lib/ehbrs_ruby_utils}/fs/compressed_package.rb +1 -1
- data/vendor/ehbrs_ruby_utils/lib/ehbrs_ruby_utils/fs/selected/build.rb +41 -0
- data/vendor/ehbrs_ruby_utils/lib/ehbrs_ruby_utils/fs/selected/build_file.rb +27 -0
- data/vendor/ehbrs_ruby_utils/lib/ehbrs_ruby_utils/fs/selected.rb +35 -0
- data/vendor/ehbrs_ruby_utils/lib/ehbrs_ruby_utils/fs.rb +10 -0
- data/vendor/ehbrs_ruby_utils/lib/ehbrs_ruby_utils/music/lyrics_book/album.rb +42 -0
- data/vendor/ehbrs_ruby_utils/lib/ehbrs_ruby_utils/music/lyrics_book/resource.rb +64 -0
- data/vendor/ehbrs_ruby_utils/lib/ehbrs_ruby_utils/music/lyrics_book/song.rb +68 -0
- data/vendor/ehbrs_ruby_utils/lib/ehbrs_ruby_utils/music/lyrics_book.rb +65 -0
- data/{lib/ehbrs/fs.rb → vendor/ehbrs_ruby_utils/lib/ehbrs_ruby_utils/music.rb} +2 -2
- data/vendor/ehbrs_ruby_utils/lib/ehbrs_ruby_utils/patches/object.rb +4 -0
- data/vendor/ehbrs_ruby_utils/lib/ehbrs_ruby_utils/patches.rb +4 -0
- data/vendor/ehbrs_ruby_utils/lib/ehbrs_ruby_utils/version.rb +1 -1
- data/vendor/ehbrs_ruby_utils/lib/ehbrs_ruby_utils/videos/container.rb +31 -0
- data/vendor/ehbrs_ruby_utils/lib/ehbrs_ruby_utils/videos/stream.rb +1 -1
- data/vendor/ehbrs_ruby_utils/template/ehbrs_ruby_utils/music/lyrics_book/album/inner.html.erb +3 -0
- data/vendor/ehbrs_ruby_utils/template/ehbrs_ruby_utils/music/lyrics_book/custom_style.css +11 -0
- data/vendor/ehbrs_ruby_utils/template/ehbrs_ruby_utils/music/lyrics_book/index.html.erb +14 -0
- data/vendor/ehbrs_ruby_utils/template/ehbrs_ruby_utils/music/lyrics_book/main.html.erb +24 -0
- data/vendor/ehbrs_ruby_utils/template/ehbrs_ruby_utils/music/lyrics_book/resource/main.html.erb +8 -0
- data/vendor/ehbrs_ruby_utils/template/ehbrs_ruby_utils/music/lyrics_book/song/inner.html.erb +5 -0
- data/vendor/ultimate_lyrics/Gemfile +5 -0
- data/vendor/ultimate_lyrics/bin/download_parser_spec_files.rb +94 -0
- data/vendor/ultimate_lyrics/lib/ultimate_lyrics/field.rb +83 -0
- data/vendor/ultimate_lyrics/lib/ultimate_lyrics/lyrics.rb +13 -0
- data/vendor/ultimate_lyrics/lib/ultimate_lyrics/parser.rb +28 -0
- data/vendor/ultimate_lyrics/lib/ultimate_lyrics/provider/exclude_item.rb +17 -0
- data/vendor/ultimate_lyrics/lib/ultimate_lyrics/provider/extract_item.rb +21 -0
- data/vendor/ultimate_lyrics/lib/ultimate_lyrics/provider/item.rb +48 -0
- data/vendor/ultimate_lyrics/lib/ultimate_lyrics/provider/replace_fields.rb +13 -0
- data/vendor/ultimate_lyrics/lib/ultimate_lyrics/provider/rule.rb +52 -0
- data/vendor/ultimate_lyrics/lib/ultimate_lyrics/provider/url_format.rb +21 -0
- data/vendor/ultimate_lyrics/lib/ultimate_lyrics/provider.rb +96 -0
- data/vendor/ultimate_lyrics/lib/ultimate_lyrics/provider_search.rb +43 -0
- data/vendor/ultimate_lyrics/lib/ultimate_lyrics/providers_data.xml +356 -0
- data/vendor/ultimate_lyrics/lib/ultimate_lyrics/song_metadata/field.rb +24 -0
- data/vendor/ultimate_lyrics/lib/ultimate_lyrics/song_metadata.rb +28 -0
- data/vendor/ultimate_lyrics/lib/ultimate_lyrics/version.rb +5 -0
- data/vendor/ultimate_lyrics/lib/ultimate_lyrics.rb +7 -0
- data/vendor/ultimate_lyrics/spec/lib/ultimate_lyrics/parser_spec.rb +20 -0
- data/vendor/ultimate_lyrics/spec/lib/ultimate_lyrics/parser_spec_files/encyclopaedia_metallum__michael_jackson_thriller.source.html +8 -0
- data/vendor/ultimate_lyrics/spec/lib/ultimate_lyrics/parser_spec_files/encyclopaedia_metallum__michael_jackson_thriller.target.yaml +3 -0
- data/vendor/ultimate_lyrics/spec/lib/ultimate_lyrics/parser_spec_files/encyclopaedia_metallum__michael_jackson_thriller.url +1 -0
- data/vendor/ultimate_lyrics/spec/lib/ultimate_lyrics/parser_spec_files/encyclopaedia_metallum__milton_nascimento_rouxinol.source.html +8 -0
- data/vendor/ultimate_lyrics/spec/lib/ultimate_lyrics/parser_spec_files/encyclopaedia_metallum__milton_nascimento_rouxinol.target.yaml +3 -0
- data/vendor/ultimate_lyrics/spec/lib/ultimate_lyrics/parser_spec_files/encyclopaedia_metallum__milton_nascimento_rouxinol.url +1 -0
- data/vendor/ultimate_lyrics/spec/lib/ultimate_lyrics/parser_spec_files/hindilyrics_net_bollywood_songs__michael_jackson_thriller.source.html +193 -0
- data/vendor/ultimate_lyrics/spec/lib/ultimate_lyrics/parser_spec_files/hindilyrics_net_bollywood_songs__michael_jackson_thriller.target.yaml +3 -0
- data/vendor/ultimate_lyrics/spec/lib/ultimate_lyrics/parser_spec_files/hindilyrics_net_bollywood_songs__michael_jackson_thriller.url +1 -0
- data/vendor/ultimate_lyrics/spec/lib/ultimate_lyrics/parser_spec_files/hindilyrics_net_bollywood_songs__milton_nascimento_rouxinol.source.html +193 -0
- data/vendor/ultimate_lyrics/spec/lib/ultimate_lyrics/parser_spec_files/hindilyrics_net_bollywood_songs__milton_nascimento_rouxinol.target.yaml +3 -0
- data/vendor/ultimate_lyrics/spec/lib/ultimate_lyrics/parser_spec_files/hindilyrics_net_bollywood_songs__milton_nascimento_rouxinol.url +1 -0
- data/vendor/ultimate_lyrics/spec/lib/ultimate_lyrics/parser_spec_files/lyrics_com__michael_jackson_thriller.source.html +87 -0
- data/vendor/ultimate_lyrics/spec/lib/ultimate_lyrics/parser_spec_files/lyrics_com__michael_jackson_thriller.target.yaml +36 -0
- data/vendor/ultimate_lyrics/spec/lib/ultimate_lyrics/parser_spec_files/lyrics_com__michael_jackson_thriller.url +1 -0
- data/vendor/ultimate_lyrics/spec/lib/ultimate_lyrics/parser_spec_files/lyrics_com__milton_nascimento_rouxinol.source.html +4 -0
- data/vendor/ultimate_lyrics/spec/lib/ultimate_lyrics/parser_spec_files/lyrics_com__milton_nascimento_rouxinol.target.yaml +3 -0
- data/vendor/ultimate_lyrics/spec/lib/ultimate_lyrics/parser_spec_files/lyrics_com__milton_nascimento_rouxinol.url +1 -0
- data/vendor/ultimate_lyrics/spec/lib/ultimate_lyrics/parser_spec_files/lyricsplugin_com__michael_jackson_thriller.source.html +2 -0
- data/vendor/ultimate_lyrics/spec/lib/ultimate_lyrics/parser_spec_files/lyricsplugin_com__michael_jackson_thriller.target.yaml +3 -0
- data/vendor/ultimate_lyrics/spec/lib/ultimate_lyrics/parser_spec_files/lyricsplugin_com__michael_jackson_thriller.url +1 -0
- data/vendor/ultimate_lyrics/spec/lib/ultimate_lyrics/parser_spec_files/lyricsplugin_com__milton_nascimento_rouxinol.source.html +2 -0
- data/vendor/ultimate_lyrics/spec/lib/ultimate_lyrics/parser_spec_files/lyricsplugin_com__milton_nascimento_rouxinol.target.yaml +3 -0
- data/vendor/ultimate_lyrics/spec/lib/ultimate_lyrics/parser_spec_files/lyricsplugin_com__milton_nascimento_rouxinol.url +1 -0
- data/vendor/ultimate_lyrics/spec/lib/ultimate_lyrics/parser_spec_files/lyricsreg_com__milton_nascimento_rouxinol.source.html +101 -0
- data/vendor/ultimate_lyrics/spec/lib/ultimate_lyrics/parser_spec_files/lyricsreg_com__milton_nascimento_rouxinol.target.yaml +3 -0
- data/vendor/ultimate_lyrics/spec/lib/ultimate_lyrics/parser_spec_files/lyricsreg_com__milton_nascimento_rouxinol.url +1 -0
- data/vendor/ultimate_lyrics/spec/lib/ultimate_lyrics/parser_spec_files/mp3lyrics_org__michael_jackson_thriller.source.html +29 -0
- data/vendor/ultimate_lyrics/spec/lib/ultimate_lyrics/parser_spec_files/mp3lyrics_org__michael_jackson_thriller.target.yaml +3 -0
- data/vendor/ultimate_lyrics/spec/lib/ultimate_lyrics/parser_spec_files/mp3lyrics_org__michael_jackson_thriller.url +1 -0
- data/vendor/ultimate_lyrics/spec/lib/ultimate_lyrics/parser_spec_files/mp3lyrics_org__milton_nascimento_rouxinol.source.html +29 -0
- data/vendor/ultimate_lyrics/spec/lib/ultimate_lyrics/parser_spec_files/mp3lyrics_org__milton_nascimento_rouxinol.target.yaml +3 -0
- data/vendor/ultimate_lyrics/spec/lib/ultimate_lyrics/parser_spec_files/mp3lyrics_org__milton_nascimento_rouxinol.url +1 -0
- data/vendor/ultimate_lyrics/spec/lib/ultimate_lyrics/parser_spec_files/songlyrics_com__michael_jackson_thriller.source.html +1301 -0
- data/vendor/ultimate_lyrics/spec/lib/ultimate_lyrics/parser_spec_files/songlyrics_com__michael_jackson_thriller.target.yaml +3 -0
- data/vendor/ultimate_lyrics/spec/lib/ultimate_lyrics/parser_spec_files/songlyrics_com__michael_jackson_thriller.url +1 -0
- data/vendor/ultimate_lyrics/spec/lib/ultimate_lyrics/provider_search_spec.rb +72 -0
- data/vendor/ultimate_lyrics/spec/rubocop_spec.rb +3 -0
- data/vendor/ultimate_lyrics/spec/spec_helper.rb +4 -0
- data/vendor/ultimate_lyrics/ultimate_lyrics.gemspec +21 -0
- metadata +251 -12
- data/lib/ehbrs/patches/module/erb_template.rb +0 -11
- data/lib/ehbrs/patches/object/erb_template.rb +0 -9
- data/vendor/eac_ruby_utils/lib/eac_ruby_utils/fs_cache.rb +0 -12
@@ -0,0 +1,30 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'eac_templates/searcher'
|
4
|
+
|
5
|
+
RSpec.describe ::EacTemplates::Searcher do
|
6
|
+
let(:files_dir) { ::File.join(__dir__, 'searcher_spec_files') }
|
7
|
+
let(:instance) do
|
8
|
+
r = described_class.new
|
9
|
+
r.included_paths << ::File.join(files_dir, 'path1')
|
10
|
+
r.included_paths << ::File.join(files_dir, 'path2')
|
11
|
+
r
|
12
|
+
end
|
13
|
+
|
14
|
+
describe '#template' do
|
15
|
+
{
|
16
|
+
::EacTemplates::Directory => %w[subdir1],
|
17
|
+
::EacTemplates::File => %w[subdir1/file1.template subdir1/file2
|
18
|
+
subdir1/file3.template],
|
19
|
+
::NilClass => %w[does_not_exist]
|
20
|
+
}.each do |klass, subpaths|
|
21
|
+
subpaths.each do |subpath|
|
22
|
+
context "when subpath is \"#{subpath}\"" do
|
23
|
+
it "returns a #{klass}'s instance" do
|
24
|
+
expect(instance.template(subpath, false)).to be_a(klass)
|
25
|
+
end
|
26
|
+
end
|
27
|
+
end
|
28
|
+
end
|
29
|
+
end
|
30
|
+
end
|
data/vendor/eac_templates/spec/lib/eac_templates/searcher_spec_files/path1/subdir1/file1.template
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
|
@@ -0,0 +1 @@
|
|
1
|
+
|
data/vendor/eac_templates/spec/lib/eac_templates/searcher_spec_files/path2/subdir1/file3.template
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
|
@@ -0,0 +1,23 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'eac_templates/patches/object/template'
|
4
|
+
|
5
|
+
RSpec.describe ::Object do
|
6
|
+
class MyStubWithTemplate # rubocop:disable RSpec/LeakyConstantDeclaration
|
7
|
+
end
|
8
|
+
|
9
|
+
let(:instance) { ::MyStubWithTemplate.new }
|
10
|
+
let(:templates_path) { ::File.join(__dir__, 'template_spec_files', 'path') }
|
11
|
+
|
12
|
+
before do
|
13
|
+
::EacTemplates::Searcher.default.included_paths.add(templates_path)
|
14
|
+
end
|
15
|
+
|
16
|
+
after do
|
17
|
+
::EacTemplates::Searcher.default.included_paths.delete(templates_path)
|
18
|
+
end
|
19
|
+
|
20
|
+
describe '#template' do
|
21
|
+
it { expect(instance.template).to be_a(::EacTemplates::File) }
|
22
|
+
end
|
23
|
+
end
|
@@ -0,0 +1 @@
|
|
1
|
+
|
@@ -12,10 +12,15 @@ Gem::Specification.new do |s|
|
|
12
12
|
s.authors = ['Eduardo H. Bogoni']
|
13
13
|
s.summary = 'Utilities for EHB/RS\'s Ruby projects.'
|
14
14
|
|
15
|
-
s.files = Dir['{lib}/**/*']
|
15
|
+
s.files = Dir['{lib,template}/**/*']
|
16
|
+
s.test_files = Dir['{spec}/**/*', '.rubocop.yml', '.rspec']
|
16
17
|
|
18
|
+
s.add_dependency 'aranha-parsers', '~> 0.8', '>= 0.8.5'
|
19
|
+
s.add_dependency 'avm', '~> 0.3', '>= 0.3.2'
|
17
20
|
s.add_dependency 'eac_ruby_utils', '~> 0.70'
|
18
21
|
s.add_dependency 'eac_templates', '~> 0.1', '>= 0.1.1'
|
22
|
+
s.add_dependency 'taglib-ruby', '~> 1.1'
|
23
|
+
s.add_dependency 'ultimate_lyrics', '~> 0.1'
|
19
24
|
|
20
25
|
s.add_development_dependency 'aranha-parsers', '~> 0.8'
|
21
26
|
s.add_development_dependency 'eac_ruby_gem_support', '~> 0.3'
|
@@ -0,0 +1,41 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'eac_ruby_utils/core_ext'
|
4
|
+
require 'ehbrs_ruby_utils/fs/selected/build_file'
|
5
|
+
|
6
|
+
module EhbrsRubyUtils
|
7
|
+
module Fs
|
8
|
+
class Selected
|
9
|
+
class Build
|
10
|
+
DEFAULT_TARGET_BASENAME_PROC = ::Proc.new { |path| path.basename.to_path }
|
11
|
+
|
12
|
+
attr_reader :selected, :target_dir, :target_basename_proc
|
13
|
+
|
14
|
+
def initialize(selected, target_dir, &target_basename_proc)
|
15
|
+
@selected = selected
|
16
|
+
@target_dir = target_dir.to_pathname
|
17
|
+
@target_basename_proc = target_basename_proc.presence || DEFAULT_TARGET_BASENAME_PROC
|
18
|
+
end
|
19
|
+
|
20
|
+
def perform
|
21
|
+
clear_target_dir
|
22
|
+
link_selected_found
|
23
|
+
end
|
24
|
+
|
25
|
+
private
|
26
|
+
|
27
|
+
def clear_target_dir
|
28
|
+
target_dir.children.each do |c|
|
29
|
+
c.unlink if c.symlink? && c.directory?
|
30
|
+
end
|
31
|
+
end
|
32
|
+
|
33
|
+
def link_selected_found
|
34
|
+
selected.found.each do |found|
|
35
|
+
::EhbrsRubyUtils::Fs::Selected::BuildFile.new(self, found).perform
|
36
|
+
end
|
37
|
+
end
|
38
|
+
end
|
39
|
+
end
|
40
|
+
end
|
41
|
+
end
|
@@ -0,0 +1,27 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'eac_ruby_utils/core_ext'
|
4
|
+
|
5
|
+
module EhbrsRubyUtils
|
6
|
+
module Fs
|
7
|
+
class Selected
|
8
|
+
class BuildFile
|
9
|
+
common_constructor :build, :path do
|
10
|
+
self.path = path.to_pathname
|
11
|
+
end
|
12
|
+
|
13
|
+
def perform
|
14
|
+
target_path.make_symlink(path)
|
15
|
+
end
|
16
|
+
|
17
|
+
def target_path
|
18
|
+
build.target_dir.join(target_basename)
|
19
|
+
end
|
20
|
+
|
21
|
+
def target_basename
|
22
|
+
build.target_basename_proc.call(path)
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end
|
27
|
+
end
|
@@ -0,0 +1,35 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'eac_ruby_utils/core_ext'
|
4
|
+
|
5
|
+
module EhbrsRubyUtils
|
6
|
+
module Fs
|
7
|
+
class Selected
|
8
|
+
require_sub __FILE__
|
9
|
+
DEFAULT_FILENAME = '.selected'
|
10
|
+
|
11
|
+
enable_listable
|
12
|
+
enable_simple_cache
|
13
|
+
lists.add_symbol :option, :filename, :target_name_builder
|
14
|
+
common_constructor :root_path, :options, default: [{}] do
|
15
|
+
self.root_path = root_path.to_pathname
|
16
|
+
self.options = self.class.lists.option.hash_keys_validate!(options)
|
17
|
+
end
|
18
|
+
|
19
|
+
def build(target_dir, &directory_target_basename)
|
20
|
+
::EhbrsRubyUtils::Fs::Selected::Build.new(self, target_dir, &directory_target_basename)
|
21
|
+
end
|
22
|
+
|
23
|
+
def filename
|
24
|
+
options[OPTION_FILENAME].if_present(DEFAULT_FILENAME)
|
25
|
+
end
|
26
|
+
|
27
|
+
private
|
28
|
+
|
29
|
+
# @return [Pathname]
|
30
|
+
def found_uncached
|
31
|
+
root_path.glob("**/#{filename}").map(&:parent).sort
|
32
|
+
end
|
33
|
+
end
|
34
|
+
end
|
35
|
+
end
|
@@ -0,0 +1,42 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'ehbrs_ruby_utils/core_ext'
|
4
|
+
require 'ehbrs_ruby_utils/music/lyrics_book/resource'
|
5
|
+
|
6
|
+
module EhbrsRubyUtils
|
7
|
+
module Music
|
8
|
+
class LyricsBook
|
9
|
+
class Album < ::EhbrsRubyUtils::Music::LyricsBook::Resource
|
10
|
+
enable_simple_cache
|
11
|
+
|
12
|
+
def book
|
13
|
+
parent
|
14
|
+
end
|
15
|
+
|
16
|
+
def first_previous
|
17
|
+
previous.if_present { |v| v.songs.last }
|
18
|
+
end
|
19
|
+
|
20
|
+
def valid?
|
21
|
+
songs.any?
|
22
|
+
end
|
23
|
+
|
24
|
+
def header_title
|
25
|
+
"#{songs.first.number}-#{songs.last.number} | #{artist} | #{title}"
|
26
|
+
end
|
27
|
+
|
28
|
+
def artist
|
29
|
+
songs.lazy.map { |v| v.tag.artist }.find(&:present?)
|
30
|
+
end
|
31
|
+
|
32
|
+
def title
|
33
|
+
songs.lazy.map { |v| v.tag.album }.find(&:present?)
|
34
|
+
end
|
35
|
+
|
36
|
+
def songs_uncached
|
37
|
+
::EhbrsRubyUtils::Music::LyricsBook::Song.create_list(self, path.children)
|
38
|
+
end
|
39
|
+
end
|
40
|
+
end
|
41
|
+
end
|
42
|
+
end
|
@@ -0,0 +1,64 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'ehbrs_ruby_utils/core_ext'
|
4
|
+
|
5
|
+
module EhbrsRubyUtils
|
6
|
+
module Music
|
7
|
+
class LyricsBook
|
8
|
+
class Resource
|
9
|
+
class << self
|
10
|
+
def create_list(parent, files)
|
11
|
+
r = files.sort.map { |path| new(parent, path) }.select(&:valid?)
|
12
|
+
previous = parent.first_previous
|
13
|
+
r.map do |e|
|
14
|
+
e.reset_cache
|
15
|
+
e.previous = previous
|
16
|
+
previous = e
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
20
|
+
|
21
|
+
enable_simple_cache
|
22
|
+
include ::Comparable
|
23
|
+
common_constructor :parent, :path
|
24
|
+
attr_accessor :previous
|
25
|
+
|
26
|
+
def filename
|
27
|
+
path.relative_path_from(parent.path)
|
28
|
+
end
|
29
|
+
|
30
|
+
def <=>(other)
|
31
|
+
path <=> other.path
|
32
|
+
end
|
33
|
+
|
34
|
+
def link_to_header
|
35
|
+
"<a href=\"\##{header_id}\" id=\"#{index_id}\">#{header_title}</a>"
|
36
|
+
end
|
37
|
+
|
38
|
+
def index_id
|
39
|
+
"index_#{header_id}"
|
40
|
+
end
|
41
|
+
|
42
|
+
def header_id
|
43
|
+
header_title.variableize
|
44
|
+
end
|
45
|
+
|
46
|
+
def header_index
|
47
|
+
parent.header_index + 1
|
48
|
+
end
|
49
|
+
|
50
|
+
def output_main
|
51
|
+
::EhbrsRubyUtils::Music::LyricsBook::Resource.erb_template('main.html.erb', binding)
|
52
|
+
end
|
53
|
+
|
54
|
+
def output_index
|
55
|
+
erb_template('index.html.erb')
|
56
|
+
end
|
57
|
+
|
58
|
+
def type
|
59
|
+
self.class.name.demodulize.underscore
|
60
|
+
end
|
61
|
+
end
|
62
|
+
end
|
63
|
+
end
|
64
|
+
end
|
@@ -0,0 +1,68 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'ehbrs_ruby_utils/core_ext'
|
4
|
+
require 'ehbrs_ruby_utils/music/lyrics_book/resource'
|
5
|
+
|
6
|
+
module EhbrsRubyUtils
|
7
|
+
module Music
|
8
|
+
class LyricsBook
|
9
|
+
class Song < ::EhbrsRubyUtils::Music::LyricsBook::Resource
|
10
|
+
enable_simple_cache
|
11
|
+
delegate :book, to: :album
|
12
|
+
delegate :provider, to: :book
|
13
|
+
delegate :tag, :to_s, to: :container
|
14
|
+
|
15
|
+
def album
|
16
|
+
parent
|
17
|
+
end
|
18
|
+
|
19
|
+
def lyrics
|
20
|
+
fetch_lyrics unless lyrics_cached?
|
21
|
+
cached_lyrics
|
22
|
+
end
|
23
|
+
|
24
|
+
def valid?
|
25
|
+
tag.present?
|
26
|
+
end
|
27
|
+
|
28
|
+
def lyrics_cached?
|
29
|
+
lyrics_cache.cached?
|
30
|
+
end
|
31
|
+
|
32
|
+
def cached_lyrics
|
33
|
+
::YAML.load_file(lyrics_cache.content_path)
|
34
|
+
end
|
35
|
+
|
36
|
+
def header_title
|
37
|
+
"#{number} - #{title}"
|
38
|
+
end
|
39
|
+
|
40
|
+
delegate :title, to: :tag
|
41
|
+
|
42
|
+
private
|
43
|
+
|
44
|
+
def container_uncached
|
45
|
+
::EhbrsRubyUtils::Videos::Container.new(path)
|
46
|
+
end
|
47
|
+
|
48
|
+
def fetch_lyrics
|
49
|
+
lyrics = fetched_lyrics
|
50
|
+
lyrics_cache.write(lyrics.to_yaml)
|
51
|
+
end
|
52
|
+
|
53
|
+
def fetched_lyrics
|
54
|
+
container.lyrics_by_provider(provider)
|
55
|
+
end
|
56
|
+
|
57
|
+
def lyrics_cache
|
58
|
+
(%w[artist album title].map { |k| tag.send(k) } + [provider.identifier])
|
59
|
+
.inject(fs_cache) { |a, e| a.child(e) }
|
60
|
+
end
|
61
|
+
|
62
|
+
def number_uncached
|
63
|
+
previous.if_present(0, &:number) + 1
|
64
|
+
end
|
65
|
+
end
|
66
|
+
end
|
67
|
+
end
|
68
|
+
end
|
@@ -0,0 +1,65 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'ehbrs_ruby_utils/core_ext'
|
4
|
+
|
5
|
+
module EhbrsRubyUtils
|
6
|
+
module Music
|
7
|
+
class LyricsBook
|
8
|
+
require_sub __FILE__
|
9
|
+
|
10
|
+
DEFAULT_PROVIDER_NAME = 'lyrics.com'
|
11
|
+
DEFAULT_TITLE = 'Letras de músicas'
|
12
|
+
|
13
|
+
enable_listable
|
14
|
+
lists.add_symbol :option, :provider_name, :title
|
15
|
+
enable_simple_cache
|
16
|
+
common_constructor :source_dir, :options, default: [{}] do
|
17
|
+
self.source_dir = source_dir.to_pathname
|
18
|
+
self.options = self.class.lists.option.hash_keys_validate!(options)
|
19
|
+
end
|
20
|
+
|
21
|
+
def first_previous
|
22
|
+
nil
|
23
|
+
end
|
24
|
+
|
25
|
+
def header_index
|
26
|
+
1
|
27
|
+
end
|
28
|
+
|
29
|
+
def output
|
30
|
+
erb_template('main.html.erb')
|
31
|
+
end
|
32
|
+
|
33
|
+
def path
|
34
|
+
source_dir
|
35
|
+
end
|
36
|
+
|
37
|
+
def title
|
38
|
+
options[OPTION_TITLE].if_present(DEFAULT_TITLE)
|
39
|
+
end
|
40
|
+
|
41
|
+
private
|
42
|
+
|
43
|
+
def albums_directories_uncached
|
44
|
+
r = []
|
45
|
+
t = ::EacRubyUtils::Fs::Traverser.new
|
46
|
+
t.recursive = true
|
47
|
+
t.check_directory = ->(directory) { r << directory }
|
48
|
+
t.check_path(source_dir)
|
49
|
+
r
|
50
|
+
end
|
51
|
+
|
52
|
+
def albums_uncached
|
53
|
+
::EhbrsRubyUtils::Music::LyricsBook::Album.create_list(self, albums_directories)
|
54
|
+
end
|
55
|
+
|
56
|
+
def provider_uncached
|
57
|
+
::UltimateLyrics::Provider.by_name(provider_name)
|
58
|
+
end
|
59
|
+
|
60
|
+
def provider_name
|
61
|
+
options[OPTION_PROVIDER_NAME].if_present(DEFAULT_PROVIDER_NAME)
|
62
|
+
end
|
63
|
+
end
|
64
|
+
end
|
65
|
+
end
|
@@ -4,23 +4,49 @@ require 'eac_ruby_utils/core_ext'
|
|
4
4
|
require 'ehbrs_ruby_utils/executables'
|
5
5
|
require 'ehbrs_ruby_utils/videos/stream'
|
6
6
|
require 'json'
|
7
|
+
require 'taglib'
|
8
|
+
require 'ultimate_lyrics/provider_search'
|
9
|
+
require 'ultimate_lyrics/song_metadata'
|
7
10
|
|
8
11
|
module EhbrsRubyUtils
|
9
12
|
module Videos
|
10
13
|
class Container
|
14
|
+
class << self
|
15
|
+
def from_file(path)
|
16
|
+
new(path)
|
17
|
+
end
|
18
|
+
end
|
19
|
+
|
11
20
|
enable_simple_cache
|
12
21
|
common_constructor :path do
|
13
22
|
self.path = path.to_pathname
|
14
23
|
end
|
15
24
|
|
25
|
+
delegate :tag, to: :tag_file
|
26
|
+
delegate :to_s, to: :path
|
27
|
+
|
16
28
|
::EhbrsRubyUtils::Videos::Stream.lists.codec_type.each_value do |stream_type|
|
17
29
|
define_method stream_type.to_s.pluralize do
|
18
30
|
streams.select { |stream| stream.codec_type == stream_type }
|
19
31
|
end
|
20
32
|
end
|
21
33
|
|
34
|
+
# @param provider [UltimateLyrics::Provider]
|
35
|
+
# @return [UltimateLyrics::Lyrics]
|
36
|
+
def lyrics_by_provider(provider)
|
37
|
+
::UltimateLyrics::ProviderSearch.new(provider, song_metadata).lyrics
|
38
|
+
end
|
39
|
+
|
22
40
|
private
|
23
41
|
|
42
|
+
# @return [UltimateLyrics::SongMetadata]
|
43
|
+
def song_metadata_uncached
|
44
|
+
::UltimateLyrics::SongMetadata.new(
|
45
|
+
::UltimateLyrics::SongMetadata::Field.lists.sources.values
|
46
|
+
.map { |source| [source, tag.send(source)] }.to_h
|
47
|
+
)
|
48
|
+
end
|
49
|
+
|
24
50
|
def probe_data_uncached
|
25
51
|
::JSON.parse(
|
26
52
|
::EhbrsRubyUtils::Executables.ffprobe.command(
|
@@ -34,6 +60,11 @@ module EhbrsRubyUtils
|
|
34
60
|
::EhbrsRubyUtils::Videos::Stream.new(stream_ffprobe_data)
|
35
61
|
end
|
36
62
|
end
|
63
|
+
|
64
|
+
# @return [TagLib::FileRef]
|
65
|
+
def tag_file_uncached
|
66
|
+
::TagLib::FileRef.new(path.to_path)
|
67
|
+
end
|
37
68
|
end
|
38
69
|
end
|
39
70
|
end
|
@@ -0,0 +1,24 @@
|
|
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.2/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-EVSTQN3/azprG1Anm3QDgpJLIm9Nao0Yz1ztcQTwFspd3yD65VohhpuuCOmLASjC" crossorigin="anonymous">
|
8
|
+
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.0.2/dist/js/bootstrap.bundle.min.js" integrity="sha384-MrcW6ZMFYlzcLA8Nl+NtUVF0sA7MsXsP1UyJoMp4YLEuNSfAP+JcXn/tWtIaxVXM" crossorigin="anonymous"></script>
|
9
|
+
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.5.0/font/bootstrap-icons.css">
|
10
|
+
<style>
|
11
|
+
<%= template.child('custom_style.css').content %>
|
12
|
+
</style>
|
13
|
+
</head>
|
14
|
+
<body>
|
15
|
+
<div class="container" >
|
16
|
+
<h1><%= title %></h1>
|
17
|
+
<h2>Índice</h2>
|
18
|
+
<%= erb_template('index.html.erb') %>
|
19
|
+
<% albums.each do |album| %>
|
20
|
+
<%= album.output_main %>
|
21
|
+
<% end %>
|
22
|
+
</div>
|
23
|
+
</body>
|
24
|
+
</html>
|
data/vendor/ehbrs_ruby_utils/template/ehbrs_ruby_utils/music/lyrics_book/resource/main.html.erb
ADDED
@@ -0,0 +1,8 @@
|
|
1
|
+
<div class="<%= type %>">
|
2
|
+
<h<%= header_index %> id='<%= header_id %>' >
|
3
|
+
<%= header_title %>
|
4
|
+
<a href="#<%= index_id %>" ><i class="bi-arrow-up-circle-fill"></i></a>
|
5
|
+
</h<%= header_index %>>
|
6
|
+
<span class="filename"><%= filename %></span>
|
7
|
+
<%= erb_template('inner.html.erb') %>
|
8
|
+
</div>
|