ipstack 0.1.0 → 0.1.1

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
  SHA256:
3
- metadata.gz: 412b55aa9741be14e2f8f8df76e93dae4856354c917118cb45084903fff0f833
4
- data.tar.gz: ba32b6b878a746814cc64d8230316d0634984735c03b50320ce21559ef3d39c4
3
+ metadata.gz: 479a63425097c0b5d1b16c1dc2123f5c3c49691c176f7b04cd899c5564230ac2
4
+ data.tar.gz: cf33e0883ea7736c80442a272ce62c425741861378da65f04338dc79c7e87c2b
5
5
  SHA512:
6
- metadata.gz: 2f7975f01d53b72a4e2e6ff9901eed1b52aa93902535cca7a435e41ae13df5a00fc905bfdd11a0ec95fc368eba1a6d50b1f99caf176432125dc362fdeeb5f134
7
- data.tar.gz: 1a5e2c1244283b62a7c67ededce73e7f7b75636f4b912ad689597d21ada181ad3125eb9efbfd87c3c1bde53db71c052b5c3a083557b5426d843fe131852c04eb
6
+ metadata.gz: 07f7602b0c5a14fb2f5fb97df71cfa46aaddc676704c65802e9ffa9f682cdf99e3fb468f9b3d27170795b4b6f9f6d50f02e50ff87305636205f0acbdbcf64c9a
7
+ data.tar.gz: 8120074efdd99aa70e9223614bbaf5053f004fbdb6ac9bd6da809e46c771342c0a0f6b0316e34bee64c798783b1ff4cfaba3ab09083e33660e49fa3ea43d4423
@@ -1,21 +1,16 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- ipstack (0.0.1)
4
+ ipstack (0.1.1)
5
5
  nokogiri (~> 1.8.0)
6
6
 
7
7
  GEM
8
8
  remote: https://rubygems.org/
9
9
  specs:
10
- coderay (1.1.2)
11
10
  diff-lcs (1.3)
12
- method_source (0.9.0)
13
11
  mini_portile2 (2.3.0)
14
12
  nokogiri (1.8.2)
15
13
  mini_portile2 (~> 2.3.0)
16
- pry (0.11.3)
17
- coderay (~> 1.1.0)
18
- method_source (~> 0.9.0)
19
14
  rake (12.3.1)
20
15
  rspec (3.7.0)
21
16
  rspec-core (~> 3.7.0)
@@ -37,7 +32,6 @@ PLATFORMS
37
32
  DEPENDENCIES
38
33
  bundler (~> 1.16)
39
34
  ipstack!
40
- pry
41
35
  rake (~> 12.3)
42
36
  rspec (~> 3.0)
43
37
 
@@ -5,13 +5,13 @@ require 'nokogiri'
5
5
 
6
6
  module Ipstack
7
7
  class API
8
- # Make sure we can access parameters of the object
9
- attr_accessor :api_url, :content_type, :access_key, :optionals, :params_uri, :return_raw
8
+ attr_accessor :api_url, :content_type, :access_key, :optionals, :params_uri, :return_raw # Make sure we can access parameters of the object in methods
10
9
  def initialize(optionals = {}, access_key = ENV['IPSTACK_ACCESS_KEY'])
11
10
 
12
11
  raise ArgumentError, 'Requires a hash of optional values found on https://ipstack.com/documentation' unless optionals.is_a?(Hash)
13
12
  raise ArgumentError, '\'access_key\' (api key) cannot be nil. Obtain your key from https://ipstack.com/quickstart and set it as ENV[\'IPSTACK_ACCESS_KEY\']' if access_key.nil? || access_key == ''
14
13
 
14
+ # non-ipstack api custom optionals
15
15
  @return_raw = optionals[:return_raw]
16
16
  optionals.delete(:return_raw) # remove it from optionals since we each optionals for our url params
17
17
 
@@ -51,7 +51,7 @@ module Ipstack
51
51
 
52
52
  def self.bulk(ips, optionals = {})
53
53
  api_request_object = Ipstack::API.new(optionals)
54
- raise ArgumentError, 'Requires a list of IPs comma separated as first parameter' if ips.nil? || ips.empty? || ip.is_a?(Hash) || !( ips.include?(',') && ips.match(/((25[0-5]|2[0-4]\d|[01]?\d\d?)\.(25[0-5]|2[0-4]\d|[01]?\d\d?)\.(25[0-5]|2[0-4]\d|[01]?\d\d?)\.(25[0-5]|2[0-4]\d|[01]?\d\d?)(,\n|,?$))/) )
54
+ raise ArgumentError, 'Requires a list of IPs comma separated as first parameter' if ips.nil? || ips.empty? || ips.is_a?(Hash) || !( ips.include?(',') && ips.match(/((25[0-5]|2[0-4]\d|[01]?\d\d?)\.(25[0-5]|2[0-4]\d|[01]?\d\d?)\.(25[0-5]|2[0-4]\d|[01]?\d\d?)\.(25[0-5]|2[0-4]\d|[01]?\d\d?)(,\n|,?$))/) )
55
55
  Ipstack::API.make_request(api_request_object,ips)
56
56
  end
57
57
 
@@ -63,5 +63,3 @@ module Ipstack
63
63
 
64
64
  end
65
65
  end
66
-
67
-
@@ -1,3 +1,3 @@
1
1
  module Ipstack
2
- VERSION = '0.1.0'
2
+ VERSION = '0.1.1'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ipstack
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
  - Nathan Pierce
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2018-04-09 00:00:00.000000000 Z
11
+ date: 2018-05-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler