i18nline 0.0.10.alpha → 0.0.11.alpha

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: 84be485a4a066f3df39cb5e042119dd5fc148fd8
4
- data.tar.gz: 3795a0deaff69a57779f1eb6d4456ec9d629fd23
3
+ metadata.gz: 5790732964593f372d6c34db20d014cfb34c16dc
4
+ data.tar.gz: df31ffa45b8b042e4ff79ab7e960e486e2333331
5
5
  SHA512:
6
- metadata.gz: a2e0c707fe888eed80b4b9d181ea0029bd296748589f05a151f0af94fd8dd67e5a7b3e05e5f0f7358c90c72a8a2bccfc8610d2614a5109b954f484e6705ae1f9
7
- data.tar.gz: ba3161979348cbf5708444b5bd7b27593d61d95326be4a0df7d09db84cb2d4d7466cb23e0240184bc5dea2e845b6e57a983a8d5a39b01cdaf5807fcc9b9694a7
6
+ metadata.gz: 3b3626d66099961ade71746ddb297f3d734f9276c51807d48b514657eafadd4fbacc8ecbdee475658b16a910855b902c39f7657f168c99644ff3b727edc3745f
7
+ data.tar.gz: 2f2b122954e45dd36f381a1fa0183943c3854905d2eff0970f2eb2c5e92ca1ab97f909130d6811ed61f33351c92a823c2f8c042c9f2a4ceb37a065ccedd6f711
@@ -7,32 +7,38 @@ module I18nline
7
7
  end
8
8
  end
9
9
 
10
- # This check is needed to make possible to install migrations with
11
- # rake when there are other gems using I18n at setup before the
12
- # table is created.
13
- if ActiveRecord::Base.connection.table_exists? 'i18nline_translations'
14
- module I18n
15
- module Backend
16
- class Chain
17
- def available_locales
18
- I18nline::enabled_locales
10
+ # Some times part of the app is initialized but i18nline is not ready.
11
+ # This happens in 'rake assets:precompile', for instance.
12
+ begin
13
+ # This check is needed to make possible to install migrations with
14
+ # rake when there are other gems using I18n at setup before the
15
+ # table is created.
16
+ if ActiveRecord::Base.connection.table_exists? 'i18nline_translations'
17
+ module I18n
18
+ module Backend
19
+ class Chain
20
+ def available_locales
21
+ I18nline::enabled_locales
22
+ end
19
23
  end
20
24
  end
21
25
  end
22
- end
23
26
 
24
- TRANSLATION_STORE = I18nline::MyBackend.new
25
- I18n.backend = I18n::Backend::Chain.new(TRANSLATION_STORE, I18n::Backend::Simple.new)
27
+ TRANSLATION_STORE = I18nline::MyBackend.new
28
+ I18n.backend = I18n::Backend::Chain.new(TRANSLATION_STORE, I18n::Backend::Simple.new)
26
29
 
27
- module I18n
28
- class JustRaiseExceptionHandler < ExceptionHandler
29
- def call(exception, locale, key, options)
30
- if exception.is_a?(MissingTranslation)
31
- TRANSLATION_STORE.store_default_translations(locale, key, options)
30
+ module I18n
31
+ class JustRaiseExceptionHandler < ExceptionHandler
32
+ def call(exception, locale, key, options)
33
+ if exception.is_a?(MissingTranslation)
34
+ TRANSLATION_STORE.store_default_translations(locale, key, options)
35
+ end
36
+ super
32
37
  end
33
- super
34
38
  end
35
39
  end
40
+ I18n.exception_handler = I18n::JustRaiseExceptionHandler.new
36
41
  end
37
- I18n.exception_handler = I18n::JustRaiseExceptionHandler.new
42
+ rescue
43
+ puts "I18nline not initiatied at this point."
38
44
  end
@@ -1,3 +1,3 @@
1
1
  module I18nline
2
- VERSION = "0.0.10.alpha"
2
+ VERSION = "0.0.11.alpha"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: i18nline
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.10.alpha
4
+ version: 0.0.11.alpha
5
5
  platform: ruby
6
6
  authors:
7
7
  - Rubén Díaz-Jorge Gil
@@ -206,7 +206,6 @@ files:
206
206
  - test/dummy/tmp/cache/assets/development/sprockets/c5d518b12d9d712aa81c6c98a57ad3b5
207
207
  - test/dummy/tmp/cache/assets/development/sprockets/90b42249c96ca020cc4d4e5d209e3662
208
208
  - test/dummy/tmp/cache/assets/development/sprockets/1fed974ece9b46e9543a13bd2cfd39c6
209
- - test/dummy/tmp/pids/server.pid
210
209
  - test/dummy/bin/rake
211
210
  - test/dummy/bin/bundle
212
211
  - test/dummy/bin/rails
@@ -318,7 +317,6 @@ test_files:
318
317
  - test/dummy/tmp/cache/assets/development/sprockets/c5d518b12d9d712aa81c6c98a57ad3b5
319
318
  - test/dummy/tmp/cache/assets/development/sprockets/90b42249c96ca020cc4d4e5d209e3662
320
319
  - test/dummy/tmp/cache/assets/development/sprockets/1fed974ece9b46e9543a13bd2cfd39c6
321
- - test/dummy/tmp/pids/server.pid
322
320
  - test/dummy/bin/rake
323
321
  - test/dummy/bin/bundle
324
322
  - test/dummy/bin/rails
@@ -1 +0,0 @@
1
- 12050