patronus_fati 0.8.9 → 0.8.10

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
  SHA1:
3
- metadata.gz: 07f850ac1cb0f1dd2f7dfb513bd4ce335fbbf6a4
4
- data.tar.gz: fb8c5272dca78ebf66d505ccb899fc2de44637dc
3
+ metadata.gz: fb413efee4a3b4a4804852f63c9d6929b6b22aa3
4
+ data.tar.gz: 7bf0278db9e8317ee699c2e84f6c7766080dc6b9
5
5
  SHA512:
6
- metadata.gz: 16a3e594dea7679cf076e53fbd762d0387a34f81e9d94e7ced43d79045fae10f1b96a8ed85fb7cb9b5e0440917be279e9c04f9b841c0c868d84cf76bdcce0496
7
- data.tar.gz: f723d26a1a9e1f143612efc29322a268d67f6a8cc7ba30d38280043b81d03e312052469ac672a4fa571b4f8e2ba3eb593ec8080b5df26e910e137ebde4f35d4f
6
+ metadata.gz: c7a04a984146e82ef6dee440a2dad9356ebc4efd7c12de375bda5f1866df4a67916b584de5d977701e68dcd61a740776fa70bf3b22801fabeb74b7f9b3c1cd96
7
+ data.tar.gz: 2d97babd5efa250bcc0dbfc187771034c93c25432be0b5f2a127c6430a5b7a5df92c7da53948ab0787f77e6c5ee9c458206733adaa8f1f742fd5b041645313c3
@@ -1,4 +1,10 @@
1
1
  module PatronusFati
2
+ PatronusFatiError = Class.new(StandardError)
3
+ LostConnection = Class.new(PatronusFatiError)
4
+ ConnectionTimeout = Class.new(PatronusFatiError)
5
+ UnableToRead = Class.new(PatronusFatiError)
6
+ UnableToWrite = Class.new(PatronusFatiError)
7
+
2
8
  class Connection
3
9
  attr_reader :port, :read_queue, :server, :write_queue
4
10
 
@@ -54,15 +60,12 @@ module PatronusFati
54
60
  while (line = socket.readline)
55
61
  read_queue << line
56
62
  end
57
- rescue Timeout::Error
58
- # Connection timed out...
59
- exit 1
60
- rescue EOFError
61
- # We lost our connection...
62
- exit 2
63
+ rescue Timeout::Error => e
64
+ raise ConnectionTimeout, e.message
65
+ rescue EOFError => e
66
+ raise LostConnection, e.message
63
67
  rescue => e
64
- puts ('Unknown issue reading from socket: %s' % e.message)
65
- exit 3
68
+ raise UnableToRead, e.message
66
69
  end
67
70
  end
68
71
  end
@@ -76,8 +79,7 @@ module PatronusFati
76
79
  count += 1
77
80
  end
78
81
  rescue => e
79
- puts ('Unknown issue writing to socket: %s' % e.message)
80
- exit 1
82
+ raise UnableToWrite, e.message
81
83
  end
82
84
  end
83
85
  end
@@ -0,0 +1,9 @@
1
+ module PatronusFati::MessageProcessor::Terminate
2
+ include PatronusFati::MessageProcessor
3
+
4
+ def self.process(obj)
5
+ puts 'Kismet announced it\'s intention to gracefully terminate'
6
+
7
+ nil
8
+ end
9
+ end
@@ -68,3 +68,4 @@ require 'patronus_fati/message_processor/critfail'
68
68
  require 'patronus_fati/message_processor/error'
69
69
  require 'patronus_fati/message_processor/protocols'
70
70
  require 'patronus_fati/message_processor/ssid'
71
+ require 'patronus_fati/message_processor/terminate'
@@ -1,3 +1,3 @@
1
1
  module PatronusFati
2
- VERSION = '0.8.9'
2
+ VERSION = '0.8.10'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: patronus_fati
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.8.9
4
+ version: 0.8.10
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sam Stelfox
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-04-13 00:00:00.000000000 Z
11
+ date: 2015-04-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: dm-constraints
@@ -344,6 +344,7 @@ files:
344
344
  - lib/patronus_fati/message_processor/error.rb
345
345
  - lib/patronus_fati/message_processor/protocols.rb
346
346
  - lib/patronus_fati/message_processor/ssid.rb
347
+ - lib/patronus_fati/message_processor/terminate.rb
347
348
  - lib/patronus_fati/version.rb
348
349
  - patronus_fati.gemspec
349
350
  - spec/data_models/access_point_spec.rb