tml 5.7.1 → 5.7.2

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: a26bbf3c59deca21956a94bc33d811377797034e
4
- data.tar.gz: fdd19956dcf43dc02228c8c43ea8687a8eb47d34
3
+ metadata.gz: 00373acbdc8243802cb22ddd14c3d2434753edfa
4
+ data.tar.gz: 01f266fa7d349cefcb19463996367aa0e35788cd
5
5
  SHA512:
6
- metadata.gz: f5277433d7a88c672d46f9c214add49e06bb52752fd1e9f23b06f8c1fad3f0db9c40723c3d159078644b59ecfd8f6d372c7b8665f8e6781404788cf19b7ffd7c
7
- data.tar.gz: 3e31327a1b93feffc6f86e1d974c0ba64e0a90aac225a154d18eb8c7de67316f1bf10438db03a88e40fe47c4a38fca0bbf6779e4ede7a5c77f8c70855e4755b0
6
+ metadata.gz: bfa73f5c1ad8abf94af47684f4c136d60647b9dd1e98bf70e4b90fb0dc78330788ccf3336af75a5a446b44fa95aa12f1e8e7929eaa07f3e8b2cd93e2d10a223b
7
+ data.tar.gz: 49528f62dd636a3a57f7cac4a5a16a8b66000b50fd7d428e39258bb45fd853944e47a90f515ab1874c0a239d3b525a1f5a470cffdeaf6386f8c292ce73d9f151
@@ -39,7 +39,7 @@ class Tml::Application < Tml::Base
39
39
  # CDN_HOST = 'https://trex-snapshots.s3-us-west-1.amazonaws.com'
40
40
 
41
41
  attributes :host, :cdn_host, :id, :key, :access_token, :name, :description, :threshold, :default_locale, :default_level
42
- has_many :features, :languages, :languages_by_locale, :sources, :tokens, :css, :shortcuts, :translations, :extensions
42
+ has_many :features, :languages, :languages_by_locale, :sources, :sources_by_key, :tokens, :css, :shortcuts, :translations, :extensions
43
43
  has_many :ignored_keys
44
44
 
45
45
  # Returns application cache key
@@ -125,14 +125,15 @@ class Tml::Application < Tml::Base
125
125
  end
126
126
 
127
127
  if hash_value(extensions, :sources)
128
- self.sources ||= {}
128
+ self.sources_by_key ||= {}
129
129
  hash_value(extensions, :sources).each do |source, data|
130
130
  cache.store(Tml::Source.cache_key(source_locale, source), data) if cache
131
- self.sources[source] ||= Tml::Source.new(
131
+ source_key = "#{source_locale}/#{source}"
132
+ self.sources_by_key[source_key] ||= Tml::Source.new(
132
133
  application: self,
133
134
  source: source
134
135
  )
135
- self.sources[source].update_translations(source_locale, data)
136
+ self.sources_by_key[source].update_translations(source_locale, data)
136
137
  end
137
138
  end
138
139
  end
@@ -193,8 +194,9 @@ class Tml::Application < Tml::Base
193
194
 
194
195
  # Returns source by key
195
196
  def source(key, locale)
196
- self.sources ||= {}
197
- self.sources["#{locale}/#{key}"] ||= Tml::Source.new(
197
+ self.sources_by_key ||= {}
198
+ source_key = "#{locale}/#{key}"
199
+ self.sources_by_key[source_key] ||= Tml::Source.new(
198
200
  :application => self,
199
201
  :source => key
200
202
  ).fetch_translations(locale)
@@ -258,7 +260,7 @@ class Tml::Application < Tml::Base
258
260
 
259
261
  # Reset translation cache
260
262
  def reset_translation_cache
261
- self.sources = {}
263
+ self.sources_by_key = {}
262
264
  self.translations = {}
263
265
  @languages_by_locale = nil
264
266
  @missing_keys_by_sources = nil
data/lib/tml/version.rb CHANGED
@@ -31,7 +31,7 @@
31
31
  #++
32
32
 
33
33
  module Tml
34
- VERSION = '5.7.1'
34
+ VERSION = '5.7.2'
35
35
 
36
36
  def self.full_version
37
37
  "tml-ruby v#{Tml::VERSION} (Faraday v#{Faraday::VERSION})"
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: tml
3
3
  version: !ruby/object:Gem::Version
4
- version: 5.7.1
4
+ version: 5.7.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Michael Berkovich
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-08-03 00:00:00.000000000 Z
11
+ date: 2017-08-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday