eac_ruby_utils 0.60.0 → 0.64.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/envs/command.rb +10 -5
- data/lib/eac_ruby_utils/filesystem_cache.rb +6 -0
- data/lib/eac_ruby_utils/fs/logs.rb +63 -0
- data/lib/eac_ruby_utils/inflector.rb +9 -1
- data/lib/eac_ruby_utils/listable/list.rb +3 -2
- data/lib/eac_ruby_utils/patches/kernel/nyi.rb +4 -2
- data/lib/eac_ruby_utils/patches/module/common_concern.rb +0 -1
- data/lib/eac_ruby_utils/patches/regexp/to_parser.rb +10 -0
- data/lib/eac_ruby_utils/patches/string/inflector.rb +4 -2
- data/lib/eac_ruby_utils/regexp_parser.rb +34 -0
- data/lib/eac_ruby_utils/rspec/conditional.rb +1 -4
- data/lib/eac_ruby_utils/simple_cache.rb +18 -5
- data/lib/eac_ruby_utils/version.rb +1 -1
- metadata +13 -66
- data/lib/eac_ruby_utils/configs.rb +0 -74
- data/lib/eac_ruby_utils/configs/base.rb +0 -43
- data/lib/eac_ruby_utils/configs/file.rb +0 -47
- data/lib/eac_ruby_utils/console.rb +0 -5
- data/lib/eac_ruby_utils/console/configs.rb +0 -38
- data/lib/eac_ruby_utils/console/configs/entry_reader.rb +0 -81
- data/lib/eac_ruby_utils/console/configs/password_entry_reader.rb +0 -18
- data/lib/eac_ruby_utils/console/configs/read_entry_options.rb +0 -46
- data/lib/eac_ruby_utils/console/configs/store_passwords_entry_reader.rb +0 -27
- data/lib/eac_ruby_utils/console/docopt_runner.rb +0 -45
- data/lib/eac_ruby_utils/console/docopt_runner/_class_methods.rb +0 -18
- data/lib/eac_ruby_utils/console/docopt_runner/_doc.rb +0 -25
- data/lib/eac_ruby_utils/console/docopt_runner/_settings.rb +0 -19
- data/lib/eac_ruby_utils/console/docopt_runner/_subcommands.rb +0 -154
- data/lib/eac_ruby_utils/console/speaker.rb +0 -133
- data/lib/eac_ruby_utils/console/speaker/_class_methods.rb +0 -39
- data/lib/eac_ruby_utils/console/speaker/_constants.rb +0 -14
- data/lib/eac_ruby_utils/console/speaker/list.rb +0 -63
- data/lib/eac_ruby_utils/console/speaker/node.rb +0 -26
- data/lib/eac_ruby_utils/patches/module/console_speaker.rb +0 -10
- data/lib/eac_ruby_utils/patches/module/template.rb +0 -10
- data/lib/eac_ruby_utils/patches/object/template.rb +0 -9
- data/lib/eac_ruby_utils/paths_hash.rb +0 -56
- data/lib/eac_ruby_utils/paths_hash/entry_key_error.rb +0 -8
- data/lib/eac_ruby_utils/paths_hash/node.rb +0 -67
- data/lib/eac_ruby_utils/paths_hash/path_search.rb +0 -39
- data/lib/eac_ruby_utils/templates.rb +0 -9
- data/lib/eac_ruby_utils/templates/directory.rb +0 -110
- data/lib/eac_ruby_utils/templates/file.rb +0 -50
- data/lib/eac_ruby_utils/templates/searcher.rb +0 -55
- data/lib/eac_ruby_utils/templates/variable_not_found_error.rb +0 -7
- data/lib/eac_ruby_utils/templates/variable_providers.rb +0 -25
- data/lib/eac_ruby_utils/templates/variable_providers/base.rb +0 -23
- data/lib/eac_ruby_utils/templates/variable_providers/entries_reader.rb +0 -25
- data/lib/eac_ruby_utils/templates/variable_providers/generic.rb +0 -25
- data/lib/eac_ruby_utils/templates/variable_providers/hash.rb +0 -29
@@ -1,25 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
require 'eac_ruby_utils/core_ext'
|
4
|
-
|
5
|
-
module EacRubyUtils
|
6
|
-
module Templates
|
7
|
-
module VariableProviders
|
8
|
-
require_sub __FILE__
|
9
|
-
|
10
|
-
PROVIDERS = %w[entries_reader hash generic].map do |name|
|
11
|
-
"eac_ruby_utils/templates/variable_providers/#{name}".camelize.constantize
|
12
|
-
end
|
13
|
-
|
14
|
-
class << self
|
15
|
-
def build(variables_source)
|
16
|
-
PROVIDERS.each do |provider|
|
17
|
-
return provider.new(variables_source) if provider.accept?(variables_source)
|
18
|
-
end
|
19
|
-
|
20
|
-
raise "Variables provider not found for #{variables_source}"
|
21
|
-
end
|
22
|
-
end
|
23
|
-
end
|
24
|
-
end
|
25
|
-
end
|
@@ -1,23 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
require 'eac_ruby_utils/templates/variable_not_found_error'
|
4
|
-
|
5
|
-
module EacRubyUtils
|
6
|
-
module Templates
|
7
|
-
module VariableProviders
|
8
|
-
class Base
|
9
|
-
attr_reader :source
|
10
|
-
|
11
|
-
def initialize(source)
|
12
|
-
@source = source
|
13
|
-
end
|
14
|
-
|
15
|
-
def variable_value(name)
|
16
|
-
return variable_fetch(name) if variable_exist?(name)
|
17
|
-
|
18
|
-
raise VariableNotFoundError, "Variable \"#{name}\" not found in #{source}"
|
19
|
-
end
|
20
|
-
end
|
21
|
-
end
|
22
|
-
end
|
23
|
-
end
|
@@ -1,25 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
require 'eac_ruby_utils/templates/variable_providers/base'
|
4
|
-
|
5
|
-
module EacRubyUtils
|
6
|
-
module Templates
|
7
|
-
module VariableProviders
|
8
|
-
class EntriesReader < ::EacRubyUtils::Templates::VariableProviders::Base
|
9
|
-
class << self
|
10
|
-
def accept?(variables_source)
|
11
|
-
variables_source.respond_to?(:read_entry)
|
12
|
-
end
|
13
|
-
end
|
14
|
-
|
15
|
-
def variable_exist?(_name)
|
16
|
-
true
|
17
|
-
end
|
18
|
-
|
19
|
-
def variable_fetch(name)
|
20
|
-
source.read_entry(name)
|
21
|
-
end
|
22
|
-
end
|
23
|
-
end
|
24
|
-
end
|
25
|
-
end
|
@@ -1,25 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
require 'eac_ruby_utils/templates/variable_providers/base'
|
4
|
-
|
5
|
-
module EacRubyUtils
|
6
|
-
module Templates
|
7
|
-
module VariableProviders
|
8
|
-
class Generic < ::EacRubyUtils::Templates::VariableProviders::Base
|
9
|
-
class << self
|
10
|
-
def accept?(variables_source)
|
11
|
-
variables_source.is_a?(::Object)
|
12
|
-
end
|
13
|
-
end
|
14
|
-
|
15
|
-
def variable_exist?(name)
|
16
|
-
source.respond_to?(name)
|
17
|
-
end
|
18
|
-
|
19
|
-
def variable_fetch(name)
|
20
|
-
source.send(name)
|
21
|
-
end
|
22
|
-
end
|
23
|
-
end
|
24
|
-
end
|
25
|
-
end
|
@@ -1,29 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
require 'eac_ruby_utils/templates/variable_providers/base'
|
4
|
-
|
5
|
-
module EacRubyUtils
|
6
|
-
module Templates
|
7
|
-
module VariableProviders
|
8
|
-
class Hash < ::EacRubyUtils::Templates::VariableProviders::Base
|
9
|
-
class << self
|
10
|
-
def accept?(variables_source)
|
11
|
-
variables_source.is_a?(::Hash)
|
12
|
-
end
|
13
|
-
end
|
14
|
-
|
15
|
-
def initialize(source)
|
16
|
-
super(source.with_indifferent_access)
|
17
|
-
end
|
18
|
-
|
19
|
-
def variable_exist?(name)
|
20
|
-
source.key?(name)
|
21
|
-
end
|
22
|
-
|
23
|
-
def variable_fetch(name)
|
24
|
-
source.fetch(name)
|
25
|
-
end
|
26
|
-
end
|
27
|
-
end
|
28
|
-
end
|
29
|
-
end
|