ehbrs_ruby_utils 0.8.0 → 0.11.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (30) hide show
  1. checksums.yaml +4 -4
  2. data/.rspec +1 -0
  3. data/.rubocop.yml +31 -0
  4. data/lib/ehbrs_ruby_utils/fs/compressed_package.rb +48 -0
  5. data/lib/ehbrs_ruby_utils/fs/selected/build.rb +41 -0
  6. data/lib/ehbrs_ruby_utils/fs/selected/build_file.rb +27 -0
  7. data/lib/ehbrs_ruby_utils/fs/selected.rb +35 -0
  8. data/lib/ehbrs_ruby_utils/fs.rb +10 -0
  9. data/lib/ehbrs_ruby_utils/music.rb +9 -0
  10. data/lib/ehbrs_ruby_utils/version.rb +1 -1
  11. data/lib/ehbrs_ruby_utils/videos/container.rb +31 -0
  12. data/lib/ehbrs_ruby_utils/videos/stream.rb +1 -1
  13. data/spec/lib/ehbrs_ruby_utils/videos/resolution_spec.rb +18 -0
  14. data/spec/lib/ehbrs_ruby_utils/videos/stream_spec.rb +13 -0
  15. data/spec/lib/ehbrs_ruby_utils/videos/stream_spec_files/menina_ovo_attachment.source.yaml +28 -0
  16. data/spec/lib/ehbrs_ruby_utils/videos/stream_spec_files/menina_ovo_attachment.target.yaml +7 -0
  17. data/spec/lib/ehbrs_ruby_utils/videos/stream_spec_files/menina_ovo_audio.source.yaml +49 -0
  18. data/spec/lib/ehbrs_ruby_utils/videos/stream_spec_files/menina_ovo_audio.target.yaml +7 -0
  19. data/spec/lib/ehbrs_ruby_utils/videos/stream_spec_files/menina_ovo_subtitle.source.yaml +43 -0
  20. data/spec/lib/ehbrs_ruby_utils/videos/stream_spec_files/menina_ovo_subtitle.target.yaml +7 -0
  21. data/spec/lib/ehbrs_ruby_utils/videos/stream_spec_files/menina_ovo_video.source.yaml +59 -0
  22. data/spec/lib/ehbrs_ruby_utils/videos/stream_spec_files/menina_ovo_video.target.yaml +7 -0
  23. data/spec/rubocop_check_spec.rb +3 -0
  24. data/spec/spec_helper.rb +4 -0
  25. data/template/ehbrs_ruby_utils/finances/bb_browser/docker_image/Dockerfile +44 -0
  26. data/template/ehbrs_ruby_utils/finances/bb_browser/docker_image/Makefile +35 -0
  27. data/template/ehbrs_ruby_utils/finances/bb_browser/docker_image/README.md +16 -0
  28. data/template/ehbrs_ruby_utils/finances/bb_browser/docker_image/context/firefox.service +8 -0
  29. data/template/ehbrs_ruby_utils/finances/bb_browser/docker_image/context/startbrowser.sh +9 -0
  30. metadata +110 -3
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 61330d9b4828f3813d1430120407527b77f13c1525446441bac3e818b93134a0
4
- data.tar.gz: ce61e87673cf8e01fa96df9aea63b45829004b9305d0e141f9a764252665edb1
3
+ metadata.gz: 230878af735547a11e32b70f8c142dcc5adb581ea9b00ced816b7944b16ca532
4
+ data.tar.gz: e28ef687a67b61e17066721e725cfdb6fe8daa62f886e513f1750f4a013a4835
5
5
  SHA512:
