ehbrs-tools 0.24.0 → 0.27.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 +286 -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 -22
- data/lib/ehbrs/tools/runner/music/lyrics.rb +69 -0
- data/lib/ehbrs/tools/runner/web_utils/videos/download.rb +20 -10
- data/lib/ehbrs/tools/runner/web_utils/videos/upload.rb +1 -1
- data/lib/ehbrs/tools/version.rb +1 -1
- 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 +61 -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 +3 -2
- data/vendor/aranha-parsers/lib/aranha/parsers/rspec/setup.rb +15 -0
- 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_docker/eac_docker.gemspec +2 -2
- data/vendor/eac_docker/lib/eac_docker/rspec/setup.rb +17 -0
- data/vendor/eac_docker/lib/eac_docker/version.rb +1 -1
- data/vendor/eac_ruby_utils/eac_ruby_utils.gemspec +1 -1
- data/vendor/eac_ruby_utils/lib/eac_ruby_utils/compact.rb +22 -0
- data/vendor/eac_ruby_utils/lib/eac_ruby_utils/fs_cache.rb +1 -1
- data/vendor/eac_ruby_utils/lib/eac_ruby_utils/gems_registry/gem.rb +36 -0
- data/vendor/eac_ruby_utils/lib/eac_ruby_utils/gems_registry.rb +2 -3
- 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/recursive_builder.rb +51 -0
- data/vendor/eac_ruby_utils/lib/eac_ruby_utils/rspec/default_setup.rb +4 -2
- data/vendor/eac_ruby_utils/lib/eac_ruby_utils/rspec/setup/conditionals.rb +17 -0
- data/vendor/eac_ruby_utils/lib/eac_ruby_utils/rspec/setup.rb +4 -37
- data/vendor/eac_ruby_utils/lib/eac_ruby_utils/rspec/setup_manager.rb +49 -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_ruby_utils/spec/lib/eac_ruby_utils/recursive_builder_spec.rb +65 -0
- data/vendor/ehbrs_ruby_utils/ehbrs_ruby_utils.gemspec +6 -1
- 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/{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/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/lib/ehbrs_ruby_utils/web_utils/videos/file/rename.rb +28 -0
- data/vendor/ehbrs_ruby_utils/lib/ehbrs_ruby_utils/web_utils/videos/file.rb +11 -8
- 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 +92 -0
- data/vendor/ultimate_lyrics/lib/ultimate_lyrics/provider_search.rb +43 -0
- data/vendor/ultimate_lyrics/lib/ultimate_lyrics/providers_data.xml +355 -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 +5 -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 +1298 -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 +168 -11
- data/vendor/aranha-parsers/lib/aranha/parsers/rspec/setup_include.rb +0 -17
- data/vendor/eac_docker/lib/eac_docker/rspec/setup_include.rb +0 -23
- data/vendor/eac_ruby_utils/lib/eac_ruby_utils/rspec/conditional.rb +0 -35
- data/vendor/eac_ruby_utils/lib/eac_ruby_utils/rspec/stubbed_ssh.rb +0 -44
@@ -0,0 +1,28 @@
|
|
1
|
+
|
2
|
+
Dump of file /home/eduardo/storage/roms/wii/disk/wbfs/SUPER MARIO GALAXY [RMGE01]/RMGE01.wbfs/#0
|
3
|
+
|
4
|
+
Real path: /mnt/storage/eduardo/roms/wii/disk/wbfs/SUPER MARIO GALAXY [RMGE01]/RMGE01.wbfs/#0
|
5
|
+
Virtual size: 118240000/hex = 4699979776 = 4482 MiB
|
6
|
+
Scrubbed size: d0b28000/hex = 3501359104 = 3339 MiB, 74.5%, 106853*32K
|
7
|
+
WBFS file size: d1200000/hex = 3508535296 = 3346 MiB, 74.7%, 100.2%
|
8
|
+
WBFS fragments: 1+0 = a ratio of 0.00 additional_fragments/GiB
|
9
|
+
File & disc type: WBFS/WII & Wii
|
10
|
+
Disc & part IDs: disc=RMGE01, ticket=RMGE, tmd=RMGE, boot=RMGE01, wbfs=RMGE01
|
11
|
+
Disc name: SUPER MARIO GALAXY
|
12
|
+
DB title: Super Mario Galaxy
|
13
|
+
ID Region: NTSC/USA [USA ]
|
14
|
+
Region setting: 1 [USA] / Jap=128 USA=6 ?=128 Eur=128,128,128,128,128,128 Kor=128
|
15
|
+
System version: 00000001-00000021 = IOS 0x21 = IOS 33
|
16
|
+
Partitions: 1 [encrypted, scrubbed, well signed]
|
17
|
+
Directories: 79
|
18
|
+
Files: 2383
|
19
|
+
|
20
|
+
1 partition table with 1 partition:
|
21
|
+
|
22
|
+
index type offset .. end off size/hex = size/dec = MiB status
|
23
|
+
----------------------------------------------------------------------------------------
|
24
|
+
0 part.tab 40020 .. 40028 8 = 8 1 partition
|
25
|
+
----------------------------------------------------------------------------------------
|
26
|
+
0.0 DATA 0 f800000 .. 1173c0000 107bc0000 = 4424728576 = 4220 enc,signed,scrub
|
27
|
+
----------------------------------------------------------------------------------------
|
28
|
+
|
@@ -0,0 +1,23 @@
|
|
1
|
+
---
|
2
|
+
Real path: "/mnt/storage/eduardo/roms/wii/disk/wbfs/SUPER MARIO GALAXY [RMGE01]/RMGE01.wbfs/#0"
|
3
|
+
Virtual size: 118240000/hex = 4699979776 = 4482 MiB
|
4
|
+
Scrubbed size: d0b28000/hex = 3501359104 = 3339 MiB, 74.5%, 106853*32K
|
5
|
+
WBFS file size: d1200000/hex = 3508535296 = 3346 MiB, 74.7%, 100.2%
|
6
|
+
WBFS fragments: 1+0 = a ratio of 0.00 additional_fragments/GiB
|
7
|
+
File & disc type/type: WBFS
|
8
|
+
File & disc type/platform_acronym: WII
|
9
|
+
File & disc type/type_extra:
|
10
|
+
File & disc type/platform_name: Wii
|
11
|
+
Disc & part IDs/disc: RMGE01
|
12
|
+
Disc & part IDs/ticket: RMGE
|
13
|
+
Disc & part IDs/tmd: RMGE
|
14
|
+
Disc & part IDs/boot: RMGE01
|
15
|
+
Disc & part IDs/wbfs: RMGE01
|
16
|
+
Disc name: SUPER MARIO GALAXY
|
17
|
+
DB title: Super Mario Galaxy
|
18
|
+
ID Region: NTSC/USA [USA ]
|
19
|
+
Region setting: 1 [USA] / Jap=128 USA=6 ?=128 Eur=128,128,128,128,128,128 Kor=128
|
20
|
+
System version: 00000001-00000021 = IOS 0x21 = IOS 33
|
21
|
+
Partitions: 1 [encrypted, scrubbed, well signed]
|
22
|
+
Directories: '79'
|
23
|
+
Files: '2383'
|
@@ -0,0 +1,33 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'ehbrs/vg/wii/wit/path'
|
4
|
+
|
5
|
+
RSpec.describe ::Ehbrs::Vg::Wii::Wit::Path do
|
6
|
+
describe '#parse' do
|
7
|
+
context 'when type is present' do
|
8
|
+
let(:source) { 'WbFs:path/to/file.wbfs' }
|
9
|
+
let(:instance) { described_class.parse(source) }
|
10
|
+
|
11
|
+
it { expect(instance.type).to eq('WBFS') }
|
12
|
+
it { expect(instance.path.to_s).to eq('path/to/file.wbfs') }
|
13
|
+
end
|
14
|
+
|
15
|
+
context 'when type is blank' do
|
16
|
+
let(:source) { 'path/to/file.wbfs' }
|
17
|
+
let(:instance) { described_class.parse(source) }
|
18
|
+
|
19
|
+
it { expect(instance.type).to eq('') }
|
20
|
+
it { expect(instance.path.to_s).to eq('path/to/file.wbfs') }
|
21
|
+
end
|
22
|
+
end
|
23
|
+
|
24
|
+
describe '#change?' do
|
25
|
+
let(:with_type) { described_class.new('ISO', 'path/to/file.wbfs') }
|
26
|
+
let(:without_type) { described_class.new(nil, 'path/to/file.wbfs') }
|
27
|
+
|
28
|
+
it { expect(with_type.change?(without_type)).to eq(false) }
|
29
|
+
it { expect(without_type.change?(with_type)).to eq(true) }
|
30
|
+
|
31
|
+
context 'when'
|
32
|
+
end
|
33
|
+
end
|
@@ -0,0 +1,30 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'eac_ruby_utils/fs/temp'
|
4
|
+
|
5
|
+
::RSpec.configure do |config|
|
6
|
+
config.before do
|
7
|
+
videos_temp_dir
|
8
|
+
end
|
9
|
+
|
10
|
+
config.after do
|
11
|
+
videos_temp_dir.remove
|
12
|
+
end
|
13
|
+
|
14
|
+
def videos_temp_dir
|
15
|
+
@videos_temp_dir ||= ::EacRubyUtils::Fs::Temp.directory
|
16
|
+
end
|
17
|
+
|
18
|
+
def stub_video_source_file
|
19
|
+
@stub_video_source_file ||= ::Pathname.new(__dir__).join('videos_files', 'stub_source.mp4')
|
20
|
+
end
|
21
|
+
|
22
|
+
def stub_video(ffmpeg_args, output_path = nil)
|
23
|
+
output_path ||= videos_temp_dir.file
|
24
|
+
::Ehbrs::Executables.ffmpeg.command.append(
|
25
|
+
['-i', stub_video_source_file.to_s, *ffmpeg_args, output_path.to_s]
|
26
|
+
).execute!
|
27
|
+
|
28
|
+
output_path
|
29
|
+
end
|
30
|
+
end
|
Binary file
|
data/spec/spec_helper.rb
ADDED
@@ -15,9 +15,10 @@ Gem::Specification.new do |s|
|
|
15
15
|
s.add_dependency 'activesupport', '>= 4.0.0'
|
16
16
|
s.add_dependency 'addressable', '~> 2.7'
|
17
17
|
s.add_dependency 'curb', '~> 0.9.10'
|
18
|
-
s.add_dependency 'eac_ruby_utils', '~> 0.
|
18
|
+
s.add_dependency 'eac_ruby_utils', '~> 0.74'
|
19
19
|
s.add_dependency 'httpclient', '~> 2.8', '>= 2.8.3'
|
20
|
+
s.add_dependency 'nokogiri', '~> 1.12', '>= 1.12.4'
|
20
21
|
s.add_dependency 'ofx-parser', '~> 1.1.0'
|
21
22
|
|
22
|
-
s.add_development_dependency 'eac_ruby_gem_support', '~> 0.3'
|
23
|
+
s.add_development_dependency 'eac_ruby_gem_support', '~> 0.3', '>= 0.3.3'
|
23
24
|
end
|
@@ -0,0 +1,15 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'eac_ruby_utils/core_ext'
|
4
|
+
|
5
|
+
module Aranha
|
6
|
+
module Parsers
|
7
|
+
module Rspec
|
8
|
+
module Setup
|
9
|
+
def self.extended(_setup_obj)
|
10
|
+
require 'aranha/parsers/rspec/shared_examples/source_target_fixtures'
|
11
|
+
end
|
12
|
+
end
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
File without changes
|
@@ -2,6 +2,7 @@
|
|
2
2
|
|
3
3
|
require 'addressable'
|
4
4
|
require 'curb'
|
5
|
+
require 'aranha/parsers/source_address/fetch_content_error'
|
5
6
|
|
6
7
|
module Aranha
|
7
8
|
module Parsers
|
@@ -34,15 +35,27 @@ module Aranha
|
|
34
35
|
def content
|
35
36
|
c = ::Curl::Easy.new(url)
|
36
37
|
c.follow_location = true
|
37
|
-
|
38
|
+
curl_perform(c)
|
38
39
|
return c.body_str if c.status.to_i == 200
|
39
40
|
|
40
|
-
raise
|
41
|
+
raise ::Aranha::Parsers::SourceAddress::FetchContentError,
|
42
|
+
"Get #{url} returned #{c.status.to_i}"
|
41
43
|
end
|
42
44
|
|
43
45
|
def serialize
|
44
46
|
url
|
45
47
|
end
|
48
|
+
|
49
|
+
private
|
50
|
+
|
51
|
+
def curl_perform(curl)
|
52
|
+
unless curl.perform
|
53
|
+
raise(::Aranha::Parsers::SourceAddress::FetchContentError,
|
54
|
+
"Curl perform failed (URL: #{url})")
|
55
|
+
end
|
56
|
+
rescue Curl::Err::CurlError => e
|
57
|
+
raise ::Aranha::Parsers::SourceAddress::FetchContentError, "CURL error: #{e.class.name}"
|
58
|
+
end
|
46
59
|
end
|
47
60
|
end
|
48
61
|
end
|
@@ -18,7 +18,7 @@ module EacCli
|
|
18
18
|
|
19
19
|
enable_listable
|
20
20
|
enable_abstract_methods :build_value, :default_value
|
21
|
-
lists.add_symbol :option, :optional, :usage, :repeat, :required
|
21
|
+
lists.add_symbol :option, :default, :optional, :usage, :repeat, :required
|
22
22
|
common_constructor :short, :long, :description, :options, default: [{}] do
|
23
23
|
raise 'Nor short neither long selector was set' if short.blank? && long.blank?
|
24
24
|
|
@@ -27,6 +27,14 @@ module EacCli
|
|
27
27
|
)
|
28
28
|
end
|
29
29
|
|
30
|
+
def default_value
|
31
|
+
default_value? ? options[OPTION_DEFAULT] : default_default_value
|
32
|
+
end
|
33
|
+
|
34
|
+
def default_value?
|
35
|
+
options.key?(OPTION_DEFAULT)
|
36
|
+
end
|
37
|
+
|
30
38
|
def identifier
|
31
39
|
[long, short].each do |v|
|
32
40
|
v.to_s.if_present { |vv| return vv.variableize.to_sym }
|
@@ -36,9 +36,9 @@ module EacCli
|
|
36
36
|
end
|
37
37
|
|
38
38
|
def option_definition(option)
|
39
|
-
self.class.option_usage_full(option)
|
40
|
-
|
41
|
-
|
39
|
+
[self.class.option_usage_full(option), option.description,
|
40
|
+
option.default_value? ? "[Default: \"#{option.default_value}\"]" : nil]
|
41
|
+
.reject(&:blank?).join(OPTION_DESC_SEP)
|
42
42
|
end
|
43
43
|
|
44
44
|
def section(header, include_header = true)
|
@@ -13,6 +13,7 @@ RSpec.describe ::EacCli::Runner do
|
|
13
13
|
bool_opt '-p', '--opt2', 'A boolean option'
|
14
14
|
arg_opt '-q', '--opt4', 'A repeatable argument option.', repeat: true
|
15
15
|
bool_opt '-r', '--opt5', 'A repeatable boolean option', repeat: true
|
16
|
+
arg_opt '-s', '--opt6', 'A argument option with default value', default: 'DEFAULT'
|
16
17
|
pos_arg :pos1
|
17
18
|
pos_arg :pos2, repeat: true, optional: true
|
18
19
|
alt do
|
@@ -28,9 +29,9 @@ RSpec.describe ::EacCli::Runner do
|
|
28
29
|
let(:parsed_actual) { instance.parsed.to_h.symbolize_keys }
|
29
30
|
|
30
31
|
context 'when all args are supplied' do
|
31
|
-
let(:argv) { %w[--opt1 aaa --opt2 bbb ccc ddd] }
|
32
|
+
let(:argv) { %w[--opt1 aaa --opt2 bbb ccc ddd --opt6 6] }
|
32
33
|
let(:parsed_expected) do
|
33
|
-
{ opt1: 'aaa', opt2: true, opt3: false, opt4: [], opt5: 0, pos1: 'bbb',
|
34
|
+
{ opt1: 'aaa', opt2: true, opt3: false, opt4: [], opt5: 0, opt6: '6', pos1: 'bbb',
|
34
35
|
pos2: %w[ccc ddd] }
|
35
36
|
end
|
36
37
|
|
@@ -65,7 +66,7 @@ RSpec.describe ::EacCli::Runner do
|
|
65
66
|
context 'when only required args are supplied' do
|
66
67
|
let(:argv) { %w[bbb] }
|
67
68
|
let(:parsed_expected) do
|
68
|
-
{ opt1: nil, opt2: false, opt3: false, opt4: [], opt5: 0, pos1: 'bbb',
|
69
|
+
{ opt1: nil, opt2: false, opt3: false, opt4: [], opt5: 0, opt6: 'DEFAULT', pos1: 'bbb',
|
69
70
|
pos2: [] }
|
70
71
|
end
|
71
72
|
|
@@ -87,7 +88,7 @@ RSpec.describe ::EacCli::Runner do
|
|
87
88
|
context 'when alternative args are supplied' do
|
88
89
|
let(:argv) { %w[--opt3] }
|
89
90
|
let(:parsed_expected) do
|
90
|
-
{ opt1: nil, opt2: false, opt3: true, opt4: [], opt5: 0, pos1: nil,
|
91
|
+
{ opt1: nil, opt2: false, opt3: true, opt4: [], opt5: 0, opt6: 'DEFAULT', pos1: nil,
|
91
92
|
pos2: [] }
|
92
93
|
end
|
93
94
|
|
@@ -98,7 +99,7 @@ RSpec.describe ::EacCli::Runner do
|
|
98
99
|
context 'when repeated options are supplied' do
|
99
100
|
let(:argv) { %w[--opt5 -rrr --opt4=A -q B --opt4 C AAA] }
|
100
101
|
let(:parsed_expected) do
|
101
|
-
{ opt1: nil, opt2: false, opt3: false, opt4: %w[A B C], opt5: 4, pos1: 'AAA',
|
102
|
+
{ opt1: nil, opt2: false, opt3: false, opt4: %w[A B C], opt5: 4, opt6: 'DEFAULT', pos1: 'AAA',
|
102
103
|
pos2: [] }
|
103
104
|
end
|
104
105
|
|
@@ -12,8 +12,8 @@ Gem::Specification.new do |s|
|
|
12
12
|
|
13
13
|
s.files = Dir['{lib}/**/*']
|
14
14
|
|
15
|
-
s.add_dependency 'eac_ruby_utils', '~> 0.
|
15
|
+
s.add_dependency 'eac_ruby_utils', '~> 0.74'
|
16
16
|
s.add_dependency 'eac_templates', '~> 0.1'
|
17
17
|
|
18
|
-
s.add_development_dependency 'eac_ruby_gem_support', '~> 0.3'
|
18
|
+
s.add_development_dependency 'eac_ruby_gem_support', '~> 0.3', '>= 0.3.3'
|
19
19
|
end
|
@@ -0,0 +1,17 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'eac_docker/executables'
|
4
|
+
|
5
|
+
module EacDocker
|
6
|
+
module Rspec
|
7
|
+
module Setup
|
8
|
+
def self.extended(obj)
|
9
|
+
obj.setup_conditional_docker_executable
|
10
|
+
end
|
11
|
+
|
12
|
+
def setup_conditional_docker_executable
|
13
|
+
conditional(:docker) { ::EacDocker::Executables.docker.validate }
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
@@ -19,5 +19,5 @@ Gem::Specification.new do |s|
|
|
19
19
|
s.add_dependency 'addressable', '~> 2.6'
|
20
20
|
s.add_dependency 'filesize'
|
21
21
|
s.add_dependency 'net-ssh', '~> 4.2'
|
22
|
-
s.add_development_dependency 'eac_ruby_gem_support', '~> 0.3'
|
22
|
+
s.add_development_dependency 'eac_ruby_gem_support', '~> 0.3', '>= 0.3.2'
|
23
23
|
end
|
@@ -0,0 +1,22 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module EacRubyUtils
|
4
|
+
class Compact
|
5
|
+
attr_reader :object, :attributes
|
6
|
+
|
7
|
+
def initialize(object, attributes)
|
8
|
+
@object = object
|
9
|
+
@attributes = attributes
|
10
|
+
end
|
11
|
+
|
12
|
+
# @return [Array]
|
13
|
+
def to_a
|
14
|
+
attributes.map { |attr| object.send(attr) }
|
15
|
+
end
|
16
|
+
|
17
|
+
# @return [Hash]
|
18
|
+
def to_h
|
19
|
+
attributes.map { |attr| [attr.to_sym, object.send(attr)] }.to_h
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
@@ -6,7 +6,7 @@ require 'tmpdir'
|
|
6
6
|
module EacRubyUtils
|
7
7
|
class << self
|
8
8
|
def fs_cache
|
9
|
-
@fs_cache ||= ::EacRubyUtils::FilesystemCache.new(::Dir.tmpdir, '
|
9
|
+
@fs_cache ||= ::EacRubyUtils::FilesystemCache.new(::Dir.tmpdir, 'eac_ruby_utils_fs_cache')
|
10
10
|
end
|
11
11
|
end
|
12
12
|
end
|
@@ -1,10 +1,15 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
3
|
require 'active_support/core_ext/string/inflections'
|
4
|
+
require 'eac_ruby_utils/recursive_builder'
|
5
|
+
require 'eac_ruby_utils/simple_cache'
|
4
6
|
|
5
7
|
module EacRubyUtils
|
6
8
|
class GemsRegistry
|
7
9
|
class Gem
|
10
|
+
include ::Comparable
|
11
|
+
include ::EacRubyUtils::SimpleCache
|
12
|
+
|
8
13
|
attr_reader :registry, :gemspec
|
9
14
|
|
10
15
|
def initialize(registry, gemspec)
|
@@ -12,6 +17,23 @@ module EacRubyUtils
|
|
12
17
|
@gemspec = gemspec
|
13
18
|
end
|
14
19
|
|
20
|
+
def depend_on(gem)
|
21
|
+
dependencies.lazy.map(&:name).include?(gem.gemspec.name)
|
22
|
+
end
|
23
|
+
|
24
|
+
def dependencies
|
25
|
+
@dependencies ||= dependencies_uncached # dependencies_uncached
|
26
|
+
end
|
27
|
+
|
28
|
+
def <=>(other)
|
29
|
+
sd = depend_on(other)
|
30
|
+
od = other.depend_on(self)
|
31
|
+
return 1 if sd && !od
|
32
|
+
return -1 if od && !sd
|
33
|
+
|
34
|
+
gemspec.name <=> other.gemspec.name
|
35
|
+
end
|
36
|
+
|
15
37
|
def found?
|
16
38
|
lib_file_found? && registered_module.is_a?(::Module)
|
17
39
|
end
|
@@ -34,6 +56,20 @@ module EacRubyUtils
|
|
34
56
|
def path_to_require
|
35
57
|
gemspec.name.gsub('-', '/') + '/' + registry.module_suffix.underscore
|
36
58
|
end
|
59
|
+
|
60
|
+
private
|
61
|
+
|
62
|
+
def dependencies_uncached
|
63
|
+
::EacRubyUtils::RecursiveBuilder
|
64
|
+
.new(gemspec) { |item| gem_item_dependencies(item) }
|
65
|
+
.result
|
66
|
+
end
|
67
|
+
|
68
|
+
def gem_item_dependencies(item)
|
69
|
+
::Gem::Specification.find_by_name(item.name).dependencies
|
70
|
+
rescue ::Gem::MissingSpecError
|
71
|
+
[]
|
72
|
+
end
|
37
73
|
end
|
38
74
|
end
|
39
75
|
end
|
@@ -28,9 +28,8 @@ module EacRubyUtils
|
|
28
28
|
|
29
29
|
# @return [Array<EacRubyUtils::GemsRegistry::Gem>]
|
30
30
|
def all_gems
|
31
|
-
::Gem::Specification.map
|
32
|
-
|
33
|
-
end
|
31
|
+
::Gem::Specification.map { |gemspec| ::EacRubyUtils::GemsRegistry::Gem.new(self, gemspec) }
|
32
|
+
.sort
|
34
33
|
end
|
35
34
|
end
|
36
35
|
end
|
@@ -0,0 +1,20 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'eac_ruby_utils/compact'
|
4
|
+
|
5
|
+
class Object
|
6
|
+
# @return [EacRubyUtils::Compact]
|
7
|
+
def compact(*attributes)
|
8
|
+
::EacRubyUtils::Compact.new(self, attributes)
|
9
|
+
end
|
10
|
+
|
11
|
+
# @return [Array]
|
12
|
+
def compact_to_a(*attributes)
|
13
|
+
compact(*attributes).to_a
|
14
|
+
end
|
15
|
+
|
16
|
+
# @return [Hash]
|
17
|
+
def compact_to_h(*attributes)
|
18
|
+
compact(*attributes).to_h
|
19
|
+
end
|
20
|
+
end
|
@@ -0,0 +1,16 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'eac_ruby_utils/string_delimited'
|
4
|
+
|
5
|
+
class String
|
6
|
+
# @return [EacRubyUtils::StringDelimited]
|
7
|
+
def delimited(begin_delimiter, end_delimiter)
|
8
|
+
::EacRubyUtils::StringDelimited.new(self, begin_delimiter, end_delimiter)
|
9
|
+
end
|
10
|
+
|
11
|
+
%w[inner outer without_inner without_outer].each do |method_suffix|
|
12
|
+
define_method "delimited_#{method_suffix}" do |begin_delimiter, end_delimiter|
|
13
|
+
delimited(begin_delimiter, end_delimiter).send(method_suffix)
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
@@ -0,0 +1,51 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'eac_ruby_utils/simple_cache'
|
4
|
+
|
5
|
+
module EacRubyUtils
|
6
|
+
class RecursiveBuilder
|
7
|
+
include ::EacRubyUtils::SimpleCache
|
8
|
+
|
9
|
+
attr_reader :root, :neighbors_block
|
10
|
+
|
11
|
+
def initialize(root, &neighbors_block)
|
12
|
+
@root = root
|
13
|
+
@neighbors_block = neighbors_block
|
14
|
+
end
|
15
|
+
|
16
|
+
private
|
17
|
+
|
18
|
+
attr_reader :added, :to_check
|
19
|
+
|
20
|
+
def result_uncached
|
21
|
+
@added = []
|
22
|
+
@to_check = []
|
23
|
+
item_try_add_to_check(root)
|
24
|
+
while check_next_item
|
25
|
+
# Do nothing
|
26
|
+
end
|
27
|
+
added
|
28
|
+
end
|
29
|
+
|
30
|
+
def item_try_add_to_check(item)
|
31
|
+
to_check << item unless item_added?(item)
|
32
|
+
end
|
33
|
+
|
34
|
+
def item_added?(item)
|
35
|
+
added.include?(item) || to_check.include?(item)
|
36
|
+
end
|
37
|
+
|
38
|
+
def check_next_item
|
39
|
+
return false unless to_check.any?
|
40
|
+
|
41
|
+
item = to_check.shift
|
42
|
+
added << item
|
43
|
+
item_neighborhs(item).each { |sub_item| item_try_add_to_check(sub_item) }
|
44
|
+
true
|
45
|
+
end
|
46
|
+
|
47
|
+
def item_neighborhs(item)
|
48
|
+
neighbors_block.call(item)
|
49
|
+
end
|
50
|
+
end
|
51
|
+
end
|
@@ -1,17 +1,19 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
require 'eac_ruby_utils/rspec/
|
3
|
+
require 'eac_ruby_utils/rspec/setup_manager'
|
4
4
|
|
5
5
|
module EacRubyUtils
|
6
6
|
module Rspec
|
7
7
|
class << self
|
8
|
+
# @return [EacRubyUtils::Rspec::SetupManager]
|
8
9
|
def default_setup
|
9
10
|
@default_setup ||
|
10
11
|
raise("Default instance was not set. Use #{self.class.name}.default_setup_create")
|
11
12
|
end
|
12
13
|
|
14
|
+
# @return [EacRubyUtils::Rspec::SetupManager]
|
13
15
|
def default_setup_create(app_root_path, rspec_config = nil)
|
14
|
-
@default_setup = ::EacRubyUtils::Rspec::
|
16
|
+
@default_setup = ::EacRubyUtils::Rspec::SetupManager.create(app_root_path, rspec_config)
|
15
17
|
end
|
16
18
|
end
|
17
19
|
end
|
@@ -0,0 +1,17 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module EacRubyUtils
|
4
|
+
module Rspec
|
5
|
+
module Setup
|
6
|
+
module Conditionals
|
7
|
+
def conditional(tag, &condition)
|
8
|
+
message = condition.call
|
9
|
+
return if message.blank?
|
10
|
+
|
11
|
+
puts("[WARN] Excluded tag: #{tag}: #{message}")
|
12
|
+
rspec_config.filter_run_excluding tag
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|