avm-tools 0.115.0 → 0.116.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (120) hide show
  1. checksums.yaml +4 -4
  2. data/lib/avm/launcher/instances/settings.rb +7 -3
  3. data/lib/avm/projects/stereotypes.rb +2 -2
  4. data/lib/avm/ruby/bundler/incompatible_parser/depends_on.rb +1 -1
  5. data/lib/avm/ruby/bundler/incompatible_parser/gem_conflict.rb +1 -1
  6. data/lib/avm/ruby/bundler/incompatible_parser/in_gemfile.rb +1 -1
  7. data/lib/avm/ruby/bundler/incompatible_parser/version_requirement.rb +1 -1
  8. data/lib/avm/ruby/bundler/incompatible_parser.rb +1 -1
  9. data/lib/avm/tools/runner/app_src/ruby/bundler/gemfile_lock/git.rb +1 -1
  10. data/lib/avm/tools/runner/app_src/test.rb +2 -2
  11. data/lib/avm/tools/runner/git/deploy.rb +5 -5
  12. data/lib/avm/tools/runner/git/dirty_files.rb +1 -1
  13. data/lib/avm/tools/runner/git/revisions_test.rb +1 -1
  14. data/lib/avm/tools/runner/ruby/rubocop.rb +2 -2
  15. data/lib/avm/tools/version.rb +1 -1
  16. data/sub/avm/avm.gemspec +2 -2
  17. data/sub/avm/lib/avm/instances/base/auto_values/mailer.rb +2 -2
  18. data/sub/avm/lib/avm/instances/entry_keys.rb +2 -0
  19. data/sub/avm/lib/avm/registry/base.rb +2 -2
  20. data/sub/avm/lib/avm/rspec/shared_examples/not_in_avm_registry.rb +1 -1
  21. data/sub/avm/lib/avm/sources/tests/builder.rb +1 -1
  22. data/sub/avm/lib/avm/version.rb +1 -1
  23. data/sub/avm-eac_asciidoctor_base0/lib/avm/eac_asciidoctor_base0/sources/build/file.rb +1 -1
  24. data/sub/avm-eac_asciidoctor_base0/lib/avm/eac_asciidoctor_base0/sources/build.rb +2 -2
  25. data/sub/avm-eac_asciidoctor_base0/lib/avm/eac_asciidoctor_base0/sources/runner/build.rb +1 -1
  26. data/sub/avm-eac_asciidoctor_base0/lib/avm/eac_asciidoctor_base0/sources/runner.rb +2 -2
  27. data/sub/avm-eac_asciidoctor_base0/lib/avm/eac_asciidoctor_base0/version.rb +1 -1
  28. data/sub/avm-eac_rails_base0/avm-eac_rails_base0.gemspec +1 -1
  29. data/sub/avm-eac_rails_base0/lib/avm/eac_rails_base0/version.rb +1 -1
  30. data/sub/avm-eac_rails_base1/avm-eac_rails_base1.gemspec +2 -2
  31. data/sub/avm-eac_rails_base1/lib/avm/eac_rails_base1/runner/tasks_scheduler/systemd_unit.rb +46 -0
  32. data/sub/avm-eac_rails_base1/lib/avm/eac_rails_base1/runner/tasks_scheduler.rb +17 -0
  33. data/sub/avm-eac_rails_base1/lib/avm/eac_rails_base1/systemd_unit/service.rb +70 -0
  34. data/sub/avm-eac_rails_base1/lib/avm/eac_rails_base1/systemd_unit/tasks_scheduler_command.rb +29 -0
  35. data/sub/avm-eac_rails_base1/lib/avm/eac_rails_base1/systemd_unit.rb +57 -0
  36. data/sub/avm-eac_rails_base1/lib/avm/eac_rails_base1/version.rb +1 -1
  37. data/sub/avm-eac_rails_base1/template/avm/eac_rails_base1/systemd_unit/tasks_scheduler.service +12 -0
  38. data/sub/avm-eac_rails_base1/template/avm/eac_rails_base1/systemd_unit/tasks_scheduler_command.sh +6 -0
  39. data/sub/avm-eac_redmine_base0/avm-eac_redmine_base0.gemspec +2 -2
  40. data/sub/avm-eac_redmine_base0/lib/avm/eac_redmine_base0/core_update.rb +3 -3
  41. data/sub/avm-eac_redmine_base0/lib/avm/eac_redmine_base0/instances/docker_image.rb +17 -2
  42. data/sub/avm-eac_redmine_base0/lib/avm/eac_redmine_base0/version.rb +1 -1
  43. data/sub/avm-eac_redmine_base0/template/avm/eac_redmine_base0/instances/docker_image/Dockerfile.template +2 -8
  44. data/sub/avm-eac_redmine_base0/template/avm/eac_redmine_base0/instances/docker_image/Dockerfile_apache_setup +8 -0
  45. data/sub/avm-eac_redmine_base0/template/avm/eac_redmine_base0/instances/docker_image/start.sh.template +1 -1
  46. data/sub/avm-eac_ruby_base1/avm-eac_ruby_base1.gemspec +1 -1
  47. data/sub/avm-eac_ruby_base1/lib/avm/eac_ruby_base1/patches/i18n.rb +1 -1
  48. data/sub/avm-eac_ruby_base1/lib/avm/eac_ruby_base1/rubocop/configured.rb +31 -0
  49. data/sub/avm-eac_ruby_base1/lib/avm/eac_ruby_base1/rubocop/envvar.rb +17 -0
  50. data/sub/avm-eac_ruby_base1/lib/avm/eac_ruby_base1/rubocop/gemfile.rb +41 -0
  51. data/{lib/avm/ruby → sub/avm-eac_ruby_base1/lib/avm/eac_ruby_base1}/rubocop.rb +2 -2
  52. data/sub/avm-eac_ruby_base1/lib/avm/eac_ruby_base1/sources/tester.rb +1 -1
  53. data/sub/avm-eac_ruby_base1/lib/avm/eac_ruby_base1/sources/update/sub_update.rb +1 -1
  54. data/sub/avm-eac_ruby_base1/lib/avm/eac_ruby_base1/version.rb +1 -1
  55. data/sub/avm-eac_ubuntu_base0/lib/avm/eac_ubuntu_base0/instances/base.rb +6 -0
  56. data/sub/avm-eac_ubuntu_base0/lib/avm/eac_ubuntu_base0/version.rb +1 -1
  57. data/sub/avm-eac_webapp_base0/avm-eac_webapp_base0.gemspec +1 -1
  58. data/sub/avm-eac_webapp_base0/lib/avm/eac_webapp_base0/instance.rb +7 -0
  59. data/sub/avm-eac_webapp_base0/lib/avm/eac_webapp_base0/version.rb +1 -1
  60. data/sub/avm-files/avm-files.gemspec +1 -1
  61. data/sub/avm-files/lib/avm/files/appendable.rb +1 -1
  62. data/sub/avm-files/lib/avm/files/formatter/formats/ruby.rb +2 -2
  63. data/sub/avm-files/lib/avm/files/version.rb +1 -1
  64. data/sub/eac_cli/eac_cli.gemspec +1 -1
  65. data/sub/eac_cli/lib/eac_cli/old_configs/entry_reader.rb +1 -1
  66. data/sub/eac_cli/lib/eac_cli/old_configs/read_entry_options.rb +1 -1
  67. data/sub/eac_cli/lib/eac_cli/parser.rb +2 -2
  68. data/sub/eac_cli/lib/eac_cli/runner_with/help/builder.rb +1 -1
  69. data/sub/eac_cli/lib/eac_cli/runner_with/subcommands.rb +5 -5
  70. data/sub/eac_cli/lib/eac_cli/runner_with_set.rb +2 -2
  71. data/sub/eac_cli/lib/eac_cli/version.rb +1 -1
  72. data/sub/eac_config/eac_config.gemspec +1 -1
  73. data/sub/eac_config/lib/eac_config/entry.rb +1 -1
  74. data/sub/eac_config/lib/eac_config/envvars_node/entry.rb +1 -1
  75. data/sub/eac_config/lib/eac_config/paths_hash/node.rb +1 -1
  76. data/sub/eac_config/lib/eac_config/version.rb +1 -1
  77. data/sub/eac_fs/eac_fs.gemspec +1 -1
  78. data/sub/eac_fs/lib/eac_fs/version.rb +1 -1
  79. data/sub/eac_git/eac_git.gemspec +1 -1
  80. data/sub/eac_git/lib/eac_git/local/remote.rb +2 -2
  81. data/sub/eac_git/lib/eac_git/local.rb +1 -1
  82. data/sub/eac_git/lib/eac_git/version.rb +1 -1
  83. data/sub/eac_rest/eac_rest.gemspec +1 -1
  84. data/sub/eac_rest/lib/eac_rest/api.rb +14 -3
  85. data/sub/eac_rest/lib/eac_rest/request.rb +22 -1
  86. data/sub/eac_rest/lib/eac_rest/response.rb +41 -1
  87. data/sub/eac_rest/lib/eac_rest/version.rb +1 -1
  88. data/sub/eac_ruby_base0/eac_ruby_base0.gemspec +1 -1
  89. data/sub/eac_ruby_base0/lib/eac_ruby_base0/application.rb +2 -2
  90. data/sub/eac_ruby_base0/lib/eac_ruby_base0/version.rb +1 -1
  91. data/sub/eac_ruby_gems_utils/eac_ruby_gems_utils.gemspec +1 -1
  92. data/sub/eac_ruby_gems_utils/lib/eac_ruby_gems_utils/gem/version_file.rb +2 -2
  93. data/sub/eac_ruby_gems_utils/lib/eac_ruby_gems_utils/version.rb +1 -1
  94. data/sub/eac_ruby_utils/eac_ruby_utils.gemspec +1 -1
  95. data/sub/eac_ruby_utils/lib/eac_ruby_utils/custom_format.rb +1 -1
  96. data/sub/eac_ruby_utils/lib/eac_ruby_utils/gems_registry/gem.rb +1 -1
  97. data/sub/eac_ruby_utils/lib/eac_ruby_utils/gems_registry.rb +1 -1
  98. data/sub/eac_ruby_utils/lib/eac_ruby_utils/inflector.rb +1 -1
  99. data/sub/eac_ruby_utils/lib/eac_ruby_utils/listable/list.rb +16 -4
  100. data/sub/eac_ruby_utils/lib/eac_ruby_utils/listable/value.rb +12 -2
  101. data/sub/eac_ruby_utils/lib/eac_ruby_utils/local_time_zone.rb +1 -1
  102. data/sub/eac_ruby_utils/lib/eac_ruby_utils/patches/object/debug.rb +6 -0
  103. data/sub/eac_ruby_utils/lib/eac_ruby_utils/ruby/on_clean_environment.rb +1 -1
  104. data/sub/eac_ruby_utils/lib/eac_ruby_utils/version.rb +1 -1
  105. data/sub/eac_ruby_utils/spec/lib/eac_ruby_utils/fs/temp/{temp_spec.rb → directory_spec.rb} +0 -0
  106. data/sub/eac_ruby_utils/spec/lib/eac_ruby_utils/fs/temp_spec.rb +4 -4
  107. data/sub/eac_ruby_utils/spec/lib/eac_ruby_utils/listable_spec.rb +169 -106
  108. data/sub/eac_ruby_utils/spec/lib/eac_ruby_utils/options_consumer_spec.rb +52 -17
  109. data/sub/eac_ruby_utils/spec/lib/eac_ruby_utils/patches/module/listable_spec.rb +5 -3
  110. data/sub/eac_ruby_utils/spec/lib/eac_ruby_utils/patches/module/simple_cache_spec.rb +5 -3
  111. data/sub/eac_ruby_utils/spec/lib/eac_ruby_utils/require_sub_spec.rb +3 -3
  112. data/sub/eac_ruby_utils/spec/lib/eac_ruby_utils/settings_provider_spec.rb +21 -18
  113. data/sub/eac_ruby_utils/spec/locales/pt-BR.yml +3 -0
  114. data/sub/eac_templates/eac_templates.gemspec +1 -1
  115. data/sub/eac_templates/lib/eac_templates/directory.rb +1 -1
  116. data/sub/eac_templates/lib/eac_templates/version.rb +1 -1
  117. metadata +41 -21
  118. data/lib/avm/ruby/rubocop/_configured.rb +0 -29
  119. data/lib/avm/ruby/rubocop/_envvar.rb +0 -15
  120. data/lib/avm/ruby/rubocop/_gemfile.rb +0 -39
