eac_ruby_utils 0.39.0 → 0.44.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/boolean.rb +31 -0
- data/lib/eac_ruby_utils/console/docopt_runner/_class_methods.rb +1 -1
- data/lib/eac_ruby_utils/envs/ssh_env.rb +12 -9
- data/lib/eac_ruby_utils/envs/ssh_env/dasho_options.rb +53 -0
- data/lib/eac_ruby_utils/envs/ssh_env/identity_file.rb +25 -0
- data/lib/eac_ruby_utils/envs/ssh_env/quiet.rb +24 -0
- data/lib/eac_ruby_utils/envs/ssh_env/terminal.rb +34 -0
- data/lib/eac_ruby_utils/fs_cache.rb +1 -0
- data/lib/eac_ruby_utils/immutable.rb +15 -0
- data/lib/eac_ruby_utils/immutable/array_accessor.rb +32 -0
- data/lib/eac_ruby_utils/immutable/base_accessor.rb +23 -0
- data/lib/eac_ruby_utils/immutable/boolean_accessor.rb +16 -0
- data/lib/eac_ruby_utils/immutable/class_methods.rb +20 -0
- data/lib/eac_ruby_utils/immutable/common_accessor.rb +30 -0
- data/lib/eac_ruby_utils/immutable/hash_accessor.rb +46 -0
- data/lib/eac_ruby_utils/immutable/instance_methods.rb +21 -0
- data/lib/eac_ruby_utils/listable/list.rb +5 -0
- data/lib/eac_ruby_utils/patches/module/immutable.rb +10 -0
- data/lib/eac_ruby_utils/patches/object/if_respond.rb +22 -0
- data/lib/eac_ruby_utils/require_sub.rb +8 -8
- data/lib/eac_ruby_utils/version.rb +1 -1
- metadata +18 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9bfd8e12446b005875a4071e96d64bce7d841a5459537c846632d303f4d89e05
|
4
|
+
data.tar.gz: cce1b321a2aa297cddc211d646ef8b471fdfda3d7ed4eac3eb690e69ce8772e0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e02f7e7aeb5cb1b1cf54f92abcfe46dfad970c7d637e412d0bb3bb35872dcbb8f4104e8cf7275dc071fb00fd5b29b9a292f9849f2c2ede1239deaec2b32c7f09
|
7
|
+
data.tar.gz: bd1af262c50b1205e15a9e63d70f2929132b7c89c6036b5ddb0f3d25f94590ff6cf05f82151dd7cb3f4e7c8ccad3cd1b5f4878a271f3ab471d59b85d2f73f7f5
|
@@ -0,0 +1,31 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module EacRubyUtils
|
4
|
+
class Boolean
|
5
|
+
class << self
|
6
|
+
def parse(value)
|
7
|
+
return parse_string(value) if value.is_a?(::String)
|
8
|
+
return parse_string(value.to_s) if value.is_a?(::Symbol)
|
9
|
+
return parse_number(value) if value.is_a?(::Number)
|
10
|
+
|
11
|
+
value ? true : false
|
12
|
+
end
|
13
|
+
|
14
|
+
private
|
15
|
+
|
16
|
+
def parse_string(value)
|
17
|
+
['', 'n', 'no', 'f', 'false'].include?(value.strip.downcase) ? false : true
|
18
|
+
end
|
19
|
+
|
20
|
+
def parse_number(value)
|
21
|
+
value.zero?
|
22
|
+
end
|
23
|
+
end
|
24
|
+
|
25
|
+
attr_reader :value
|
26
|
+
|
27
|
+
def initialize(value)
|
28
|
+
@value = self.class.parse(value)
|
29
|
+
end
|
30
|
+
end
|
31
|
+
end
|
@@ -2,12 +2,16 @@
|
|
2
2
|
|
3
3
|
require 'addressable'
|
4
4
|
require 'eac_ruby_utils/envs/base_env'
|
5
|
+
require 'eac_ruby_utils/patches/object/if_present'
|
6
|
+
require 'eac_ruby_utils/patches/module/require_sub'
|
5
7
|
require 'net/ssh'
|
6
8
|
require 'shellwords'
|
7
9
|
|
8
10
|
module EacRubyUtils
|
9
11
|
module Envs
|
10
12
|
class SshEnv < ::EacRubyUtils::Envs::BaseEnv
|
13
|
+
require_sub __FILE__, include_modules: true
|
14
|
+
|
11
15
|
USER_PATTERN = /[a-z_][a-z0-9_-]*/.freeze
|
12
16
|
HOSTNAME_PATTERN = /[^@]+/.freeze
|
13
17
|
USER_HOSTNAME_PATTERN = /\A(?:(#{USER_PATTERN})@)?(#{HOSTNAME_PATTERN})\z/.freeze
|
@@ -49,17 +53,16 @@ module EacRubyUtils
|
|
49
53
|
private
|
50
54
|
|
51
55
|
def ssh_command_line
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
r.map { |a| Shellwords.escape(a) }.join(' ')
|
56
|
+
(%w[ssh] +
|
57
|
+
%w[nodasho dasho port].flat_map { |m| send("ssh_command_line_#{m}_args") } +
|
58
|
+
[user_hostname_uri])
|
59
|
+
.map { |a| Shellwords.escape(a) }.join(' ')
|
57
60
|
end
|
58
61
|
|
59
|
-
def
|
60
|
-
|
61
|
-
|
62
|
-
|
62
|
+
def ssh_command_line_port_args
|
63
|
+
uri.port.if_present([]) do |v|
|
64
|
+
['-p', v]
|
65
|
+
end
|
63
66
|
end
|
64
67
|
|
65
68
|
def user_hostname_uri
|
@@ -0,0 +1,53 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'eac_ruby_utils/patches/module/common_concern'
|
4
|
+
require 'eac_ruby_utils/patches/module/simple_cache'
|
5
|
+
|
6
|
+
module EacRubyUtils
|
7
|
+
module Envs
|
8
|
+
class SshEnv < ::EacRubyUtils::Envs::BaseEnv
|
9
|
+
module DashoOptions
|
10
|
+
common_concern
|
11
|
+
|
12
|
+
module ClassMethods
|
13
|
+
def add_nodasho_option(name)
|
14
|
+
return if nodasho_options.include?(name)
|
15
|
+
|
16
|
+
nodasho_options << name
|
17
|
+
const_set("#{name.underscore}_option".upcase, name)
|
18
|
+
end
|
19
|
+
|
20
|
+
def nodasho_options
|
21
|
+
@nodasho_options ||= []
|
22
|
+
end
|
23
|
+
end
|
24
|
+
|
25
|
+
module InstanceMethods
|
26
|
+
def ssh_command_line_dasho_args
|
27
|
+
r = []
|
28
|
+
uri.query_values&.each do |k, v|
|
29
|
+
r += ['-o', "#{k}=#{v}"] unless nodasho_options.include?(k)
|
30
|
+
end
|
31
|
+
r
|
32
|
+
end
|
33
|
+
|
34
|
+
def ssh_command_line_nodasho_args
|
35
|
+
nodasho_options.flat_map do |option_name|
|
36
|
+
uri_query_value(option_name).if_present([]) do |option_value|
|
37
|
+
send("ssh_command_line_#{option_name.underscore}_args", option_value)
|
38
|
+
end
|
39
|
+
end
|
40
|
+
end
|
41
|
+
|
42
|
+
def nodasho_options
|
43
|
+
self.class.nodasho_options
|
44
|
+
end
|
45
|
+
|
46
|
+
def uri_query_value(name)
|
47
|
+
uri.query_values.if_present { |v| v[name] }
|
48
|
+
end
|
49
|
+
end
|
50
|
+
end
|
51
|
+
end
|
52
|
+
end
|
53
|
+
end
|
@@ -0,0 +1,25 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'active_support/concern'
|
4
|
+
require 'eac_ruby_utils/envs/ssh_env/dasho_options'
|
5
|
+
require 'eac_ruby_utils/listable'
|
6
|
+
require 'eac_ruby_utils/patches/object/if_present'
|
7
|
+
|
8
|
+
module EacRubyUtils
|
9
|
+
module Envs
|
10
|
+
class SshEnv < ::EacRubyUtils::Envs::BaseEnv
|
11
|
+
module IdentityFile
|
12
|
+
extend ::ActiveSupport::Concern
|
13
|
+
|
14
|
+
included do
|
15
|
+
include ::EacRubyUtils::Envs::SshEnv::DashoOptions
|
16
|
+
add_nodasho_option('IdentityFile')
|
17
|
+
end
|
18
|
+
|
19
|
+
def ssh_command_line_identity_file_args(value)
|
20
|
+
['-i', value]
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
@@ -0,0 +1,24 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'active_support/concern'
|
4
|
+
require 'eac_ruby_utils/boolean'
|
5
|
+
require 'eac_ruby_utils/envs/ssh_env/dasho_options'
|
6
|
+
|
7
|
+
module EacRubyUtils
|
8
|
+
module Envs
|
9
|
+
class SshEnv < ::EacRubyUtils::Envs::BaseEnv
|
10
|
+
module Quiet
|
11
|
+
extend ::ActiveSupport::Concern
|
12
|
+
|
13
|
+
included do
|
14
|
+
include ::EacRubyUtils::Envs::SshEnv::DashoOptions
|
15
|
+
add_nodasho_option('Quiet')
|
16
|
+
end
|
17
|
+
|
18
|
+
def ssh_command_line_quiet_args(value)
|
19
|
+
::EacRubyUtils::Boolean.parse(value) ? ['-q'] : []
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
@@ -0,0 +1,34 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'active_support/concern'
|
4
|
+
require 'eac_ruby_utils/envs/ssh_env/dasho_options'
|
5
|
+
require 'eac_ruby_utils/listable'
|
6
|
+
require 'eac_ruby_utils/patches/object/if_present'
|
7
|
+
|
8
|
+
module EacRubyUtils
|
9
|
+
module Envs
|
10
|
+
class SshEnv < ::EacRubyUtils::Envs::BaseEnv
|
11
|
+
module Terminal
|
12
|
+
extend ::ActiveSupport::Concern
|
13
|
+
|
14
|
+
included do
|
15
|
+
include ::EacRubyUtils::Envs::SshEnv::DashoOptions
|
16
|
+
add_nodasho_option('Terminal')
|
17
|
+
include ::EacRubyUtils::Listable
|
18
|
+
lists.add_string :terminal_option, :auto, :disable, :enable, :force
|
19
|
+
end
|
20
|
+
|
21
|
+
def ssh_command_line_terminal_args(value)
|
22
|
+
self.class.lists.terminal_option.value_validate!(value)
|
23
|
+
case value
|
24
|
+
when TERMINAL_OPTION_AUTO then ENV['TERM'].present? ? %w[-t] : []
|
25
|
+
when TERMINAL_OPTION_DISABLE then ['-T']
|
26
|
+
when TERMINAL_OPTION_ENABLE then ['-t']
|
27
|
+
when TERMINAL_OPTION_FORCE then ['-tt']
|
28
|
+
else raise "Invalid conditional branch: #{value}"
|
29
|
+
end
|
30
|
+
end
|
31
|
+
end
|
32
|
+
end
|
33
|
+
end
|
34
|
+
end
|
@@ -0,0 +1,15 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'eac_ruby_utils/patches/module/common_concern'
|
4
|
+
require 'eac_ruby_utils/require_sub'
|
5
|
+
|
6
|
+
module EacRubyUtils
|
7
|
+
module Immutable
|
8
|
+
::EacRubyUtils.require_sub __FILE__
|
9
|
+
|
10
|
+
common_concern do
|
11
|
+
include ::EacRubyUtils::Listable
|
12
|
+
lists.add_symbol :type, :array, :boolean, :common, :hash
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
@@ -0,0 +1,32 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'active_support/inflector'
|
4
|
+
require 'eac_ruby_utils/immutable/base_accessor'
|
5
|
+
require 'eac_ruby_utils/patches/class/common_constructor'
|
6
|
+
|
7
|
+
module EacRubyUtils
|
8
|
+
module Immutable
|
9
|
+
class ArrayAccessor < ::EacRubyUtils::Immutable::BaseAccessor
|
10
|
+
def apply(klass)
|
11
|
+
accessor = self
|
12
|
+
klass.send(:define_method, name) do |value|
|
13
|
+
accessor.immutable_value_set(self, value)
|
14
|
+
end
|
15
|
+
|
16
|
+
klass.send(:define_method, ::ActiveSupport::Inflector.pluralize(name)) do
|
17
|
+
accessor.immutable_value_get(self)
|
18
|
+
end
|
19
|
+
end
|
20
|
+
|
21
|
+
def immutable_value_get(object)
|
22
|
+
super || []
|
23
|
+
end
|
24
|
+
|
25
|
+
def immutable_value_set(object, value)
|
26
|
+
duplicate_object(object) do |old_value|
|
27
|
+
(old_value || []) + [value]
|
28
|
+
end
|
29
|
+
end
|
30
|
+
end
|
31
|
+
end
|
32
|
+
end
|
@@ -0,0 +1,23 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module EacRubyUtils
|
4
|
+
module Immutable
|
5
|
+
class BaseAccessor
|
6
|
+
common_constructor :name do
|
7
|
+
self.name = name.to_sym
|
8
|
+
end
|
9
|
+
|
10
|
+
def duplicate_object(object)
|
11
|
+
accessor_new_value = yield(immutable_value_get(object))
|
12
|
+
new_values = object.send(:immutable_values_get).merge(name => accessor_new_value)
|
13
|
+
r = object.class.new(*object.immutable_constructor_args)
|
14
|
+
r.send(:immutable_values_set, new_values)
|
15
|
+
r
|
16
|
+
end
|
17
|
+
|
18
|
+
def immutable_value_get(object)
|
19
|
+
object.send(:immutable_values_get)[name]
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
@@ -0,0 +1,16 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'eac_ruby_utils/immutable/common_accessor'
|
4
|
+
require 'eac_ruby_utils/patches/class/common_constructor'
|
5
|
+
|
6
|
+
module EacRubyUtils
|
7
|
+
module Immutable
|
8
|
+
class BooleanAccessor < ::EacRubyUtils::Immutable::CommonAccessor
|
9
|
+
def apply(klass)
|
10
|
+
super
|
11
|
+
accessor = self
|
12
|
+
klass.send(:define_method, "#{name}?") { send(accessor.name) }
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
@@ -0,0 +1,20 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module EacRubyUtils
|
4
|
+
module Immutable
|
5
|
+
module ClassMethods
|
6
|
+
def immutable_accessor(*accessors)
|
7
|
+
options = accessors.extract_options!
|
8
|
+
options[:type] ||= const_get('TYPE_COMMON')
|
9
|
+
accessors.each do |name|
|
10
|
+
class_name = options.fetch(:type).to_s.camelize + 'Accessor'
|
11
|
+
::EacRubyUtils::Immutable.const_get(class_name).new(name).apply(self)
|
12
|
+
end
|
13
|
+
end
|
14
|
+
|
15
|
+
private
|
16
|
+
|
17
|
+
def imutable_single_accessor(name, options); end
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
@@ -0,0 +1,30 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'eac_ruby_utils/immutable/base_accessor'
|
4
|
+
require 'eac_ruby_utils/patches/class/common_constructor'
|
5
|
+
|
6
|
+
module EacRubyUtils
|
7
|
+
module Immutable
|
8
|
+
class CommonAccessor < ::EacRubyUtils::Immutable::BaseAccessor
|
9
|
+
def apply(klass)
|
10
|
+
accessor = self
|
11
|
+
klass.send(:define_method, name) do |*args|
|
12
|
+
case args.count
|
13
|
+
when 0 then next accessor.immutable_value_get(self)
|
14
|
+
when 1 then next accessor.immutable_value_set(self, args.first)
|
15
|
+
else
|
16
|
+
raise ::ArgumentError, "wrong number of arguments (given #{args.count}, expected 0..1)"
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
20
|
+
|
21
|
+
def immutable_value_get(object)
|
22
|
+
object.send(:immutable_values_get)[name]
|
23
|
+
end
|
24
|
+
|
25
|
+
def immutable_value_set(object, value)
|
26
|
+
duplicate_object(object) { |_old_value| value }
|
27
|
+
end
|
28
|
+
end
|
29
|
+
end
|
30
|
+
end
|
@@ -0,0 +1,46 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'eac_ruby_utils/immutable/base_accessor'
|
4
|
+
require 'eac_ruby_utils/patches/class/common_constructor'
|
5
|
+
|
6
|
+
module EacRubyUtils
|
7
|
+
module Immutable
|
8
|
+
class HashAccessor < ::EacRubyUtils::Immutable::BaseAccessor
|
9
|
+
def apply(klass)
|
10
|
+
apply_get(klass)
|
11
|
+
apply_set(klass)
|
12
|
+
end
|
13
|
+
|
14
|
+
def immutable_value_get(object)
|
15
|
+
super || {}
|
16
|
+
end
|
17
|
+
|
18
|
+
def immutable_value_set(object, key, value)
|
19
|
+
duplicate_object(object) do |old_value|
|
20
|
+
(old_value || {}).merge(key => value)
|
21
|
+
end
|
22
|
+
end
|
23
|
+
|
24
|
+
private
|
25
|
+
|
26
|
+
def apply_get(klass)
|
27
|
+
accessor = self
|
28
|
+
klass.send(:define_method, ::ActiveSupport::Inflector.pluralize(name)) do
|
29
|
+
accessor.immutable_value_get(self)
|
30
|
+
end
|
31
|
+
end
|
32
|
+
|
33
|
+
def apply_set(klass)
|
34
|
+
accessor = self
|
35
|
+
klass.send(:define_method, name) do |*args|
|
36
|
+
case args.count
|
37
|
+
when 1 then next accessor.immutable_value_get(self, args[0])
|
38
|
+
when 2 then next accessor.immutable_value_set(self, *args[0..1])
|
39
|
+
else
|
40
|
+
raise ::ArgumentError, "wrong number of arguments (given #{args.count}, expected 1..2)"
|
41
|
+
end
|
42
|
+
end
|
43
|
+
end
|
44
|
+
end
|
45
|
+
end
|
46
|
+
end
|
@@ -0,0 +1,21 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module EacRubyUtils
|
4
|
+
module Immutable
|
5
|
+
module InstanceMethods
|
6
|
+
def immutable_constructor_args
|
7
|
+
[]
|
8
|
+
end
|
9
|
+
|
10
|
+
private
|
11
|
+
|
12
|
+
def immutable_values_get
|
13
|
+
@immutable_values || {}
|
14
|
+
end
|
15
|
+
|
16
|
+
def immutable_values_set(new_values)
|
17
|
+
@immutable_values = new_values
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
@@ -33,6 +33,11 @@ module EacRubyUtils
|
|
33
33
|
find_list_by_method(name) || super
|
34
34
|
end
|
35
35
|
|
36
|
+
def hash_keys_validate!(hash, error_class = ::StandardError)
|
37
|
+
hash.keys.each { |key| value_validate!(key, error_class) }
|
38
|
+
hash
|
39
|
+
end
|
40
|
+
|
36
41
|
def i18n_key
|
37
42
|
"eac_ruby_utils.listable.#{class_i18n_key}.#{item}"
|
38
43
|
end
|
@@ -0,0 +1,22 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'active_support/core_ext/object/blank'
|
4
|
+
|
5
|
+
class Object
|
6
|
+
# @return +block.call(self.method_name)+ if +self+ responds to +method_name+, +default_value+
|
7
|
+
# otherwise.
|
8
|
+
def if_respond(method_name, default_value = nil)
|
9
|
+
return default_value unless respond_to?(method_name)
|
10
|
+
|
11
|
+
value = send(method_name)
|
12
|
+
|
13
|
+
block_given? ? yield(value) : value
|
14
|
+
end
|
15
|
+
|
16
|
+
# @return +yield+ if +self+ is blank.
|
17
|
+
def if_blank
|
18
|
+
return yield if blank? && block_given?
|
19
|
+
|
20
|
+
self
|
21
|
+
end
|
22
|
+
end
|
@@ -1,6 +1,7 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
3
|
require 'active_support/inflector'
|
4
|
+
require 'eac_ruby_utils/listable'
|
4
5
|
|
5
6
|
module EacRubyUtils
|
6
7
|
class << self
|
@@ -10,15 +11,14 @@ module EacRubyUtils
|
|
10
11
|
end
|
11
12
|
|
12
13
|
class RequireSub
|
13
|
-
|
14
|
-
|
15
|
-
REQUIRE_DEPENDENCY_OPTION_KEY = :require_dependency
|
14
|
+
include ::EacRubyUtils::Listable
|
15
|
+
lists.add_symbol :option, :base, :include_modules, :require_dependency
|
16
16
|
|
17
17
|
attr_reader :file, :options
|
18
18
|
|
19
19
|
def initialize(file, options = {})
|
20
20
|
@file = file
|
21
|
-
@options = options
|
21
|
+
@options = self.class.lists.option.hash_keys_validate!(options)
|
22
22
|
end
|
23
23
|
|
24
24
|
def apply
|
@@ -29,7 +29,7 @@ module EacRubyUtils
|
|
29
29
|
private
|
30
30
|
|
31
31
|
def active_support_require(path)
|
32
|
-
return false unless options[
|
32
|
+
return false unless options[OPTION_REQUIRE_DEPENDENCY]
|
33
33
|
|
34
34
|
::Kernel.require_dependency(path)
|
35
35
|
true
|
@@ -46,7 +46,7 @@ module EacRubyUtils
|
|
46
46
|
end
|
47
47
|
|
48
48
|
def include_modules
|
49
|
-
return unless options[
|
49
|
+
return unless options[OPTION_INCLUDE_MODULES]
|
50
50
|
|
51
51
|
base.constants.each do |constant_name|
|
52
52
|
constant = base.const_get(constant_name)
|
@@ -57,11 +57,11 @@ module EacRubyUtils
|
|
57
57
|
end
|
58
58
|
|
59
59
|
def base
|
60
|
-
options[
|
60
|
+
options[OPTION_BASE] || raise('Option :base not setted')
|
61
61
|
end
|
62
62
|
|
63
63
|
def base?
|
64
|
-
options[
|
64
|
+
options[OPTION_BASE] ? true : false
|
65
65
|
end
|
66
66
|
|
67
67
|
def kernel_require(path)
|
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.44.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-09-02 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|
@@ -109,6 +109,7 @@ 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/boolean.rb
|
112
113
|
- lib/eac_ruby_utils/by_reference.rb
|
113
114
|
- lib/eac_ruby_utils/common_concern.rb
|
114
115
|
- lib/eac_ruby_utils/common_constructor.rb
|
@@ -139,6 +140,10 @@ files:
|
|
139
140
|
- lib/eac_ruby_utils/envs/process.rb
|
140
141
|
- lib/eac_ruby_utils/envs/spawn.rb
|
141
142
|
- lib/eac_ruby_utils/envs/ssh_env.rb
|
143
|
+
- lib/eac_ruby_utils/envs/ssh_env/dasho_options.rb
|
144
|
+
- lib/eac_ruby_utils/envs/ssh_env/identity_file.rb
|
145
|
+
- lib/eac_ruby_utils/envs/ssh_env/quiet.rb
|
146
|
+
- lib/eac_ruby_utils/envs/ssh_env/terminal.rb
|
142
147
|
- lib/eac_ruby_utils/filesystem_cache.rb
|
143
148
|
- lib/eac_ruby_utils/fs.rb
|
144
149
|
- lib/eac_ruby_utils/fs/extname.rb
|
@@ -148,6 +153,14 @@ files:
|
|
148
153
|
- lib/eac_ruby_utils/fs/traversable.rb
|
149
154
|
- lib/eac_ruby_utils/fs/traverser.rb
|
150
155
|
- lib/eac_ruby_utils/fs_cache.rb
|
156
|
+
- lib/eac_ruby_utils/immutable.rb
|
157
|
+
- lib/eac_ruby_utils/immutable/array_accessor.rb
|
158
|
+
- lib/eac_ruby_utils/immutable/base_accessor.rb
|
159
|
+
- lib/eac_ruby_utils/immutable/boolean_accessor.rb
|
160
|
+
- lib/eac_ruby_utils/immutable/class_methods.rb
|
161
|
+
- lib/eac_ruby_utils/immutable/common_accessor.rb
|
162
|
+
- lib/eac_ruby_utils/immutable/hash_accessor.rb
|
163
|
+
- lib/eac_ruby_utils/immutable/instance_methods.rb
|
151
164
|
- lib/eac_ruby_utils/listable.rb
|
152
165
|
- lib/eac_ruby_utils/listable/class_methods.rb
|
153
166
|
- lib/eac_ruby_utils/listable/instance_methods.rb
|
@@ -171,6 +184,7 @@ files:
|
|
171
184
|
- lib/eac_ruby_utils/patches/module.rb
|
172
185
|
- lib/eac_ruby_utils/patches/module/common_concern.rb
|
173
186
|
- lib/eac_ruby_utils/patches/module/console_speaker.rb
|
187
|
+
- lib/eac_ruby_utils/patches/module/immutable.rb
|
174
188
|
- lib/eac_ruby_utils/patches/module/listable.rb
|
175
189
|
- lib/eac_ruby_utils/patches/module/patch.rb
|
176
190
|
- lib/eac_ruby_utils/patches/module/require_sub.rb
|
@@ -178,6 +192,7 @@ files:
|
|
178
192
|
- lib/eac_ruby_utils/patches/object.rb
|
179
193
|
- lib/eac_ruby_utils/patches/object/asserts.rb
|
180
194
|
- lib/eac_ruby_utils/patches/object/if_present.rb
|
195
|
+
- lib/eac_ruby_utils/patches/object/if_respond.rb
|
181
196
|
- lib/eac_ruby_utils/patches/object/template.rb
|
182
197
|
- lib/eac_ruby_utils/patches/object/to_pathname.rb
|
183
198
|
- lib/eac_ruby_utils/patches/pathname.rb
|
@@ -228,8 +243,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
228
243
|
- !ruby/object:Gem::Version
|
229
244
|
version: '0'
|
230
245
|
requirements: []
|
231
|
-
|
232
|
-
rubygems_version: 2.7.7
|
246
|
+
rubygems_version: 3.0.8
|
233
247
|
signing_key:
|
234
248
|
specification_version: 4
|
235
249
|
summary: Utilities for E.A.C.'s Ruby projects.
|