eac_fs 0.14.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/core_ext.rb +4 -0
- data/lib/eac_fs/rspec/setup.rb +25 -0
- data/lib/eac_fs/rspec.rb +9 -0
- data/lib/eac_fs/storage_tree.rb +19 -0
- data/lib/eac_fs/version.rb +1 -1
- metadata +9 -6
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
|
@@ -0,0 +1,25 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'eac_ruby_utils/core_ext'
|
4
|
+
require 'eac_fs/contexts'
|
5
|
+
require 'eac_fs/storage_tree'
|
6
|
+
require 'eac_ruby_utils/fs/temp'
|
7
|
+
|
8
|
+
module EacFs
|
9
|
+
module Rspec
|
10
|
+
module Setup
|
11
|
+
require_sub __FILE__
|
12
|
+
|
13
|
+
# @return [self]
|
14
|
+
def stub_eac_fs_contexts
|
15
|
+
::EacFs::Contexts::TYPES.each do |type|
|
16
|
+
::EacFs::Contexts.send(type).push(
|
17
|
+
::EacFs::StorageTree.new(::EacRubyUtils::Fs::Temp.directory)
|
18
|
+
)
|
19
|
+
end
|
20
|
+
|
21
|
+
self
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
data/lib/eac_fs/rspec.rb
ADDED
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
|
+
date: 2022-11-22 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: content-type
|
@@ -36,20 +36,20 @@ dependencies:
|
|
36
36
|
requirements:
|
37
37
|
- - "~>"
|
38
38
|
- !ruby/object:Gem::Version
|
39
|
-
version: '0.
|
39
|
+
version: '0.107'
|
40
40
|
- - ">="
|
41
41
|
- !ruby/object:Gem::Version
|
42
|
-
version: 0.
|
42
|
+
version: 0.107.1
|
43
43
|
type: :runtime
|
44
44
|
prerelease: false
|
45
45
|
version_requirements: !ruby/object:Gem::Requirement
|
46
46
|
requirements:
|
47
47
|
- - "~>"
|
48
48
|
- !ruby/object:Gem::Version
|
49
|
-
version: '0.
|
49
|
+
version: '0.107'
|
50
50
|
- - ">="
|
51
51
|
- !ruby/object:Gem::Version
|
52
|
-
version: 0.
|
52
|
+
version: 0.107.1
|
53
53
|
- !ruby/object:Gem::Dependency
|
54
54
|
name: ruby-filemagic
|
55
55
|
requirement: !ruby/object:Gem::Requirement
|
@@ -96,6 +96,7 @@ files:
|
|
96
96
|
- lib/eac_fs/comparator/build.rb
|
97
97
|
- lib/eac_fs/comparator/rename_file.rb
|
98
98
|
- lib/eac_fs/contexts.rb
|
99
|
+
- lib/eac_fs/core_ext.rb
|
99
100
|
- lib/eac_fs/file_info.rb
|
100
101
|
- lib/eac_fs/logs.rb
|
101
102
|
- lib/eac_fs/logs/file.rb
|
@@ -106,6 +107,8 @@ files:
|
|
106
107
|
- lib/eac_fs/patches/object/fs_cache.rb
|
107
108
|
- lib/eac_fs/patches/pathname.rb
|
108
109
|
- lib/eac_fs/patches/pathname/info.rb
|
110
|
+
- lib/eac_fs/rspec.rb
|
111
|
+
- lib/eac_fs/rspec/setup.rb
|
109
112
|
- lib/eac_fs/storage_tree.rb
|
110
113
|
- lib/eac_fs/traversable.rb
|
111
114
|
- lib/eac_fs/traverser.rb
|