trifle 0.0.5 → 0.0.6

Sign up to get free protection for your applications and to get access to all the features.
data/README.md CHANGED
@@ -65,6 +65,7 @@ trifle.find "192.168.1.1"
65
65
 
66
66
  ## Release notes
67
67
 
68
+ * **0.0.6** Added a fix for invalid IPs
68
69
  * **0.0.5** Fixed bug when finding IPs at the edge of the data set
69
70
  * **0.0.4** Changed binary syntax
70
71
  * **0.0.3** Added a binary for loading Trifle from the command line
data/lib/trifle/finder.rb CHANGED
@@ -8,6 +8,8 @@ class Trifle
8
8
  def handle ip
9
9
  ip_i = IPAddr.new(ip).to_i
10
10
  find(ip_i, 0, max)
11
+ rescue ArgumentError => ex
12
+ nil
11
13
  end
12
14
 
13
15
  protected
@@ -1,3 +1,3 @@
1
1
  class Trifle
2
- VERSION = "0.0.5" unless defined? Trifle::VERSION
2
+ VERSION = "0.0.6" unless defined? Trifle::VERSION
3
3
  end
@@ -37,6 +37,10 @@ describe Trifle::Finder do
37
37
  @trifle.load(data: [["82.132.242.55","82.132.242.55","1384444471","1384444471","GB","United Kingdrom"]])
38
38
  @finder.handle("127.0.0.1").should be_nil
39
39
  end
40
+
41
+ it "should handle nil ips" do
42
+ @finder.handle(nil).should be_nil
43
+ end
40
44
  end
41
45
 
42
46
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: trifle
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.5
4
+ version: 0.0.6
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -13,7 +13,7 @@ date: 2012-06-21 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rspec
16
- requirement: &70169180633800 !ruby/object:Gem::Requirement
16
+ requirement: &70348294670440 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ! '>='
@@ -21,10 +21,10 @@ dependencies:
21
21
  version: '0'
22
22
  type: :development
23
23
  prerelease: false
24
- version_requirements: *70169180633800
24
+ version_requirements: *70348294670440
25
25
  - !ruby/object:Gem::Dependency
26
26
  name: rujitsu
27
- requirement: &70169180632840 !ruby/object:Gem::Requirement
27
+ requirement: &70348294688940 !ruby/object:Gem::Requirement
28
28
  none: false
29
29
  requirements:
30
30
  - - ! '>='
@@ -32,10 +32,10 @@ dependencies:
32
32
  version: '0'
33
33
  type: :development
34
34
  prerelease: false
35
- version_requirements: *70169180632840
35
+ version_requirements: *70348294688940
36
36
  - !ruby/object:Gem::Dependency
37
37
  name: active_support
38
- requirement: &70169180632020 !ruby/object:Gem::Requirement
38
+ requirement: &70348294688500 !ruby/object:Gem::Requirement
39
39
  none: false
40
40
  requirements:
41
41
  - - ! '>='
@@ -43,10 +43,10 @@ dependencies:
43
43
  version: '0'
44
44
  type: :development
45
45
  prerelease: false
46
- version_requirements: *70169180632020
46
+ version_requirements: *70348294688500
47
47
  - !ruby/object:Gem::Dependency
48
48
  name: fakeredis
49
- requirement: &70169180631100 !ruby/object:Gem::Requirement
49
+ requirement: &70348294688000 !ruby/object:Gem::Requirement
50
50
  none: false
51
51
  requirements:
52
52
  - - ~>
@@ -54,7 +54,7 @@ dependencies:
54
54
  version: 0.3.0
55
55
  type: :development
56
56
  prerelease: false
57
- version_requirements: *70169180631100
57
+ version_requirements: *70348294688000
58
58
  description: Stores the GeoIP databases in Redis and gives it a simple way to lookup
59
59
  IPs and map them to countries
60
60
  email: