gem-firewall 0.0.5 → 0.0.6

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
  SHA1:
3
- metadata.gz: b5e2e4ad290ed5bb5ef7adcdd549701d7d8901c3
4
- data.tar.gz: 48f19cceb8e5351adeb9b1af4f333b7280e069b3
3
+ metadata.gz: 212cc75989d7c42720f2b20f4ca5b3909667d20e
4
+ data.tar.gz: b08472fadd74a539fedf15d083b06b6219251d22
5
5
  SHA512:
6
- metadata.gz: a7bfaf925c05c9118a72d9a284d21c1d50dcd2ea70d731d8dc09ba80a806ea7ba546ef610f798c907e205c11d060f452728012857fa00aee9f0ad498c7a7bd44
7
- data.tar.gz: 19f0976a2f7107cd38cfdd0b53e68919a48ac4443c3d2bfa936f0142984b93423e491c9db4976798c005e4670573af683e22aa23e866dd6c0a830d174ce23ec4
6
+ metadata.gz: f81cfb5d72f334dd2ecb71b531163b97e4a511f17043e005c674abed510769d1570f684bb37f92b896df698da44f2d0423765177f6298216d1925ef53c1b5d26
7
+ data.tar.gz: 5f313f93cc99ad51ecf26c175591b4e56b9c2758b6c0b911ddb4f1437458cd4911da4c31a7cae497a8dd967d8c91cc2b51297ddd3833c43a2cdaa06e690d47fd
@@ -1,3 +1,3 @@
1
1
  module Firewall
2
- VERSION = "0.0.5"
2
+ VERSION = "0.0.6"
3
3
  end
@@ -17,6 +17,7 @@ module Firewall
17
17
  def pass? str_ip
18
18
  value = false
19
19
  ip = IPAddress.parse str_ip
20
+
20
21
  if @ip.prefix == 32 or ! @ip.network? # single address
21
22
  if @ip.address == ip.address
22
23
  value = @allowed
@@ -27,6 +28,10 @@ module Firewall
27
28
  end
28
29
  end
29
30
 
31
+ if @ip.address == "0.0.0.0"
32
+ value = @allowed
33
+ end
34
+
30
35
  value
31
36
  end
32
37
 
@@ -90,4 +90,13 @@ class RuleTest < Minitest::Unit::TestCase
90
90
  assert_equal r1.pass?(ip2), true
91
91
  end
92
92
 
93
+ def test_all_match
94
+ network = "0.0.0.0"
95
+ ip = "192.168.2.10/24"
96
+
97
+ r1 = Firewall::Rule.new(network, true)
98
+
99
+ assert_equal r1.pass?(ip), true
100
+ end
101
+
93
102
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gem-firewall
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.5
4
+ version: 0.0.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Terranova David