ip_lookup 1.0.1 → 1.0.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/ip_lookup/db.rb +13 -1
- data/lib/ip_lookup/version.rb +1 -1
- metadata +1 -2
- data/lib/rubygems_plugin.rb +0 -9
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: bf432b307f50395c06ef5c0bb9526db2d07f59612da2ba457518dc289e9dbe56
|
4
|
+
data.tar.gz: 3b4e7cd8d283166c872e44ccb7e56cf58b38d4446acc4d42f46892124c673ff1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0b1160edafe10379b0d9c4ea7093acb357e1d22d673e5c245556aff572d2ca627947255fd5edb5e0da9214b686f4cf3e3ca6d41925a822144e755d6a46290804
|
7
|
+
data.tar.gz: 763dc6634c61f7b9f59bf090d98e58f02262d39befacc24de79d54d7b416df022a7075050a8c80d35c46ed1706e12b66e8418316e498e67dae013101c076be48
|
data/lib/ip_lookup/db.rb
CHANGED
@@ -72,6 +72,14 @@ class IPLookup
|
|
72
72
|
end
|
73
73
|
end
|
74
74
|
|
75
|
+
def teleport(*args)
|
76
|
+
if args.length == 1
|
77
|
+
teleport_timezone(args[0])
|
78
|
+
else
|
79
|
+
teleport_location(args)
|
80
|
+
end
|
81
|
+
end
|
82
|
+
|
75
83
|
def update_db?(update_period)
|
76
84
|
!db_exists? || (update_period >= 0 && db_age > update_period)
|
77
85
|
end
|
@@ -85,7 +93,11 @@ class IPLookup
|
|
85
93
|
end
|
86
94
|
|
87
95
|
def db_path
|
88
|
-
|
96
|
+
if Gem.loaded_specs["ip_lookup"]
|
97
|
+
File.join(Gem.loaded_specs["ip_lookup"].full_gem_path, "/support/geolite-city.mmdb")
|
98
|
+
else
|
99
|
+
File.join(File.expand_path("../..", File.dirname(__FILE__)), "/support/geolite-city.mmdb")
|
100
|
+
end
|
89
101
|
end
|
90
102
|
end
|
91
103
|
end
|
data/lib/ip_lookup/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ip_lookup
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ole Richter
|
@@ -155,7 +155,6 @@ files:
|
|
155
155
|
- lib/ip_lookup/defaults.rb
|
156
156
|
- lib/ip_lookup/errors.rb
|
157
157
|
- lib/ip_lookup/version.rb
|
158
|
-
- lib/rubygems_plugin.rb
|
159
158
|
homepage: https://github.com/blinkist/ip-lookup
|
160
159
|
licenses:
|
161
160
|
- MIT
|