whereisthis 1.0.5 → 1.2.0
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 +4 -4
- data/README.md +4 -0
- data/lib/whereisthis.rb +4 -9
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 06b23ce989679b47017d3bd80a1e5ce0b76ec038
|
4
|
+
data.tar.gz: f7a8b9ac2780d7f2459e97b964bf0bb1eb7d2a1c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f58141b4fb3a07101c55d8c7ccc7e1217107259191db3a6f37556f0c27364781908bea564089f6f793ef257e30f1ce8d85de23bc82cbe8c53e96f6d119206241
|
7
|
+
data.tar.gz: 2317120bb28439c19f833956515f65463e1541d4d2a0ca101e205ec6e1e0e64b3e605e23871f6ecdc2020c70a798d95b516d6445fe590f92ad936303a4e5374b
|
data/README.md
CHANGED
@@ -2,6 +2,10 @@
|
|
2
2
|
|
3
3
|
This gem is meant to be simple, easy to operate command-line application to help determine the location information from a given ip address or url.
|
4
4
|
|
5
|
+
## Screen Shot
|
6
|
+
|
7
|
+

|
8
|
+
|
5
9
|
## Installation
|
6
10
|
|
7
11
|
$ gem install whereisthis
|
data/lib/whereisthis.rb
CHANGED
@@ -1,3 +1,4 @@
|
|
1
|
+
require 'pry'
|
1
2
|
require 'socket'
|
2
3
|
require 'colorize'
|
3
4
|
require 'ipaddress'
|
@@ -5,7 +6,7 @@ require 'trollop'
|
|
5
6
|
require 'unirest'
|
6
7
|
|
7
8
|
module Whereisthis
|
8
|
-
VERSION = "1.0
|
9
|
+
VERSION = "1.2.0"
|
9
10
|
|
10
11
|
def self.findout!
|
11
12
|
# Default to a help menu
|
@@ -21,7 +22,7 @@ module Whereisthis
|
|
21
22
|
opt :postal, "Show the postal information if possible"
|
22
23
|
opt :org, "Show the organization information if possible"
|
23
24
|
opt :Hostname, "Show the hostname information if possible"
|
24
|
-
opt :ip, "Specify the ip address to lookup",
|
25
|
+
opt :ip, "Specify the ip address to lookup", :type => :string
|
25
26
|
opt :website, "Specify the website url to lookup", :type => :string
|
26
27
|
end
|
27
28
|
|
@@ -32,7 +33,7 @@ module Whereisthis
|
|
32
33
|
end
|
33
34
|
elsif opts.website
|
34
35
|
begin
|
35
|
-
opts
|
36
|
+
opts[:ip] = IPSocket::getaddress(opts.website)
|
36
37
|
rescue
|
37
38
|
puts "Unable to resolve #{opts.website} to an ip address. Is it legit?"
|
38
39
|
exit 1
|
@@ -51,16 +52,10 @@ module Whereisthis
|
|
51
52
|
end
|
52
53
|
|
53
54
|
unless opts.ip or opts.website
|
54
|
-
binding.pry
|
55
55
|
puts "Need to specify an ip address or website to figure out what it is!"
|
56
56
|
exit 1
|
57
57
|
end
|
58
58
|
|
59
|
-
if opts.ip and opts.website
|
60
|
-
puts "Need to specify either just an ip address or website ( not both ) to figure out what it is!"
|
61
|
-
exit 1
|
62
|
-
end
|
63
|
-
|
64
59
|
Struct.new("WhereIsInfo", :ip, :hostname, :city, :region, :country, :gps, :org, :postal )
|
65
60
|
|
66
61
|
# Get response from web service.
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: whereisthis
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0
|
4
|
+
version: 1.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Kent Gruber
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-11-
|
11
|
+
date: 2016-11-20 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: ipaddress
|