wovnrb 2.6.0 → 3.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.en.md +24 -0
- data/lib/wovnrb/railtie.rb +1 -15
- data/lib/wovnrb/version.rb +1 -1
- metadata +5 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7a23be23f4867343c0330c49d48086581bab699eb9ba1abf4e193c8c64f08fe6
|
4
|
+
data.tar.gz: 192ce01a0ba04a4f8e2db9fbdc1cef91c9e0cc871a9a2169243d293e031f284c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2549eb653db18fe3d99bfdb5a22f2231becf4af6bf3165d2a4d8971ada59235b83e369dcac5abd3d5e971c5f862e6f724532819fb27b12fe151adddff90b87d9
|
7
|
+
data.tar.gz: a461b0ca5083dc24d4b9c5b951cb86a8d81d8120e6fcca92d68ad33d30d619d4e938efde8e91a21543c8f1afc3440be092df166ae93cb231df7b260069aa9cfc
|
data/README.en.md
CHANGED
@@ -47,6 +47,8 @@ config.wovnrb = {
|
|
47
47
|
...
|
48
48
|
```
|
49
49
|
|
50
|
+
The WOVN.rb Rails middleware must also be installed. See [2.10 - install_middleware](#2.10-install_middleware)
|
51
|
+
|
50
52
|
* If you're using Sinatra
|
51
53
|
|
52
54
|
Insert the following into either the Application File or config.ru.
|
@@ -83,6 +85,7 @@ query | | []
|
|
83
85
|
ignore_class | | []
|
84
86
|
translate_fragment | | true
|
85
87
|
ignore_paths | | []
|
88
|
+
install_middleware | | true
|
86
89
|
|
87
90
|
### 2.1. project_token
|
88
91
|
|
@@ -172,3 +175,24 @@ For instance, if you want to not localize the admin directory of your website, y
|
|
172
175
|
```
|
173
176
|
'ignore_paths' => ['/admin/']
|
174
177
|
```
|
178
|
+
|
179
|
+
### 2.10 install_middleware
|
180
|
+
|
181
|
+
When using WOVN.rb in a Rails environment, this parameter controls whether the WOVN.rb middleware will be automatically installed or not.
|
182
|
+
|
183
|
+
By default, WOVN.rb is automatically installed as the first middleware.
|
184
|
+
If you are using Rack::Deflater or other middleware that needs to be executed first, set this parameter to `false` and manually insert the middleware appropriately.
|
185
|
+
WOVN.rb needs to be added after any compression middleware.
|
186
|
+
|
187
|
+
```ruby
|
188
|
+
config.middleware.use Rack::Deflater
|
189
|
+
config.middleware.insert_after Rack::Deflater, Wovnrb::Interceptor
|
190
|
+
|
191
|
+
config.wovnrb = {
|
192
|
+
:project_token => 'EnS!t3',
|
193
|
+
:default_lang => 'en',
|
194
|
+
:supported_langs => ['en'],
|
195
|
+
:url_pattern => 'path',
|
196
|
+
:install_middleware => false
|
197
|
+
}
|
198
|
+
```
|
data/lib/wovnrb/railtie.rb
CHANGED
@@ -1,21 +1,7 @@
|
|
1
1
|
module Wovnrb
|
2
|
-
def self.middleware_inserted?(app, middleware)
|
3
|
-
app.middleware.send(:operations).each do |_, middlewares, _|
|
4
|
-
return true if middlewares&.include?(middleware)
|
5
|
-
end
|
6
|
-
|
7
|
-
false
|
8
|
-
end
|
9
|
-
|
10
2
|
class Railtie < Rails::Railtie
|
11
3
|
initializer 'wovnrb.configure_rails_initialization' do |app|
|
12
|
-
|
13
|
-
if defined?(Rack::Deflater) && Wovnrb.middleware_inserted?(app, Rack::Deflater)
|
14
|
-
app.middleware.insert_after(Rack::Deflater, Wovnrb::Interceptor)
|
15
|
-
else
|
16
|
-
app.middleware.insert_before(0, Wovnrb::Interceptor)
|
17
|
-
end
|
18
|
-
end
|
4
|
+
app.middleware.insert_before(0, Wovnrb::Interceptor) if Rails.configuration.wovnrb[:install_middleware]
|
19
5
|
end
|
20
6
|
end
|
21
7
|
end
|
data/lib/wovnrb/version.rb
CHANGED
metadata
CHANGED
@@ -1,12 +1,12 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: wovnrb
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 3.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jeff Sandford
|
8
8
|
- Antoine David
|
9
|
-
autorequire:
|
9
|
+
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
12
|
date: 2021-04-14 00:00:00.000000000 Z
|
@@ -448,7 +448,7 @@ homepage: ''
|
|
448
448
|
licenses:
|
449
449
|
- MIT
|
450
450
|
metadata: {}
|
451
|
-
post_install_message:
|
451
|
+
post_install_message:
|
452
452
|
rdoc_options: []
|
453
453
|
require_paths:
|
454
454
|
- lib
|
@@ -463,9 +463,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
463
463
|
- !ruby/object:Gem::Version
|
464
464
|
version: '0'
|
465
465
|
requirements: []
|
466
|
-
|
467
|
-
|
468
|
-
signing_key:
|
466
|
+
rubygems_version: 3.1.4
|
467
|
+
signing_key:
|
469
468
|
specification_version: 4
|
470
469
|
summary: Gem for WOVN.io
|
471
470
|
test_files:
|