avm-tools 0.78.0 → 0.79.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: 31676da0253c7ec8dc92aee2619723858f021faedb659e4f6128a7552eaad975
4
- data.tar.gz: b6c14df8700750c9e0a39c9b8de6ee78e5864bdbf8ff2c21c7c59f029257437f
3
+ metadata.gz: eec96ee906113345d8ef2b32945ccf9140141b63cdeaccb7b2f351762f338e82
4
+ data.tar.gz: 8f25aaa99149329fc034c040f45609b8eb078b2c547ab88d99c89dfd2b607135
5
5
  SHA512:
6
- metadata.gz: 989f01a3eb81d88b99186f3471f7437cdd00d7f6d182a68cb2f1080461f08cbadb84bb30782e8bab731eecd75782cc7728d175920cb28f8544e31f88e435ef02
7
- data.tar.gz: 2b51fd22a6aec3d7955f75c3f4d1c68fc5a60c2c8c2dbc13e25cdaff6396df1ba655e1ef5183ab3081e18f17b642a5cf832f7583e80997c6bfb121c90fd0c0a4
6
+ metadata.gz: 1790d224e7b049c1aca352e2d4859ae9d48d80df3664aa2741654a56c70491e065380936e1d62f542b449aaf8de3e7e5d609985da830ebef6a24e4e392a75f99
7
+ data.tar.gz: 4e658ff31fcb8044695f44a20a8f0777eda5eb580ddaad93d7e63f1ecfb4676e3f284e8e8578a0c3d2db1b978f0a3754ec3c0709fbb7e80c50a903c718dd408b
@@ -0,0 +1,31 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'avm/patches/i18n'
4
+
5
+ class Class
6
+ TRANSLATE_LOCALE_KEY = :__locale
7
+
8
+ def translate(entry_suffix, values = {})
9
+ on_i18n_locale(values.delete(TRANSLATE_LOCALE_KEY)) do
10
+ ::I18n.translate(translate_entry_full(entry_suffix), values)
11
+ end
12
+ end
13
+
14
+ def translate_entry_full(entry_suffix)
15
+ "#{translate_entry_self_prefix}.#{entry_suffix}"
16
+ end
17
+
18
+ def translate_entry_self_prefix
19
+ name.underscore.gsub('/', '.')
20
+ end
21
+
22
+ def on_i18n_locale(locale)
23
+ old_locale = ::I18n.locale
24
+ begin
25
+ ::I18n.locale = locale
26
+ yield
27
+ ensure
28
+ ::I18n.locale = old_locale
29
+ end
30
+ end
31
+ end
@@ -1,17 +1,9 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require 'avm/patches/i18n'
3
+ require 'avm/patches/class/i18n'
4
4
 
5
5
  class Object
6
6
  def translate(entry_suffix, values = {})
7
- ::I18n.translate(translate_entry_full(entry_suffix), values)
8
- end
9
-
10
- def translate_entry_full(entry_suffix)
11
- "#{translate_entry_self_prefix}.#{entry_suffix}"
12
- end
13
-
14
- def translate_entry_self_prefix
15
- self.class.name.underscore.gsub('/', '.')
7
+ self.class.translate(entry_suffix, values)
16
8
  end
17
9
  end
@@ -1,12 +1,15 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  require 'eac_ruby_utils/core_ext'
4
+ require 'avm/patches/class/i18n'
4
5
 
5
6
  module Avm
6
7
  module Projects
7
8
  module Stereotypes
8
9
  class RubyGem
9
10
  class Update
11
+ TRANSLATE_CLASS = self
12
+
10
13
  enable_console_speaker
11
14
  common_constructor :instance
12
15
 
@@ -46,7 +49,7 @@ module Avm
46
49
  end
47
50
 
48
51
  def gemfile_lock_commit_message
49
- 'Todas as gems: atualiza.'
52
+ TRANSLATE_CLASS.translate(__method__, __locale: instance.locale)
50
53
  end
51
54
 
52
55
  def gemfile_lock_changed?
@@ -47,8 +47,7 @@ module Avm
47
47
  end
48
48
 
49
49
  def git_commit_message
50
- ::I18n.default_locale = instance.locale
51
- translate(__method__, version: target_version)
50
+ translate(__method__, version: target_version, __locale: instance.locale)
52
51
  end
53
52
 
54
53
  def changing_files
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Avm
4
4
  module Tools
5
- VERSION = '0.78.0'
5
+ VERSION = '0.79.0'
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: avm-tools
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.78.0
4
+ version: 0.79.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Esquilo Azul Company
@@ -434,6 +434,7 @@ files:
434
434
  - lib/avm/local_projects.rb
435
435
  - lib/avm/local_projects/instance.rb
436
436
  - lib/avm/patches.rb
437
+ - lib/avm/patches/class/i18n.rb
437
438
  - lib/avm/patches/eac_ruby_gems_utils/gem.rb
438
439
  - lib/avm/patches/i18n.rb
439
440
  - lib/avm/patches/object/i18n.rb