ehbrs_ruby_utils 0.5.1 → 0.8.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: a12ebb31b9d43c2d015b07c8173e4b0e2197e0989d5030fdbb4f5e42f8144e57
4
- data.tar.gz: '0396cb171671713feaa39b5b8794edbc6901c62dd520ed26998d006f9588a32b'
3
+ metadata.gz: 61330d9b4828f3813d1430120407527b77f13c1525446441bac3e818b93134a0
4
+ data.tar.gz: ce61e87673cf8e01fa96df9aea63b45829004b9305d0e141f9a764252665edb1
5
5
  SHA512:
6
- metadata.gz: a33e6b5c8b84ce3388a1d7508e47afc2f7b507e1f9684e089ddf56551aa7baec1e35844f3649898e67fa779a52b2d3276febfb316374cd466969acf9f3003b15
7
- data.tar.gz: 4f8902ed5d5e40970a80977f02fc65740af3b7fa1485498b9a6985c9030f65cdb310664fd622631ac84ff8582bb153f65a1e4d48782776086210e98a283ce58d
6
+ metadata.gz: 83fee97906fc1ed7dd110f4c59e4dea81a11efd1697b275691b31b0d34b8326c534f29b069b1647a5eda03d1ef5eebf8fe51ab130dbe97c3a8a83f2e73f7927f
7
+ data.tar.gz: fd6dc95bb3e4ed3b6c536d1f46b3b2e7d605d72e706890140a5cf7034599677d038bb08818889b7020df7899787949c2e3f0a88029b4d4677697775de3d924ab
@@ -0,0 +1,18 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'eac_docker/images/templatized'
4
+ require 'ehbrs_ruby_utils/patches/object/template'
5
+
6
+ module EhbrsRubyUtils
7
+ module Finances
8
+ module BbBrowser
9
+ class DockerImage < ::EacDocker::Images::Templatized
10
+ class << self
11
+ def create
12
+ new.tag(name.variableize)
13
+ end
14
+ end
15
+ end
16
+ end
17
+ end
18
+ end
@@ -0,0 +1,6 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'eac_templates/patches/object/template'
4
+
5
+ ::EacTemplates::Searcher.default.included_paths <<
6
+ ::File.expand_path('../../../../template', __dir__)
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module EhbrsRubyUtils
4
- VERSION = '0.5.1'
4
+ VERSION = '0.8.0'
5
5
  end
@@ -11,7 +11,7 @@ module EhbrsRubyUtils
11
11
  'matroska' => '.mkv'
12
12
  }.freeze
13
13
 
14
- enable_console_speaker
14
+ enable_speaker
15
15
  enable_simple_cache
16
16
  common_constructor :input, :ffmpeg_convert_args do
17
17
  self.input = input.to_pathname.expand_path
@@ -29,12 +29,18 @@ module EhbrsRubyUtils
29
29
  ffprobe_data
30
30
  end
31
31
 
32
- %i[index codec_name codec_long_name].each do |method_name|
32
+ %i[index].each do |method_name|
33
33
  define_method method_name do
34
34
  ffprobe_data.fetch(method_name)
35
35
  end
36
36
  end
37
37
 
38
+ %i[codec_name codec_long_name].each do |method_name|
39
+ define_method method_name do
40
+ ffprobe_data[method_name]
41
+ end
42
+ end
43
+
38
44
  def codec_type
39
45
  ffprobe_data.fetch(:codec_type).to_sym
40
46
  end
@@ -46,6 +52,10 @@ module EhbrsRubyUtils
46
52
  def language
47
53
  tags[:language]
48
54
  end
55
+
56
+ def title
57
+ tags[:title]
58
+ end
49
59
  end
50
60
  end
51
61
  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 path_changed?
18
- original_path != new_path
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 can_rename?
22
- ::File.exist?(original_path) && !::File.exist?(new_path)
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
- return unless can_rename?
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,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
@@ -8,7 +8,7 @@ module EhbrsRubyUtils
8
8
  module WebUtils