6
- metadata.gz: 83fee97906fc1ed7dd110f4c59e4dea81a11efd1697b275691b31b0d34b8326c534f29b069b1647a5eda03d1ef5eebf8fe51ab130dbe97c3a8a83f2e73f7927f
7
- data.tar.gz: fd6dc95bb3e4ed3b6c536d1f46b3b2e7d605d72e706890140a5cf7034599677d038bb08818889b7020df7899787949c2e3f0a88029b4d4677697775de3d924ab
6
+ metadata.gz: 9663bc98612d1f83e1654a3f518c6319d12395528c01392049360fc2eca89c727e7c5e8d4acfec04ba8062bf6601cbebc45576203ac78adf3f15b3826c303d67
7
+ data.tar.gz: '0805245a0e679bfdeeb3be0d621acd8daa5765042e697922d6e75c69f9d58c8fed91e7722ea4903cf3f97106a10b737a950f5f02210c3d6d2c2d5aff2dbba752'
data/.rspec ADDED
@@ -0,0 +1 @@
1
+ --require spec_helper
data/.rubocop.yml ADDED
@@ -0,0 +1,31 @@
1
+ require:
2
+ - rubocop-rails
3
+ - rubocop-rspec
4
+
5
+ AllCops:
6
+ TargetRubyVersion: 2.4
7
+
8
+ Layout/LineLength:
9
+ Max: 100
10
+
11
+ Metrics/BlockLength:
12
+ Exclude:
13
+ - 'spec/**/*_spec.rb'
14
+
15
+ Style/Documentation:
16
+ Enabled: false
17
+
18
+ Style/AsciiComments:
19
+ Enabled: false
20
+
21
+ Style/HashEachMethods:
22
+ Enabled: true
23
+
24
+ Style/HashTransformKeys:
25
+ Enabled: true
26
+
27
+ Style/HashTransformValues:
28
+ Enabled: true
29
+
30
+ Layout/MultilineMethodCallIndentation:
31
+ EnforcedStyle: indented_relative_to_receiver
@@ -0,0 +1,48 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'avm/files/info'
4
+ require 'eac_ruby_utils/core_ext'
5
+
6
+ module EhbrsRubyUtils
7
+ module Fs
8
+ class CompressedPackage < ::Avm::Files::Info
9
+ MIME_TYPES = {
10
+ 'application/zip' => :zip,
11
+ 'application/x-7z-compressed' => :sevenzip,
12
+ 'application/x-rar' => :rar,
13
+ 'application/x-tar' => :tar
14
+ }.freeze
15
+
16
+ def extract_to(target)
17
+ target = target.to_pathname
18
+ target.mkpath
19
+ sub_extract_to(target)
20
+ end
21
+
22
+ private
23
+
24
+ def sub_extract_to(target)
25
+ MIME_TYPES[content_type.mime_type].if_present do |v|
26
+ return send("#{v}_extract_command", target).execute!
27
+ end
28
+ raise "Unknown how to extract \"#{path}\" (#{content_type})"
29
+ end
30
+
31
+ def sevenzip_extract_command(target_dir)
32
+ ::Ehbrs::Executables.sevenzip.command('x', path, '-o', target_dir)
33
+ end
34
+
35
+ def tar_extract_command(target_dir)
36
+ ::Ehbrs::Executables.tar.command('-xf', path, '-C', target_dir)
37
+ end
38
+
39
+ def rar_extract_command(target_dir)
40
+ ::Ehbrs::Executables.rar.command('x', path.expand_path).chdir(target_dir)
41
+ end
42
+
43
+ def zip_extract_command(target_dir)
44
+ ::Ehbrs::Executables.unzip.command(path, '-d', target_dir)
45
+ end
46
+ end
47
+ end
48
+ end
@@ -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 { |basename| basename }
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.basename.to_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)
20
+ ::EhbrsRubyUtils::Fs::Selected::Build.new(self, target_dir)
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,10 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'eac_ruby_utils/core_ext'
4
+
5
+ module EhbrsRubyUtils
6
+ # Filesystem utilities.
7
+ module Fs
8
+ require_sub __FILE__
9
+ end
10
+ end
@@ -0,0 +1,9 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'eac_ruby_utils/core_ext'
4
+
5
+ module EhbrsRubyUtils
6
+ module Music
7
+ require_sub __FILE__
8
+ end
9
+ end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module EhbrsRubyUtils
4
- VERSION = '0.8.0'
4
+ VERSION = '0.11.0'
5
5
  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
@@ -35,7 +35,7 @@ module EhbrsRubyUtils
35
35
  end
36
36
  end
37
37
 
38
- %i[codec_name codec_long_name].each do |method_name|
38
+ %i[codec_name codec_long_name height width].each do |method_name|
39
39
  define_method method_name do
40
40
  ffprobe_data[method_name]
41
41
  end
@@ -0,0 +1,18 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'ehbrs_ruby_utils/videos/resolution'
4
+
5
+ RSpec.describe ::EhbrsRubyUtils::Videos::Resolution do
6
+ describe '#quality' do
7
+ { [500, 720] => 480, [1080, 720] => 720, [1, 1] => 240, [9999, 9999] => 2160,
8
+ [480, 420] => 240, [480, 421] => 480 }.each do |resolution_parts, quality_height|
9
+ context "when resolution is #{described_class.new(*resolution_parts).to_xs}" do
10
+ let(:instance) { described_class.new(*resolution_parts) }
11
+
12
+ it "quality is #{::EhbrsRubyUtils::Videos::Quality.by_height(quality_height).to_xs}" do
13
+ expect(instance.quality.height).to eq(quality_height)
14
+ end
15
+ end
16
+ end
17
+ end
18
+ end
@@ -0,0 +1,13 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'ehbrs_ruby_utils/videos/stream'
4
+
5
+ RSpec.describe ::EhbrsRubyUtils::Videos::Stream do
6
+ include_examples 'source_target_fixtures', __FILE__
7
+
8
+ def source_data(source_file)
9
+ instance = described_class.new(::YAML.load_file(source_file))
10
+ %w[codec_name codec_long_name codec_type index language title]
11
+ .map { |k| [k.to_sym, instance.send(k)] }.sort.to_h
12
+ end
13
+ end
@@ -0,0 +1,28 @@
1
+ ---
2
+ :index: 19
3
+ :codec_type: attachment
4
+ :codec_tag_string: "[0][0][0][0]"
5
+ :codec_tag: '0x0000'
6
+ :r_frame_rate: 0/0
7
+ :avg_frame_rate: 0/0
8
+ :time_base: 1/90000
9
+ :start_pts: 0
10
+ :start_time: '0.000000'
11
+ :duration_ts: 383973120
12
+ :duration: '4266.368000'
13
+ :disposition:
14
+ :default: 0
15
+ :dub: 0
16
+ :original: 0
17
+ :comment: 0
18
+ :lyrics: 0
19
+ :karaoke: 0
20
+ :forced: 0
21
+ :hearing_impaired: 0
22
+ :visual_impaired: 0
23
+ :clean_effects: 0
24
+ :attached_pic: 0
25
+ :timed_thumbnails: 0
26
+ :tags:
27
+ :filename: encoding-source-code.7z
28
+ :mimetype: application/octet-stream
@@ -0,0 +1,7 @@
1
+ ---
2
+ :codec_long_name:
3
+ :codec_name:
4
+ :codec_type: :attachment
5
+ :index: 19
6
+ :language:
7
+ :title:
@@ -0,0 +1,49 @@
1
+ ---
2
+ :index: 18
3
+ :codec_name: aac
4
+ :codec_long_name: AAC (Advanced Audio Coding)
5
+ :profile: LC
6
+ :codec_type: audio
7
+ :codec_time_base: 1/48000
8
+ :codec_tag_string: "[0][0][0][0]"
9
+ :codec_tag: '0x0000'
10
+ :sample_fmt: fltp
11
+ :sample_rate: '48000'
12
+ :channels: 2
13
+ :channel_layout: stereo
14
+ :bits_per_sample: 0
15
+ :r_frame_rate: 0/0
16
+ :avg_frame_rate: 0/0
17
+ :time_base: 1/1000
18
+ :start_pts: 0
19
+ :start_time: '0.000000'
20
+ :disposition:
21
+ :default: 1
22
+ :dub: 0
23
+ :original: 0
24
+ :comment: 0
25
+ :lyrics: 0
26
+ :karaoke: 0
27
+ :forced: 0
28
+ :hearing_impaired: 0
29
+ :visual_impaired: 0
30
+ :clean_effects: 0
31
+ :attached_pic: 0
32
+ :timed_thumbnails: 0
33
+ :tags:
34
+ :language: jpn
35
+ :title: "[AnimeRG] Tenshi No Tamago [1080p] [ScavvyKiD]"
36
+ :BPS: '125375'
37
+ :BPS-eng: '125375'
38
+ :DURATION: '01:11:06.368000000'
39
+ :DURATION-eng: '01:11:06.368000000'
40
+ :NUMBER_OF_FRAMES: '199986'
41
+ :NUMBER_OF_FRAMES-eng: '199986'
42
+ :NUMBER_OF_BYTES: '66861986'
43
+ :NUMBER_OF_BYTES-eng: '66861986'
44
+ :_STATISTICS_WRITING_APP: mkvmerge v8.3.0 ('Over the Horizon') 32bit
45
+ :_STATISTICS_WRITING_APP-eng: mkvmerge v8.3.0 ('Over the Horizon') 32bit
46
+ :_STATISTICS_WRITING_DATE_UTC: '2015-12-04 08:47:49'
47
+ :_STATISTICS_WRITING_DATE_UTC-eng: '2015-12-04 08:47:49'
48
+ :_STATISTICS_TAGS: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES
49
+ :_STATISTICS_TAGS-eng: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES
@@ -0,0 +1,7 @@
1
+ ---
2
+ :codec_long_name: AAC (Advanced Audio Coding)
3
+ :codec_name: aac
4
+ :codec_type: :audio
5
+ :index: 18
6
+ :language: jpn
7
+ :title: "[AnimeRG] Tenshi No Tamago [1080p] [ScavvyKiD]"
@@ -0,0 +1,43 @@
1
+ ---
2
+ :index: 0
3
+ :codec_name: ass
4
+ :codec_long_name: ASS (Advanced SSA) subtitle
5
+ :codec_type: subtitle
6
+ :codec_time_base: 0/1
7
+ :codec_tag_string: "[0][0][0][0]"
8
+ :codec_tag: '0x0000'
9
+ :r_frame_rate: 0/0
10
+ :avg_frame_rate: 0/0
11
+ :time_base: 1/1000
12
+ :start_pts: 980
13
+ :start_time: '0.980000'
14
+ :disposition:
15
+ :default: 0
16
+ :dub: 0
17
+ :original: 0
18
+ :comment: 0
19
+ :lyrics: 0
20
+ :karaoke: 0
21
+ :forced: 0
22
+ :hearing_impaired: 0
23
+ :visual_impaired: 0
24
+ :clean_effects: 0
25
+ :attached_pic: 0
26
+ :timed_thumbnails: 0
27
+ :tags:
28
+ :language: fre
29
+ :title: French Subs
30
+ :BPS: '19'
31
+ :BPS-eng: '19'
32
+ :DURATION: '01:11:01.020000000'
33
+ :DURATION-eng: '01:11:01.020000000'
34
+ :NUMBER_OF_FRAMES: '134'
35
+ :NUMBER_OF_FRAMES-eng: '134'
36
+ :NUMBER_OF_BYTES: '10267'
37
+ :NUMBER_OF_BYTES-eng: '10267'
38
+ :_STATISTICS_WRITING_APP: mkvmerge v8.3.0 ('Over the Horizon') 32bit
39
+ :_STATISTICS_WRITING_APP-eng: mkvmerge v8.3.0 ('Over the Horizon') 32bit
40
+ :_STATISTICS_WRITING_DATE_UTC: '2015-12-04 08:47:49'
41
+ :_STATISTICS_WRITING_DATE_UTC-eng: '2015-12-04 08:47:49'
42
+ :_STATISTICS_TAGS: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES
43
+ :_STATISTICS_TAGS-eng: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES
@@ -0,0 +1,7 @@
1
+ ---
2
+ :codec_long_name: ASS (Advanced SSA) subtitle
3
+ :codec_name: ass
4
+ :codec_type: :subtitle
5
+ :index: 0
6
+ :language: fre
7
+ :title: French Subs
@@ -0,0 +1,59 @@
1
+ ---
2
+ :index: 17
3
+ :codec_name: h264
4
+ :codec_long_name: H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10
5
+ :profile: High
6
+ :codec_type: video
7
+ :codec_time_base: 1001/48000
8
+ :codec_tag_string: "[0][0][0][0]"
9
+ :codec_tag: '0x0000'
10
+ :width: 1920
11
+ :height: 1080
12
+ :coded_width: 1920
13
+ :coded_height: 1088
14
+ :has_b_frames: 2
15
+ :sample_aspect_ratio: '1:1'
16
+ :display_aspect_ratio: '16:9'
17
+ :pix_fmt: yuv420p
18
+ :level: 41
19
+ :chroma_location: left
20
+ :field_order: progressive
21
+ :refs: 1
22
+ :is_avc: 'true'
23
+ :nal_length_size: '4'
24
+ :r_frame_rate: 24000/1001
25
+ :avg_frame_rate: 24000/1001
26
+ :time_base: 1/1000
27
+ :start_pts: 0
28
+ :start_time: '0.000000'
29
+ :bits_per_raw_sample: '8'
30
+ :disposition:
31
+ :default: 1
32
+ :dub: 0
33
+ :original: 0
34
+ :comment: 0
35
+ :lyrics: 0
36
+ :karaoke: 0
37
+ :forced: 0
38
+ :hearing_impaired: 0
39
+ :visual_impaired: 0
40
+ :clean_effects: 0
41
+ :attached_pic: 0
42
+ :timed_thumbnails: 0
43
+ :tags:
44
+ :language: eng
45
+ :title: "[AnimeRG] Tenshi No Tamago [1080p] [ScavvyKiD]"
46
+ :BPS: '3495932'
47
+ :BPS-eng: '3495932'
48
+ :DURATION: '01:11:06.218000000'
49
+ :DURATION-eng: '01:11:06.218000000'
50
+ :NUMBER_OF_FRAMES: '102288'
51
+ :NUMBER_OF_FRAMES-eng: '102288'
52
+ :NUMBER_OF_BYTES: '1864301082'
53
+ :NUMBER_OF_BYTES-eng: '1864301082'
54
+ :_STATISTICS_WRITING_APP: mkvmerge v8.3.0 ('Over the Horizon') 32bit
55
+ :_STATISTICS_WRITING_APP-eng: mkvmerge v8.3.0 ('Over the Horizon') 32bit
56
+ :_STATISTICS_WRITING_DATE_UTC: '2015-12-04 08:47:49'
57
+ :_STATISTICS_WRITING_DATE_UTC-eng: '2015-12-04 08:47:49'
58
+ :_STATISTICS_TAGS: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES
59
+ :_STATISTICS_TAGS-eng: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES
@@ -0,0 +1,7 @@
1
+ ---
2
+ :codec_long_name: H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10
3
+ :codec_name: h264
4
+ :codec_type: :video
5
+ :index: 17
6
+ :language: eng
7
+ :title: "[AnimeRG] Tenshi No Tamago [1080p] [ScavvyKiD]"
@@ -0,0 +1,3 @@
1
+ # frozen_string_literal: true
2
+
3
+ ::EacRubyUtils::Rspec.default_setup.describe_rubocop
@@ -0,0 +1,4 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'eac_ruby_utils/rspec/default_setup'
4
+ ::EacRubyUtils::Rspec.default_setup_create(::File.expand_path('..', __dir__))
@@ -0,0 +1,44 @@
1
+ FROM ubuntu:18.04
2
+
3
+ ENV DEBIAN_FRONTEND=noninteractive
4
+ ENV USER_UID=1000
5
+ ENV USER_GID=1000
6
+ ENV USERNAME=user
7
+
8
+ # sudo gosu \
9
+
10
+ RUN ln -sf /bin/true /usr/bin/chfn && apt-get update && apt-get install -y \
11
+ libnss3-tools \
12
+ zenity \
13
+ libgtk2.0-0 \
14
+ dbus-x11 \
15
+ yad \
16
+ libcurl3 \
17
+ libdbus-1.3 \
18
+ libxss1 \
19
+ lsb-release \
20
+ net-tools \
21
+ openssl \
22
+ firefox \
23
+ systemd \
24
+ systemd-sysv
25
+
26
+
27
+ ADD https://cloud.gastecnologia.com.br/cef/warsaw/install/GBPCEFwr64.deb /src/warsaw.deb
28
+ RUN groupadd -g ${USER_GID} user && useradd -u ${USER_UID} -g ${USER_GID} -ms /bin/bash user && chown -R user.user /home/user
29
+
30
+ #RUN dpkg -i /w.deb || exit 0
31
+
32
+ COPY context/firefox.service /etc/systemd/system/
33
+ COPY context/startbrowser.sh /usr/local/bin/
34
+
35
+ # systemctl enable warsaw && \
36
+
37
+ RUN mkdir -p /var/run/dbus && \
38
+ systemctl enable firefox && \
39
+ systemctl disable systemd-resolved && systemctl disable systemd-tmpfiles-setup.service
40
+
41
+ STOPSIGNAL SIGRTMIN+3
42
+
43
+
44
+ ENTRYPOINT [ "/sbin/init" ]
@@ -0,0 +1,35 @@
1
+ IMG=jsalatiel/wsbb-podman:latest
2
+ CONTAINER_NAME=wsbb
3
+ DOCKERCMD=sudo podman
4
+
5
+
6
+ USER_UID = $(shell id -u $(USER))
7
+ USER_GID = $(shell id -g $(USER))
8
+ ifeq ($(shell uname),Darwin)
9
+ USER_GID = $(shell id -u $(USER))
10
+ endif
11
+
12
+ build:
13
+ $(DOCKERCMD) build -t ${IMG} .
14
+
15
+ start:
16
+ $(DOCKERCMD) run -d --rm -it --name ${CONTAINER_NAME} \
17
+ --cap-add CAP_AUDIT_WRITE --cap-add CAP_SYS_PTRACE \
18
+ -e USER_UID=$(USER_UID) \
19
+ -e USER_GID=$(USER_GID) \
20
+ -v "$(HOME)/.Xauthority:/home/user/.Xauthority:ro" \
21
+ -v "/tmp/.X11-unix:/tmp/.X11-unix:ro" \
22
+ -v "/etc/machine-id:/etc/machine-id:ro" \
23
+ $(IMG) seg.bb.com.br
24
+ logs:
25
+ $(DOCKERCMD) logs -f ${CONTAINER_NAME}
26
+
27
+ shell:
28
+ $(DOCKERCMD) exec -it ${CONTAINER_NAME} bash
29
+
30
+ stop:
31
+ -$(DOCKERCMD) kill ${CONTAINER_NAME}
32
+
33
+ remove:
34
+ -$(DOCKERCMD) image rm ${CONTAINER_NAME}
35
+
@@ -0,0 +1,16 @@
1
+ # wsbb-podman
2
+ Credits go to farribeiro/wscef-docker and juliohm1978/dockerbb
3
+
4
+
5
+ **make build** to build the container
6
+
7
+ **make start** to run the container ( It may take a while to start firefox - Just wait)
8
+
9
+ When you close firefox the container will be deleted.
10
+
11
+
12
+
13
+
14
+
15
+
16
+
@@ -0,0 +1,8 @@
1
+ [Unit]
2
+
3
+ [Service]
4
+ ExecStart=/usr/local/bin/startbrowser.sh
5
+ Restart=no
6
+
7
+ [Install]
8
+ WantedBy=multi-user.target
@@ -0,0 +1,9 @@
1
+ #!/bin/bash -xe
2
+
3
+ /usr/bin/dpkg -D10 -i /src/warsaw.deb
4
+ systemctl enable --now warsaw
5
+
6
+ runuser -l user -c "XAUTHORITY=/home/user/.Xauthority DISPLAY=:0 firefox --no-remote --new-instance https://seg.bb.com.br"
7
+
8
+ kill -SIGRTMIN+3 1
9
+
metadata CHANGED
@@ -1,15 +1,55 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ehbrs_ruby_utils
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.8.0
4
+ version: 0.11.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Eduardo H. Bogoni
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-08-15 00:00:00.000000000 Z
11
+ date: 2021-09-22 00:00:00.000000000 Z
12
12
  dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: aranha-parsers
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: '0.8'
20
+ - - ">="
21
+ - !ruby/object:Gem::Version
22
+ version: 0.8.5
23
+ type: :runtime
24
+ prerelease: false
25
+ version_requirements: !ruby/object:Gem::Requirement
26
+ requirements:
27
+ - - "~>"
28
+ - !ruby/object:Gem::Version
29
+ version: '0.8'
30
+ - - ">="
31
+ - !ruby/object:Gem::Version
32
+ version: 0.8.5
33
+ - !ruby/object:Gem::Dependency
34
+ name: avm
35
+ requirement: !ruby/object:Gem::Requirement
36
+ requirements:
37
+ - - "~>"
38
+ - !ruby/object:Gem::Version
39
+ version: '0.3'
40
+ - - ">="
41
+ - !ruby/object:Gem::Version
42
+ version: 0.3.2
43
+ type: :runtime
44
+ prerelease: false
45
+ version_requirements: !ruby/object:Gem::Requirement
46
+ requirements:
47
+ - - "~>"
48
+ - !ruby/object:Gem::Version
49
+ version: '0.3'
50
+ - - ">="
51
+ - !ruby/object:Gem::Version
52
+ version: 0.3.2
13
53
  - !ruby/object:Gem::Dependency
