eac_ruby_utils 0.42.0 → 0.43.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: aae61dcf00f56fd19422516fdeddc796f6f18cb592bfda3d994ad91651f6ed9a
4
- data.tar.gz: cec8de39973f51c39a7466249756105e3c37b80ffba2ab373f8a9a29f9eea8ca
3
+ metadata.gz: 17c2233b153a30506d6d62a3e8d89e35b9233d9ddb7043a4641a52ee214c2382
4
+ data.tar.gz: 7369e5d33ca13dd1827371d8fb257bf3ddab56bcd0a12b997eb6835349a94d61
5
5
  SHA512:
6
- metadata.gz: 7c8ec736251746dabf77d8d97b35c0768995cc83817830ec9af8c7261ce3d100d74ae87143ba7a3fbd82ca81e2618c8b0fbf13367820babb29341a1bfcf28efc
7
- data.tar.gz: 98ce82f43d3f029d947e368dc1cd519d69249182e73fb13d0ee683050e0b93e4770d029eda3bc02f07b80909ab16788bec35b6086fb44f6daa82ec38255ebc37
6
+ metadata.gz: afc7ada9f7bd0f0c260d058db8d755d6778fa8d76e4dd549e8a0b7d6b6aac755ff18229da447bb2d8a6cac831b8d4a9c7585755fe16ed03ef6214653ee7b3f85
7
+ data.tar.gz: 4f227e60bcf60d4598a15cb4b8748696a602d3490d282e0ae2b4ca5546eb8161e4b011f22ab8647b39409a6bf5fb8055f78f4b6373c41e57c6351821274bfe1d
@@ -3,7 +3,7 @@
3
3
  module EacRubyUtils
4
4
  module Console
5
5
  class DocoptRunner
6
- DOCOPT_ERROR_EXIT_CODE = 0x22220000
6
+ DOCOPT_ERROR_EXIT_CODE = 0xC0
7
7
 
8
8
  class << self
9
9
  def run(options = {})
@@ -1,6 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  require 'active_support/concern'
4
+ require 'eac_ruby_utils/envs/ssh_env/dasho_options'
4
5
  require 'eac_ruby_utils/listable'
5
6
  require 'eac_ruby_utils/patches/object/if_present'
6
7
 
@@ -11,6 +12,7 @@ module EacRubyUtils
11
12
  extend ::ActiveSupport::Concern
12
13
 
13
14
  included do
15
+ include ::EacRubyUtils::Envs::SshEnv::DashoOptions
14
16
  add_nodasho_option('IdentityFile')
15
17
  end
16
18
 
@@ -2,6 +2,7 @@
2
2
 
3
3
  require 'active_support/concern'
4
4
  require 'eac_ruby_utils/boolean'
5
+ require 'eac_ruby_utils/envs/ssh_env/dasho_options'
5
6
 
6
7
  module EacRubyUtils
7
8
  module Envs
@@ -10,6 +11,7 @@ module EacRubyUtils
10
11
  extend ::ActiveSupport::Concern
11
12
 
12
13
  included do
14
+ include ::EacRubyUtils::Envs::SshEnv::DashoOptions
13
15
  add_nodasho_option('Quiet')
14
16
  end
15
17
 
@@ -1,6 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  require 'active_support/concern'
4
+ require 'eac_ruby_utils/envs/ssh_env/dasho_options'
4
5
  require 'eac_ruby_utils/listable'
5
6
  require 'eac_ruby_utils/patches/object/if_present'
6
7
 
@@ -11,6 +12,7 @@ module EacRubyUtils
11
12
  extend ::ActiveSupport::Concern
12
13
 
13
14
  included do
15
+ include ::EacRubyUtils::Envs::SshEnv::DashoOptions
14
16
  add_nodasho_option('Terminal')
15
17
  include ::EacRubyUtils::Listable
16
18
  lists.add_string :terminal_option, :auto, :disable, :enable, :force
@@ -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
@@ -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
- BASE_OPTION_KEY = :base
14
- INCLUDE_MODULES_OPTION_KEY = :include_modules
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[REQUIRE_DEPENDENCY_OPTION_KEY]
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[INCLUDE_MODULES_OPTION_KEY]
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[BASE_OPTION_KEY] || raise('Option :base not setted')
60
+ options[OPTION_BASE] || raise('Option :base not setted')
61
61
  end
62
62
 
63
63
  def base?
64
- options[BASE_OPTION_KEY] ? true : false
64
+ options[OPTION_BASE] ? true : false
65
65
  end
66
66
 
67
67
  def kernel_require(path)
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module EacRubyUtils
4
- VERSION = '0.42.0'
4
+ VERSION = '0.43.0'
5
5
  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.42.0
4
+ version: 0.43.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-07-20 00:00:00.000000000 Z
11
+ date: 2020-07-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport