i18n-sequel_bitemporal 1.1.0 → 1.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +47 -11
- data/lib/i18n/backend/sequel_bitemporal.rb +11 -5
- data/lib/i18n/sequel_bitemporal/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 51c7ecf260b7f3a053b84865028e583ec85555735d4b1198f643ac32628f4db8
|
4
|
+
data.tar.gz: 72ebf745d1c757327e594bf7963881ea9a77e1ccee8146a7ff1681debc8ed399
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: fdeb0f48ba7610088e730c37e7366e5824e2244f8df1e7bef809c8ae2d7b6ed3adb1cd5b12c8b2d4f4b4f0cc9aefd7dbe1ffb44f13e92a4f35250727a31a4619
|
7
|
+
data.tar.gz: 8bd09dc1e24f6e0a97d1856dd56f1532e914a9b6ef221747f6467d8442acb082e56421723ac4c324a8563f5746bfcd2e9cbcb0c4ac770e1af0414a1b13d2a67b
|
data/README.md
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
[![Build Status](https://
|
1
|
+
[![Build Status](https://github.com/TalentBox/i18n-sequel_bitemporal/workflows/CI/badge.svg)](https://github.com/TalentBox/i18n-sequel_bitemporal/actions)
|
2
2
|
|
3
3
|
# I18n::Backend::SequelBitemporal
|
4
4
|
|
@@ -122,16 +122,52 @@ database.
|
|
122
122
|
|
123
123
|
## Runnning tests
|
124
124
|
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
125
|
+
```shell
|
126
|
+
# Create db for mysql tests
|
127
|
+
mysql -e 'create database i18n_sequel_bitemporal;' --host 127.0.0.1
|
128
|
+
# Create db for postgresql tests
|
129
|
+
createdb i18n_sequel_bitemporal
|
130
|
+
|
131
|
+
##
|
132
|
+
# Run tests for a specific Rails version
|
133
|
+
##
|
134
|
+
BUNDLE_GEMFILE="ci/Gemfile.rails-6.1" bundle install
|
135
|
+
# MySQL
|
136
|
+
BUNDLE_GEMFILE="ci/Gemfile.rails-6.1" TEST_ADAPTER=mysql2 TEST_DATABASE=i18n_sequel_bitemporal TEST_ENCODING="utf8" bundle exec rake test
|
137
|
+
# PG
|
138
|
+
BUNDLE_GEMFILE="ci/Gemfile.rails-6.1" TEST_ADAPTER=postgresql TEST_DATABASE=i18n_sequel_bitemporal bundle exec rake test
|
139
|
+
# Sqlite
|
140
|
+
BUNDLE_GEMFILE="ci/Gemfile.rails-6.1" TEST_ADAPTER=sqlite3 TEST_DATABASE=test/database.sqlite3 bundle exec rake test
|
141
|
+
|
142
|
+
##
|
143
|
+
# Run tests for a specific Rails version, logging all queries to stdout
|
144
|
+
##
|
145
|
+
BUNDLE_GEMFILE="ci/Gemfile.rails-6.1" bundle install
|
146
|
+
# MySQL
|
147
|
+
DEBUG=1 BUNDLE_GEMFILE="ci/Gemfile.rails-6.1" TEST_ADAPTER=mysql2 TEST_DATABASE=i18n_sequel_bitemporal TEST_ENCODING="utf8" bundle exec rake test
|
148
|
+
# PG
|
149
|
+
DEBUG=1 BUNDLE_GEMFILE="ci/Gemfile.rails-6.1" TEST_ADAPTER=postgresql TEST_DATABASE=i18n_sequel_bitemporal bundle exec rake test
|
150
|
+
# Sqlite
|
151
|
+
DEBUG=1 BUNDLE_GEMFILE="ci/Gemfile.rails-6.1" TEST_ADAPTER=sqlite3 TEST_DATABASE=test/database.sqlite3 bundle exec rake test
|
152
|
+
|
153
|
+
##
|
154
|
+
# Example to run tests for every supported Rails version.
|
155
|
+
# !! Some Rails versions are not compatible with all Ruby versions !!
|
156
|
+
##
|
157
|
+
for gemfile in (ls ci/Gemfile.rails-* | grep -v lock);
|
158
|
+
echo $gemfile
|
159
|
+
BUNDLE_GEMFILE=$gemfile bundle install
|
160
|
+
|
161
|
+
# MySQL
|
162
|
+
BUNDLE_GEMFILE=$gemfile TEST_ADAPTER=mysql2 TEST_DATABASE=i18n_sequel_bitemporal TEST_ENCODING="utf8" bundle exec rake test
|
163
|
+
|
164
|
+
# PG
|
165
|
+
BUNDLE_GEMFILE=$gemfile TEST_ADAPTER=postgresql TEST_DATABASE=i18n_sequel_bitemporal bundle exec rake test
|
166
|
+
|
167
|
+
# Sqlite
|
168
|
+
BUNDLE_GEMFILE=$gemfile TEST_ADAPTER=sqlite3 TEST_DATABASE=test/database.sqlite3 bundle exec rake test
|
169
|
+
end
|
170
|
+
```
|
135
171
|
|
136
172
|
## Maintainers
|
137
173
|
|
@@ -73,9 +73,10 @@ module I18n
|
|
73
73
|
@translations.keys.each{|loc| clear loc, options }
|
74
74
|
else
|
75
75
|
last_update = options[:last_update]
|
76
|
-
|
76
|
+
cache_key = cache_key_of locale
|
77
|
+
cache_time = @cache_times[cache_key]
|
77
78
|
return if last_update && cache_time && last_update < cache_time
|
78
|
-
@translations[
|
79
|
+
@translations[cache_key] = nil
|
79
80
|
end
|
80
81
|
end
|
81
82
|
|
@@ -83,11 +84,12 @@ module I18n
|
|
83
84
|
|
84
85
|
def fetch_all_translations(locale)
|
85
86
|
@translations ||= {}
|
86
|
-
|
87
|
-
|
87
|
+
cache_key = cache_key_of locale
|
88
|
+
@translations[cache_key] ||= begin
|
89
|
+
@cache_times[cache_key] = Time.now
|
88
90
|
Translation.all_for_locale(locale).group_by(&:key)
|
89
91
|
end
|
90
|
-
@translations[
|
92
|
+
@translations[cache_key]
|
91
93
|
end
|
92
94
|
|
93
95
|
def lookup(locale, key, scope = [], options = {})
|
@@ -118,6 +120,10 @@ module I18n
|
|
118
120
|
keys << [keys.last, key].compact.join(FLATTEN_SEPARATOR)
|
119
121
|
end
|
120
122
|
end
|
123
|
+
|
124
|
+
def cache_key_of(locale)
|
125
|
+
locale
|
126
|
+
end
|
121
127
|
end
|
122
128
|
|
123
129
|
include Implementation
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: i18n-sequel_bitemporal
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.1.
|
4
|
+
version: 1.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jonathan Tron
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-01-
|
11
|
+
date: 2024-01-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: i18n
|