14
54
  name: eac_ruby_utils
15
55
  requirement: !ruby/object:Gem::Requirement
@@ -44,6 +84,34 @@ dependencies:
44
84
  - - ">="
45
85
  - !ruby/object:Gem::Version
46
86
  version: 0.1.1
87
+ - !ruby/object:Gem::Dependency
88
+ name: taglib-ruby
89
+ requirement: !ruby/object:Gem::Requirement
90
+ requirements:
91
+ - - "~>"
92
+ - !ruby/object:Gem::Version
93
+ version: '1.1'
94
+ type: :runtime
95
+ prerelease: false
96
+ version_requirements: !ruby/object:Gem::Requirement
97
+ requirements:
98
+ - - "~>"
99
+ - !ruby/object:Gem::Version
100
+ version: '1.1'
101
+ - !ruby/object:Gem::Dependency
102
+ name: ultimate_lyrics
103
+ requirement: !ruby/object:Gem::Requirement
104
+ requirements:
105
+ - - "~>"
106
+ - !ruby/object:Gem::Version
107
+ version: '0.1'
108
+ type: :runtime
109
+ prerelease: false
110
+ version_requirements: !ruby/object:Gem::Requirement
111
+ requirements:
112
+ - - "~>"
113
+ - !ruby/object:Gem::Version
114
+ version: '0.1'
47
115
  - !ruby/object:Gem::Dependency
48
116
  name: aranha-parsers
49
117
  requirement: !ruby/object:Gem::Requirement
@@ -78,9 +146,17 @@ executables: []
78
146
  extensions: []
79
147
  extra_rdoc_files: []
80
148
  files:
149
+ - ".rspec"
150
+ - ".rubocop.yml"
81
151
  - lib/ehbrs_ruby_utils.rb
82
152
  - lib/ehbrs_ruby_utils/executables.rb
83
153
  - lib/ehbrs_ruby_utils/finances/bb_browser/docker_image.rb
154
+ - lib/ehbrs_ruby_utils/fs.rb
155
+ - lib/ehbrs_ruby_utils/fs/compressed_package.rb
156
+ - lib/ehbrs_ruby_utils/fs/selected.rb
157
+ - lib/ehbrs_ruby_utils/fs/selected/build.rb
158
+ - lib/ehbrs_ruby_utils/fs/selected/build_file.rb
159
+ - lib/ehbrs_ruby_utils/music.rb
84
160
  - lib/ehbrs_ruby_utils/patches/object/template.rb
85
161
  - lib/ehbrs_ruby_utils/version.rb
86
162
  - lib/ehbrs_ruby_utils/videos.rb
@@ -95,6 +171,23 @@ files:
95
171
  - lib/ehbrs_ruby_utils/web_utils/videos/file.rb
