ipcat_jruby 0.2.2-java → 0.2.3-java

Sign up to get free protection for your applications and to get access to all the features.
Files changed (4) hide show
  1. checksums.yaml +4 -4
  2. data/lib/ipcat.jar +0 -0
  3. data/lib/ipcat.rb +8 -2
  4. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 7342a1b15901ab55c7a34dc5056bf6062044afe1
4
- data.tar.gz: 0c878190a4e9e48b33c65cf62d7c08f894f9caad
3
+ metadata.gz: 282cba712945228fa6985c5886b7d5f976c77abd
4
+ data.tar.gz: d0722cdaab356f41c9ce6625a29ef3845b67f598
5
5
  SHA512:
6
- metadata.gz: e3dfcceed109bf4d250d853623683c839ade14a91caed8fd1d2692ffbdbb1232b5ed6fa6e31eb201dec7833dd2f6759219e5b67f78bb3f875b23f62bd43bb753
7
- data.tar.gz: 2b0c072fdd40e0afe51c591c509e4fd261f6dd458cc4c9a4e1bd3bfbf03faf5701c62af407920fb6c85a67126f57fda0707fc2ad105ba1019ca4c2cf681f7b0e
6
+ metadata.gz: c80128c65c52594e7c682a4f19f1baadf6c09188e2cb4971b62c551b00b58ca98236c0db425de0a63eb0e19f90f367e8a9b9e5c925f5531671fcd4900832ce54
7
+ data.tar.gz: 17db1553fbe88d993cf3dd2d26740d5437c984e6c9f1d00044c27dfaacab3dedfbfbe6c0c25ef1b7c71ded09f6e0615c1389ae7d42e1982d5e31cd32fcbc707b
data/lib/ipcat.jar CHANGED
Binary file
data/lib/ipcat.rb CHANGED
@@ -1,6 +1,8 @@
1
1
  require 'java'
2
2
  require 'ipcat.jar'
3
3
 
4
+ include_class 'java.lang.NumberFormatException'
5
+
4
6
  module IPCat
5
7
  class Datacenters
6
8
  def initialize(file)
@@ -18,8 +20,12 @@ module IPCat
18
20
 
19
21
  def find(ipstring)
20
22
  return nil if ipstring.nil?
21
- n = @blocks.find(org.ipcat.IP.parseIp(ipstring))
22
- return @urls[n] unless n == -1
23
+ begin
24
+ n = @blocks.find(org.ipcat.IP.parseIp(ipstring))
25
+ return @urls[n] unless n == -1
26
+ rescue NumberFormatException => e
27
+ return nil
28
+ end
23
29
  end
24
30
 
25
31
  def length
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ipcat_jruby
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.2
4
+ version: 0.2.3
5
5
  platform: java
6
6
  authors:
7
7
  - Mathieu Lecarme
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-01-11 00:00:00.000000000 Z
11
+ date: 2016-06-10 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: Client for the data from https://github.com/client9/ipcat
14
14
  email: mlecarme@garambrogne.net