@@ -7,11 +7,13 @@ require 'ostruct'
7
7
 
8
8
  module EacRest
9
9
  class Request
10
+ BOOLEAN_MODIFIERS = %w[ssl_verify ssl_verify_peer ssl_verify_host].freeze
10
11
  COMMON_MODIFIERS = %w[auth body_data verb].freeze
11
12
  HASH_MODIFIERS = %w[header].freeze
12
- MODIFIERS = COMMON_MODIFIERS + HASH_MODIFIERS.map(&:pluralize)
13
+ MODIFIERS = COMMON_MODIFIERS + BOOLEAN_MODIFIERS + HASH_MODIFIERS.map(&:pluralize)
13
14
 
14
15
  enable_immutable
16
+ immutable_accessor(*BOOLEAN_MODIFIERS, type: :boolean)
15
17
  immutable_accessor(*COMMON_MODIFIERS, type: :common)
16
18
  immutable_accessor(*HASH_MODIFIERS, type: :hash)
17
19
 
@@ -56,6 +58,25 @@ module EacRest
56
58
  curl.headers.merge!(headers)
57
59
  end
58
60
 
61
+ def build_curl_ssl_verify(curl)
62
+ return if ssl_verify?.nil?
63
+
64
+ curl.ssl_verify_host = ssl_verify?
65
+ curl.ssl_verify_peer = ssl_verify?
66
+ end
67
+
68
+ def build_curl_ssl_verify_peer(curl)
69
+ return if ssl_verify_peer?.nil?
70
+
71
+ curl.ssl_verify_peer = ssl_verify_peer?
72
+ end
73
+
74
+ def build_curl_ssl_verify_host(curl)
75
+ return if ssl_verify_host?.nil?
76
+
77
+ curl.ssl_verify_peer = ssl_verify_host?
78
+ end
79
+
59
80
  def build_curl_verb(curl)
60
81
  curl.set(
61
82
  :customrequest,
@@ -6,6 +6,18 @@ require 'json'
6
6
 
7
7
  module EacRest
8
8
  class Response < ::StandardError
9
+ HEADER_LINE_PARSER = /\A([^:]+):(.*)\z/.to_parser do |m|
10
+ [m[1].strip, m[2].strip]
11
+ end
12
+
13
+ # https://www.w3.org/wiki/LinkHeader
14
+ LINKS_HEADER_NAME = 'Link'
15
+
16
+ # https://www.w3.org/wiki/LinkHeader
17
+ LINK_PARSER = /\A\<(.+)\>\s*;\s*rel\s*=\s*\"(.*)\"\z/.to_parser do |m|
18
+ [m[2], m[1]]
19
+ end
20
+
9
21
  common_constructor :curl, :body_data_proc
10
22
 
11
23
  def body_data
@@ -23,7 +35,7 @@ module EacRest
23
35
  body_data
24
36
  end
25
37
 
26
- delegate :body_str, :headers, to: :performed_curl
38
+ delegate :body_str, to: :performed_curl
27
39
 
28
40
  def body_str_or_raise
29
41
  raise_unless_200
@@ -31,6 +43,26 @@ module EacRest
31
43
  body_str
32
44
  end
33
45
 
46
+ def header(name)
47
+ hash_search(headers, name)
48
+ end
49
+
50
+ def headers
51
+ performed_curl.header_str.each_line.map(&:strip)[1..-1].reject(&:blank?)
52
+ .map { |header_line| HEADER_LINE_PARSER.parse!(header_line) }
53
+ .to_h
54
+ end
55
+
56
+ def link(rel)
57
+ hash_search(links, rel)
58
+ end
59
+
60
+ def links
61
+ header(LINKS_HEADER_NAME).if_present({}) do |v|
62
+ v.split(',').map { |w| LINK_PARSER.parse!(w.strip) }.to_h
63
+ end
64
+ end
65
+
34
66
  def raise_unless_200
35
67
  return nil if status == 200
36
68
 
@@ -57,6 +89,14 @@ module EacRest
57
89
  Hash.from_xml(body_str)
58
90
  end
59
91
 
92
+ def hash_search(hash, key)
93
+ key = key.to_s.downcase
94
+ hash.each do |k, v|
95
+ return v if k.to_s.downcase == key
96
+ end
97
+ nil
98
+ end
99
+
60
100
  def perform
61
101
  @perform ||= begin
62
102
  curl.perform || raise("CURL perform failed for #{url}")
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module EacRest
4
- VERSION = '0.4.0'
4
+ VERSION = '0.6.1'
5
5
  end
@@ -17,5 +17,5 @@ Gem::Specification.new do |s|
17
17
  s.add_dependency 'eac_ruby_gems_utils', '~> 0.9', '~> 0.9.6'
18
18
  s.add_dependency 'eac_ruby_utils', '~> 0.70'
19
19
 
20
- s.add_development_dependency 'eac_ruby_gem_support', '~> 0.3'
20
+ s.add_development_dependency 'eac_ruby_gem_support', '~> 0.5.1'
21
21
  end
@@ -23,7 +23,7 @@ module EacRubyBase0
23
23
  delegate :version, to: :self_gem
24
24
 
25
25
  def all_gems
26
- vendor_gems + [self_gem]
26
+ sub_gems + [self_gem]
27
27
  end
28
28
 
29
29
  # @return [EacCli::Config]
@@ -75,7 +75,7 @@ CODE
75
75
  ::EacRubyGemsUtils::Gem.new(gemspec_dir)
76
76
  end
77
77
 
78
- def vendor_gems_uncached
78
+ def sub_gems_uncached
79
79
  r = []
80
80
  vendor_dir.children.each do |c|
81
81
  vgem = ::EacRubyGemsUtils::Gem.new(c)
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module EacRubyBase0
4
- VERSION = '0.16.1'
4
+ VERSION = '0.16.2'
5
5
  end
@@ -27,5 +27,5 @@ Gem::Specification.new do |s|
27
27
  s.add_dependency 'eac_ruby_utils', '~> 0.81'
28
28
 
29
29
  # Tests
30
- s.add_development_dependency 'eac_ruby_gem_support', '~> 0.3'
30
+ s.add_development_dependency 'eac_ruby_gem_support', '~> 0.5.1'
31
31
  end
@@ -26,8 +26,8 @@ module EacRubyGemsUtils
26
26
 
27
27
  def new_value_content(new_value)
28
28
  path.read.each_line
29
- .map { |line| new_value_line(line, new_value) }
30
- .join
29
+ .map { |line| new_value_line(line, new_value) }
30
+ .join
31
31
  end
32
32
 
33
33
  def new_value_line(line, new_value)
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module EacRubyGemsUtils
4
- VERSION = '0.9.9'
4
+ VERSION = '0.9.10'
5
5
  end
@@ -19,5 +19,5 @@ Gem::Specification.new do |s|
19
19
  s.add_dependency 'addressable', '~> 2.6'
20
20
  s.add_dependency 'filesize'
21
21
  s.add_dependency 'net-ssh', '~> 4.2'
22
- s.add_development_dependency 'eac_ruby_gem_support', '~> 0.3', '>= 0.3.2'
22
+ s.add_development_dependency 'eac_ruby_gem_support', '~> 0.5.1'
23
23
  end
@@ -9,7 +9,7 @@ module EacRubyUtils
9
9
  attr_reader :mapping
10
10
 
11
11
  def initialize(mapping)
12
- @mapping = mapping.map { |k, v| [k.to_sym, v] }.to_h.freeze
12
+ @mapping = mapping.transform_keys(&:to_sym).freeze
13
13
  end
14
14
 
15
15
  def format(string)
@@ -41,7 +41,7 @@ module EacRubyUtils
41
41
  def lib_file_found?
42
42
  gemspec.require_paths.any? do |require_path|
43
43
  ::Pathname.new(require_path).expand_path(gemspec.gem_dir).join(path_to_require + '.rb')
44
- .file?
44
+ .file?
45
45
  end
46
46
  end
47
47
 
@@ -29,7 +29,7 @@ module EacRubyUtils
29
29
  # @return [Array<EacRubyUtils::GemsRegistry::Gem>]
30
30
  def all_gems
31
31
  ::Gem::Specification.map { |gemspec| ::EacRubyUtils::GemsRegistry::Gem.new(self, gemspec) }
32
- .sort
32
+ .sort
33
33
  end
34
34
  end
35
35
  end
@@ -16,7 +16,7 @@ module EacRubyUtils
16
16
  # @raise [ArgumentError]
17
17
  def variableize(string, validate = true)
18
18
  r = ::ActiveSupport::Inflector.transliterate(string).gsub(/[^_a-z0-9]/i, '_')
19
- .gsub(/_+/, '_').gsub(/_\z/, '').gsub(/\A_/, '').downcase
19
+ .gsub(/_+/, '_').gsub(/_\z/, '').gsub(/\A_/, '').downcase
20
20
  m = VARIABLE_NAME_PATTERN.match(r)
21
21
  return r if m
22
22
  return nil unless validate
@@ -1,8 +1,13 @@
1
1
  # frozen_string_literal: true
2
2
 
3
+ require 'eac_ruby_utils/listable/value'
4
+
3
5
  module EacRubyUtils
4
6
  module Listable
5
7
  class List
8
+ BLANK_VALUE = nil
9
+ BLANK_KEY = :__blank
10
+
6
11
  attr_reader :item
7
12
 
8
13
  def initialize(lists, item, labels)
@@ -12,6 +17,10 @@ module EacRubyUtils
12
17
  apply_constants
13
18
  end
14
19
 
20
+ def blank_value
21
+ @blank_value ||= ::EacRubyUtils::Listable::Value.new(self, BLANK_VALUE, BLANK_KEY, false)
22
+ end
23
+
15
24
  def each_value(&block)
16
25
  values.each(&block)
17
26
  end
@@ -34,7 +43,7 @@ module EacRubyUtils
34
43
  end
35
44
 
36
45
  def hash_keys_validate!(hash, error_class = ::StandardError)
37
- hash.keys.each { |key| value_validate!(key, error_class) }
46
+ hash.each_key { |key| value_validate!(key, error_class) }
38
47
  hash
39
48
  end
40
49
 
@@ -42,11 +51,14 @@ module EacRubyUtils
42
51
  "eac_ruby_utils.listable.#{class_i18n_key}.#{item}"
43
52
  end
44
53
 
54
+ # @return [EacRubyUtils::Listable::Value, nil]
45
55
  def instance_value(instance)
46
56
  v = instance.send(item)
57
+ return blank_value if v.blank?
47
58
  return @values[v] if @values.key?(v)
48
59
 
49
- raise "List value unkown: #{v} (Source: #{@lists.source}, Item: #{item})"
60
+ raise "List value unkown: \"#{v}\" (Source: #{@lists.source}, Item: #{item}, Instance: " \
61
+ "#{instance.to_debug}, Values: #{@values.keys})"
50
62
  end
51
63
 
52
64
  def value_valid?(value)
@@ -70,7 +82,7 @@ module EacRubyUtils
70
82
  end
71
83
 
72
84
  def find_list_by_method(method)
73
- @values.values.each do |v|
85
+ @values.each_value do |v|
74
86
  return v if method.to_s == "value_#{v.key}"
75
87
  end
76
88
  nil
@@ -81,7 +93,7 @@ module EacRubyUtils
81
93
  end
82
94
 
83
95
  def apply_constants
84
- @values.values.each do |v|
96
+ @values.each_value do |v|
85
97
  @lists.source.const_set(v.constant_name, v.value)
86
98
  end
87
99
  end
@@ -7,10 +7,11 @@ module EacRubyUtils
7
7
  class Value
8
8
  attr_reader :value, :key
9
9
 
10
- def initialize(list, value, key)
10
+ def initialize(list, value, key, translation_required = true)
11
11
  @list = list
12
12
  @value = value
13
13
  @key = key
14
+ @translation_required = translation_required
14
15
  end
15
16
 
16
17
  def to_s
@@ -29,10 +30,19 @@ module EacRubyUtils
29
30
  translate('description')
30
31
  end
31
32
 
33
+ def translation_required?
34
+ @translation_required
35
+ end
36
+
32
37
  private
33
38
 
34
39
  def translate(translate_key)
35
- ::I18n.t("#{@list.i18n_key}.#{@key}.#{translate_key}")
40
+ full_translate_key = "#{@list.i18n_key}.#{@key}.#{translate_key}"
41
+ if !::I18n.exists?(full_translate_key) && !translation_required?
42
+ ''
43
+ else
44
+ ::I18n.t(full_translate_key)
45
+ end
36
46
  end
37
47
  end
38
48
  end
@@ -36,7 +36,7 @@ module EacRubyUtils
36
36
  return nil unless executable.exist?
37
37
 
38
38
  TIMEDATECTL_TIMEZONE_LINE_PATTERN.if_match(executable.command.execute!) { |m| m[1] }
39
- .if_present { |v| ::ActiveSupport::TimeZone[v] }
39
+ .if_present { |v| ::ActiveSupport::TimeZone[v] }
40
40
  end
41
41
 
42
42
  # @return [ActiveSupport::TimeZone]
@@ -1,6 +1,12 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  class Object
4
+ def pretty_debug
5
+ STDERR.write(pretty_inspect)
6
+
7
+ self
8
+ end
9
+
4
10
  def print_debug
5
11
  STDERR.write(to_debug + "\n")
6
12
 
@@ -12,7 +12,7 @@ module EacRubyUtils
12
12
 
13
13
  def on_clean_envvars(*start_with_vars)
14
14
  old_values = envvars_starting_with(start_with_vars)
15
- old_values.keys.each { |k| ENV.delete(k) }
15
+ old_values.each_key { |k| ENV.delete(k) }
16
16
  yield
17
17
  ensure
18
18
  old_values&.each { |k, v| ENV[k] = v }
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module EacRubyUtils
4
- VERSION = '0.92.1'
4
+ VERSION = '0.94.2'
5
5
  end
@@ -4,7 +4,7 @@ require 'eac_ruby_utils/fs/temp'
4
4
 
5
5
  RSpec.describe ::EacRubyUtils::Fs::Temp do
6
6
  describe '#on_file' do
7
- it do
7
+ it do # rubocop:disable RSpec/ExampleLength, RSpec/MultipleExpectations
8
8
  temp_path = nil
9
9
  described_class.on_file do |path|
10
10
  temp_path = path
@@ -15,7 +15,7 @@ RSpec.describe ::EacRubyUtils::Fs::Temp do
15
15
  expect(temp_path).not_to exist
16
16
  end
17
17
 
18
- it 'not fail if already removed' do
18
+ it 'not fail if already removed' do # rubocop:disable RSpec/ExampleLength, RSpec/MultipleExpectations
19
19
  temp_path = nil
20
20
  described_class.on_file do |path|
21
21
  temp_path = path
@@ -29,7 +29,7 @@ RSpec.describe ::EacRubyUtils::Fs::Temp do
29
29
  end
30
30
 
31
31
  describe '#on_directory' do
32
- it do
32
+ it do # rubocop:disable RSpec/ExampleLength, RSpec/MultipleExpectations
33
33
  temp_path = nil
34
34
  described_class.on_directory do |path|
35
35
  temp_path = path
@@ -38,7 +38,7 @@ RSpec.describe ::EacRubyUtils::Fs::Temp do
38
38
  expect(temp_path).not_to exist
39
39
  end
40
40
 
41
- it 'not fail if already removed' do
41
+ it 'not fail if already removed' do # rubocop:disable RSpec/ExampleLength, RSpec/MultipleExpectations
42
42
  temp_path = nil
43
43
  described_class.on_directory do |path|
44
44
  temp_path = path