96
172
  - lib/ehbrs_ruby_utils/web_utils/videos/file/rename.rb
97
173
  - lib/ehbrs_ruby_utils/web_utils/videos/files_list.rb
174
+ - spec/lib/ehbrs_ruby_utils/videos/resolution_spec.rb
175
+ - spec/lib/ehbrs_ruby_utils/videos/stream_spec.rb
176
+ - spec/lib/ehbrs_ruby_utils/videos/stream_spec_files/menina_ovo_attachment.source.yaml
177
+ - spec/lib/ehbrs_ruby_utils/videos/stream_spec_files/menina_ovo_attachment.target.yaml
178
+ - spec/lib/ehbrs_ruby_utils/videos/stream_spec_files/menina_ovo_audio.source.yaml
179
+ - spec/lib/ehbrs_ruby_utils/videos/stream_spec_files/menina_ovo_audio.target.yaml
180
+ - spec/lib/ehbrs_ruby_utils/videos/stream_spec_files/menina_ovo_subtitle.source.yaml
181
+ - spec/lib/ehbrs_ruby_utils/videos/stream_spec_files/menina_ovo_subtitle.target.yaml
182
+ - spec/lib/ehbrs_ruby_utils/videos/stream_spec_files/menina_ovo_video.source.yaml
183
+ - spec/lib/ehbrs_ruby_utils/videos/stream_spec_files/menina_ovo_video.target.yaml
184
+ - spec/rubocop_check_spec.rb
185
+ - spec/spec_helper.rb
186
+ - template/ehbrs_ruby_utils/finances/bb_browser/docker_image/Dockerfile
187
+ - template/ehbrs_ruby_utils/finances/bb_browser/docker_image/Makefile
188
+ - template/ehbrs_ruby_utils/finances/bb_browser/docker_image/README.md
189
+ - template/ehbrs_ruby_utils/finances/bb_browser/docker_image/context/firefox.service
190
+ - template/ehbrs_ruby_utils/finances/bb_browser/docker_image/context/startbrowser.sh
98
191
  homepage:
