wovnrb 0.1.09 → 0.1.10
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/wovnrb.rb +11 -7
- data/lib/wovnrb/store.rb +1 -1
- data/lib/wovnrb/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7ca7bed74be6d6a61a8f5c8107ccee865fdf304e
|
4
|
+
data.tar.gz: f5ec357ab1ae89337b630a0c4d2675fe092823af
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 88d93aca8aa15ad285dd48e348d8106493b224609869ef875b1afb465f514a6fbddde8327afc0c69c97460fb7394d35770075f050d1814f35eaa3eb70765206e
|
7
|
+
data.tar.gz: d945655709b5d2759041185b7273cc91a257e29cce0ed44e5c31e103c25f16024df7e17389e28f836568de92eb7b88eec3696a425fdacff708622b851037ac0a
|
data/lib/wovnrb.rb
CHANGED
@@ -1,6 +1,5 @@
|
|
1
1
|
require 'wovnrb/store'
|
2
|
-
require 'wovnrb/headers'
|
3
|
-
require 'wovnrb/lang'
|
2
|
+
require 'wovnrb/headers' require 'wovnrb/lang'
|
4
3
|
#require 'dom'
|
5
4
|
require 'json'
|
6
5
|
|
@@ -19,14 +18,19 @@ module Wovnrb
|
|
19
18
|
@env = env
|
20
19
|
STORE.refresh_settings
|
21
20
|
headers = Headers.new(env, STORE.settings)
|
22
|
-
if
|
21
|
+
# redirect if the path is set to the default language (for SEO purposes)
|
22
|
+
if (headers.path_lang == STORE.settings['default_lang'])
|
23
23
|
redirect_headers = headers.redirect(STORE.settings['default_lang'])
|
24
|
-
redirect_headers['set-cookie'] = "wovn_selected_lang=#{STORE.settings['default_lang']};"
|
25
|
-
return [307, redirect_headers, ['']]
|
26
|
-
elsif headers.path_lang == '' && (headers.browser_lang != STORE.settings['default_lang'] && STORE.settings['supported_langs'].include?(headers.browser_lang))
|
27
|
-
redirect_headers = headers.redirect(headers.browser_lang)
|
28
24
|
return [307, redirect_headers, ['']]
|
29
25
|
end
|
26
|
+
#if ((headers.path_lang != '' && !STORE.settings['supported_langs'].include?(headers.path_lang)) || headers.path_lang == STORE.settings['default_lang'])
|
27
|
+
# redirect_headers = headers.redirect(STORE.settings['default_lang'])
|
28
|
+
# redirect_headers['set-cookie'] = "wovn_selected_lang=#{STORE.settings['default_lang']};"
|
29
|
+
# return [307, redirect_headers, ['']]
|
30
|
+
#elsif headers.path_lang == '' && (headers.browser_lang != STORE.settings['default_lang'] && STORE.settings['supported_langs'].include?(headers.browser_lang))
|
31
|
+
# redirect_headers = headers.redirect(headers.browser_lang)
|
32
|
+
# return [307, redirect_headers, ['']]
|
33
|
+
#end
|
30
34
|
lang = headers.lang
|
31
35
|
|
32
36
|
# pass to application
|
data/lib/wovnrb/store.rb
CHANGED
@@ -64,7 +64,7 @@ module Wovnrb
|
|
64
64
|
if @settings['url_pattern_name'] == 'path'
|
65
65
|
@settings['url_pattern_reg'] = "/(?<lang>[^/.?]+)"
|
66
66
|
elsif @settings['url_pattern_name'] == 'query'
|
67
|
-
@settings['url_pattern_reg'] =
|
67
|
+
@settings['url_pattern_reg'] = "((\?.*&)|\?)wovn=(?<lang>[^&]+)(&|$)"
|
68
68
|
end
|
69
69
|
@settings
|
70
70
|
end
|
data/lib/wovnrb/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: wovnrb
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.10
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jeff Sandford
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2015-06-
|
12
|
+
date: 2015-06-15 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: nokogumbo
|