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 +4 -4
- data/lib/minimalizer/controller_helpers.rb +7 -4
- data/lib/minimalizer/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6636a8dae0b668a64fea6da9f63fa87a874ec3f3
|
4
|
+
data.tar.gz: b0291192eaabeb704a48130f60981e835f5d5fd5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
155
|
-
# returned. If the value is a hash or is truthful the I18n translation
|
156
|
-
# that key will be rendered with the value as its locals. Include a
|
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)
|
data/lib/minimalizer/version.rb
CHANGED