rsk_snitch 0.1.2 → 0.1.3

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: 235fc26d3ddf919364ec79aeb3aa27c05ce5b3fa
4
- data.tar.gz: 4f3bf90d1a38a5eb73123594e9582b7068a12969
3
+ metadata.gz: 796e36c480593a5e47a30d982c6a51341d0ed6ba
4
+ data.tar.gz: ff13ee91af11a142edb7545956fef70b059fbb99
5
5
  SHA512:
6
- metadata.gz: 6ad68481bfb50321e8e0584dbade2b6f7e63e6b942141df22abf555b08cc3e1c2b63388f13eb3e88e85ff0ca6def04fb56ff8dd9ea6e287fa138ae57bd1f1de4
7
- data.tar.gz: c0a1efca73384213085985158652a84d47599edaf823a2e6dcc758a4c0f33c4f5914c407a14c2bf3fc34ff283c589c884655d69bcfe221627778114f1d0aa8e7
6
+ metadata.gz: 122a1451772c9fafb261dc320e12886e1d88a4e6b1c3e3f72bad6f163f1e0bc17113b0cf964d9b5e6c9246d1d505030ca1914502dfc81cfabbfe309d989c0d0b
7
+ data.tar.gz: 6ff712f8948eccc96dd66caafd506c63b9ac9d9d5764f1a6a59883a5cafa9647be15f08ed7c34358db5304e31f4aa7e2ae896eb1d8bccaf72365cd0dc82424b2
@@ -2,15 +2,14 @@ require "rsk_snitch/version"
2
2
  require 'faye/websocket'
3
3
 
4
4
  module RskSnitch
5
- # Checks the RSK public stats websocket to see if bitex is there
6
- # Emails admins otherwise
7
- class Nodes
8
- def self.url
9
- "ws://stats.rsk.co/primus/?_primuscb=#{Time.now.to_i}-0"
10
- end
5
+ # Checks the RSK public stats websocket to see if bitex is there
6
+ class Nodes
7
+ def self.url
8
+ "ws://stats.rsk.co/primus/?_primuscb=#{(Time.now.to_f * 1000).round}-0"
9
+ end
11
10
 
12
11
  def self.debug=(debug)
13
- @debug = true
12
+ @debug = debug
14
13
  end
15
14
 
16
15
  def self.find(node, max_messages = 500)
@@ -22,7 +21,7 @@ module RskSnitch
22
21
  ws.on :message do |event|
23
22
  puts event.data if @debug
24
23
  messages += 1
25
- found = true if /"id":"#{node}"/ =~ event.data
24
+ found = true if /"id":".*?#{node}.*?"/ =~ event.data
26
25
  ws.close if found || messages > max_messages
27
26
  end
28
27
 
@@ -1,3 +1,3 @@
1
1
  module RskSnitch
2
- VERSION = "0.1.2"
2
+ VERSION = "0.1.3"
3
3
  end
@@ -10,7 +10,7 @@ Gem::Specification.new do |spec|
10
10
  spec.email = ["yo@nubis.im"]
11
11
 
12
12
  spec.summary = %q{Check if a node is reporting stats in stats.rsk.co}
13
- spec.description = %q{Check if a node is reporting stats in stats.rsk.co by id}
13
+ spec.description = %q{Check if a node is reporting stats in stats.rsk.co. Can be used as lib or executable.}
14
14
  spec.homepage = "https://github.com/bitex-la/rsk-snitch"
15
15
  spec.license = "MIT"
16
16
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rsk_snitch
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - nubis
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2017-03-30 00:00:00.000000000 Z
11
+ date: 2017-06-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faye-websocket
@@ -122,7 +122,8 @@ dependencies:
122
122
  - - "~>"
123
123
  - !ruby/object:Gem::Version
124
124
  version: '1.0'
125
- description: Check if a node is reporting stats in stats.rsk.co by id
125
+ description: Check if a node is reporting stats in stats.rsk.co. Can be used as lib
126
+ or executable.
126
127
  email:
127
128
  - yo@nubis.im
128
129
  executables: