patronus_fati 0.8.6 → 0.8.7

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: 725745e081c9e7897377b775d8cfd332a2405b5a
4
- data.tar.gz: a9ff1104efae054a0a2a9f234fd40956edc075bd
3
+ metadata.gz: 2766e0c2b0611d3128030f8ef94cb253ec0e5d53
4
+ data.tar.gz: e713ce49e98c54b182b99ee27ffba61cea4a7df9
5
5
  SHA512:
6
- metadata.gz: 59c77baf2fb1d4fe2dbfe61c57cc52ef781c2e8fd093840f8cf75e1b2157ec3763fb53f5b05932d0ee067da23099d93b1a11c4c8f0795db4d1380516bf291c46
7
- data.tar.gz: 632668d00434b0fbc3980fef5665605f80b6f4c3030826fa5f18c52ef7c935e18a8a9db2a3f172f92a0ad1b78ec79d25dccd43758c63f0e09acaf67d2682e141
6
+ metadata.gz: 66dae983e670375c70f47c940b51549d4fff543815d1897451b8679704eee99f54909128a3bf24b01cf6bd9611e2ce6c55d9e27faf9ae4101102da0e592274f5
7
+ data.tar.gz: b12896f06236ebbac36d7ce9c2e178102887c8cd2e65a5ff9de0476b65408541552ebbc8431d2048d557417f86dd6ac8518529b2e51a40d71397a41cc33b8208
data/Gemfile CHANGED
@@ -1,4 +1,3 @@
1
1
  source 'https://rubygems.org'
2
2
 
3
- # Specify your gem's dependencies in patronus_fati.gemspec
4
3
  gemspec
@@ -6,16 +6,15 @@ module PatronusFati::MessageProcessor::Client
6
6
  return if obj[:lasttime] < PatronusFati::DataModels::Client.current_expiration_threshold
7
7
 
8
8
  client_info = client_data(obj.attributes)
9
-
10
9
  client = PatronusFati::DataModels::Client.first_or_create({bssid: obj[:mac]}, client_info)
11
- client.update(client_info)
12
10
 
11
+ client.update(client_info)
13
12
  client.record_signal(obj.signal_dbm)
14
13
  client.update_frequencies(obj.freqmhz)
15
14
 
16
15
  # Don't deal in associations that are outside of our connection expiration
17
16
  # time...
18
- return if obj[:lasttime] <= (Time.now.to_i - PatronusFati::CONNECTION_EXPIRATION)
17
+ return if obj[:lasttime] < PatronusFati::DataModels::Connection.current_expiration_threshold
19
18
 
20
19
  # Handle the associations
21
20
  unless obj[:bssid].nil? || obj[:bssid].empty? || obj[:bssid] == obj[:mac]
@@ -3,7 +3,7 @@ module PatronusFati::MessageProcessor::Ssid
3
3
 
4
4
  def self.process(obj)
5
5
  # We don't care about objects that would have expired already...
6
- return if obj[:lasttime] < (Time.now.to_i - PatronusFati::SSID_EXPIRATION)
6
+ return if obj[:lasttime] < PatronusFati::DataModels::Ssid.current_expiration_threshold
7
7
 
8
8
  ssid_info = ssid_data(obj.attributes)
9
9
 
@@ -3,10 +3,10 @@ module PatronusFati
3
3
  extend FactoryBase
4
4
 
5
5
  def self.cleanup_models
6
- @last_cleanup ||= Time.now.to_i
6
+ @next_cleanup ||= 0
7
7
 
8
- if @last_cleanup < (Time.now.to_i - 10)
9
- @last_cleanup = Time.now.to_i
8
+ if @next_cleanup <= Time.now.to_i
9
+ @next_cleanup = Time.now.to_i + 10
10
10
 
11
11
  PatronusFati::DataModels::AccessPoint.inactive.reported_online.each do |ap|
12
12
  ap.update(:reported_online => false)
@@ -53,7 +53,7 @@ module PatronusFati
53
53
  end
54
54
 
55
55
  PatronusFati::DataModels::Client.all.each do |cli|
56
- PatronusFati.event_handler.event(:client, :sync, ap.full_state, {})
56
+ PatronusFati.event_handler.event(:client, :sync, cli.full_state, {})
57
57
  end
58
58
  end
59
59
  end
@@ -1,3 +1,3 @@
1
1
  module PatronusFati
2
- VERSION = '0.8.6'
2
+ VERSION = '0.8.7'
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.6
4
+ version: 0.8.7
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-02 00:00:00.000000000 Z
11
+ date: 2015-04-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: dm-constraints