rack-geoipcountry 1.0.0 → 1.0.1
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/rack/geoipcountry.rb +6 -6
- data/lib/rack/geoipcountry/version.rb +1 -1
- data/rack-geoipcountry.gemspec +1 -1
- metadata +36 -53
data/lib/rack/geoipcountry.rb
CHANGED
@@ -34,12 +34,12 @@ module Rack
|
|
34
34
|
end
|
35
35
|
|
36
36
|
def call(env)
|
37
|
-
|
38
|
-
env['X_GEOIP_COUNTRY_ID'] =
|
39
|
-
env['X_GEOIP_COUNTRY_CODE'] =
|
40
|
-
env['X_GEOIP_COUNTRY_CODE3'] =
|
41
|
-
env['X_GEOIP_COUNTRY'] =
|
42
|
-
env['X_GEOIP_CONTINENT'] =
|
37
|
+
result = @db.country(env['REMOTE_ADDR']).to_hash
|
38
|
+
env['X_GEOIP_COUNTRY_ID'] = result[:country_code]
|
39
|
+
env['X_GEOIP_COUNTRY_CODE'] = result[:country_code2]
|
40
|
+
env['X_GEOIP_COUNTRY_CODE3'] = result[:country_code3]
|
41
|
+
env['X_GEOIP_COUNTRY'] = result[:country_name]
|
42
|
+
env['X_GEOIP_CONTINENT'] = result[:continent_code]
|
43
43
|
@app.call(env)
|
44
44
|
end
|
45
45
|
|
data/rack-geoipcountry.gemspec
CHANGED
@@ -15,7 +15,7 @@ Gem::Specification.new do |s|
|
|
15
15
|
|
16
16
|
s.rubyforge_project = "rack-geoipcountry"
|
17
17
|
|
18
|
-
s.add_dependency 'geoip'
|
18
|
+
s.add_dependency 'geoip', '>= 1.1.2'
|
19
19
|
|
20
20
|
s.files = `git ls-files`.split("\n")
|
21
21
|
s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
|
metadata
CHANGED
@@ -1,48 +1,41 @@
|
|
1
|
-
--- !ruby/object:Gem::Specification
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
2
|
name: rack-geoipcountry
|
3
|
-
version: !ruby/object:Gem::Version
|
4
|
-
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 1.0.1
|
5
5
|
prerelease:
|
6
|
-
segments:
|
7
|
-
- 1
|
8
|
-
- 0
|
9
|
-
- 0
|
10
|
-
version: 1.0.0
|
11
6
|
platform: ruby
|
12
|
-
authors:
|
7
|
+
authors:
|
13
8
|
- Karol Hosiawa
|
14
9
|
- Thomas Maurer
|
15
10
|
autorequire:
|
16
11
|
bindir: bin
|
17
12
|
cert_chain: []
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
dependencies:
|
22
|
-
- !ruby/object:Gem::Dependency
|
13
|
+
date: 2012-03-29 00:00:00.000000000 Z
|
14
|
+
dependencies:
|
15
|
+
- !ruby/object:Gem::Dependency
|
23
16
|
name: geoip
|
24
|
-
|
25
|
-
requirement: &id001 !ruby/object:Gem::Requirement
|
17
|
+
requirement: !ruby/object:Gem::Requirement
|
26
18
|
none: false
|
27
|
-
requirements:
|
28
|
-
- -
|
29
|
-
- !ruby/object:Gem::Version
|
30
|
-
|
31
|
-
segments:
|
32
|
-
- 0
|
33
|
-
version: "0"
|
19
|
+
requirements:
|
20
|
+
- - ! '>='
|
21
|
+
- !ruby/object:Gem::Version
|
22
|
+
version: 1.1.2
|
34
23
|
type: :runtime
|
35
|
-
|
36
|
-
|
37
|
-
|
24
|
+
prerelease: false
|
25
|
+
version_requirements: !ruby/object:Gem::Requirement
|
26
|
+
none: false
|
27
|
+
requirements:
|
28
|
+
- - ! '>='
|
29
|
+
- !ruby/object:Gem::Version
|
30
|
+
version: 1.1.2
|
31
|
+
description: Rack::GeoIPCountry uses the geoip gem and the GeoIP database to lookup
|
32
|
+
the country of a request by its IP address
|
33
|
+
email:
|
38
34
|
- tma@freshbit.ch
|
39
35
|
executables: []
|
40
|
-
|
41
36
|
extensions: []
|
42
|
-
|
43
37
|
extra_rdoc_files: []
|
44
|
-
|
45
|
-
files:
|
38
|
+
files:
|
46
39
|
- .gitignore
|
47
40
|
- Gemfile
|
48
41
|
- README.markdown
|
@@ -51,39 +44,29 @@ files:
|
|
51
44
|
- lib/rack/geoipcountry.rb
|
52
45
|
- lib/rack/geoipcountry/version.rb
|
53
46
|
- rack-geoipcountry.gemspec
|
54
|
-
has_rdoc: true
|
55
47
|
homepage: http://coderack.org/users/hosiawak/middlewares/36-geoip-country
|
56
|
-
licenses:
|
48
|
+
licenses:
|
57
49
|
- MIT
|
58
50
|
post_install_message:
|
59
51
|
rdoc_options: []
|
60
|
-
|
61
|
-
require_paths:
|
52
|
+
require_paths:
|
62
53
|
- lib
|
63
|
-
required_ruby_version: !ruby/object:Gem::Requirement
|
54
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
64
55
|
none: false
|
65
|
-
requirements:
|
66
|
-
- -
|
67
|
-
- !ruby/object:Gem::Version
|
68
|
-
|
69
|
-
|
70
|
-
- 0
|
71
|
-
version: "0"
|
72
|
-
required_rubygems_version: !ruby/object:Gem::Requirement
|
56
|
+
requirements:
|
57
|
+
- - ! '>='
|
58
|
+
- !ruby/object:Gem::Version
|
59
|
+
version: '0'
|
60
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
73
61
|
none: false
|
74
|
-
requirements:
|
75
|
-
- -
|
76
|
-
- !ruby/object:Gem::Version
|
77
|
-
|
78
|
-
segments:
|
79
|
-
- 0
|
80
|
-
version: "0"
|
62
|
+
requirements:
|
63
|
+
- - ! '>='
|
64
|
+
- !ruby/object:Gem::Version
|
65
|
+
version: '0'
|
81
66
|
requirements: []
|
82
|
-
|
83
67
|
rubyforge_project: rack-geoipcountry
|
84
|
-
rubygems_version: 1.
|
68
|
+
rubygems_version: 1.8.21
|
85
69
|
signing_key:
|
86
70
|
specification_version: 3
|
87
71
|
summary: Rack middleware for Geo IP country lookup
|
88
72
|
test_files: []
|
89
|
-
|