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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 8aabb45b4cf3175416891b706d4426e365555953
4
- data.tar.gz: 4182a8a1dc83097b0e37bbe0e8f0738ef5ba6ae5
3
+ metadata.gz: 7ca7bed74be6d6a61a8f5c8107ccee865fdf304e
4
+ data.tar.gz: f5ec357ab1ae89337b630a0c4d2675fe092823af
5
5
  SHA512:
6
- metadata.gz: 99173d1bfd0a4e217e8b6850c23b6344136e672ef5e1536fd9581d23dc79f83de8b0396b2102ea1a0993a4ccf14582d0425b9b5caf790842515ed06729803e73
7
- data.tar.gz: 82933f61765c502a4abac8be6b353681d7e25acd0f8f7790ad759ac6ff110bd4d2027e30159bfe1f43d8a422764438890a89f532fdbcf62fe9d4d2b8b22018dd
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 ((headers.path_lang != '' && !STORE.settings['supported_langs'].include?(headers.path_lang)) || headers.path_lang == STORE.settings['default_lang'])
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'] = '((\?.*&)|\?)wovn=(?<lang>[^&]+)(&|$)'
67
+ @settings['url_pattern_reg'] = "((\?.*&)|\?)wovn=(?<lang>[^&]+)(&|$)"
68
68
  end
69
69
  @settings
70
70
  end
@@ -1,3 +1,3 @@
1
1
  module Wovnrb
2
- VERSION = "0.1.09"
2
+ VERSION = "0.1.10"
3
3
  end
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.09
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-03 00:00:00.000000000 Z
12
+ date: 2015-06-15 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: nokogumbo