geoip-jars 1.2.3-java
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/geoip-1.2.3.jar +0 -0
- data/lib/geoip-jars.rb +41 -0
- metadata +56 -0
data/lib/geoip-1.2.3.jar
ADDED
Binary file
|
data/lib/geoip-jars.rb
ADDED
@@ -0,0 +1,41 @@
|
|
1
|
+
# encoding: utf-8
|
2
|
+
|
3
|
+
require 'java'
|
4
|
+
|
5
|
+
Dir["#{File.expand_path('..', __FILE__)}/*.jar"].each { |jar| require(jar) }
|
6
|
+
|
7
|
+
|
8
|
+
class Java::ComMaxmindGeoip::Location
|
9
|
+
HASH_FIELDS = {
|
10
|
+
:country_code => :countryCode,
|
11
|
+
:country_name => :countryName,
|
12
|
+
:region_code => :region,
|
13
|
+
:region_name => :region_name,
|
14
|
+
:city => :city,
|
15
|
+
:postal_code => :postalCode,
|
16
|
+
:latitude => :latitude,
|
17
|
+
:longitude => :longitude,
|
18
|
+
:dma_code => :dma_code,
|
19
|
+
:area_code => :area_code,
|
20
|
+
:metro_code => :metro_code,
|
21
|
+
:time_zone => :time_zone
|
22
|
+
}
|
23
|
+
|
24
|
+
def region_name
|
25
|
+
@region_name ||= Java::ComMaxmindGeoip::regionName.region_name_by_code(countryCode, region)
|
26
|
+
end
|
27
|
+
|
28
|
+
|
29
|
+
def time_zone
|
30
|
+
@time_zone ||= Java::ComMaxmindGeoip::timeZone.time_zone_by_country_and_region(countryCode, region)
|
31
|
+
end
|
32
|
+
|
33
|
+
def to_h
|
34
|
+
@h ||= begin
|
35
|
+
HASH_FIELDS.reduce({}) do |acc, (hash_field, java_field)|
|
36
|
+
acc[hash_field] = self.send(java_field)
|
37
|
+
acc
|
38
|
+
end
|
39
|
+
end
|
40
|
+
end
|
41
|
+
end
|
metadata
ADDED
@@ -0,0 +1,56 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: geoip-jars
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
prerelease:
|
5
|
+
version: 1.2.3
|
6
|
+
platform: java
|
7
|
+
authors:
|
8
|
+
- Theo Hultberg
|
9
|
+
autorequire:
|
10
|
+
bindir: bin
|
11
|
+
cert_chain: []
|
12
|
+
|
13
|
+
date: 2011-09-15 00:00:00 Z
|
14
|
+
dependencies: []
|
15
|
+
|
16
|
+
description: ""
|
17
|
+
email:
|
18
|
+
- theo@iconara.net
|
19
|
+
executables: []
|
20
|
+
|
21
|
+
extensions: []
|
22
|
+
|
23
|
+
extra_rdoc_files: []
|
24
|
+
|
25
|
+
files:
|
26
|
+
- lib/geoip-jars.rb
|
27
|
+
- lib/geoip-1.2.3.jar
|
28
|
+
homepage: http://www.maxmind.com/app/java
|
29
|
+
licenses: []
|
30
|
+
|
31
|
+
post_install_message:
|
32
|
+
rdoc_options: []
|
33
|
+
|
34
|
+
require_paths:
|
35
|
+
- lib
|
36
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
37
|
+
none: false
|
38
|
+
requirements:
|
39
|
+
- - ">="
|
40
|
+
- !ruby/object:Gem::Version
|
41
|
+
version: "0"
|
42
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
43
|
+
none: false
|
44
|
+
requirements:
|
45
|
+
- - ">="
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: "0"
|
48
|
+
requirements: []
|
49
|
+
|
50
|
+
rubyforge_project: geoip-jars
|
51
|
+
rubygems_version: 1.8.10
|
52
|
+
signing_key:
|
53
|
+
specification_version: 3
|
54
|
+
summary: Maxmind GeoIP JARs
|
55
|
+
test_files: []
|
56
|
+
|