jekyll-polyglot 1.1.1 → 1.1.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/polyglot.rb +20 -13
  3. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: ca5555c293e66a474d1e376be77e2734c3306f4a
4
- data.tar.gz: 4c4c2f6caa77f7571ba4274964873e598ff7cb29
3
+ metadata.gz: 289c28c81021239f036efc472756cef0fde5516d
4
+ data.tar.gz: 4ca06ed535b8c8d6a2ccd8c49c10d8711ea73595
5
5
  SHA512:
6
- metadata.gz: e4a344bd2433929d60bd767747a8366e3beefef1152e1ee0fe2f5e8ee2be5fed005ed14875b3f99e9f94197eb8c9f8b147c38433d7578b84ca6e1917b7d2cba8
7
- data.tar.gz: af745ab17521284b5dfc294de4666dc80b8a0eaca237817d61099e7bb342c460bb69fffdb169b5b2926c51371d68043fcd521526c20cbbe7f3bb7079357a0713
6
+ metadata.gz: 7251009d52ff1b6e86b21ebca008d1deb6ca555745e45edf69af9cf779999b180c314d8f011dd5cbed2688c4f572107253e622419231e75dffaa8f7143f7e40d
7
+ data.tar.gz: 211636afabf4b5868cd1a76d183e292acf93dc48428113eab1d5d0578850ac9a57d40d81f111f7d4a72503fecf714166abffa63a0c2e4efcb3c5eac2d3be0927
data/lib/polyglot.rb CHANGED
@@ -1,4 +1,4 @@
1
- # Jekyll Polyglot v1.1.1
1
+ # Jekyll Polyglot v1.1.2
2
2
  # Fast, painless, open source i18n plugin for Jekyll 3.0 Blogs.
3
3
  # author: Samuel Volin (@untra)
4
4
  # github: https://github.com/untra/polyglot
@@ -16,6 +16,7 @@ module Jekyll
16
16
  @file_langs = {}
17
17
  @default_lang = config['default_lang'] || 'en'
18
18
  @languages = config['languages'] || ['en']
19
+ @parallel_localization = config['parallel_localization'] || true
19
20
  (@keep_files << @languages - [@default_lang]).flatten!
20
21
  @exclude_from_localization = config['exclude_from_localization'] || []
21
22
  @active_lang = @default_lang
@@ -24,21 +25,27 @@ module Jekyll
24
25
  alias_method :process_orig, :process
25
26
  def process
26
27
  prepare
27
- pids = {}
28
- languages.each do |lang|
29
- pids[lang] = fork do
30
- process_language lang
28
+ if @parallel_localization
29
+ pids = {}
30
+ languages.each do |lang|
31
+ pids[lang] = fork do
32
+ process_language lang
33
+ end
34
+ end
35
+ Signal.trap('INT') do
36
+ languages.each do |lang|
37
+ puts "Killing #{pids[lang]} : #{lang}"
38
+ kill('INT', pids[lang])
39
+ end
31
40
  end
32
- end
33
- Signal.trap('INT') do
34
41
  languages.each do |lang|
35
- puts "Killing #{pids[lang]} : #{lang}"
36
- kill('INT', pids[lang])
42
+ waitpid pids[lang]
43
+ detach pids[lang]
44
+ end
45
+ else
46
+ languages.each do |lang|
47
+ process_language lang
37
48
  end
38
- end
39
- languages.each do |lang|
40
- waitpid pids[lang]
41
- detach pids[lang]
42
49
  end
43
50
  end
44
51
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jekyll-polyglot
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.1
4
+ version: 1.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Samuel Volin
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-12-20 00:00:00.000000000 Z
11
+ date: 2016-04-04 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: Fast open source internationalization plugin for Jekyll blogs.
14
14
  email: untra.sam@gmail.com