jake-scripts 1.8.2 → 1.8.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 358c4f16383475ec478e659cb29b759c181c85bb
4
- data.tar.gz: ead93a472d3b01d9524e7d2e9c429cbfd1cc5246
3
+ metadata.gz: 3583415403ff2ba178535137eb62f57694f33efc
4
+ data.tar.gz: f7d802599d898d51523b45894e00f1994ee899de
5
5
  SHA512:
6
- metadata.gz: 7f50328b784ca2f94df658d6ce80d4b637fe04ca28922d450c590076d58759e9a30d462f764327c62f4c03d2f48ab9da1defc582815ff986cc07d1e551c0ccbd
7
- data.tar.gz: 96ae76198ae46d488bdac364cba158e1095da64fcf6838f2e4f5cc4570ce7588a0e52423ef0666996ddbd1f1e1d6a355bd5e969dd8af036baa9af4990f213914
6
+ metadata.gz: 645174e7489b62eb794899cf7017c7622e4fcadeca0eb6bc581aeb953e08027b6cfa5c545568b0e175c25da15814ef256c6e97484f7535b5c86717a4bf25f198
7
+ data.tar.gz: f316d7b2fa4c8b41fc81706c15600eb3c422a478a5a96acc5b4f584cfeb972cbb87c64036b46149dec649df9fbe63976c41c2b30ee777c14fa65a190196373d8
data/exe/ip_geo CHANGED
@@ -68,6 +68,30 @@ elsif opt != nil && arg != nil
68
68
  response = RestClient.get(url)
69
69
  info = JSON.parse(response)
70
70
 
71
+ if info['status'] == 'fail'
72
+ puts 'No IP info'
73
+ else
74
+ if opt == 'ip'
75
+ puts info['query']
76
+ elsif opt == 'city'
77
+ puts info['city']
78
+ elsif opt == 'region'
79
+ puts info['region']
80
+ elsif opt == 'country'
81
+ puts info['country']
82
+ elsif opt == 'zip'
83
+ puts info['zip']
84
+ elsif opt == 'isp'
85
+ puts info['isp']
86
+ else
87
+ puts 'Bad input'
88
+ end
89
+ end
90
+ elsif opt != nil && arg == nil
91
+ url = "http://ip-api.com/json/#{arg.join}"
92
+ response = RestClient.get(url)
93
+ info = JSON.parse(response)
94
+
71
95
  if info['status'] == 'fail'
72
96
  puts 'No IP info'
73
97
  else
@@ -1,5 +1,5 @@
1
1
  module Jake
2
2
  module Scripts
3
- VERSION = "1.8.2"
3
+ VERSION = "1.8.3"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jake-scripts
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.8.2
4
+ version: 1.8.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jake Meyer