9
9
  module Videos
10
10
  class FilesList
11
- enable_console_speaker
11
+ enable_speaker
12
12
  enable_simple_cache
13
13
 
14
14
  common_constructor :type_class, :root_path, :options do
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ehbrs_ruby_utils
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.1
4
+ version: 0.8.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: 2020-12-26 00:00:00.000000000 Z
11
+ date: 2021-08-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: eac_ruby_utils
@@ -16,16 +16,16 @@ dependencies:
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: '0.36'
19
+ version: '0.70'
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - "~>"
25
25
  - !ruby/object:Gem::Version
26
- version: '0.36'
26
+ version: '0.70'
27
27
  - !ruby/object:Gem::Dependency
28
- name: eac_ruby_gem_support
28
+ name: eac_templates
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
31
  - - "~>"
@@ -34,7 +34,7 @@ dependencies:
34
34
  - - ">="
35
35
  - !ruby/object:Gem::Version
36
36
  version: 0.1.1
37
- type: :development
37
+ type: :runtime
38
38
  prerelease: false
39
39
  version_requirements: !ruby/object:Gem::Requirement
40
40
  requirements:
@@ -44,6 +44,34 @@ dependencies:
44
44
  - - ">="
45
45
  - !ruby/object:Gem::Version
46
46
  version: 0.1.1
47
+ - !ruby/object:Gem::Dependency
48
+ name: aranha-parsers
49
+ requirement: !ruby/object:Gem::Requirement
50
+ requirements:
51
+ - - "~>"
52
+ - !ruby/object:Gem::Version
53
+ version: '0.8'
54
+ type: :development
55
+ prerelease: false
56
+ version_requirements: !ruby/object:Gem::Requirement
57
+ requirements:
58
+ - - "~>"
59
+ - !ruby/object:Gem::Version
60
+ version: '0.8'
61
+ - !ruby/object:Gem::Dependency
62
+ name: eac_ruby_gem_support
63
+ requirement: !ruby/object:Gem::Requirement
64
+ requirements:
65
+ - - "~>"
66
+ - !ruby/object:Gem::Version
67
+ version: '0.3'
68
+ type: :development
69
+ prerelease: false
70
+ version_requirements: !ruby/object:Gem::Requirement
71
+ requirements:
72
+ - - "~>"
73
+ - !ruby/object:Gem::Version
74
+ version: '0.3'
47
75
  description:
48
76
  email:
49
77
  executables: []
@@ -52,6 +80,8 @@ extra_rdoc_files: []
52
80
  files:
53
81
  - lib/ehbrs_ruby_utils.rb
54
82
  - lib/ehbrs_ruby_utils/executables.rb
83
+ - lib/ehbrs_ruby_utils/finances/bb_browser/docker_image.rb
84
+ - lib/ehbrs_ruby_utils/patches/object/template.rb
55
85
  - lib/ehbrs_ruby_utils/version.rb
56
86
  - lib/ehbrs_ruby_utils/videos.rb
57
87
  - lib/ehbrs_ruby_utils/videos/container.rb
@@ -63,6 +93,7 @@ files:
63
93
  - lib/ehbrs_ruby_utils/web_utils/instance.rb
64
94
  - lib/ehbrs_ruby_utils/web_utils/videos.rb
65
95
  - lib/ehbrs_ruby_utils/web_utils/videos/file.rb
96
+ - lib/ehbrs_ruby_utils/web_utils/videos/file/rename.rb
66
97
  - lib/ehbrs_ruby_utils/web_utils/videos/files_list.rb
67
98
  homepage:
68
99
  licenses: []
@@ -82,7 +113,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
82
113
  - !ruby/object:Gem::Version
83
114
  version: '0'
84
115
  requirements: []
85
- rubygems_version: 3.0.8
116
+ rubygems_version: 3.1.6
86
117
  signing_key:
87
118
  specification_version: 4
88
119
  summary: Utilities for EHB/RS's Ruby projects.