99
192
  licenses: []
100
193
  metadata: {}
@@ -117,4 +210,18 @@ rubygems_version: 3.1.6
117
210
  signing_key:
118
211
  specification_version: 4
119
212
  summary: Utilities for EHB/RS's Ruby projects.
120
- test_files: []
213
+ test_files:
214
+ - spec/rubocop_check_spec.rb
215
+ - spec/lib/ehbrs_ruby_utils/videos/stream_spec.rb
216
+ - spec/lib/ehbrs_ruby_utils/videos/stream_spec_files/menina_ovo_audio.target.yaml
217
+ - spec/lib/ehbrs_ruby_utils/videos/stream_spec_files/menina_ovo_video.target.yaml
218
+ - spec/lib/ehbrs_ruby_utils/videos/stream_spec_files/menina_ovo_attachment.target.yaml
219
+ - spec/lib/ehbrs_ruby_utils/videos/stream_spec_files/menina_ovo_subtitle.target.yaml
220
+ - spec/lib/ehbrs_ruby_utils/videos/stream_spec_files/menina_ovo_audio.source.yaml
221
+ - spec/lib/ehbrs_ruby_utils/videos/stream_spec_files/menina_ovo_attachment.source.yaml
222
+ - spec/lib/ehbrs_ruby_utils/videos/stream_spec_files/menina_ovo_subtitle.source.yaml
223
+ - spec/lib/ehbrs_ruby_utils/videos/stream_spec_files/menina_ovo_video.source.yaml
224
+ - spec/lib/ehbrs_ruby_utils/videos/resolution_spec.rb
225
+ - spec/spec_helper.rb
226
+ - ".rubocop.yml"
227
+ - ".rspec"