niri_ip_track 0.2.2 → 1.2.2

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.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/niri_ip_track.rb +18 -3
  3. metadata +8 -4
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: e830912c42f13d487d76265f06420464f3695262
4
- data.tar.gz: 499d52c0a0f037325d633bc307f4a337e171f4ac
3
+ metadata.gz: f8b418a35dd9eb2f72d8223e6408cb89437e1a06
4
+ data.tar.gz: 764259a85ae017a12902742f81b386fdc3296140
5
5
  SHA512:
6
- metadata.gz: d37059b614e67941228bca7317b54059aa6e8f53faa6263d3547c128e26dc876ee188ad0d25bb833d15377446f10d8d32407a2abd3cbdcdc9ca2379e057e3021
7
- data.tar.gz: c3cf49ed70b1fa48be2419a4ab3476cacd11aea44e4ed1ff3a5ca2c7e457bc90cc5331696bc4d288e8f7d9ce31093d1cca57d7d6860199cc52a61c09db3e120c
6
+ metadata.gz: ada75095f059ba4e3440374a87cbd93ed8ea1bc57a014e52d00c3fc1979029629640d093ea3fc32e8b623baee2328c8d251abf34c70a737ed368cfff0ff5809e
7
+ data.tar.gz: bc49589bc11ca285e4c7dcf419ac169f3f17f72ea1e2c31724999efe44302f2a94339507aef37ff3638e51fc9b3627f9d13ae436c9864cdb92f200fbe78cd2aa
@@ -3,17 +3,32 @@ require "niri_ip_track/railtie" if defined?(Rails)
3
3
 
4
4
  module NiriIpTrack
5
5
  class IpTrack
6
+ require 'open-uri'
7
+ require 'json'
6
8
 
7
9
  def self.locate_ip(ip)
8
10
  client_ip = ip
9
- ip_call ="http://freegeoip.io/json/#{client_ip}"
10
- require 'open-uri'
11
- require 'json'
11
+ # ip_call ="http://freegeoip.io/json/#{client_ip}"
12
+ # require 'open-uri'
13
+ # require 'json'
12
14
  ip_call ="http://freegeoip.io/json/#{client_ip}"
13
15
  content = open(ip_call).read
14
16
  data=JSON.parse(content)
15
17
  return data
16
18
  end
19
+ def self.locate_ip_xml(ip)
20
+ client_ip = ip
21
+ ip_call = "http://freegeoip.io/xml/#{client_ip}"
22
+ content = open(ip_call).read
23
+ return content
24
+ end
25
+
26
+ def self.locate_ip_csv(ip)
27
+ client_ip = ip
28
+ ip_call = "http://freegeoip.io/csv/#{client_ip}"
29
+ content = open(ip_call).read
30
+ return content
31
+ end
17
32
  end
18
33
  # Your code goes here...
19
34
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: niri_ip_track
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.2
4
+ version: 1.2.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - niri4
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2017-06-26 00:00:00.000000000 Z
11
+ date: 2017-06-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -66,7 +66,9 @@ dependencies:
66
66
  - - "~>"
67
67
  - !ruby/object:Gem::Version
68
68
  version: '3.0'
69
- description: " Write a longer description or delete this line."
69
+ description: " This gem provides a simple and extremely flexible way to find your
70
+ location from Ruby applications. It works well with Rack based web applications
71
+ such as Ruby On Rails."
70
72
  email:
71
73
  - nirankarsingh247@gmail.com
72
74
  executables: []
@@ -97,5 +99,7 @@ rubyforge_project:
97
99
  rubygems_version: 2.6.11
98
100
  signing_key:
99
101
  specification_version: 4
100
- summary: Write a short summary, because Rubygems requires one.
102
+ summary: This gem provides a simple and extremely flexible way to find your location
103
+ from Ruby applications. It works well with Rack based web applications such as Ruby
104
+ On Rails.
101
105
  test_files: []