eac_ruby_utils 0.47.0 → 0.51.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_ruby_utils/blank_not_blank.rb +19 -0
- data/lib/eac_ruby_utils/configs/base.rb +43 -0
- data/lib/eac_ruby_utils/configs/file.rb +12 -31
- data/lib/eac_ruby_utils/console/configs.rb +8 -40
- data/lib/eac_ruby_utils/console/configs/read_entry_options.rb +41 -0
- data/lib/eac_ruby_utils/fs/clearable_directory.rb +57 -0
- data/lib/eac_ruby_utils/patches/enumerator.rb +4 -0
- data/lib/eac_ruby_utils/patches/enumerator/current.rb +9 -0
- data/lib/eac_ruby_utils/patches/enumerator/stopped.rb +14 -0
- data/lib/eac_ruby_utils/patches/object/debug.rb +17 -0
- data/lib/eac_ruby_utils/paths_hash.rb +21 -58
- data/lib/eac_ruby_utils/paths_hash/entry_key_error.rb +8 -0
- data/lib/eac_ruby_utils/paths_hash/node.rb +67 -0
- data/lib/eac_ruby_utils/paths_hash/path_search.rb +39 -0
- data/lib/eac_ruby_utils/struct.rb +4 -0
- data/lib/eac_ruby_utils/version.rb +1 -1
- metadata +13 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: db10c1ceaf0bbf46f4d4bb60de583c5bd0e9dcb4d9e836919ba4cbb3da526583
|
4
|
+
data.tar.gz: 9f84d861c34de8496ff30bb5bc14bf376bfba47a81c7ace9e8e51e006d44f4de
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c61d5b10f2981624324aaa7cee8f1c554e1521814fd158f43701d42391fcb4f29b8e2b55b799f887f1434ee47ea032108ae96136fd8200fde7fbe8181fe8efab
|
7
|
+
data.tar.gz: 3339282f35c34c843b500a0d37a025a6f53be072e495771d6262d08fda8c3957dad6feedbc82d0b6bfdb1eeebc1cc8a6f9c183f5071f1e90cd205a9c79404e71
|
@@ -0,0 +1,19 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'active_support/core_ext/object/blank'
|
4
|
+
require 'singleton'
|
5
|
+
|
6
|
+
module EacRubyUtils
|
7
|
+
# A blank string which returns +false+ for +blank?+ method.
|
8
|
+
class BlankNotBlank < String
|
9
|
+
include ::Singleton
|
10
|
+
|
11
|
+
def initialize
|
12
|
+
super('')
|
13
|
+
end
|
14
|
+
|
15
|
+
def blank?
|
16
|
+
false
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
@@ -0,0 +1,43 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'eac_ruby_utils/blank_not_blank'
|
4
|
+
require 'eac_ruby_utils/core_ext'
|
5
|
+
require 'eac_ruby_utils/paths_hash'
|
6
|
+
|
7
|
+
module EacRubyUtils
|
8
|
+
class Configs
|
9
|
+
class Base
|
10
|
+
enable_simple_cache
|
11
|
+
|
12
|
+
common_constructor :data, default: [{}] do
|
13
|
+
self.data = ::EacRubyUtils::PathsHash.new(data)
|
14
|
+
end
|
15
|
+
|
16
|
+
def []=(entry_key, entry_value)
|
17
|
+
write(entry_key, entry_value)
|
18
|
+
end
|
19
|
+
|
20
|
+
def [](entry_key)
|
21
|
+
read(entry_key)
|
22
|
+
end
|
23
|
+
|
24
|
+
def clear
|
25
|
+
replace({})
|
26
|
+
end
|
27
|
+
|
28
|
+
def read(entry_key)
|
29
|
+
return nil unless data.key?(entry_key)
|
30
|
+
|
31
|
+
data.fetch(entry_key).if_present(::EacRubyUtils::BlankNotBlank.instance)
|
32
|
+
end
|
33
|
+
|
34
|
+
def replace(new_data)
|
35
|
+
self.data = ::EacRubyUtils::PathsHash.new(new_data)
|
36
|
+
end
|
37
|
+
|
38
|
+
def write(entry_key, entry_value)
|
39
|
+
data[entry_key] = entry_value
|
40
|
+
end
|
41
|
+
end
|
42
|
+
end
|
43
|
+
end
|
@@ -1,27 +1,18 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
require '
|
3
|
+
require 'eac_ruby_utils/configs/base'
|
4
4
|
require 'yaml'
|
5
|
-
require 'eac_ruby_utils/patches/hash/sym_keys_hash'
|
6
|
-
require 'eac_ruby_utils/paths_hash'
|
7
|
-
require 'eac_ruby_utils/simple_cache'
|
8
5
|
|
9
6
|
module EacRubyUtils
|
10
7
|
class Configs
|
11
|
-
class File
|
12
|
-
include ::EacRubyUtils::SimpleCache
|
13
|
-
|
8
|
+
class File < ::EacRubyUtils::Configs::Base
|
14
9
|
attr_reader :path, :options
|
15
10
|
|
16
11
|
# Valid options: [:autosave]
|
17
12
|
def initialize(path, options = {})
|
18
13
|
@path = path
|
19
14
|
@options = options.to_sym_keys_hash.freeze
|
20
|
-
|
21
|
-
end
|
22
|
-
|
23
|
-
def clear
|
24
|
-
self.data = ::EacRubyUtils::PathsHash.new({})
|
15
|
+
super(raw_data_from_file)
|
25
16
|
end
|
26
17
|
|
27
18
|
def save
|
@@ -30,37 +21,27 @@ module EacRubyUtils
|
|
30
21
|
end
|
31
22
|
|
32
23
|
def load
|
33
|
-
|
34
|
-
::EacRubyUtils::PathsHash.new(YAML.load_file(path))
|
35
|
-
else
|
36
|
-
{}
|
37
|
-
end
|
38
|
-
end
|
39
|
-
|
40
|
-
def []=(entry_key, entry_value)
|
41
|
-
write(entry_key, entry_value)
|
24
|
+
replace(raw_data_from_file)
|
42
25
|
end
|
43
26
|
|
44
27
|
def write(entry_key, entry_value)
|
45
|
-
|
28
|
+
super
|
46
29
|
save if autosave?
|
47
30
|
end
|
48
31
|
|
49
|
-
def [](entry_key)
|
50
|
-
read(entry_key)
|
51
|
-
end
|
52
|
-
|
53
|
-
def read(entry_key)
|
54
|
-
data[entry_key]
|
55
|
-
end
|
56
|
-
|
57
32
|
def autosave?
|
58
33
|
options[:autosave] ? true : false
|
59
34
|
end
|
60
35
|
|
61
36
|
private
|
62
37
|
|
63
|
-
|
38
|
+
def raw_data_from_file
|
39
|
+
if ::File.exist?(path) && ::File.size(path).positive?
|
40
|
+
::YAML.load_file(path)
|
41
|
+
else
|
42
|
+
{}
|
43
|
+
end
|
44
|
+
end
|
64
45
|
end
|
65
46
|
end
|
66
47
|
end
|
@@ -1,16 +1,13 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
require 'eac_ruby_utils/common_constructor'
|
4
3
|
require 'eac_ruby_utils/configs'
|
5
|
-
require 'eac_ruby_utils/
|
6
|
-
require 'eac_ruby_utils/options_consumer'
|
7
|
-
require 'eac_ruby_utils/patches/object/asserts'
|
8
|
-
require 'eac_ruby_utils/simple_cache'
|
4
|
+
require 'eac_ruby_utils/core_ext'
|
9
5
|
|
10
6
|
module EacRubyUtils
|
11
7
|
module Console
|
12
8
|
class Configs
|
13
|
-
|
9
|
+
require_sub __FILE__
|
10
|
+
enable_console_speaker
|
14
11
|
|
15
12
|
class << self
|
16
13
|
def entry_key_to_envvar_name(entry_key)
|
@@ -34,7 +31,7 @@ module EacRubyUtils
|
|
34
31
|
end
|
35
32
|
|
36
33
|
def read_password(entry_key, options = {})
|
37
|
-
options = options.merge(noecho: true)
|
34
|
+
options = ReadEntryOptions.new(options.merge(noecho: true))
|
38
35
|
if store_passwords?
|
39
36
|
read_entry(entry_key, options)
|
40
37
|
else
|
@@ -66,7 +63,10 @@ module EacRubyUtils
|
|
66
63
|
protected
|
67
64
|
|
68
65
|
def envvar_read_entry(entry_key)
|
69
|
-
|
66
|
+
env_entry_key = self.class.entry_key_to_envvar_name(entry_key)
|
67
|
+
return nil unless ENV.key?(env_entry_key)
|
68
|
+
|
69
|
+
ENV.fetch(env_entry_key).if_present(::EacRubyUtils::BlankNotBlank.instance)
|
70
70
|
end
|
71
71
|
|
72
72
|
def read_entry_from_console(entry_key, options)
|
@@ -98,38 +98,6 @@ module EacRubyUtils
|
|
98
98
|
warn('Entered value is blank') if entry_value.blank?
|
99
99
|
entry_value
|
100
100
|
end
|
101
|
-
|
102
|
-
class ReadEntryOptions
|
103
|
-
include ::EacRubyUtils::SimpleCache
|
104
|
-
::EacRubyUtils::CommonConstructor.new(:options).setup_class(self)
|
105
|
-
|
106
|
-
DEFAULT_VALUES = {
|
107
|
-
before_input: nil, bool: false, list: false, noecho: false, noenv: false, noinput: false,
|
108
|
-
required: true, validator: nil
|
109
|
-
}.freeze
|
110
|
-
|
111
|
-
def [](key)
|
112
|
-
values.fetch(key.to_sym)
|
113
|
-
end
|
114
|
-
|
115
|
-
def request_input_options
|
116
|
-
values.slice(:bool, :list, :noecho)
|
117
|
-
end
|
118
|
-
|
119
|
-
private
|
120
|
-
|
121
|
-
def values_uncached
|
122
|
-
consumer = ::EacRubyUtils::OptionsConsumer.new(options)
|
123
|
-
r = {}
|
124
|
-
DEFAULT_VALUES.each do |key, default_value|
|
125
|
-
value = consumer.consume(key)
|
126
|
-
value = default_value if value.nil?
|
127
|
-
r[key] = value
|
128
|
-
end
|
129
|
-
consumer.validate
|
130
|
-
r
|
131
|
-
end
|
132
|
-
end
|
133
101
|
end
|
134
102
|
end
|
135
103
|
end
|
@@ -0,0 +1,41 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'eac_ruby_utils/core_ext'
|
4
|
+
|
5
|
+
module EacRubyUtils
|
6
|
+
module Console
|
7
|
+
class Configs
|
8
|
+
class ReadEntryOptions
|
9
|
+
enable_simple_cache
|
10
|
+
common_constructor :options
|
11
|
+
|
12
|
+
DEFAULT_VALUES = {
|
13
|
+
before_input: nil, bool: false, list: false, noecho: false, noenv: false, noinput: false,
|
14
|
+
required: true, validator: nil
|
15
|
+
}.freeze
|
16
|
+
|
17
|
+
def [](key)
|
18
|
+
values.fetch(key.to_sym)
|
19
|
+
end
|
20
|
+
|
21
|
+
def request_input_options
|
22
|
+
values.slice(:bool, :list, :noecho)
|
23
|
+
end
|
24
|
+
|
25
|
+
private
|
26
|
+
|
27
|
+
def values_uncached
|
28
|
+
consumer = options.to_options_consumer
|
29
|
+
r = {}
|
30
|
+
DEFAULT_VALUES.each do |key, default_value|
|
31
|
+
value = consumer.consume(key)
|
32
|
+
value = default_value if value.nil?
|
33
|
+
r[key] = value
|
34
|
+
end
|
35
|
+
consumer.validate
|
36
|
+
r
|
37
|
+
end
|
38
|
+
end
|
39
|
+
end
|
40
|
+
end
|
41
|
+
end
|
@@ -0,0 +1,57 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'fileutils'
|
4
|
+
require 'pathname'
|
5
|
+
|
6
|
+
module EacRubyUtils
|
7
|
+
module Fs
|
8
|
+
class ClearableDirectory < ::Pathname
|
9
|
+
CLEARABLE_BASENAME = '.clearable_directory'
|
10
|
+
|
11
|
+
def clear
|
12
|
+
validate_clearable
|
13
|
+
directory? ? clear_directory : clear_no_directory
|
14
|
+
mkpath
|
15
|
+
::FileUtils.touch(clearable_note_file.to_path)
|
16
|
+
self
|
17
|
+
end
|
18
|
+
|
19
|
+
def clearable?
|
20
|
+
clearable_negate_message ? true : false
|
21
|
+
end
|
22
|
+
|
23
|
+
def clearable_negate_message
|
24
|
+
return if !exist? || empty?
|
25
|
+
return "Path \"#{self}\" exists, is not empty and is not a directory" unless directory?
|
26
|
+
return if clearable_note_file.exist?
|
27
|
+
|
28
|
+
"Directory \"#{self}\" is not empty and does not have a #{CLEARABLE_BASENAME} file"
|
29
|
+
end
|
30
|
+
|
31
|
+
def clearable_note_file
|
32
|
+
join(CLEARABLE_BASENAME)
|
33
|
+
end
|
34
|
+
|
35
|
+
def validate_clearable
|
36
|
+
message = clearable_negate_message
|
37
|
+
raise message if message
|
38
|
+
end
|
39
|
+
|
40
|
+
private
|
41
|
+
|
42
|
+
def clear_directory
|
43
|
+
children.each do |child|
|
44
|
+
if child.directory?
|
45
|
+
child.rmtree
|
46
|
+
elsif child.file?
|
47
|
+
child.unlink
|
48
|
+
end
|
49
|
+
end
|
50
|
+
end
|
51
|
+
|
52
|
+
def clear_no_directory
|
53
|
+
::FileUtils.rm_rf(to_path)
|
54
|
+
end
|
55
|
+
end
|
56
|
+
end
|
57
|
+
end
|
@@ -1,21 +1,25 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
require '
|
4
|
-
require 'eac_ruby_utils/patches/object/asserts'
|
3
|
+
require 'eac_ruby_utils/core_ext'
|
5
4
|
|
6
5
|
module EacRubyUtils
|
7
6
|
class PathsHash
|
7
|
+
require_sub __FILE__
|
8
|
+
|
8
9
|
class << self
|
9
10
|
def parse_entry_key(entry_key)
|
10
11
|
r = entry_key.to_s.strip
|
11
|
-
raise EntryKeyError, 'Entry key cannot start or end with dot' if
|
12
|
+
raise ::EacRubyUtils::PathsHash::EntryKeyError, 'Entry key cannot start or end with dot' if
|
12
13
|
r.start_with?('.') || r.end_with?('.')
|
13
14
|
|
14
15
|
r = r.split('.').map(&:strip)
|
15
|
-
|
16
|
+
if r.empty?
|
17
|
+
raise ::EacRubyUtils::PathsHash::EntryKeyError, "Entry key \"#{entry_key}\" is empty"
|
18
|
+
end
|
16
19
|
return r.map(&:to_sym) unless r.any?(&:blank?)
|
17
20
|
|
18
|
-
raise EntryKeyError,
|
21
|
+
raise ::EacRubyUtils::PathsHash::EntryKeyError,
|
22
|
+
"Entry key \"#{entry_key}\" has at least one blank part"
|
19
23
|
end
|
20
24
|
end
|
21
25
|
|
@@ -26,68 +30,27 @@ module EacRubyUtils
|
|
26
30
|
end
|
27
31
|
|
28
32
|
def [](entry_key)
|
29
|
-
root.read_entry(
|
33
|
+
root.read_entry(::EacRubyUtils::PathsHash::PathSearch.parse_entry_key(entry_key))
|
30
34
|
end
|
31
35
|
|
32
36
|
def []=(entry_key, entry_value)
|
33
|
-
root.write_entry(
|
37
|
+
root.write_entry(
|
38
|
+
::EacRubyUtils::PathsHash::PathSearch.parse_entry_key(entry_key), entry_value
|
39
|
+
)
|
34
40
|
end
|
35
41
|
|
36
|
-
|
37
|
-
|
38
|
-
private
|
39
|
-
|
40
|
-
attr_reader :data
|
41
|
-
|
42
|
-
class EntryKeyError < StandardError
|
42
|
+
def fetch(entry_key)
|
43
|
+
root.fetch(::EacRubyUtils::PathsHash::PathSearch.parse_entry_key(entry_key))
|
43
44
|
end
|
44
45
|
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
@data = source_hash.map { |k, v| [k.to_sym, v.is_a?(Hash) ? Node.new(v) : v] }.to_h
|
49
|
-
end
|
50
|
-
|
51
|
-
def to_h
|
52
|
-
data.map { |k, v| [k, v.is_a?(Node) ? v.to_h : v] }.to_h
|
53
|
-
end
|
54
|
-
|
55
|
-
def read_entry(path, current)
|
56
|
-
validate_path(path, current)
|
57
|
-
node_key = path.shift
|
58
|
-
node = data[node_key]
|
59
|
-
return (node.is_a?(Node) ? node.to_h : node) if path.empty?
|
60
|
-
return nil if node.blank?
|
61
|
-
return node.read_entry(path, current + [node_key]) if node.is_a?(Node)
|
62
|
-
|
63
|
-
raise(EntryKeyError,
|
64
|
-
"Path #{current.join(',')} is not a Node and path continues (#{current + path})")
|
65
|
-
end
|
66
|
-
|
67
|
-
def write_entry(path, value, current)
|
68
|
-
validate_path(path, current)
|
69
|
-
node_key = path.shift
|
70
|
-
write_entry_value(path, node_key, value, current)
|
71
|
-
end
|
72
|
-
|
73
|
-
private
|
46
|
+
def key?(entry_key)
|
47
|
+
root.entry?(::EacRubyUtils::PathsHash::PathSearch.parse_entry_key(entry_key))
|
48
|
+
end
|
74
49
|
|
75
|
-
|
76
|
-
if path.empty?
|
77
|
-
data[node_key] = value.is_a?(Hash) ? Node.new(value) : value
|
78
|
-
else
|
79
|
-
data[node_key] = Node.new({}) unless data[node_key].is_a?(Node)
|
80
|
-
data[node_key].write_entry(path, value, current + [node_key])
|
81
|
-
end
|
82
|
-
end
|
50
|
+
delegate :to_h, to: :root
|
83
51
|
|
84
|
-
|
85
|
-
path.assert_argument(Array, 'path')
|
86
|
-
current.assert_argument(Array, 'current')
|
87
|
-
raise EntryKeyError, 'Path is empty' if path.empty?
|
88
|
-
end
|
52
|
+
private
|
89
53
|
|
90
|
-
|
91
|
-
end
|
54
|
+
attr_reader :data
|
92
55
|
end
|
93
56
|
end
|
@@ -0,0 +1,67 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'eac_ruby_utils/core_ext'
|
4
|
+
require 'eac_ruby_utils/paths_hash/entry_key_error'
|
5
|
+
|
6
|
+
module EacRubyUtils
|
7
|
+
class PathsHash
|
8
|
+
class Node
|
9
|
+
PATH_SEARCH_UNENDED_ERROR_MESSAGE = 'Path search is not a Node and is not ended'
|
10
|
+
|
11
|
+
def initialize(source_hash)
|
12
|
+
source_hash.assert_argument(Hash, 'source_hash')
|
13
|
+
@data = source_hash.map { |k, v| [k.to_sym, v.is_a?(Hash) ? Node.new(v) : v] }.to_h
|
14
|
+
end
|
15
|
+
|
16
|
+
def entry?(path_search)
|
17
|
+
return false unless data.key?(path_search.cursor)
|
18
|
+
return true if path_search.ended?
|
19
|
+
return data.fetch(path_search.cursor).entry?(path_search.succeeding) if
|
20
|
+
data.fetch(path_search.cursor).is_a?(Node)
|
21
|
+
|
22
|
+
false # Paths continue and there is not available nodes
|
23
|
+
end
|
24
|
+
|
25
|
+
def fetch(path_search)
|
26
|
+
if data.key?(path_search.cursor)
|
27
|
+
node = data.fetch(path_search.cursor)
|
28
|
+
return (node.is_a?(Node) ? node.to_h : node) if path_search.ended?
|
29
|
+
return nil if node.blank?
|
30
|
+
return node.fetch(path_search.succeeding) if node.is_a?(Node)
|
31
|
+
end
|
32
|
+
|
33
|
+
path_search.raise_error(PATH_SEARCH_UNENDED_ERROR_MESSAGE)
|
34
|
+
end
|
35
|
+
|
36
|
+
def to_h
|
37
|
+
data.map { |k, v| [k, v.is_a?(Node) ? v.to_h : v] }.to_h
|
38
|
+
end
|
39
|
+
|
40
|
+
def read_entry(path_search)
|
41
|
+
node = data[path_search.cursor]
|
42
|
+
return (node.is_a?(Node) ? node.to_h : node) if path_search.ended?
|
43
|
+
return nil if node.blank?
|
44
|
+
return node.read_entry(path_search.succeeding) if node.is_a?(Node)
|
45
|
+
|
46
|
+
path_search.raise_error(PATH_SEARCH_UNENDED_ERROR_MESSAGE)
|
47
|
+
end
|
48
|
+
|
49
|
+
def write_entry(path_search, value)
|
50
|
+
if path_search.ended?
|
51
|
+
data[path_search.cursor] = value.is_a?(Hash) ? self.class.new(value) : value
|
52
|
+
else
|
53
|
+
assert_data_node(path_search.cursor).write_entry(path_search.succeeding, value)
|
54
|
+
end
|
55
|
+
end
|
56
|
+
|
57
|
+
private
|
58
|
+
|
59
|
+
attr_reader :data
|
60
|
+
|
61
|
+
def assert_data_node(key)
|
62
|
+
data[key] = self.class.new({}) unless data[key].is_a?(Node)
|
63
|
+
data[key]
|
64
|
+
end
|
65
|
+
end
|
66
|
+
end
|
67
|
+
end
|
@@ -0,0 +1,39 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module EacRubyUtils
|
4
|
+
class PathsHash
|
5
|
+
class PathSearch
|
6
|
+
class << self
|
7
|
+
def parse_entry_key(string)
|
8
|
+
new(::EacRubyUtils::PathsHash.parse_entry_key(string), [])
|
9
|
+
end
|
10
|
+
end
|
11
|
+
|
12
|
+
common_constructor :current, :previous do
|
13
|
+
self.current = current.assert_argument(Array, 'current').freeze
|
14
|
+
self.previous = previous.assert_argument(Array, 'previous')
|
15
|
+
raise ::EacRubyUtils::PathsHash::EntryKeyError, 'Current is empty' if current.empty?
|
16
|
+
end
|
17
|
+
|
18
|
+
def cursor
|
19
|
+
current.first
|
20
|
+
end
|
21
|
+
|
22
|
+
def ended?
|
23
|
+
current.count <= 1
|
24
|
+
end
|
25
|
+
|
26
|
+
def raise_error(message)
|
27
|
+
raise ::EacRubyUtils::PathsHash::EntryKeyError, "#{message} (#{self})"
|
28
|
+
end
|
29
|
+
|
30
|
+
def succeeding
|
31
|
+
self.class.new(current[1..-1], previous + [cursor])
|
32
|
+
end
|
33
|
+
|
34
|
+
def to_s
|
35
|
+
"#{self.class}[Current: #{current}, Previous: #{previous}]"
|
36
|
+
end
|
37
|
+
end
|
38
|
+
end
|
39
|
+
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.
|
4
|
+
version: 0.51.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: 2020-
|
11
|
+
date: 2020-11-16 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|
@@ -109,14 +109,17 @@ files:
|
|
109
109
|
- README.rdoc
|
110
110
|
- lib/eac_ruby_utils.rb
|
111
111
|
- lib/eac_ruby_utils/arguments_consumer.rb
|
112
|
+
- lib/eac_ruby_utils/blank_not_blank.rb
|
112
113
|
- lib/eac_ruby_utils/boolean.rb
|
113
114
|
- lib/eac_ruby_utils/by_reference.rb
|
114
115
|
- lib/eac_ruby_utils/common_concern.rb
|
115
116
|
- lib/eac_ruby_utils/common_constructor.rb
|
116
117
|
- lib/eac_ruby_utils/configs.rb
|
118
|
+
- lib/eac_ruby_utils/configs/base.rb
|
117
119
|
- lib/eac_ruby_utils/configs/file.rb
|
118
120
|
- lib/eac_ruby_utils/console.rb
|
119
121
|
- lib/eac_ruby_utils/console/configs.rb
|
122
|
+
- lib/eac_ruby_utils/console/configs/read_entry_options.rb
|
120
123
|
- lib/eac_ruby_utils/console/docopt_runner.rb
|
121
124
|
- lib/eac_ruby_utils/console/docopt_runner/_class_methods.rb
|
122
125
|
- lib/eac_ruby_utils/console/docopt_runner/_doc.rb
|
@@ -146,6 +149,7 @@ files:
|
|
146
149
|
- lib/eac_ruby_utils/envs/ssh_env/terminal.rb
|
147
150
|
- lib/eac_ruby_utils/filesystem_cache.rb
|
148
151
|
- lib/eac_ruby_utils/fs.rb
|
152
|
+
- lib/eac_ruby_utils/fs/clearable_directory.rb
|
149
153
|
- lib/eac_ruby_utils/fs/extname.rb
|
150
154
|
- lib/eac_ruby_utils/fs/temp.rb
|
151
155
|
- lib/eac_ruby_utils/fs/temp/directory.rb
|
@@ -179,6 +183,9 @@ files:
|
|
179
183
|
- lib/eac_ruby_utils/patches/class/common_constructor.rb
|
180
184
|
- lib/eac_ruby_utils/patches/enumerable.rb
|
181
185
|
- lib/eac_ruby_utils/patches/enumerable/boolean_combinations.rb
|
186
|
+
- lib/eac_ruby_utils/patches/enumerator.rb
|
187
|
+
- lib/eac_ruby_utils/patches/enumerator/current.rb
|
188
|
+
- lib/eac_ruby_utils/patches/enumerator/stopped.rb
|
182
189
|
- lib/eac_ruby_utils/patches/hash.rb
|
183
190
|
- lib/eac_ruby_utils/patches/hash/options_consumer.rb
|
184
191
|
- lib/eac_ruby_utils/patches/hash/sym_keys_hash.rb
|
@@ -192,6 +199,7 @@ files:
|
|
192
199
|
- lib/eac_ruby_utils/patches/module/simple_cache.rb
|
193
200
|
- lib/eac_ruby_utils/patches/object.rb
|
194
201
|
- lib/eac_ruby_utils/patches/object/asserts.rb
|
202
|
+
- lib/eac_ruby_utils/patches/object/debug.rb
|
195
203
|
- lib/eac_ruby_utils/patches/object/if_present.rb
|
196
204
|
- lib/eac_ruby_utils/patches/object/if_respond.rb
|
197
205
|
- lib/eac_ruby_utils/patches/object/template.rb
|
@@ -206,6 +214,9 @@ files:
|
|
206
214
|
- lib/eac_ruby_utils/patches/time/default_time_zone_set.rb
|
207
215
|
- lib/eac_ruby_utils/patches/time/local_time_zone.rb
|
208
216
|
- lib/eac_ruby_utils/paths_hash.rb
|
217
|
+
- lib/eac_ruby_utils/paths_hash/entry_key_error.rb
|
218
|
+
- lib/eac_ruby_utils/paths_hash/node.rb
|
219
|
+
- lib/eac_ruby_utils/paths_hash/path_search.rb
|
209
220
|
- lib/eac_ruby_utils/require_sub.rb
|
210
221
|
- lib/eac_ruby_utils/rspec.rb
|
211
222
|
- lib/eac_ruby_utils/rspec/conditional.rb
|