eac_ruby_utils 0.75.0 → 0.76.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: 68abbc7acfbe86b2e24bb721047ef23e0d99c7444c9d97e107db9adbb92adca8
4
- data.tar.gz: af3d13481855122ae753eaaf0ed1dec94ec620524d03cf358592573405017399
3
+ metadata.gz: '09b73f3a93332bc0d9ef7963c51ab545d9f40de9ffa6df3c09beaab2f788cc14'
4
+ data.tar.gz: 6574b30b1407c63bb3ff51fcda661c05622d663deabbd7032b5ad32635376902
5
5
  SHA512:
6
- metadata.gz: '0041989ecacd0b99a2a699fd2fbbceebf22f002360c8f4ef1b622bce4975d230e42b8912b4236d3d653b55a9864c00873be0222ac33ecf8b1efc588880c4bb23'
7
- data.tar.gz: 0a030761ca0ae9030bd68421b8c6e1cbd883ffcae51e947241821deef8c887fcf99819ef2fc7c3f2912c962b81c7c35271950934c87553839923a492af698e8b
6
+ metadata.gz: b7afb496fd00e1ed22f567673dce53a2a678dee0c95a06c664a5155ee19bdb2f4208a37cfd97ec26492ff78663558ead8be6c9e1f36cba36868a2319e326e8c1
7
+ data.tar.gz: 7378232e47c0b748669c68dd4e8125765a60b59628aba6c795061fc3c20a3609dff96fd80cbcbaa0e40a28b76e8c9aecbbd54436d039a0d7e419c37fdb491d08
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module EacRubyUtils
4
- VERSION = '0.75.0'
4
+ VERSION = '0.76.0'
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: eac_ruby_utils
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.75.0
4
+ version: 0.76.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Esquilo Azul Company
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-09-21 00:00:00.000000000 Z
11
+ date: 2021-09-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport
@@ -127,7 +127,6 @@ files:
127
127
  - lib/eac_ruby_utils/envs/ssh_env/identity_file.rb
128
128
  - lib/eac_ruby_utils/envs/ssh_env/quiet.rb
129
129
  - lib/eac_ruby_utils/envs/ssh_env/terminal.rb
130
- - lib/eac_ruby_utils/filesystem_cache.rb
131
130
  - lib/eac_ruby_utils/fs.rb
132
131
  - lib/eac_ruby_utils/fs/clearable_directory.rb
133
132
  - lib/eac_ruby_utils/fs/extname.rb
@@ -137,7 +136,6 @@ files:
137
136
  - lib/eac_ruby_utils/fs/temp/file.rb
138
137
  - lib/eac_ruby_utils/fs/traversable.rb
139
138
  - lib/eac_ruby_utils/fs/traverser.rb
140
- - lib/eac_ruby_utils/fs_cache.rb
141
139
  - lib/eac_ruby_utils/gems_registry.rb
142
140
  - lib/eac_ruby_utils/gems_registry/gem.rb
143
141
  - lib/eac_ruby_utils/immutable.rb
@@ -1,59 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module EacRubyUtils
4
- class FilesystemCache
5
- CONTENT_FILE_NAME = '__content__'
6
-
7
- attr_reader :path
8
-
9
- def initialize(*path_parts)
10
- raise ArgumentError, "\"#{path_parts}\" is empty" if path_parts.empty?
11
-
12
- @path = ::File.expand_path(::File.join(*path_parts.map(&:to_s)))
13
- end
14
-
15
- def clear
16
- return unless cached?
17
-
18
- ::File.unlink(content_path)
19
- end
20
-
21
- def read
22
- return nil unless cached?
23
-
24
- ::File.read(content_path)
25
- end
26
-
27
- def read_or_cache
28
- write(yield) unless cached?
29
-
30
- read
31
- end
32
-
33
- def write(value)
34
- assert_directory_on_path
35
- ::File.write(content_path, value)
36
- value
37
- end
38
-
39
- def child(*child_path_parts)
40
- self.class.new(path, *child_path_parts)
41
- end
42
-
43
- def cached?
44
- ::File.exist?(content_path)
45
- end
46
-
47
- def content_path
48
- ::File.join(path, CONTENT_FILE_NAME)
49
- end
50
-
51
- private
52
-
53
- def assert_directory_on_path
54
- raise "#{path} is a file" if ::File.file?(path)
55
-
56
- ::FileUtils.mkdir_p(path)
57
- end
58
- end
59
- end
@@ -1,12 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require 'eac_ruby_utils/filesystem_cache'
4
- require 'tmpdir'
5
-
6
- module EacRubyUtils
7
- class << self
8
- def fs_cache
9
- @fs_cache ||= ::EacRubyUtils::FilesystemCache.new(::Dir.tmpdir, 'eac_ruby_utils_fs_cache')
10
- end
11
- end
12
- end