lit 0.4.0.pre.alpha → 0.4.0.pre.alpha.1

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
  SHA1:
3
- metadata.gz: 6bcba84c0fc5b731bbbbd07f38d7a263f1778869
4
- data.tar.gz: 105fcbf83b9b7df7f19eee1a33dc60802ff0703e
3
+ metadata.gz: 4df32a49da08696b7996f469dbd9041655750f22
4
+ data.tar.gz: e642cef48888929647b2782be05bb96339eb8788
5
5
  SHA512:
6
- metadata.gz: 9aeaae0bb50a36db06603cbe05323d12ac63ee6635acf76f8b70db0dbef5db694f063fabac4eb1416724c121b46d1cee1cc434ae988d59472e7528a8ec24f301
7
- data.tar.gz: 277a1d97c1737886c8b5a0536336515f1bbc58dab0c0d4385b5f11dbd956136aafc0d1f040def8cf8ea0866bd5cfb5aaaff9eabc70b2b4e5d693777721ca6b86
6
+ metadata.gz: c002db4e8d5262e15c4d62a55cbccb44a44c6580dd31a4d1feefdb3eec72b182894d6e72d8d13659cbf0e8e679bea203a1a8344818b841351590b40207e1b100
7
+ data.tar.gz: 133089d93bc0f5da416480e4fe59a9f27a2779bbab8c859691d0e18644fb2e81fbf24e2341fa0e8c553cb9e056c7ea71afd50ea44b203d40cc533af7b2f7df56
data/lib/lit.rb CHANGED
@@ -8,6 +8,8 @@ module Lit
8
8
  mattr_accessor :redis_url
9
9
  mattr_accessor :storage_options
10
10
  mattr_accessor :humanize_key
11
+ mattr_accessor :humanize_key_ignored_keys
12
+ mattr_accessor :humanize_key_ignored
11
13
  mattr_accessor :ignored_keys
12
14
  mattr_accessor :ignore_yaml_on_startup
13
15
  mattr_accessor :api_enabled
@@ -25,6 +27,10 @@ module Lit
25
27
  if loader.nil? && @@table_exists
26
28
  self.loader ||= Loader.new
27
29
  Lit.humanize_key = false if Lit.humanize_key.nil?
30
+ Lit.humanize_key_ignored_keys = [] if Lit.humanize_key_ignored_keys.nil?
31
+ Lit.humanize_key_ignored = %w[i18n date datetime number time support ]
32
+ Lit.humanize_key_ignored |= Lit.humanize_key_ignored_keys
33
+ Lit.humanize_key_ignored = %r{(#{Lit.humanize_key_ignored.join('|')}).*}
28
34
  if Lit.ignored_keys.is_a?(String)
29
35
  keys = Lit.ignored_keys.split(',').map(&:strip)
30
36
  Lit.ignored_keys = keys
@@ -108,7 +108,7 @@ module Lit
108
108
  # it anyway if we return nil, but then it will wrap it also in
109
109
  # translation_missing span.
110
110
  # Humanizing key should be last resort
111
- if content.nil? && Lit.humanize_key
111
+ if content.nil? && Lit.humanize_key && key.match(Lit.humanize_key_ignored).nil?
112
112
  content = key.to_s.split('.').last.humanize
113
113
  if content.present?
114
114
  @cache[key_with_locale] = content
@@ -1,3 +1,3 @@
1
1
  module Lit
2
- VERSION = '0.4.0-alpha'.freeze
2
+ VERSION = '0.4.0-alpha.1'.freeze
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: lit
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.0.pre.alpha
4
+ version: 0.4.0.pre.alpha.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Maciej Litwiniuk