ehbrs-tools 0.28.1 → 0.28.2

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: 558059e25d8a6a43c217fc0bee9124272d21dc2ff16412d55259d50be5cce94b
4
- data.tar.gz: 5f636e17e8b5577e7ae65b72e56b82d9c28e34c34902c82afb83115d1d7a331e
3
+ metadata.gz: 27cfd6fd70b80a51d74091e516bcd784cafe2ed0150de7424e865213ef2a6397
4
+ data.tar.gz: '099eae7fd47b2b34f11417228a16f838033b4dfa3b725bc16363c2a23ccc6ce6'
5
5
  SHA512:
6
- metadata.gz: 4f10bf9f2eecd95c38d19362315c126411addc52fdf972e2f1d7a3be1abe26fd58ee09f5159b9618ffe1533fd4b032a14d908fa3d9b6d37b4438206986a1fce0
7
- data.tar.gz: 94f20bb40c888fc248f357634148a0c0b9bd907164381e95a0e60af58c1794021c525c076605d1c72fc4a2c58c0738cc391cf2045d68f7641afa7b25b90f4741
6
+ metadata.gz: caf38bb6c3ae4c907aa20761ef390b8ef3371e150ad512758813c8c411c7d24d10c33abf2a263904875c96cd90dc00987ba6127d0b5ef5452f9581594b96e878
7
+ data.tar.gz: 14096bf6312bde96792b427a71b5eddc03bc044b8fbd11a56e7513b6a72fb517641a0b53a2ce8f01ada21433bb376871af1aa8f6c3bb2cec30bd4ea734cd9ec0
data/Gemfile CHANGED
@@ -11,3 +11,5 @@ Dir["#{gems_subdir}/*"].each do |dir|
11
11
  basename = ::File.basename(dir)
12
12
  gem basename, path: "#{gems_subdir}/#{basename}"
13
13
  end
14
+
15
+ gem 'httpclient', git: 'https://github.com/livelink/httpclient.git'
data/Gemfile.lock CHANGED
@@ -1,7 +1,13 @@
1
+ GIT
2
+ remote: https://github.com/livelink/httpclient.git
3
+ revision: 40f7e88078c95f9a6909fb56f9e313632637cd72
4
+ specs:
5
+ httpclient (2.8.4)
6
+
1
7
  PATH
2
8
  remote: .
3
9
  specs:
4
- ehbrs-tools (0.28.1)
10
+ ehbrs-tools (0.28.2)
5
11
  avm-tools (~> 0.82, >= 0.82.1)
6
12
  eac_cli (~> 0.12, >= 0.12.5)
7
13
  eac_ruby_utils (~> 0.71)
@@ -33,7 +39,7 @@ PATH
33
39
  PATH
34
40
  remote: vendor/eac_cli
35
41
  specs:
36
- eac_cli (0.23.0)
42
+ eac_cli (0.23.1)
37
43
  colorize (~> 0.8.1)
38
44
  eac_config (~> 0.5, >= 0.5.1)
39
45
  eac_ruby_utils (~> 0.70)
@@ -55,7 +61,7 @@ PATH
55
61
  PATH
56
62
  remote: vendor/eac_fs
57
63
  specs:
58
- eac_fs (0.3.0)
64
+ eac_fs (0.5.0)
59
65
  content-type
60
66
  eac_ruby_utils (~> 0.70)
61
67
  ruby-filemagic
@@ -63,7 +69,7 @@ PATH
63
69
  PATH
64
70
  remote: vendor/eac_ruby_base0
65
71
  specs:
66
- eac_ruby_base0 (0.11.0)
72
+ eac_ruby_base0 (0.12.0)
67
73
  eac_cli (~> 0.22, >= 0.22.2)
68
74
  eac_fs (~> 0.3)
69
75
  eac_ruby_gems_utils (~> 0.9.6, ~> 0.9)
@@ -95,9 +101,10 @@ PATH
95
101
  PATH
96
102
  remote: vendor/ehbrs_ruby_utils
97
103
  specs:
98
- ehbrs_ruby_utils (0.12.0)
104
+ ehbrs_ruby_utils (0.12.1)
99
105
  aranha-parsers (~> 0.8, >= 0.8.5)
100
106
  avm (~> 0.3, >= 0.3.2)
107
+ eac_fs (~> 0.5)
101
108
  eac_ruby_utils (~> 0.70)
102
109
  eac_templates (~> 0.1, >= 0.1.1)
103
110
  taglib-ruby (~> 1.1)
@@ -123,13 +130,14 @@ GEM
123
130
  public_suffix (>= 2.0.2, < 5.0)
124
131
  asciidoctor (2.0.16)
125
132
  ast (2.4.2)
126
- avm (0.3.2)
133
+ avm (0.5.0)
127
134
  eac_docker (~> 0.3)
128
135
  eac_git (~> 0.6)
129
136
  eac_ruby_utils (~> 0.68)
130
137
  eac_templates (~> 0.1, >= 0.1.1)
