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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: '08399492b4d47444c8c43d975b3df949219276b076a98579b461823c0e5d1081'
4
- data.tar.gz: 07c1d0c6e29b7953d840e92fa773b0ffc755ea72f6e43b062b71072267aa45d0
3
+ metadata.gz: dfe0d65e3408f013ff78b8fd68f4681631e603145afa2ba459d00f29295fb0b3
4
+ data.tar.gz: a866fbb1d874bd0be0e9ef608674bc45a0f57ef13242a45b0715919871838ca0
5
5
  SHA512:
6
- metadata.gz: bf8804f0e3a76aa3a07a97051a14d09434cd48773f0304d85e0bf7cfa0f8e0182ad8d99b8bcf71a59a88376f1608b3285a99bd0c171b54a0dbe8919dda2a3cc9
7
- data.tar.gz: 11049ae95e7cdb9934f37549d7e79bf4ccc4fbf23705f13f15cad36817bf9bb075b402d3bf96b16496495dae5978b021114d6eaaf9872daba93b57084addc4d5
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 |_task|
29
- Async::WebSocket::Client.connect(@endpoint, headers: { 'Authorization' => "Bearer #{token}" }) do |connection|
30
- while (message = connection.read)
31
- parsed_message =
32
- JSON.parse(message, symbolize_names: true)
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
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Neh
4
- VERSION = "0.0.14"
4
+ VERSION = "0.0.16"
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: neh
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.14
4
+ version: 0.0.16
5
5
  platform: ruby
6
6
  authors:
7
7
  - Atsushi Ishida