i18n-migrations 1.0.1 → 1.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/i18n/migrations/migrator.rb +12 -4
- data/lib/i18n/migrations/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b742b520e0c42a29cbed11f435eaf57293a4c958de7ed2eed8be1ed802bfc7da
|
4
|
+
data.tar.gz: b69d6b18f29f0290810322c8e051f5895ffd69982725b3cb8ea9b01630094af1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 36e7b155f30d24c24fc84c181860595dbb995c7cf53f9ca6c7b693794b7b7cfa1a1f9a287c996c3ed75e7fe897b8a870946a37ec73c47bf25c2ea7c005fb766a
|
7
|
+
data.tar.gz: e5957eb775f2592d38824141e5c67cf42e8889c71c6cf239c98bb1ffeb0250529963ddc8f58d5df4a2a5dde0a51ca6a7c0cb848fae73c5648194a4989b7993bf
|
@@ -11,6 +11,8 @@ require 'config'
|
|
11
11
|
require 'locale'
|
12
12
|
require 'migration_factory'
|
13
13
|
|
14
|
+
ASYNC = false
|
15
|
+
|
14
16
|
# this class knows how to do all the things the cli needs done.
|
15
17
|
# it mostly delegates to locale to do it, often asking multiple locales to do the same thing
|
16
18
|
module I18n
|
@@ -115,11 +117,17 @@ end
|
|
115
117
|
private
|
116
118
|
|
117
119
|
def each_locale(name = 'all')
|
118
|
-
|
119
|
-
|
120
|
-
|
120
|
+
locale_names = name == 'all' ? all_locale_names : [name]
|
121
|
+
|
122
|
+
if ASYNC
|
123
|
+
threads = locale_names.map do |l|
|
124
|
+
locale = locale_for(l)
|
125
|
+
Thread.new {yield locale}
|
126
|
+
end
|
127
|
+
threads.each(&:join)
|
128
|
+
else
|
129
|
+
locale_names.each {|l| yield locale_for(l)}
|
121
130
|
end
|
122
|
-
threads.each(&:join)
|
123
131
|
end
|
124
132
|
|
125
133
|
def all_locale_names
|