131
- avm-apps (0.4.1)
132
- eac_ruby_utils (~> 0.67)
138
+ filesize (~> 0.2)
139
+ htmlbeautifier (~> 1.3, >= 1.3.1)
140
+ minitar (~> 0.9)
133
141
  avm-eac_asciidoctor_base0 (0.3.1)
134
142
  asciidoctor (~> 2.0, >= 2.0.12)
135
143
  avm-eac_webapp_base0 (~> 0.1)
@@ -139,25 +147,15 @@ GEM
139
147
  avm-eac_webapp_base0 (0.1.1)
140
148
  avm (~> 0.1)
141
149
  eac_ruby_utils (~> 0.68)
142
- avm-tools (0.106.0)
150
+ avm-tools (0.108.0)
143
151
  aranha-parsers (~> 0.4)
144
- asciidoctor (~> 2.0, >= 2.0.12)
145
152
  avm (~> 0.1)
146
- avm-apps (~> 0.2)
147
153
  avm-eac_asciidoctor_base0
148
154
  clipboard (~> 1.3, >= 1.3.3)
149
- content-type (~> 0.0.1)
150
155
  curb (~> 0.9.10)
151
- eac_docker (~> 0.2)
152
- eac_git (~> 0.2)
153
156
  eac_ruby_base0 (~> 0.7, >= 0.7.2)
154
157
  eac_ruby_gems_utils (~> 0.6, >= 0.6.1)
155
- eac_templates (~> 0.1)
156
- filesize
157
158
  git (~> 1.7)
158
- htmlbeautifier (~> 1.3, >= 1.3.1)
159
- minitar
160
- os
161
159
  ruby-progressbar (~> 1.10, >= 1.10.1)
162
160
  axiom-types (0.1.1)
163
161
  descendants_tracker (~> 0.0.4)
@@ -176,7 +174,7 @@ GEM
176
174
  thread_safe (~> 0.3, >= 0.3.1)
177
175
  diff-lcs (1.4.4)
178
176
  dry-inflector (0.2.1)
179
- eac_git (0.7.3)
177
+ eac_git (0.8.0)
180
178
  eac_ruby_utils (~> 0.74)
181
179
  parseconfig (~> 1.0, >= 1.0.8)
182
180
  eac_ruby_gem_support (0.4.0)
@@ -209,7 +207,6 @@ GEM
209
207
  rchardet (~> 1.8)
210
208
  hpricot (0.8.6)
211
209
  htmlbeautifier (1.3.1)
212
- httpclient (2.8.3)
213
210
  i18n (1.8.10)
214
211
  concurrent-ruby (~> 1.0)
215
212
  ice_nine (0.11.2)
@@ -219,13 +216,13 @@ GEM
219
216
  minitest (5.14.4)
220
217
  multipart-post (2.1.1)
221
218
  net-ssh (4.2.0)
222
- nokogiri (1.12.4-x86_64-linux)
219
+ nokogiri (1.12.5-x86_64-linux)
223
220
  racc (~> 1.4)
224
221
  ofx-parser (1.1.0)
225
222
  hpricot (>= 0.6)
226
223
  os (1.1.1)
227
224
  parallel (1.21.0)
228
- parseconfig (1.1.0)
225
+ parseconfig (1.1.2)
229
226
  parser (3.0.2.0)
230
227
  ast (~> 2.4.1)
231
228
  parslet (1.8.2)
@@ -301,6 +298,7 @@ DEPENDENCIES
301
298
  eac_templates!
302
299
  ehbrs-tools!
303
300
  ehbrs_ruby_utils!
301
+ httpclient!
304
302
  ultimate_lyrics!
305
303
 
306
304
  BUNDLED WITH
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Ehbrs
4
4
  module Tools
5
- VERSION = '0.28.1'
5
+ VERSION = '0.28.2'
6
6
  end
7
7
  end
@@ -3,16 +3,19 @@
3
3
  require 'eac_ruby_utils/core_ext'
4
4
 
5
5
  module EacCli
6
- class Config
6
+ class Config < ::SimpleDelegator
7
7
  require_sub __FILE__
8
- attr_reader :sub
9
8
 
10
9
  def initialize(sub_node)
11
- @sub = sub_node
10
+ super(sub_node)
12
11
  end
13
12
 
14
13
  def entry(path, options = {})
15
14
  ::EacCli::Config::Entry.new(self, path, options)
16
15
  end
16
+
17
+ def sub
18
+ __getobj__
19
+ end
17
20
  end
18
21
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module EacCli
4
- VERSION = '0.23.0'
4
+ VERSION = '0.23.1'
5
5
  end
@@ -0,0 +1,39 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'eac_fs/patches'
4
+ require 'eac_ruby_utils/fs/temp'
5
+
6
+ module Avm
7
+ class CachedDownload
8
+ attr_reader :url, :fs_cache
9
+
10
+ def initialize(url, parent_fs_cache = nil)
11
+ @url = url
12
+ @fs_cache = (parent_fs_cache || fs_cache).child(url.parameterize)
13
+ end
14
+
15
+ def assert
16
+ download unless fs_cache.cached?
17
+ end
18
+
19
+ def download
20
+ ::EacRubyUtils::Fs::Temp.on_file do |temp|
21
+ download_to(temp)
22
+ fs_cache.content_path.to_pathname.dirname.mkpath
23
+ ::FileUtils.mv(temp.to_path, fs_cache.content_path)
24
+ end
25
+ end
26
+
27
+ def path
28
+ fs_cache.content_path.to_pathname
29
+ end
30
+
31
+ private
32
+
33
+ def download_to(local_file)
34
+ ::URI.parse(url).open do |remote|
35
+ local_file.open('wb') { |handle| handle.write(remote.read) }
36
+ end
37
+ end
38
+ end
39
+ end
@@ -6,6 +6,9 @@ require 'filemagic'
6
6
 
7
7
  module EacFs
8
8
  class FileInfo
9
+ UNKNOWN_CONTENT_TYPE_STRING = 'application/octet-stream'
10
+ UNKNOWN_CONTENT_TYPE = ::ContentType.parse(UNKNOWN_CONTENT_TYPE_STRING)
11
+
9
12
  enable_simple_cache
10
13
  attr_reader :magic_string
11
14
 
@@ -19,6 +22,8 @@ module EacFs
19
22
 
20
23
  def content_type_uncached
21
24
  ::ContentType.parse(magic_string)
25
+ rescue ::Parslet::ParseFailed
26
+ UNKNOWN_CONTENT_TYPE
22
27
  end
23
28
  end
24
29
  end
@@ -5,6 +5,11 @@ require 'eac_fs/patches/module/fs_cache'
5
5
  class Object
6
6
  # @return [EacFs::Cache]
7
7
  def fs_cache
8
- self.class.fs_cache
8
+ self.class.fs_cache.child(fs_cache_object_id)
9
+ end
10
+
11
+ # @return [String]
12
+ def fs_cache_object_id
13
+ raise 'Abstract method hit'
9
14
  end
10
15
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module EacFs
4
- VERSION = '0.3.0'
4
+ VERSION = '0.5.0'
5
5
  end
@@ -43,8 +43,8 @@ module EacRubyBase0
43
43
  delegate "#{item}_xdg_env", "#{item}_dir", to: :app_xdg
44
44
  end
45
45
 
46
- def fs_cache
47
- @fs_cache ||= ::EacFs::Cache.new(
46
+ def self_fs_cache
47
+ @self_fs_cache ||= ::EacFs::Cache.new(
48
48
  cache_dir.join(::EacFs::Cache.name.parameterize)
49
49
  )
50
50
  end
@@ -40,7 +40,7 @@ module EacRubyBase0
40
40
  def on_context
41
41
  ::EacRubyUtils::Speaker.context.on(build_speaker) do
42
42
  ::EacConfig::Node.context.on(runner_context.call(:application).build_config) do
43
- ::EacFs::Cache.context.on(application.fs_cache) do
43
+ ::EacFs::Cache.context.on(application.self_fs_cache) do
44
44
  yield
45
45
  end
46
46
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module EacRubyBase0
4
- VERSION = '0.11.0'
4
+ VERSION = '0.12.0'
5
5
  end
@@ -17,6 +17,7 @@ Gem::Specification.new do |s|
17
17
 
18
18
  s.add_dependency 'aranha-parsers', '~> 0.8', '>= 0.8.5'
19
19
  s.add_dependency 'avm', '~> 0.3', '>= 0.3.2'
20
+ s.add_dependency 'eac_fs', '~> 0.5'
20
21
  s.add_dependency 'eac_ruby_utils', '~> 0.70'
21
22
  s.add_dependency 'eac_templates', '~> 0.1', '>= 0.1.1'
22
23
  s.add_dependency 'taglib-ruby', '~> 1.1'
@@ -1,11 +1,11 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require 'avm/files/info'
3
+ require 'eac_fs/file_info'
4
4
  require 'eac_ruby_utils/core_ext'
5
5
 
6
6
  module EhbrsRubyUtils
7
7
  module Fs
8
- class CompressedPackage < ::Avm::Files::Info
8
+ class CompressedPackage < ::EacFs::FileInfo
9
9
  MIME_TYPES = {
10
10
  'application/zip' => :zip,
11
11
  'application/x-7z-compressed' => :sevenzip,
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module EhbrsRubyUtils
4
- VERSION = '0.12.0'
4
+ VERSION = '0.12.1'
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ehbrs-tools
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.28.1
4
+ version: 0.28.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Esquilo Azul Company
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2021-09-25 00:00:00.000000000 Z
11
+ date: 2021-10-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: avm-tools
@@ -482,6 +482,7 @@ files:
482
482
  - vendor/eac_fs/eac_fs.gemspec
483
483
  - vendor/eac_fs/lib/eac_fs.rb
484
484
  - vendor/eac_fs/lib/eac_fs/cache.rb
485
+ - vendor/eac_fs/lib/eac_fs/cached_download.rb
485
486
  - vendor/eac_fs/lib/eac_fs/file_info.rb
486
487
  - vendor/eac_fs/lib/eac_fs/patches.rb
487
488
  - vendor/eac_fs/lib/eac_fs/patches/module.rb