ip_lookup 1.0.1 → 1.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 3fc773650faa6ffc425dca036e1e2ca80bacafd51548eb16754720ca8c5b07ec
4
- data.tar.gz: b260b88a05a4366df81d10a5d44271c8d7c11d0650c3997d76e242d64003f3f2
3
+ metadata.gz: bf432b307f50395c06ef5c0bb9526db2d07f59612da2ba457518dc289e9dbe56
4
+ data.tar.gz: 3b4e7cd8d283166c872e44ccb7e56cf58b38d4446acc4d42f46892124c673ff1
5
5
  SHA512:
6
- metadata.gz: 4b2c9138cde92e92ef7e795a3845c5e8a4fb097b7a236d83085cd00ef9270be86d32adc780c4b538d27594736dcd80aff82c2b04f07de46cc76ad01ef6daab6e
7
- data.tar.gz: 3dec5779bc48e845223983eacc66050abc6e5e37e6d78d7f6c6f94ec616fbc932982555c777e6ff9e7c6fe6fb699ef2b040f6c482bbe1459ce97bc7680900ed2
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
- File.join(Gem.loaded_specs["ip_lookup"].full_gem_path, "/support/geolite-city.mmdb")
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
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  class IPLookup
4
- VERSION = "1.0.1"
4
+ VERSION = "1.0.3"
5
5
  end
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.1
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
@@ -1,9 +0,0 @@
1
- require_relative "ip_lookup"
2
-
3
- Gem.post_install do
4
- puts "Started IPLookup database update."
5
-
6
- IpLookup.DB.update
7
-
8
- puts "Finished IPLookup database update."
9
- end