eac_fs 0.15.0 → 0.16.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/eac_fs/storage_tree.rb +19 -0
- data/lib/eac_fs/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1a300257ce1a101a3b02f89dc5a949eb61f37e6ed235074f911bbe039bae1e65
|
4
|
+
data.tar.gz: 2c8bb21e251b09eaa07c2cbf9123d4848bb20d94c671a756428458e50078a6dc
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2f57dd6a77ed650bfa10977eb78e168648b0ad5b56472732979dc11cc84ca40a2b5c2d59087ca09996d7d3148efa71c4f1219932668844929a8239deb4c58609
|
7
|
+
data.tar.gz: b0f1828e81c88fea66ed0630e1a70cc543ba3eda00bd143dabb25620e0a389d2e351a862032fc54dccca1e069e3a0246b29493cb10a2aa0f5ac90b4d6ff0de40
|
data/lib/eac_fs/storage_tree.rb
CHANGED
@@ -1,6 +1,7 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
3
|
require 'eac_ruby_utils/core_ext'
|
4
|
+
require 'eac_ruby_utils/yaml'
|
4
5
|
require 'fileutils'
|
5
6
|
|
6
7
|
module EacFs
|
@@ -33,12 +34,30 @@ module EacFs
|
|
33
34
|
read
|
34
35
|
end
|
35
36
|
|
37
|
+
# @return [Object]
|
38
|
+
def read_or_store_yaml(use_cache = true)
|
39
|
+
write_yaml(yield) unless stored? && use_cache
|
40
|
+
|
41
|
+
read_yaml
|
42
|
+
end
|
43
|
+
|
44
|
+
# @return [Object, nil]
|
45
|
+
def read_yaml
|
46
|
+
r = read
|
47
|
+
r.nil? ? nil : ::EacRubyUtils::Yaml.load(r)
|
48
|
+
end
|
49
|
+
|
36
50
|
def write(value)
|
37
51
|
assert_directory_on_path
|
38
52
|
::File.write(content_path, value)
|
39
53
|
value
|
40
54
|
end
|
41
55
|
|
56
|
+
def write_yaml(object)
|
57
|
+
write(::EacRubyUtils::Yaml.dump(object))
|
58
|
+
object
|
59
|
+
end
|
60
|
+
|
42
61
|
def child(*child_path_parts)
|
43
62
|
self.class.new(path, *child_path_parts)
|
44
63
|
end
|
data/lib/eac_fs/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: eac_fs
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.16.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Put here the authors
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-11-
|
11
|
+
date: 2022-11-22 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: content-type
|