ip-lookup 0.1.0 → 0.1.1

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: 31f869db37902d3bf9baf18b838c8f134cd5529206165ecb39227b2b0a9f6814
4
- data.tar.gz: f76232a532a24eb366db7fbcf49c1e307b3deffc2ac3118ec710cf7b2e26e398
3
+ metadata.gz: b59dddff7c79fecc0f2a400041eb88e72ab64676b9883237399b608ad6a022c5
4
+ data.tar.gz: bd854e52fc42fb092d7b5542a46cf184379db7440548aecc9c956a55a274e256
5
5
  SHA512:
6
- metadata.gz: 769498fe9790bd790d79287598722970b746e8ef940e426fb65fc917d72b2de6ccaa591de4f1ced08b853f3591e7ea8b3cf55a16e9a1fd8edd3a1badeddffb00
7
- data.tar.gz: 3bd0afcd867efe8297e4621dd83a8d8ad5154ef7e8a2a55e4b8343a5f617e4be157d6e7e570b3c76bf5ee16190ae6afdbcc0ed5c9ab569930f40f85b043e84ad
6
+ metadata.gz: 6ed0347dc8ae4e4af235012551b098c33b70861bd0426ec0dd2b02492c734c10df037d8c1840224c1b08b58aefcb3a450373b816cf507c66c71aa8ca8e25ea70
7
+ data.tar.gz: 238b1a18d289b543fa0abdb48ed7657b228121a679dadab9694ce825c985bb52b59a1e078b2e05c8a579fb715d8d03ba5ff33b2a4d539462dc5bdd39258438b3
data/README.md CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  [![Build Status](https://travis-ci.com/SunDi3yansyah/ip-lookup-rb.svg)](https://travis-ci.com/SunDi3yansyah/ip-lookup-rb)
4
4
  [![License](https://img.shields.io/github/license/SunDi3yansyah/ip-lookup-rb.svg)](LICENSE)
5
- [![Gem Version](https://badge.fury.io/rb/ip-lookup-rb.svg)](https://badge.fury.io/rb/ip-lookup-rb)
5
+ [![Gem Version](https://badge.fury.io/rb/ip-lookup.svg)](https://badge.fury.io/rb/ip-lookup)
6
6
  [![GitHub last commit](https://img.shields.io/github/last-commit/SunDi3yansyah/ip-lookup-rb.svg)](https://github.com/SunDi3yansyah/ip-lookup-rb/commits/master)
7
7
  [![GitHub issues](https://img.shields.io/github/issues/SunDi3yansyah/ip-lookup-rb.svg)](https://github.com/SunDi3yansyah/ip-lookup-rb/issues)
8
8
 
@@ -29,7 +29,60 @@ $ gem install ip-lookup
29
29
 
30
30
  ## Usage
31
31
 
32
- TODO: Write usage instructions here
32
+ ```
33
+ irb(main):001:0> Ip::Lookup.server_whatismyipaddress
34
+ => "36.72.215.137"
35
+ ```
36
+
37
+ ```
38
+ irb(main):001:0> Ip::Lookup.cli
39
+ +-------------+---------------------------------------+
40
+ | String | Value |
41
+ +-------------+---------------------------------------+
42
+ | Network | AS17974 Telekomunikasi Indonesia (PT) |
43
+ | City | Yogyakarta |
44
+ | Country | Indonesia |
45
+ | CountryCode | ID |
46
+ | Isp | PT. TELKOM INDONESIA |
47
+ | Lat | -7.8014 |
48
+ | Lon | 110.3647 |
49
+ | Org | |
50
+ | IP Address | 36.72.215.137 |
51
+ | Region | YO |
52
+ | RegionName | Yogyakarta |
53
+ | Timezone | Asia/Jakarta |
54
+ | Zip | |
55
+ +-------------+---------------------------------------+
56
+ => nil
57
+
58
+ ```
59
+
60
+ ```
61
+ irb(main):001:0> Ip::Lookup.cli table: false
62
+ => {"as"=>"AS17974 Telekomunikasi Indonesia (PT)", "city"=>"Yogyakarta", "country"=>"Indonesia", "countryCode"=>"ID", "isp"=>"PT. TELKOM INDONESIA", "lat"=>-7.8014, "lon"=>110.3647, "org"=>"", "query"=>"36.72.215.137", "region"=>"YO", "regionName"=>"Yogyakarta", "status"=>"success", "timezone"=>"Asia/Jakarta", "zip"=>""}
63
+ ```
64
+
65
+ ```
66
+ irb(main):001:0> Ip::Lookup.get :as
67
+ => "AS17974 Telekomunikasi Indonesia (PT)"
68
+ ```
69
+
70
+ List of parameter for `get`
71
+ ```
72
+ as
73
+ city
74
+ country
75
+ countryCode
76
+ isp
77
+ lat
78
+ lon
79
+ org
80
+ query
81
+ region
82
+ regionName
83
+ timezone
84
+ zip
85
+ ```
33
86
 
34
87
  ## Development
35
88
 
@@ -56,7 +56,7 @@ module Ip
56
56
  ]
57
57
  end
58
58
  data = Terminal::Table.new :headings => ["String", "Value"], :rows => array
59
- puts "\n", data, "\n"
59
+ puts data
60
60
  else
61
61
  data = ''
62
62
  if api["status"] == "success"
@@ -1,5 +1,5 @@
1
1
  module Ip
2
2
  module Lookup
3
- VERSION = "0.1.0"
3
+ VERSION = "0.1.1"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ip-lookup
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Cahyadi Triyansyah
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2019-02-11 00:00:00.000000000 Z
11
+ date: 2019-02-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler