neh 0.0.14 → 0.0.16
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/neh/cli/base.rb +9 -9
- data/lib/neh/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: dfe0d65e3408f013ff78b8fd68f4681631e603145afa2ba459d00f29295fb0b3
|
4
|
+
data.tar.gz: a866fbb1d874bd0be0e9ef608674bc45a0f57ef13242a45b0715919871838ca0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 825a107e9afe80f70e6c0736392b29c3ae604062552a1ce93a8cf2dec9c44eaa4661084efb89029f8817a8d48455a1815d3930d1c2664e81b8695b701966cd36
|
7
|
+
data.tar.gz: 27e0f1c9215e4e0e52edc15011843cb7840bf59fdc08952ffcee42180a42298e11a3ee0de0a3c6e1999d35e7b7ea64d865d45919af9a8107c6f49893eb26e476
|
data/lib/neh/cli/base.rb
CHANGED
@@ -8,7 +8,7 @@ require 'async/http/endpoint'
|
|
8
8
|
require 'async/websocket/client'
|
9
9
|
require 'ruby-progressbar'
|
10
10
|
require 'faraday'
|
11
|
-
require 'pry'
|
11
|
+
require 'pry' if ENV['NEH_DEBUG']
|
12
12
|
require 'active_support/all'
|
13
13
|
|
14
14
|
class Neh::Cli::Base
|
@@ -25,14 +25,12 @@ class Neh::Cli::Base
|
|
25
25
|
end
|
26
26
|
|
27
27
|
def execute
|
28
|
-
Async do |
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
on_receive(connection, parsed_message)
|
35
|
-
end
|
28
|
+
Async::WebSocket::Client.connect(@endpoint, headers: { 'Authorization' => "Bearer #{token}" }) do |connection|
|
29
|
+
while (message = connection.read)
|
30
|
+
parsed_message =
|
31
|
+
JSON.parse(message, symbolize_names: true)
|
32
|
+
|
33
|
+
on_receive(connection, parsed_message)
|
36
34
|
end
|
37
35
|
end
|
38
36
|
end
|
@@ -41,6 +39,8 @@ class Neh::Cli::Base
|
|
41
39
|
|
42
40
|
def token
|
43
41
|
ENV.fetch('NEH_PERSONAL_ACCESS_TOKEN')
|
42
|
+
rescue KeyError
|
43
|
+
puts 'Please set the environment variable NEH_PERSONAL_ACCESS_TOKEN'
|
44
44
|
end
|
45
45
|
|
46
46
|
def on_receive(connection, message)
|
data/lib/neh/version.rb
CHANGED