releaf-i18n_database 1.1.5 → 1.1.6

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: 96abca76572ac6e36749a858f421cbfda0b0d4a4
4
- data.tar.gz: 4ded412eb371b6c16e827cf08867202349125c1a
3
+ metadata.gz: df9137e1428781e10e753d7ff5d125aa4dfe7387
4
+ data.tar.gz: c59cee5c4df6bedf70c75c0e531a3cc9869e2a02
5
5
  SHA512:
6
- metadata.gz: 8cb5612f67412d6c161ba8833080d2436e27940cccc12daf8bb3862ba626d111186f0a8579ef3abb796c323ed426b29f90499b0a96963ec0b811b043d70e0085
7
- data.tar.gz: 6b7ca9fa034e0af756f2a6682539ab432f4d881443d7c8fb81c2d39c1157e949eb70108554591f406741f8dbde3f0b6c0942944f4bbc3551d900e72f33f8e174
6
+ metadata.gz: 11929194b50e514b46cc5252be1d525f001a053d7742a1a14465460b610aca0e260678c3b91335aab4541b7e20af20bb2a6946f2499f556651d02d0a6ae85c2a
7
+ data.tar.gz: 046025ad8268b2da79edcbcfe8733a6300d2adf7dfe7ad654c3195184da1efa7b36426cfa994704fd6be80ea2b05bc8a2a3cff6322bfff117f4a7f2f31536966
@@ -63,6 +63,7 @@ class Releaf::I18nDatabase::TranslationsStore
63
63
  result.present? || options.fetch(:inherit_scopes, true) == false
64
64
  end
65
65
 
66
+ cache_instance_method :localization_data
66
67
  def localization_data
67
68
  Releaf::I18nDatabase::I18nEntryTranslation
68
69
  .joins(:i18n_entry)
@@ -71,12 +72,14 @@ class Releaf::I18nDatabase::TranslationsStore
71
72
  .to_h
72
73
  end
73
74
 
75
+ cache_instance_method :stored_keys
74
76
  def stored_keys
75
77
  Releaf::I18nDatabase::I18nEntry.pluck(:key).inject({}) do|h, key|
76
78
  h.update(key => true)
77
79
  end
78
80
  end
79
81
 
82
+ cache_instance_method :stored_translations
80
83
  def stored_translations
81
84
  stored_keys.map do |key, _|
82
85
  key_hash(key)
@@ -136,8 +139,6 @@ class Releaf::I18nDatabase::TranslationsStore
136
139
  options.has_key?(:count) && options[:create_plurals] == true
137
140
  end
138
141
 
139
- cache_instance_methods :stored_translations, :stored_keys, :localization_data
140
-
141
142
  private
142
143
 
143
144
  def key_locale_hash(localized_key, localization)
@@ -277,8 +277,8 @@ describe Releaf::I18nDatabase::TranslationsStore do
277
277
  "lv.some.good" => "xx")
278
278
  end
279
279
 
280
- it "caches built hash" do
281
- expect(described_class.cached_instance_methods).to include(:localization_data)
280
+ it "has cached method result" do
281
+ expect(described_class).to cache_instance_method(:localization_data)
282
282
  end
283
283
  end
284
284
 
@@ -289,8 +289,8 @@ describe Releaf::I18nDatabase::TranslationsStore do
289
289
  expect(subject.stored_keys).to eq("some.food" => true, "some.good" => true)
290
290
  end
291
291
 
292
- it "caches built hash" do
293
- expect(described_class.cached_instance_methods).to include(:stored_keys)
292
+ it "has cached method result" do
293
+ expect(described_class).to cache_instance_method(:stored_keys)
294
294
  end
295
295
  end
296
296
 
@@ -309,8 +309,8 @@ describe Releaf::I18nDatabase::TranslationsStore do
309
309
  end
310
310
  end
311
311
 
312
- it "caches built hash" do
313
- expect(described_class.cached_instance_methods).to include(:stored_translations)
312
+ it "has cached method result" do
313
+ expect(described_class).to cache_instance_method(:stored_translations)
314
314
  end
315
315
  end
316
316
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: releaf-i18n_database
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.5
4
+ version: 1.1.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - CubeSystems
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-06-07 00:00:00.000000000 Z
11
+ date: 2017-08-31 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: releaf-core
@@ -16,14 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - '='
18
18
  - !ruby/object:Gem::Version
19
- version: 1.1.5
19
+ version: 1.1.6
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - '='
25
25
  - !ruby/object:Gem::Version
26
- version: 1.1.5
26
+ version: 1.1.6
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: rails-i18n
29
29
  requirement: !ruby/object:Gem::Requirement
@@ -144,23 +144,23 @@ signing_key:
144
144
  specification_version: 4
145
145
  summary: i18n database gem for releaf
146
146
  test_files:
147
+ - spec/builders/translations/table_builder_spec.rb
148
+ - spec/builders/translations/index_builder_spec.rb
147
149
  - spec/builders/translations/builder_common_spec.rb
148
150
  - spec/builders/translations/edit_builder_spec.rb
149
- - spec/builders/translations/index_builder_spec.rb
150
- - spec/builders/translations/table_builder_spec.rb
151
- - spec/controllers/i18n_backend/translations_controller_spec.rb
152
151
  - spec/features/translations_spec.rb
153
- - spec/fixtures/all_translations_exported.xlsx
154
- - spec/fixtures/invalid.xls
155
- - spec/fixtures/invalid.xlsx
156
- - spec/fixtures/time.formats.xlsx
157
- - spec/fixtures/translations_import.xlsx
158
- - spec/fixtures/unsupported_import_file.png
152
+ - spec/models/i18n_database/i18n_entry_spec.rb
153
+ - spec/models/i18n_database/i18n_entry_translation_spec.rb
154
+ - spec/lib/releaf/i18n_database/translations_utilities_spec.rb
155
+ - spec/lib/releaf/i18n_database/humanize_missing_translations_spec.rb
159
156
  - spec/lib/releaf/i18n_database/backend_spec.rb
160
157
  - spec/lib/releaf/i18n_database/configuration_spec.rb
161
- - spec/lib/releaf/i18n_database/humanize_missing_translations_spec.rb
162
- - spec/lib/releaf/i18n_database/parse_spreadsheet_translations_spec.rb
163
158
  - spec/lib/releaf/i18n_database/translations_store_spec.rb
164
- - spec/lib/releaf/i18n_database/translations_utilities_spec.rb
165
- - spec/models/i18n_database/i18n_entry_spec.rb
166
- - spec/models/i18n_database/i18n_entry_translation_spec.rb
159
+ - spec/lib/releaf/i18n_database/parse_spreadsheet_translations_spec.rb
160
+ - spec/fixtures/all_translations_exported.xlsx
161
+ - spec/fixtures/unsupported_import_file.png
162
+ - spec/fixtures/time.formats.xlsx
163
+ - spec/fixtures/translations_import.xlsx
164
+ - spec/fixtures/invalid.xlsx
165
+ - spec/fixtures/invalid.xls
166
+ - spec/controllers/i18n_backend/translations_controller_spec.rb