ehbrs_ruby_utils 0.7.0 → 0.10.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.rspec +1 -0
- data/.rubocop.yml +31 -0
- data/lib/ehbrs_ruby_utils/music.rb +9 -0
- data/lib/ehbrs_ruby_utils/version.rb +1 -1
- data/lib/ehbrs_ruby_utils/videos/container.rb +31 -0
- data/lib/ehbrs_ruby_utils/videos/stream.rb +1 -1
- data/lib/ehbrs_ruby_utils/web_utils/videos/file/rename.rb +28 -0
- data/lib/ehbrs_ruby_utils/web_utils/videos/file.rb +11 -8
- data/spec/lib/ehbrs_ruby_utils/videos/resolution_spec.rb +18 -0
- data/spec/lib/ehbrs_ruby_utils/videos/stream_spec.rb +13 -0
- data/spec/lib/ehbrs_ruby_utils/videos/stream_spec_files/menina_ovo_attachment.source.yaml +28 -0
- data/spec/lib/ehbrs_ruby_utils/videos/stream_spec_files/menina_ovo_attachment.target.yaml +7 -0
- data/spec/lib/ehbrs_ruby_utils/videos/stream_spec_files/menina_ovo_audio.source.yaml +49 -0
- data/spec/lib/ehbrs_ruby_utils/videos/stream_spec_files/menina_ovo_audio.target.yaml +7 -0
- data/spec/lib/ehbrs_ruby_utils/videos/stream_spec_files/menina_ovo_subtitle.source.yaml +43 -0
- data/spec/lib/ehbrs_ruby_utils/videos/stream_spec_files/menina_ovo_subtitle.target.yaml +7 -0
- data/spec/lib/ehbrs_ruby_utils/videos/stream_spec_files/menina_ovo_video.source.yaml +59 -0
- data/spec/lib/ehbrs_ruby_utils/videos/stream_spec_files/menina_ovo_video.target.yaml +7 -0
- data/spec/rubocop_check_spec.rb +3 -0
- data/spec/spec_helper.rb +4 -0
- data/template/ehbrs_ruby_utils/finances/bb_browser/docker_image/Dockerfile +44 -0
- data/template/ehbrs_ruby_utils/finances/bb_browser/docker_image/Makefile +35 -0
- data/template/ehbrs_ruby_utils/finances/bb_browser/docker_image/README.md +16 -0
- data/template/ehbrs_ruby_utils/finances/bb_browser/docker_image/context/firefox.service +8 -0
- data/template/ehbrs_ruby_utils/finances/bb_browser/docker_image/context/startbrowser.sh +9 -0
- metadata +86 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e525be69cfe63696e72dc2184618e53ab5d092cb330ea999a0cc7c1593b59a09
|
4
|
+
data.tar.gz: 3bc91b8b5660eef3fd427f3795f4c7191b4bc1f253cd6cbad4d84b59686997d0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8dba5f9914093130cc606c99ed44e5dc88967dc7423cd8843d89111636ccd70d7a2570adfa087d5c6148347ffd03dfbc9efda4b107c88e7b1dac0fde2485f96b
|
7
|
+
data.tar.gz: 0dbfef1d8c97cc3179789d9fcc3c1dffcaad87154e697d5a04d514c2cdb737bbb4350702e3f9846cb8057f18238bf7907acfd073c1372097d77b63e04ab4507d
|
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
|
@@ -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,28 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'eac_ruby_utils/core_ext'
|
4
|
+
|
5
|
+
module EhbrsRubyUtils
|
6
|
+
module WebUtils
|
7
|
+
module Videos
|
8
|
+
class File < ::SimpleDelegator
|
9
|
+
class Rename
|
10
|
+
common_constructor :file, :target_path
|
11
|
+
|
12
|
+
delegate :original_path, to: :file
|
13
|
+
|
14
|
+
def can_rename?
|
15
|
+
::File.exist?(original_path) && !::File.exist?(target_path)
|
16
|
+
end
|
17
|
+
|
18
|
+
def perform
|
19
|
+
return unless can_rename?
|
20
|
+
|
21
|
+
::FileUtils.mkdir_p(::File.dirname(target_path))
|
22
|
+
::FileUtils.mv(original_path, target_path)
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end
|
27
|
+
end
|
28
|
+
end
|
@@ -1,11 +1,14 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
3
|
require 'ostruct'
|
4
|
+
require 'eac_ruby_utils/core_ext'
|
4
5
|
|
5
6
|
module EhbrsRubyUtils
|
6
7
|
module WebUtils
|
7
8
|
module Videos
|
8
9
|
class File < ::SimpleDelegator
|
10
|
+
require_sub __FILE__
|
11
|
+
|
9
12
|
def initialize(data)
|
10
13
|
super(::OpenStruct.new(data))
|
11
14
|
end
|
@@ -14,12 +17,15 @@ module EhbrsRubyUtils
|
|
14
17
|
::File.exist?(original_path)
|
15
18
|
end
|
16
19
|
|
17
|
-
def
|
18
|
-
|
20
|
+
def move(target_dir)
|
21
|
+
::EhbrsRubyUtils::WebUtils::Videos::File::Rename.new(
|
22
|
+
self,
|
23
|
+
target_dir.to_pathname.join(original_path.to_pathname.relative_path_from(root_path))
|
24
|
+
).perform
|
19
25
|
end
|
20
26
|
|
21
|
-
def
|
22
|
-
|
27
|
+
def path_changed?
|
28
|
+
original_path != new_path
|
23
29
|
end
|
24
30
|
|
25
31
|
def remove
|
@@ -29,10 +35,7 @@ module EhbrsRubyUtils
|
|
29
35
|
end
|
30
36
|
|
31
37
|
def rename
|
32
|
-
|
33
|
-
|
34
|
-
::FileUtils.mkdir_p(::File.dirname(new_path))
|
35
|
-
::FileUtils.mv(original_path, new_path)
|
38
|
+
::EhbrsRubyUtils::WebUtils::Videos::File::Rename.new(self, new_path).perform
|
36
39
|
end
|
37
40
|
end
|
38
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,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,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,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
|
data/spec/spec_helper.rb
ADDED
@@ -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
|
+
|
metadata
CHANGED
@@ -1,15 +1,35 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ehbrs_ruby_utils
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.10.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-
|
11
|
+
date: 2021-09-21 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
|
13
33
|
- !ruby/object:Gem::Dependency
|
14
34
|
name: eac_ruby_utils
|
15
35
|
requirement: !ruby/object:Gem::Requirement
|
@@ -44,6 +64,34 @@ dependencies:
|
|
44
64
|
- - ">="
|
45
65
|
- !ruby/object:Gem::Version
|
46
66
|
version: 0.1.1
|
67
|
+
- !ruby/object:Gem::Dependency
|
68
|
+
name: taglib-ruby
|
69
|
+
requirement: !ruby/object:Gem::Requirement
|
70
|
+
requirements:
|
71
|
+
- - "~>"
|
72
|
+
- !ruby/object:Gem::Version
|
73
|
+
version: '1.1'
|
74
|
+
type: :runtime
|
75
|
+
prerelease: false
|
76
|
+
version_requirements: !ruby/object:Gem::Requirement
|
77
|
+
requirements:
|
78
|
+
- - "~>"
|
79
|
+
- !ruby/object:Gem::Version
|
80
|
+
version: '1.1'
|
81
|
+
- !ruby/object:Gem::Dependency
|
82
|
+
name: ultimate_lyrics
|
83
|
+
requirement: !ruby/object:Gem::Requirement
|
84
|
+
requirements:
|
85
|
+
- - "~>"
|
86
|
+
- !ruby/object:Gem::Version
|
87
|
+
version: '0.1'
|
88
|
+
type: :runtime
|
89
|
+
prerelease: false
|
90
|
+
version_requirements: !ruby/object:Gem::Requirement
|
91
|
+
requirements:
|
92
|
+
- - "~>"
|
93
|
+
- !ruby/object:Gem::Version
|
94
|
+
version: '0.1'
|
47
95
|
- !ruby/object:Gem::Dependency
|
48
96
|
name: aranha-parsers
|
49
97
|
requirement: !ruby/object:Gem::Requirement
|
@@ -78,9 +126,12 @@ executables: []
|
|
78
126
|
extensions: []
|
79
127
|
extra_rdoc_files: []
|
80
128
|
files:
|
129
|
+
- ".rspec"
|
130
|
+
- ".rubocop.yml"
|
81
131
|
- lib/ehbrs_ruby_utils.rb
|
82
132
|
- lib/ehbrs_ruby_utils/executables.rb
|
83
133
|
- lib/ehbrs_ruby_utils/finances/bb_browser/docker_image.rb
|
134
|
+
- lib/ehbrs_ruby_utils/music.rb
|
84
135
|
- lib/ehbrs_ruby_utils/patches/object/template.rb
|
85
136
|
- lib/ehbrs_ruby_utils/version.rb
|
86
137
|
- lib/ehbrs_ruby_utils/videos.rb
|
@@ -93,7 +144,25 @@ files:
|
|
93
144
|
- lib/ehbrs_ruby_utils/web_utils/instance.rb
|
94
145
|
- lib/ehbrs_ruby_utils/web_utils/videos.rb
|
95
146
|
- lib/ehbrs_ruby_utils/web_utils/videos/file.rb
|
147
|
+
- lib/ehbrs_ruby_utils/web_utils/videos/file/rename.rb
|
96
148
|
- lib/ehbrs_ruby_utils/web_utils/videos/files_list.rb
|
149
|
+
- spec/lib/ehbrs_ruby_utils/videos/resolution_spec.rb
|
150
|
+
- spec/lib/ehbrs_ruby_utils/videos/stream_spec.rb
|
151
|
+
- spec/lib/ehbrs_ruby_utils/videos/stream_spec_files/menina_ovo_attachment.source.yaml
|
152
|
+
- spec/lib/ehbrs_ruby_utils/videos/stream_spec_files/menina_ovo_attachment.target.yaml
|
153
|
+
- spec/lib/ehbrs_ruby_utils/videos/stream_spec_files/menina_ovo_audio.source.yaml
|
154
|
+
- spec/lib/ehbrs_ruby_utils/videos/stream_spec_files/menina_ovo_audio.target.yaml
|
155
|
+
- spec/lib/ehbrs_ruby_utils/videos/stream_spec_files/menina_ovo_subtitle.source.yaml
|
156
|
+
- spec/lib/ehbrs_ruby_utils/videos/stream_spec_files/menina_ovo_subtitle.target.yaml
|
157
|
+
- spec/lib/ehbrs_ruby_utils/videos/stream_spec_files/menina_ovo_video.source.yaml
|
158
|
+
- spec/lib/ehbrs_ruby_utils/videos/stream_spec_files/menina_ovo_video.target.yaml
|
159
|
+
- spec/rubocop_check_spec.rb
|
160
|
+
- spec/spec_helper.rb
|
161
|
+
- template/ehbrs_ruby_utils/finances/bb_browser/docker_image/Dockerfile
|
162
|
+
- template/ehbrs_ruby_utils/finances/bb_browser/docker_image/Makefile
|
163
|
+
- template/ehbrs_ruby_utils/finances/bb_browser/docker_image/README.md
|
164
|
+
- template/ehbrs_ruby_utils/finances/bb_browser/docker_image/context/firefox.service
|
165
|
+
- template/ehbrs_ruby_utils/finances/bb_browser/docker_image/context/startbrowser.sh
|
97
166
|
homepage:
|
98
167
|
licenses: []
|
99
168
|
metadata: {}
|
@@ -116,4 +185,18 @@ rubygems_version: 3.1.6
|
|
116
185
|
signing_key:
|
117
186
|
specification_version: 4
|
118
187
|
summary: Utilities for EHB/RS's Ruby projects.
|
119
|
-
test_files:
|
188
|
+
test_files:
|
189
|
+
- spec/rubocop_check_spec.rb
|
190
|
+
- spec/lib/ehbrs_ruby_utils/videos/stream_spec.rb
|
191
|
+
- spec/lib/ehbrs_ruby_utils/videos/stream_spec_files/menina_ovo_audio.target.yaml
|
192
|
+
- spec/lib/ehbrs_ruby_utils/videos/stream_spec_files/menina_ovo_video.target.yaml
|
193
|
+
- spec/lib/ehbrs_ruby_utils/videos/stream_spec_files/menina_ovo_attachment.target.yaml
|
194
|
+
- spec/lib/ehbrs_ruby_utils/videos/stream_spec_files/menina_ovo_subtitle.target.yaml
|
195
|
+
- spec/lib/ehbrs_ruby_utils/videos/stream_spec_files/menina_ovo_audio.source.yaml
|
196
|
+
- spec/lib/ehbrs_ruby_utils/videos/stream_spec_files/menina_ovo_attachment.source.yaml
|
197
|
+
- spec/lib/ehbrs_ruby_utils/videos/stream_spec_files/menina_ovo_subtitle.source.yaml
|
198
|
+
- spec/lib/ehbrs_ruby_utils/videos/stream_spec_files/menina_ovo_video.source.yaml
|
199
|
+
- spec/lib/ehbrs_ruby_utils/videos/resolution_spec.rb
|
200
|
+
- spec/spec_helper.rb
|
201
|
+
- ".rubocop.yml"
|
202
|
+
- ".rspec"
|