neh 0.0.12 → 0.0.14

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: 9ee23f077b2167f86dc40dcf5d0f2c1d8d04f806ebf883cb4b926778a549d37c
4
- data.tar.gz: 95cf5614fa37ae4abcbddcfdca91bd364580c2aaf4fe73c99d0fdac13799009e
3
+ metadata.gz: '08399492b4d47444c8c43d975b3df949219276b076a98579b461823c0e5d1081'
4
+ data.tar.gz: 07c1d0c6e29b7953d840e92fa773b0ffc755ea72f6e43b062b71072267aa45d0
5
5
  SHA512:
6
- metadata.gz: f0348653539a6f078c28a17544b5a0ca9119458457774937b1e6cbcf5ec59a8038a36992f03885f0fca7773ad1e975a7241c25471ead5055495ff453cebeeb1e
7
- data.tar.gz: f4c05d264f7ec7669d846e83eea18680e0178b0830f5ecfdce5cf0a1898c5cb1190e4bcb3f65b7692a7da18d4df2553977359d4a38d55ccf64cca16599bbe05a
6
+ metadata.gz: bf8804f0e3a76aa3a07a97051a14d09434cd48773f0304d85e0bf7cfa0f8e0182ad8d99b8bcf71a59a88376f1608b3285a99bd0c171b54a0dbe8919dda2a3cc9
7
+ data.tar.gz: 11049ae95e7cdb9934f37549d7e79bf4ccc4fbf23705f13f15cad36817bf9bb075b402d3bf96b16496495dae5978b021114d6eaaf9872daba93b57084addc4d5
data/lib/neh/cli/base.rb CHANGED
@@ -9,6 +9,7 @@ require 'async/websocket/client'
9
9
  require 'ruby-progressbar'
10
10
  require 'faraday'
11
11
  require 'pry'
12
+ require 'active_support/all'
12
13
 
13
14
  class Neh::Cli::Base
14
15
  def initialize(*args, options:)
@@ -68,11 +69,14 @@ class Neh::Cli::Base
68
69
  when 'output'
69
70
  print message[:message]
70
71
  when 'worker_done'
71
- puts ''
72
- connection.close
72
+ close(connection)
73
73
  end
74
74
  end
75
75
 
76
+ def close(connection)
77
+ connection.close
78
+ end
79
+
76
80
  def subscribe(connection)
77
81
  content =
78
82
  {
@@ -96,7 +100,8 @@ class Neh::Cli::Base
96
100
  end
97
101
 
98
102
  body = JSON.parse response.body
99
- puts body['message'] if debug_mode?
103
+ message = body['message']
104
+ puts message if message.present?
100
105
  end
101
106
 
102
107
  def command
@@ -106,7 +111,7 @@ class Neh::Cli::Base
106
111
  raise NotImplementedError, 'command method must be implemented in subclasses'
107
112
  end
108
113
 
109
- self.class.name.split('::').last.downcase
114
+ self.class.name.demodulize.downcase
110
115
  end
111
116
 
112
117
  def http_connection
@@ -119,8 +124,4 @@ class Neh::Cli::Base
119
124
  def protocol
120
125
  @endpoint.secure? ? 'https' : 'http'
121
126
  end
122
-
123
- def debug_mode?
124
- ENV['NEH_DEBUG'] == 'true'
125
- end
126
127
  end
data/lib/neh/cli/o.rb CHANGED
@@ -2,5 +2,11 @@
2
2
 
3
3
  module Neh::Cli
4
4
  class O < Base
5
+ private
6
+
7
+ def close(connection)
8
+ puts ''
9
+ super
10
+ end
5
11
  end
6
12
  end
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.12"
4
+ VERSION = "0.0.14"
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.12
4
+ version: 0.0.14
5
5
  platform: ruby
6
6
  authors:
7
7
  - Atsushi Ishida
@@ -10,6 +10,20 @@ bindir: exe
10
10
  cert_chain: []
11
11
  date: 2024-08-11 00:00:00.000000000 Z
12
12
  dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: activesupport
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: '7.1'
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: '7.1'
13
27
  - !ruby/object:Gem::Dependency
14
28
  name: async-io
15
29
  requirement: !ruby/object:Gem::Requirement