rack-locale_chooser 0.0.10 → 0.0.11

Sign up to get free protection for your applications and to get access to all the features.
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- rack-locale_chooser (0.0.8)
4
+ rack-locale_chooser (0.0.10)
5
5
 
6
6
  GEM
7
7
  remote: http://rubygems.org/
@@ -8,7 +8,7 @@ module Rack::LocaleChooser
8
8
  :geodb_path => '/usr/local/Cellar/geoip/1.4.6/share/GeoIP/GeoLiteCity.dat'
9
9
  }.merge(options)
10
10
  @geodb = Net::GeoIP.new(@options[:geodb_path])
11
- @logger = File.new("log/locale_chooser.log", "a")
11
+ @logger = options[:logger]
12
12
  end
13
13
 
14
14
  def call(env)
@@ -21,9 +21,9 @@ module Rack::LocaleChooser
21
21
 
22
22
  set_locale
23
23
 
24
- @logger.puts "Url Locale: #{url_locale} | Cookie Locale: #{cookie_locale} | Geo Locale: #{geo_locale} | Browser Locale: #{browser_locale} | Definitive Locale: #{locale} | Original URL: #{@original_url} | New URL: #{localized_url}"
24
+ @logger.debug("Request URL: #{@request.url} | URL Locale: #{url_locale} | Cookie Locale: #{cookie_locale} | Geo Locale: #{geo_locale} | Browser Locale: #{browser_locale} | Definitive Locale: #{locale}") if @logger
25
25
 
26
- @app.call(env) if @request.post? || @request.put? || @request.delete?
26
+ @app.call(env) if @request.post? || @request.put? || @request.delete?
27
27
 
28
28
  if @original_url != localized_url then
29
29
  [301, {'Location' => localized_url}, '']
@@ -37,7 +37,7 @@ module Rack::LocaleChooser
37
37
  response.finish
38
38
  end
39
39
  end
40
-
40
+
41
41
  # check http://codetunes.com/2009/04/17/dynamic-cookie-domains-with-racks-middleware/
42
42
  def set_session_options
43
43
  @env['rack.session.options'] = {} unless @env['rack.session.options']
@@ -1,5 +1,5 @@
1
1
  module Rack
2
2
  module LocaleChooser
3
- VERSION = "0.0.10"
3
+ VERSION = "0.0.11"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rack-locale_chooser
3
3
  version: !ruby/object:Gem::Version
4
- hash: 11
4
+ hash: 9
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
8
  - 0
9
- - 10
10
- version: 0.0.10
9
+ - 11
10
+ version: 0.0.11
11
11
  platform: ruby
12
12
  authors:
13
13
  - "Jefferson Jean Martins Gir\xC3\xA3o"
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2010-11-03 00:00:00 -03:00
18
+ date: 2010-11-07 00:00:00 -03:00
19
19
  default_executable:
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency