minimalizer 0.1.1 → 0.1.2

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 2f4a400521f6ee2271e7b63cce69f699bbb3d425
4
- data.tar.gz: b156e1958a6cd4574f508e08fc194e67ee6dfe0b
3
+ metadata.gz: 6636a8dae0b668a64fea6da9f63fa87a874ec3f3
4
+ data.tar.gz: b0291192eaabeb704a48130f60981e835f5d5fd5
5
5
  SHA512:
6
- metadata.gz: ea969138640a5d361f842fd60af670cb718418e7765cb8a7e98130073a5edd48d856c01d4dfada9675898ce925b1a5af22bfb5e220954da0a869f2eda6baf1ef
7
- data.tar.gz: e858ebf64e8f0c71dcd9d8259924b1fa54f8284d1de31c22aefd55882b408df11ddf70869065bb4c245adb9c98e45eadbaf1bab9924b3f37f5164bd88152ff0c
6
+ metadata.gz: c6258cc76d465f8de7f39e92ec5e0f0a3519c063ed6accef9baedbae5b0a392c4b661c40481119b29d666d0c9458b48f1fd83c361334193af783259c259a3306
7
+ data.tar.gz: ffc20a09f115289bbb11a5984c4d01b208ddc2686d13aff9130cee32695cefaf6107c82f59393448de1c672586ad65276181842deae316214633d64d9163868c
@@ -151,11 +151,14 @@ module Minimalizer
151
151
 
152
152
  private
153
153
 
154
- # Returns a string for the value. If the value is a string it will be
155
- # returned. If the value is a hash or is truthful the I18n translation for
156
- # that key will be rendered with the value as its locals. Include a local of
157
- # :_html to render the html version of the translation.
154
+ # Returns a string for present values. If the value is a string it will be
155
+ # returned as is. If the value is a hash or is truthful the I18n translation
156
+ # for that key will be rendered with the value as its locals. Include a
157
+ # local of :_html to render the html version of the translation. If the
158
+ # value is a Proc it will be called at the start of the method’s execution.
158
159
  def translate_key(key, value)
160
+ value = value.call if value.is_a?(Proc)
161
+
159
162
  if value.is_a?(String)
160
163
  value
161
164
  elsif value.kind_of?(Hash)
@@ -1,3 +1,3 @@
1
1
  module Minimalizer
2
- VERSION = '0.1.1'
2
+ VERSION = '0.1.2'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: minimalizer
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Theodore Kimble