fast_gettext 3.1.0 → 4.0.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: bafc7c8a404376de4731fee7974898616e9218096b75d667f87d4d1ebf435d76
4
- data.tar.gz: e7b3992809e416b30d80305b80fd1aa9092954463e6a9fee58f44f844c8d540a
3
+ metadata.gz: 20e208d22e9a3e7d486f620c2c134e4e602c4d31411d737a07a4fc700a5cb50d
4
+ data.tar.gz: '09d8b2bc909e0163e1120dc61d9e87dc23604dce84829f20ddf4fe19c8433ff1'
5
5
  SHA512:
6
- metadata.gz: feb42678bbee41fe12f2ea6d4e55a9ad1af4afbb4edb4cb1f5736ad275101938a717b168726f40f08695a7cc7e9678fdc8dc3d95c1ad2a533c94dbd57af38329
7
- data.tar.gz: af0a583a57e498952d88b7346a31e8dba50cb6a1c621fd7e9e09bc53367c0ec470195d56118108cfce0c0ae460a1bd3b503dd59f9a8b88a6110eb402e8c2c5b0
6
+ metadata.gz: 9746937a00829ef51350812f51207941014bb7f354417e585c7f2f5b19415ea83abd762e7d6cf679ec56c595b509b36a523decc187fec5c185819bfb003f54cd
7
+ data.tar.gz: 4779c2456eaab59d6012eb6a00009cbf5869c5db46fab4cf52d1717062141e10b9b4341d4ffc524d63403f85d6fc79af9019482b15ab3866115a2ce06ccd3b68
data/CHANGELOG CHANGED
@@ -1,3 +1,4 @@
1
+ 4.0.0 -- Remove String#% hack that would make it not blow up when using invalid keys, can temporarily restore with `FastGettext.allow_invalid_keys!`
1
2
  3.1.0 -- Work with frozen strings
2
3
  3.0.0 -- Drop ruby 2.x support
3
4
  2.4.0 -- Depend on prime gem
@@ -58,19 +58,3 @@ rescue ArgumentError
58
58
  end
59
59
  end
60
60
  end
61
-
62
- # 1.9.1 if you misspell a %{key} your whole page would blow up, no thanks...
63
- begin
64
- ("%{b}" % {:a=>'b'})
65
- rescue KeyError
66
- class String
67
- alias :_fast_gettext_old_format_m :%
68
- def %(*args)
69
- begin
70
- _fast_gettext_old_format_m(*args)
71
- rescue KeyError
72
- self
73
- end
74
- end
75
- end
76
- end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module FastGettext
4
- VERSION = Version = '3.1.0' # rubocop:disable Naming/ConstantName
4
+ VERSION = Version = '4.0.0' # rubocop:disable Naming/ConstantName
5
5
  end
data/lib/fast_gettext.rb CHANGED
@@ -28,6 +28,22 @@ module FastGettext
28
28
  translation_repositories[name] = TranslationRepository.build(name, options)
29
29
  end
30
30
 
31
+ # deprecated, just a crutch to migrate to new api
32
+ def self.allow_invalid_keys!
33
+ eval(<<~CODE)
34
+ class ::String
35
+ alias :_fast_gettext_old_format_m :%
36
+ def %(*args)
37
+ begin
38
+ _fast_gettext_old_format_m(*args)
39
+ rescue KeyError
40
+ self
41
+ end
42
+ end
43
+ end
44
+ CODE
45
+ end
46
+
31
47
  # some repositories know where to store their locales
32
48
  def self.locale_path
33
49
  translation_repositories[text_domain].instance_variable_get(:@options)[:path]
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fast_gettext
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.1.0
4
+ version: 4.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Michael Grosser
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-08-21 00:00:00.000000000 Z
11
+ date: 2025-01-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: prime