ehbrs-tools 0.27.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/Gemfile.lock +34 -13
- data/lib/ehbrs/tools/runner/fs/selected.rb +1 -5
- data/lib/ehbrs/tools/runner/music/lyrics.rb +3 -4
- 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/version.rb +1 -1
- data/lib/ehbrs/user_dirs.rb +2 -2
- data/spec/lib/ehbrs/tools/runner/fs/used_space_spec.rb +2 -1
- 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/version.rb +1 -1
- 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/lib/ehbrs_ruby_utils/core_ext.rb +5 -0
- data/vendor/ehbrs_ruby_utils/lib/ehbrs_ruby_utils/fs/selected/build.rb +1 -1
- data/vendor/ehbrs_ruby_utils/lib/ehbrs_ruby_utils/fs/selected/build_file.rb +1 -1
- data/vendor/ehbrs_ruby_utils/lib/ehbrs_ruby_utils/fs/selected.rb +2 -2
- 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/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/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/lib/ultimate_lyrics/provider.rb +4 -0
- data/vendor/ultimate_lyrics/lib/ultimate_lyrics/provider_search.rb +1 -1
- data/vendor/ultimate_lyrics/lib/ultimate_lyrics/providers_data.xml +2 -1
- data/vendor/ultimate_lyrics/lib/ultimate_lyrics/version.rb +1 -1
- data/vendor/ultimate_lyrics/spec/lib/ultimate_lyrics/parser_spec_files/encyclopaedia_metallum__michael_jackson_thriller.target.yaml +1 -1
- data/vendor/ultimate_lyrics/spec/lib/ultimate_lyrics/parser_spec_files/encyclopaedia_metallum__milton_nascimento_rouxinol.target.yaml +1 -1
- data/vendor/ultimate_lyrics/spec/lib/ultimate_lyrics/parser_spec_files/hindilyrics_net_bollywood_songs__michael_jackson_thriller.source.html +18 -18
- data/vendor/ultimate_lyrics/spec/lib/ultimate_lyrics/parser_spec_files/hindilyrics_net_bollywood_songs__michael_jackson_thriller.target.yaml +1 -1
- data/vendor/ultimate_lyrics/spec/lib/ultimate_lyrics/parser_spec_files/hindilyrics_net_bollywood_songs__milton_nascimento_rouxinol.source.html +18 -18
- data/vendor/ultimate_lyrics/spec/lib/ultimate_lyrics/parser_spec_files/hindilyrics_net_bollywood_songs__milton_nascimento_rouxinol.target.yaml +1 -1
- data/vendor/ultimate_lyrics/spec/lib/ultimate_lyrics/parser_spec_files/lyrics_com__milton_nascimento_rouxinol.target.yaml +1 -3
- data/vendor/ultimate_lyrics/spec/lib/ultimate_lyrics/parser_spec_files/lyricsplugin_com__michael_jackson_thriller.target.yaml +1 -1
- data/vendor/ultimate_lyrics/spec/lib/ultimate_lyrics/parser_spec_files/lyricsplugin_com__milton_nascimento_rouxinol.target.yaml +1 -1
- data/vendor/ultimate_lyrics/spec/lib/ultimate_lyrics/parser_spec_files/lyricsreg_com__milton_nascimento_rouxinol.source.html +3 -3
- data/vendor/ultimate_lyrics/spec/lib/ultimate_lyrics/parser_spec_files/lyricsreg_com__milton_nascimento_rouxinol.target.yaml +1 -1
- data/vendor/ultimate_lyrics/spec/lib/ultimate_lyrics/parser_spec_files/mp3lyrics_org__michael_jackson_thriller.source.html +3 -3
- data/vendor/ultimate_lyrics/spec/lib/ultimate_lyrics/parser_spec_files/mp3lyrics_org__michael_jackson_thriller.target.yaml +1 -1
- data/vendor/ultimate_lyrics/spec/lib/ultimate_lyrics/parser_spec_files/mp3lyrics_org__milton_nascimento_rouxinol.source.html +3 -3
- data/vendor/ultimate_lyrics/spec/lib/ultimate_lyrics/parser_spec_files/mp3lyrics_org__milton_nascimento_rouxinol.target.yaml +1 -1
- data/vendor/ultimate_lyrics/spec/lib/ultimate_lyrics/parser_spec_files/songlyrics_com__michael_jackson_thriller.source.html +15 -12
- data/vendor/ultimate_lyrics/spec/lib/ultimate_lyrics/parser_spec_files/songlyrics_com__michael_jackson_thriller.target.yaml +1 -1
- metadata +92 -7
- 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
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d120fac3799ba8b11dea2134287103606747746071469112c2fd8b78232666c4
|
4
|
+
data.tar.gz: bd700b8bfef75819deffd9e0894cb1956517f417643e975915764a77dff5423e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ee15c9a092934a7ee3d760f327919efa619da486bf615fc67c0c46fe02b49968b5523206303851694b6c4a4089c154818225e5bcc5d3eebc1ca78a22726aa6ac
|
7
|
+
data.tar.gz: 94c0648afebd291856a80a2f2214ba5ccab7e2d5a979373f0a72104f2b60b5b5053d1b7086db17ee95f688a4ed818799b6b6192116f3576c1cb31c99a1e03663
|
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
ehbrs-tools (0.
|
4
|
+
ehbrs-tools (0.28.0)
|
5
5
|
avm-tools (~> 0.82, >= 0.82.1)
|
6
6
|
eac_cli (~> 0.12, >= 0.12.5)
|
7
7
|
eac_ruby_utils (~> 0.71)
|
@@ -52,27 +52,50 @@ PATH
|
|
52
52
|
eac_ruby_utils (~> 0.74)
|
53
53
|
eac_templates (~> 0.1)
|
54
54
|
|
55
|
+
PATH
|
56
|
+
remote: vendor/eac_fs
|
57
|
+
specs:
|
58
|
+
eac_fs (0.3.0)
|
59
|
+
content-type
|
60
|
+
eac_ruby_utils (~> 0.70)
|
61
|
+
ruby-filemagic
|
62
|
+
|
55
63
|
PATH
|
56
64
|
remote: vendor/eac_ruby_base0
|
57
65
|
specs:
|
58
|
-
eac_ruby_base0 (0.
|
66
|
+
eac_ruby_base0 (0.11.0)
|
59
67
|
eac_cli (~> 0.22, >= 0.22.2)
|
60
|
-
|
68
|
+
eac_fs (~> 0.3)
|
69
|
+
eac_ruby_gems_utils (~> 0.9.6, ~> 0.9)
|
70
|
+
eac_ruby_utils (~> 0.70)
|
71
|
+
|
72
|
+
PATH
|
73
|
+
remote: vendor/eac_ruby_gems_utils
|
74
|
+
specs:
|
75
|
+
eac_ruby_gems_utils (0.9.6)
|
76
|
+
bundler (~> 2.2, >= 2.2.17)
|
61
77
|
eac_ruby_utils (~> 0.70)
|
62
78
|
|
63
79
|
PATH
|
64
80
|
remote: vendor/eac_ruby_utils
|
65
81
|
specs:
|
66
|
-
eac_ruby_utils (0.
|
82
|
+
eac_ruby_utils (0.76.0)
|
67
83
|
activesupport (>= 4.0)
|
68
84
|
addressable (~> 2.6)
|
69
85
|
filesize
|
70
86
|
net-ssh (~> 4.2)
|
71
87
|
|
88
|
+
PATH
|
89
|
+
remote: vendor/eac_templates
|
90
|
+
specs:
|
91
|
+
eac_templates (0.2.0)
|
92
|
+
eac_config (~> 0.5)
|
93
|
+
eac_ruby_utils (~> 0.64)
|
94
|
+
|
72
95
|
PATH
|
73
96
|
remote: vendor/ehbrs_ruby_utils
|
74
97
|
specs:
|
75
|
-
ehbrs_ruby_utils (0.
|
98
|
+
ehbrs_ruby_utils (0.12.0)
|
76
99
|
aranha-parsers (~> 0.8, >= 0.8.5)
|
77
100
|
avm (~> 0.3, >= 0.3.2)
|
78
101
|
eac_ruby_utils (~> 0.70)
|
@@ -83,7 +106,7 @@ PATH
|
|
83
106
|
PATH
|
84
107
|
remote: vendor/ultimate_lyrics
|
85
108
|
specs:
|
86
|
-
ultimate_lyrics (0.1.
|
109
|
+
ultimate_lyrics (0.1.2)
|
87
110
|
aranha-parsers (~> 0.8, >= 0.8.5)
|
88
111
|
eac_ruby_utils (~> 0.74)
|
89
112
|
|
@@ -116,7 +139,7 @@ GEM
|
|
116
139
|
avm-eac_webapp_base0 (0.1.1)
|
117
140
|
avm (~> 0.1)
|
118
141
|
eac_ruby_utils (~> 0.68)
|
119
|
-
avm-tools (0.
|
142
|
+
avm-tools (0.106.0)
|
120
143
|
aranha-parsers (~> 0.4)
|
121
144
|
asciidoctor (~> 2.0, >= 2.0.12)
|
122
145
|
avm (~> 0.1)
|
@@ -162,12 +185,6 @@ GEM
|
|
162
185
|
rubocop (~> 0.80.1)
|
163
186
|
rubocop-rails (~> 2.4.2)
|
164
187
|
rubocop-rspec (~> 1.38.1)
|
165
|
-
eac_ruby_gems_utils (0.9.5)
|
166
|
-
bundler (~> 2.2, >= 2.2.17)
|
167
|
-
eac_ruby_utils (~> 0.70)
|
168
|
-
eac_templates (0.1.2)
|
169
|
-
eac_config (~> 0.5)
|
170
|
-
eac_ruby_utils (~> 0.64)
|
171
188
|
faraday (1.8.0)
|
172
189
|
faraday-em_http (~> 1.0)
|
173
190
|
faraday-em_synchrony (~> 1.0)
|
@@ -245,6 +262,7 @@ GEM
|
|
245
262
|
rubocop (>= 0.72.0)
|
246
263
|
rubocop-rspec (1.38.1)
|
247
264
|
rubocop (>= 0.68.1)
|
265
|
+
ruby-filemagic (0.7.2)
|
248
266
|
ruby-progressbar (1.11.0)
|
249
267
|
ruby2_keywords (0.0.5)
|
250
268
|
rubyzip (2.3.2)
|
@@ -275,9 +293,12 @@ DEPENDENCIES
|
|
275
293
|
eac_cli!
|
276
294
|
eac_config!
|
277
295
|
eac_docker!
|
296
|
+
eac_fs!
|
278
297
|
eac_ruby_base0!
|
279
298
|
eac_ruby_gem_support (~> 0.3)
|
299
|
+
eac_ruby_gems_utils!
|
280
300
|
eac_ruby_utils!
|
301
|
+
eac_templates!
|
281
302
|
ehbrs-tools!
|
282
303
|
ehbrs_ruby_utils!
|
283
304
|
ultimate_lyrics!
|
@@ -29,10 +29,6 @@ module Ehbrs
|
|
29
29
|
|
30
30
|
protected
|
31
31
|
|
32
|
-
def build_selected_directory(path)
|
33
|
-
path
|
34
|
-
end
|
35
|
-
|
36
32
|
def directory_label(directory)
|
37
33
|
directory.to_s
|
38
34
|
end
|
@@ -58,7 +54,7 @@ module Ehbrs
|
|
58
54
|
|
59
55
|
def selected_directories_uncached
|
60
56
|
infom 'Searching selected directories...'
|
61
|
-
selected.found
|
57
|
+
selected.found
|
62
58
|
end
|
63
59
|
|
64
60
|
def selected_uncached
|
@@ -1,6 +1,5 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
require 'eac_ruby_utils/fs_cache'
|
4
3
|
require 'ehbrs/tools/core_ext'
|
5
4
|
require 'ehbrs_ruby_utils/videos/container'
|
6
5
|
require 'ultimate_lyrics/provider'
|
@@ -13,7 +12,7 @@ module Ehbrs
|
|
13
12
|
DEFAULT_PROVIDER = 'lyrics.com'
|
14
13
|
|
15
14
|
runner_with :help, :output do
|
16
|
-
arg_opt '-p', '--provider',
|
15
|
+
arg_opt '-p', '--provider', 'Nome do provedor.', default: DEFAULT_PROVIDER
|
17
16
|
pos_arg :file
|
18
17
|
end
|
19
18
|
|
@@ -33,7 +32,7 @@ module Ehbrs
|
|
33
32
|
|
34
33
|
def start_banner
|
35
34
|
infov 'File', file
|
36
|
-
%w[artist album track title].each do |attr|
|
35
|
+
%w[artist album track title year].each do |attr|
|
37
36
|
infov attr.humanize, container.tag_file.tag.send(attr)
|
38
37
|
end
|
39
38
|
infov 'Selected provider', provider
|
@@ -60,7 +59,7 @@ module Ehbrs
|
|
60
59
|
end
|
61
60
|
|
62
61
|
def provider_name
|
63
|
-
parsed.provider
|
62
|
+
parsed.provider
|
64
63
|
end
|
65
64
|
end
|
66
65
|
end
|
@@ -0,0 +1,41 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'ehbrs/tools/core_ext'
|
4
|
+
require 'ehbrs_ruby_utils/music/lyrics_book'
|
5
|
+
require 'ehbrs_ruby_utils/videos/container'
|
6
|
+
require 'ultimate_lyrics/provider'
|
7
|
+
|
8
|
+
module Ehbrs
|
9
|
+
module Tools
|
10
|
+
class Runner
|
11
|
+
class Music
|
12
|
+
class LyricsBook
|
13
|
+
runner_with :help, :output do
|
14
|
+
arg_opt '-p', '--provider', 'Nome do provedor.',
|
15
|
+
default: ::EhbrsRubyUtils::Music::LyricsBook::DEFAULT_PROVIDER_NAME
|
16
|
+
pos_arg :source_dir
|
17
|
+
end
|
18
|
+
|
19
|
+
def run
|
20
|
+
start_banner
|
21
|
+
run_output
|
22
|
+
end
|
23
|
+
|
24
|
+
def start_banner
|
25
|
+
infov 'Source directory', book.source_dir
|
26
|
+
infov 'Selected provider', book.provider
|
27
|
+
end
|
28
|
+
|
29
|
+
def book_uncached
|
30
|
+
::EhbrsRubyUtils::Music::LyricsBook.new(parsed.source_dir,
|
31
|
+
provider_name: parsed.provider)
|
32
|
+
end
|
33
|
+
|
34
|
+
def output_content
|
35
|
+
book.output
|
36
|
+
end
|
37
|
+
end
|
38
|
+
end
|
39
|
+
end
|
40
|
+
end
|
41
|
+
end
|
@@ -10,16 +10,16 @@ module Ehbrs
|
|
10
10
|
class Selected < ::Ehbrs::Tools::Runner::Fs::Selected
|
11
11
|
protected
|
12
12
|
|
13
|
-
def build_selected_directory(path)
|
14
|
-
::Ehbrs::Music::Album.new(path)
|
15
|
-
end
|
16
|
-
|
17
13
|
def directory_label(directory)
|
18
|
-
directory.to_label
|
14
|
+
path_to_album(directory).to_label
|
19
15
|
end
|
20
16
|
|
21
17
|
def directory_target_basename(directory)
|
22
|
-
directory.id
|
18
|
+
path_to_album(directory).id
|
19
|
+
end
|
20
|
+
|
21
|
+
def path_to_album(path)
|
22
|
+
::Ehbrs::Music::Album.new(path)
|
23
23
|
end
|
24
24
|
end
|
25
25
|
end
|
data/lib/ehbrs/tools/version.rb
CHANGED
data/lib/ehbrs/user_dirs.rb
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
require '
|
3
|
+
require 'eac_fs/cache'
|
4
4
|
require 'eac_ruby_utils/simple_cache'
|
5
5
|
|
6
6
|
module Ehbrs
|
@@ -15,7 +15,7 @@ module Ehbrs
|
|
15
15
|
private
|
16
16
|
|
17
17
|
def user_home_dir_uncached
|
18
|
-
::
|
18
|
+
::EacFs::Cache.new(ENV['HOME'])
|
19
19
|
end
|
20
20
|
|
21
21
|
def cache_uncached
|
@@ -1,5 +1,6 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
+
require 'eac_fs/cache'
|
3
4
|
require 'eac_ruby_utils/fs/temp'
|
4
5
|
require 'ehbrs/tools/runner'
|
5
6
|
require 'ehbrs/tools/runner/fs/used_space'
|
@@ -8,7 +9,7 @@ require 'ehbrs/observers/with_persistence'
|
|
8
9
|
RSpec.describe ::Ehbrs::Tools::Runner::Fs::UsedSpace do
|
9
10
|
let(:target) { ::EacRubyUtils::Fs::Temp.directory }
|
10
11
|
let(:user_dir) { ::EacRubyUtils::Fs::Temp.directory }
|
11
|
-
let(:cached_user_dir) { ::
|
12
|
+
let(:cached_user_dir) { ::EacFs::Cache.new(user_dir) }
|
12
13
|
let(:observers_user_dir) { cached_user_dir.child('observers') }
|
13
14
|
let(:observer_path) do
|
14
15
|
observers_user_dir.child(target.to_s.parameterize).content_path.to_pathname
|
@@ -0,0 +1,20 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
$LOAD_PATH.push File.expand_path('lib', __dir__)
|
4
|
+
|
5
|
+
require 'eac_fs/version'
|
6
|
+
|
7
|
+
Gem::Specification.new do |s|
|
8
|
+
s.name = 'eac_fs'
|
9
|
+
s.version = EacFs::VERSION
|
10
|
+
s.authors = ['Put here the authors']
|
11
|
+
s.summary = 'Put here de description.'
|
12
|
+
|
13
|
+
s.files = Dir['{lib}/**/*']
|
14
|
+
|
15
|
+
s.add_dependency 'content-type'
|
16
|
+
s.add_dependency 'eac_ruby_utils', '~> 0.70'
|
17
|
+
s.add_dependency 'ruby-filemagic'
|
18
|
+
|
19
|
+
s.add_development_dependency 'eac_ruby_gem_support', '~> 0.3'
|
20
|
+
end
|
@@ -0,0 +1,24 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'eac_ruby_utils/core_ext'
|
4
|
+
require 'content-type'
|
5
|
+
require 'filemagic'
|
6
|
+
|
7
|
+
module EacFs
|
8
|
+
class FileInfo
|
9
|
+
enable_simple_cache
|
10
|
+
attr_reader :magic_string
|
11
|
+
|
12
|
+
def initialize(path)
|
13
|
+
@magic_string = ::FileMagic.new(FileMagic::MAGIC_MIME).file(path.to_pathname.to_path)
|
14
|
+
end
|
15
|
+
|
16
|
+
delegate :charset, :mime_type, :subtype, :type, to: :content_type
|
17
|
+
|
18
|
+
private
|
19
|
+
|
20
|
+
def content_type_uncached
|
21
|
+
::ContentType.parse(magic_string)
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
@@ -1,9 +1,9 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
3
|
require 'active_support/core_ext/object/blank'
|
4
|
-
require '
|
4
|
+
require 'eac_fs/cache'
|
5
5
|
|
6
|
-
RSpec.describe ::
|
6
|
+
RSpec.describe ::EacFs::Cache do
|
7
7
|
let(:tmpdir) { ::Dir.mktmpdir }
|
8
8
|
let(:instance) { described_class.new(tmpdir, 'instance') }
|
9
9
|
|
@@ -13,7 +13,8 @@ Gem::Specification.new do |s|
|
|
13
13
|
s.files = Dir['{lib}/**/*']
|
14
14
|
|
15
15
|
s.add_dependency 'eac_cli', '~> 0.22', '>= 0.22.2'
|
16
|
-
s.add_dependency '
|
16
|
+
s.add_dependency 'eac_fs', '~> 0.3'
|
17
|
+
s.add_dependency 'eac_ruby_gems_utils', '~> 0.9', '~> 0.9.6'
|
17
18
|
s.add_dependency 'eac_ruby_utils', '~> 0.70'
|
18
19
|
|
19
20
|
s.add_development_dependency 'eac_ruby_gem_support', '~> 0.3'
|
@@ -3,10 +3,10 @@
|
|
3
3
|
require 'eac_cli/config'
|
4
4
|
require 'eac_config/envvars_node'
|
5
5
|
require 'eac_config/yaml_file_node'
|
6
|
+
require 'eac_fs/cache'
|
6
7
|
require 'eac_ruby_base0/application_xdg'
|
7
8
|
require 'eac_ruby_gems_utils/gem'
|
8
9
|
require 'eac_ruby_utils/core_ext'
|
9
|
-
require 'eac_ruby_utils/filesystem_cache'
|
10
10
|
|
11
11
|
module EacRubyBase0
|
12
12
|
class Application
|
@@ -44,8 +44,8 @@ module EacRubyBase0
|
|
44
44
|
end
|
45
45
|
|
46
46
|
def fs_cache
|
47
|
-
@fs_cache ||= ::
|
48
|
-
cache_dir.join(::
|
47
|
+
@fs_cache ||= ::EacFs::Cache.new(
|
48
|
+
cache_dir.join(::EacFs::Cache.name.parameterize)
|
49
49
|
)
|
50
50
|
end
|
51
51
|
|
@@ -3,6 +3,7 @@
|
|
3
3
|
require 'eac_cli/core_ext'
|
4
4
|
require 'eac_cli/speaker'
|
5
5
|
require 'eac_config/node'
|
6
|
+
require 'eac_fs/cache'
|
6
7
|
require 'eac_ruby_utils/speaker'
|
7
8
|
|
8
9
|
module EacRubyBase0
|
@@ -23,13 +24,11 @@ module EacRubyBase0
|
|
23
24
|
end
|
24
25
|
|
25
26
|
def run
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
run_with_subcommand
|
32
|
-
end
|
27
|
+
on_context do
|
28
|
+
if parsed.version?
|
29
|
+
show_version
|
30
|
+
else
|
31
|
+
run_with_subcommand
|
33
32
|
end
|
34
33
|
end
|
35
34
|
end
|
@@ -38,6 +37,16 @@ module EacRubyBase0
|
|
38
37
|
runner_context.call(:application).version.to_s
|
39
38
|
end
|
40
39
|
|
40
|
+
def on_context
|
41
|
+
::EacRubyUtils::Speaker.context.on(build_speaker) do
|
42
|
+
::EacConfig::Node.context.on(runner_context.call(:application).build_config) do
|
43
|
+
::EacFs::Cache.context.on(application.fs_cache) do
|
44
|
+
yield
|
45
|
+
end
|
46
|
+
end
|
47
|
+
end
|
48
|
+
end
|
49
|
+
|
41
50
|
def show_version
|
42
51
|
out("#{application_version}\n")
|
43
52
|
end
|
@@ -0,0 +1,16 @@
|
|
1
|
+
Copyright (c) 2020 Eduardo Henrique Bogoni
|
2
|
+
|
3
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and
|
4
|
+
associated documentation files (the "Software"), to deal in the Software without restriction,
|
5
|
+
including without limitation the rights to use, copy, modify, merge, publish, distribute,
|
6
|
+
sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is
|
7
|
+
furnished to do so, subject to the following conditions:
|
8
|
+
|
9
|
+
The above copyright notice and this permission notice (including the next paragraph) shall be
|
10
|
+
included in all copies or substantial portions of the Software.
|
11
|
+
|
12
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT
|
13
|
+
NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
14
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
|
15
|
+
DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT
|
16
|
+
OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
@@ -0,0 +1,30 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
$LOAD_PATH.push File.expand_path('lib', __dir__)
|
4
|
+
|
5
|
+
# Maintain your gem's version:
|
6
|
+
require 'eac_ruby_gems_utils/version'
|
7
|
+
|
8
|
+
# Describe your gem and declare its dependencies:
|
9
|
+
Gem::Specification.new do |s|
|
10
|
+
s.name = 'eac_ruby_gems_utils'
|
11
|
+
s.version = ::EacRubyGemsUtils::VERSION
|
12
|
+
s.authors = ['Esquilo Azul Company']
|
13
|
+
s.summary = 'Utilities for Ruby gems development.'
|
14
|
+
s.license = 'MIT'
|
15
|
+
s.homepage = 'https://github.com/esquilo-azul/eac_ruby_gems_utils'
|
16
|
+
s.metadata = { 'source_code_uri' => s.homepage }
|
17
|
+
|
18
|
+
s.extra_rdoc_files = ['README.rdoc']
|
19
|
+
s.rdoc_options = ['--charset=UTF-8']
|
20
|
+
|
21
|
+
s.require_paths = ['lib']
|
22
|
+
s.files = Dir['{lib}/**/*', 'Gemfile']
|
23
|
+
s.test_files = Dir['{spec}/**/*', '.rspec']
|
24
|
+
|
25
|
+
s.add_dependency 'bundler', '~> 2.2', '>= 2.2.17'
|
26
|
+
s.add_dependency 'eac_ruby_utils', '~> 0.70'
|
27
|
+
|
28
|
+
# Tests
|
29
|
+
s.add_development_dependency 'eac_ruby_gem_support', '~> 0.3'
|
30
|
+
end
|
@@ -0,0 +1,33 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'eac_ruby_utils/core_ext'
|
4
|
+
require 'eac_ruby_utils/ruby/command'
|
5
|
+
require 'delegate'
|
6
|
+
|
7
|
+
module EacRubyGemsUtils
|
8
|
+
class Gem
|
9
|
+
class Command < ::EacRubyUtils::Ruby::Command
|
10
|
+
attr_reader :gem
|
11
|
+
|
12
|
+
def initialize(gem, command_args, extra_options = {})
|
13
|
+
@gem = gem
|
14
|
+
super(command_args, extra_options.merge(host_env: gem.host_env))
|
15
|
+
end
|
16
|
+
|
17
|
+
# Changes current directory to the gem's directory.
|
18
|
+
def chdir_root
|
19
|
+
chdir(gem.root.to_path)
|
20
|
+
end
|
21
|
+
|
22
|
+
def envvar_gemfile
|
23
|
+
envvar('BUNDLE_GEMFILE', gem.gemfile_path.to_path)
|
24
|
+
end
|
25
|
+
|
26
|
+
protected
|
27
|
+
|
28
|
+
def duplicate(command, extra_options)
|
29
|
+
self.class.new(gem, command, extra_options)
|
30
|
+
end
|
31
|
+
end
|
32
|
+
end
|
33
|
+
end
|